Page 1 of 2

The four fours problem

Posted: Wed May 02, 2007 12:32 am UTC
by mattmacf
A fun problem a former history professor gave to me an a friend to keep us occupied during class :lol:

Using only four 4's in whatever combination, using as many operators as you desire, create a representation for each of the first 100 whole numbers. A couple examples to get you started:

0: 4 + 4 - 4 - 4 OR 44 - 44
1: 44/44 OR 4/4 + 4 - 4

The rules are only as strict or as lax as you make them. There are plenty of websites on the problem if you're so inclined to chea^H^H^H^Hresearch the problem, although it's a lot more fulfilling if you do it yourself. Things start to get very hairy around 31 or 73.

Enjoy! :)

EDIT:Some clarification of the rules as I understand them:
  • You must use exactly four 4's
  • You cannot use numbers other than 4. This means
  • The multiplicitative inverse is no good (unless there's a way you can do it without 4^-1 or 1/4 that I'm not aware of)
  • Sqr(4) is ambiguous. 4^2 is obviously no good, so I'm hesitant to say that Sqr(4) is an acceptable workaround. Any answer that can be done without it (i.e. pretty much all of them I think) would be preferable
  • Sqrt(4) is ok. In ordinary mathematical notation, the root operator defaults to 2 the same way log(x) implies log_10(x). No need to get terribly pedantic here 8)
  • Constants are no good, as they are neither a function nor a four. This is also to avoid simply adding euler's identity an arbitrary number of times :wink:

Posted: Wed May 02, 2007 12:41 am UTC
by cmacis
2: 4/4+4/4

Posted: Wed May 02, 2007 12:44 am UTC
by The LuigiManiac
3: 4/4 + sqrt4

Posted: Wed May 02, 2007 12:45 am UTC
by Token
3: phi(4^sqrt(4) + sqrt(4)) / phi(phi(phi(4!))

EDIT: too late - I'll do 4 instead

4: ((4! / 4) - 4) x sqrt(4)

Posted: Wed May 02, 2007 12:45 am UTC
by EvanED
3: 4 - ((4^(1/4))^4

(The ^1/4 is really the 4th root of 4; I'm not cheating)

EDIT: Crap I'm slow

4: 4 * ((4^(1/4))^4)

(Got to reuse my solution almost though ;-))

Posted: Wed May 02, 2007 12:47 am UTC
by The LuigiManiac
Token wrote:3: phi(4^sqrt(4) + sqrt(4)) / phi(phi(phi(4!))


You win.

4: 4 + 4 - 4

(EDIT: Didn't notice the four fours part, I was beaten out anyway in them)

Posted: Wed May 02, 2007 12:47 am UTC
by cmacis
4: 4+[4^-1]+[4^-1]+[4^-1]

Where [] is take integer part. And ^-1 means taking multiplicative inverse.

Posted: Wed May 02, 2007 12:49 am UTC
by EvanED
Wait, do we have to use exactly four 4s, or just up to four 4s?

I interpreted as the former, because that makes it more interesting, but then none of LuigiManiac's solutions work.

Posted: Wed May 02, 2007 12:49 am UTC
by Token
Who says you are allowed 1s?

Posted: Wed May 02, 2007 12:49 am UTC
by EvanED
And

5: 4 + ((4^(1/4))^4)

Posted: Wed May 02, 2007 12:50 am UTC
by cmacis
I didn't use a 1, it was part of the notation for the operator "taking multiplicative inverse".

Posted: Wed May 02, 2007 12:50 am UTC
by EvanED
Token wrote:Who says you are allowed 1s?


Read my post; that's the 4th root of 4. I just can't actually write that except by some ambiguous function call like root(4, 4) or in words, so I expressed it as ^1/4.

Posted: Wed May 02, 2007 12:53 am UTC
by gmalivuk
6 = (4+sqrt(4)) * (4/4)

Also, what part of four fours do people not understand?

Posted: Wed May 02, 2007 12:55 am UTC
by Xial
6: 4+Sqrt(4)+4-4

since gmalivuk beat me to it ill do 7 too

7: 4+sqrt(4)+4/4

Posted: Wed May 02, 2007 12:55 am UTC
by EvanED
Might as well take care of the next three:

7: 4 + 4 - 4/4
8: 4 + 4 * 4/4
9: 4 + 4 + 4/4

Posted: Wed May 02, 2007 12:56 am UTC
by cmacis
Using only four 4's


Looks like "Use no more than 4" rather than "use exactly 4". Though it's clear from the title and to keep the puzzle interesting that it's the latter.

Posted: Wed May 02, 2007 12:56 am UTC
by EvanED
And because I like my solution (I'll stop after this one for a while...)

10: 4*4 - 4!/4

Posted: Wed May 02, 2007 12:58 am UTC
by Token
Well, unless you require that you have to have an actual, well-known symbol for an operation that doesn't involve a non-permitted number, then the whole game becomes rather pointless. I may be being dense here, but I can't think of a way of writing the multiplicative inverse of a number without using a 1.

11: (4! - sqrt(sqrt(4*4)))/sqrt(4)

Posted: Wed May 02, 2007 12:59 am UTC
by Pathway
6 = 4 + 4 - 4 + sqrt(4)

7 = 4 + 4 - (4/4)

8 = (4/4)*(4+4)

9 = 4/4 + 4 + 4

10 = 4*sqrt(4) + 4/sqrt(4)
er, do we get bonus points if our answers have nice symmetries?

10 = cuberoot(4+4) + 4 + 4

11 = AAGH MISTAKE

12 = 4*4 - sqrt(4) - sqrt(4)

Posted: Wed May 02, 2007 1:01 am UTC
by Xial
Pathway wrote:6 = 4 + 4 - 4 + sqrt(4)

7 = 4 + 4 - (4/4)

8 = (4/4)*(4+4)

9 = 4/4 + 4 + 4

10 = 4*sqrt(4) + 4/sqrt(4)
er, do we get bonus points if our answers have nice symmetries?

10 = cuberoot(4+4) + 4 + 4

11 = 4 + 4 + 4 - sqrt(4)

12 = 4*4 - sqrt(4) - sqrt(4)


11 is flawed. 4+4+4-sqrt(4) is 10

if the use of "squared" is allowed than

11:squared(4) -4 -4/4

Posted: Wed May 02, 2007 1:04 am UTC
by The LuigiManiac
13: 4squared - sqrt4 - 4/4

Posted: Wed May 02, 2007 1:20 am UTC
by EvanED
Not a fan of "squared"; the only notation I know for it uses a 2. Similarly not a fan of the ^-1 to do 1/x.

But I can't come up with anything better for 13, so:

14 = 4 + 4 + 4 + sqrt(4)

Posted: Wed May 02, 2007 1:41 am UTC
by Xial
15= 4*4-4/4
16=4*4*4/4
17=4*4+4/4
18=4*4+4-sqrt(4)

Posted: Wed May 02, 2007 1:46 am UTC
by EvanED
19 = 4! - 4 - 4/4
20 = (4! - 4) * 4/4
21 = 4! - 4 + 4/4

Posted: Wed May 02, 2007 1:48 am UTC
by Xial
22 = 4! - sqrt(4) * 4 / 4
23 = 4! - sqrt(4) * sqrt(4) / 4
24 = 4! * (sqrt(4) * sqrt(4) / 4)
25 = 4! + (sqrt(4) * sqrt(4) / 4)




Edited for proper use of spacing and parenthesis

Posted: Wed May 02, 2007 2:01 am UTC
by AndreGiant
26 = 4! + (4+4)/4

Woot.

Posted: Wed May 02, 2007 2:01 am UTC
by mattmacf
Because I really don't like the way 11 and 13 were done with the 4^2 thing (and because I'm OCD like that), I submit

11: gamma(4)*sqrt(4)-4/4
13: gamma(4)*sqrt(4)+4/4

Posted: Wed May 02, 2007 2:12 am UTC
by EvanED
mattmacf wrote:Because I really don't like the way 11 and 13 were done with the 4^2 thing (and because I'm OCD like that), I submit

11: gamma(4)*sqrt(4)-4/4
13: gamma(4)*sqrt(4)+4/4


Heh, nice. I forgot gamma(n) = (n-1)! instead of n!. (Though 11 had a "legitimate" solution from Token.)


27 = 4! + 4 - 4/4
28 = (4+4)*4 -4
29 = 4! + 4 + 4/4
30 = (4+4)*4 - sqrt(4)

Re: The four fours problem

Posted: Wed May 02, 2007 2:18 am UTC
by EvanED
mattmacf wrote:EDIT:Some clarification of the rules as I understand them:
[list][*]Sqr(4) is ambiguous. 4^2 is obviously no good, so I'm hesitant to say that Sqr(4) is an acceptable workaround. Any answer that can be done without it (i.e. pretty much all of them I think) would be preferable


I'm not sure here. It depends upon how you interpret something like f^-1(x). It's not 1/f(x) or anything like that; it's just a notation for inverses. f^-2(x) doesn't make sense for instance, so that would argue in favor of this view.

In that sense, sqr = sqrt^-1.

I don't like it, but I do think that it's better not using it.

For instance, there's nothing in the above rules that would outlaw the following for 31:
31 = (4+4) * 4 - floor(sqrt(sqrt(4)))
but there's probably a better way to do it.

Posted: Wed May 02, 2007 2:22 am UTC
by skeptical scientist
32=4*4+4*4

Re: The four fours problem

Posted: Wed May 02, 2007 2:25 am UTC
by mattmacf
EvanED wrote:For instance, there's nothing in the above rules that would outlaw the following for 31:
31 = (4+4) * 4 - floor(sqrt(sqrt(4)))
but there's probably a better way to do it.

Haha very creative! I like it. Personally I was thinking something along the lines of

31 = 4^5/2 - 4/4

Where 4^5/2 really equals the .4'th root of 4 8)

Re: The four fours problem

Posted: Wed May 02, 2007 2:34 am UTC
by EvanED
mattmacf wrote:
EvanED wrote:For instance, there's nothing in the above rules that would outlaw the following for 31:
31 = (4+4) * 4 - floor(sqrt(sqrt(4)))
but there's probably a better way to do it.

Haha very creative! I like it. Personally I was thinking something along the lines of

31 = 4^5/2 - 4/4

Where 4^5/2 really equals the .4'th root of 4 8)


Then we also have
33 = 4^5/2 + 4/4
34 = (4+4)*4 + sqrt(4)

Posted: Wed May 02, 2007 2:45 am UTC
by mattmacf
35 = gamma(4)*gamma(4) - 4/4
36 = gamma(4)*gamma(4) + 4 - 4
37 = gamma(4)*gamma(4) + 4/4

Posted: Wed May 02, 2007 2:52 am UTC
by skeptical scientist
Very nice Matt!
38=4^1/.4+4+sqrt(4)

Posted: Wed May 02, 2007 3:06 am UTC
by EvanED
39 = .4/4 - 4/4
40 = .4/4 * 4/4
41 = .4/4 + 4/4

And since I'm on a roll and so I can do 42

42 = 44 - 4 + sqrt(4)

43 = 44 - 4/4
44 = 44 * 4/4
45 = 44 + 4/4
46 = 44 + 4 - sqrt(4)

(Mmmm, patterns...)

Posted: Wed May 02, 2007 3:32 am UTC
by Solt
EvanED wrote:3: 4 - ((4^(1/4))^4

4: 4 * ((4^(1/4))^4)


EvanED wrote:5: 4 + ((4^(1/4))^4)



Ok Please explain how the fourth root of a number x raised to the fourth power equals 1, not x.

By my calculations, your solution for 3 = 0, 4 = 16, and 5 = 8.

???


I think you are getting ^ confused with *, because the latter (4*(1/4))^4) would give you 1, but is inconsistent with the rules. What you should be using is 4^(4-4) = 1.

Why did no one else catch this? Am I wrong?

Posted: Wed May 02, 2007 3:44 am UTC
by EvanED
Solt wrote:
EvanED wrote:3: 4 - ((4^(1/4))^4

4: 4 * ((4^(1/4))^4)


EvanED wrote:5: 4 + ((4^(1/4))^4)



Ok Please explain how the fourth root of a number x raised to the fourth power equals 1, not x.


Um... because I'm an idiot apparently.

Not sure what I was thinking. I think it's purely a coincidence that if you replace ^ with * the equality holds.

Posted: Wed May 02, 2007 4:04 am UTC
by umbrae
47: 4!+4!-(4/4)
48: 44+4%(4!) is modulo allowed? Especially where it's completely a copout like right here? :P
49: 4!+4!+(4/4)

Edit: a better 48 just in case: 44 + (4! / gamma(4))

Posted: Wed May 02, 2007 6:54 am UTC
by skeptical scientist
48=44+sqrt(4)+sqrt(4)
50=44+sqrt(4)+4

And how is .4/4=40?

39=<4,4>-4/4
40=4^(1/.4)+4+4
41=<4,4>+4/4

Here <x,y> is Cantor's pairing function <x,y>=1/2(x+y)(x+y+1)+y, which gives a bijection from the set of pairs of natural numbers to the natural numbers.

Posted: Wed May 02, 2007 7:08 am UTC
by EvanED
skeptical scientist wrote:48=44+sqrt(4)+sqrt(4)
50=44+sqrt(4)+4

And how is .4/4=40?


You know, maybe I should just resign from doing math. :-p