Slashdot Mirror


You Can Make Any Number Out of Four 4s Because Math Is Amazing (youtube.com)

Andrew Moseman, writing for Popular Mechanics: Here's a fun math puzzle to brighten your day. Say you've got four 4s -- 4, 4, 4, 4 -- and you're allowed to place any normal math symbols around them. How many different numbers can you make? According to the fantastic YouTube channel Numberphile, you can make all of them. Really. You just have to have some fun and get creative. When you first start out, the problem seems pretty simple. So, for example, 4 - 4 + 4 - 4 = 0. To make 1, you can do 4 / 4 + 4 - 4. In fact, you can make all the numbers up to about 20 using only the basic arithmetic operations of addition, subtraction, multiplication, and division. But soon that's not enough. To start reaching bigger numbers, the video explains, you must pull in more sophisticated operations like square roots, exponents, factorials (4!, or 4 x 3 x 2 x 1), and concatenation (basically, turning 4 and 4 into 44).

31 of 309 comments (clear)

  1. Um, no. by rickb928 · · Score: 4, Informative

    "and concatenation"
    No, that's not really maths,

    --
    deleting the extra space after periods so i can stay relevant, yeah.
    1. Re:Um, no. by sexconker · · Score: 3, Insightful

      Yup. They say "normal math symbols" and then include concatenation. Fucking horse shit.

    2. Re:Um, no. by XxtraLarGe · · Score: 5, Funny

      "and concatenation"
      No, that's not really maths,

      Oh really? Then how come "4" + "4" = 44? I just tested it in JavaScript, and it works!

      --
      Taking guns away from the 99% gives the 1% 100% of the power.
    3. Re:Um, no. by Anonymous Coward · · Score: 5, Funny

      Checkmate, atheists.

    4. Re:Um, no. by vux984 · · Score: 5, Interesting

      The video is actually worth watching.

      They don't need concatenation; and can get any whole number from

      log
        sqrt symbol
      division

      the sqrt symbol is the 'trick' to it all; since it can be applied an infinite number of times to a single expression.

    5. Re:Um, no. by PIBM · · Score: 2

      Was this really a thing ? Years ago in college (~18y ago) we were asked to get up to infinity with only 2 4s and math ops. Having 4 just adds 4/4 * in front of the solution to make it to infinity

      4/4 * log(4)/log(4) = 1

      Then you add sqrt operators in front of the bottom 4.

      4/4 * log(4)/log(sqrt(4)) = 2
      4/4 * log(4)/log(sqrt(sqrt(4))) = 4

      Now, if you want to get 'any number' in between, use the same trick and the extra 4s to change the basis of the whole thing

      log in base sqrt(4) / 4 of (log base 4 of sqrt(4))

      log( log(sqrt(4)) / log(4) ) / log ( sqrt(4) / 4) = 1
      log( log(sqrt(sqrt(4))) / log(4) ) / log ( sqrt(4) / 4) = 2
      log( log(sqrt(sqrt(sqrt(4)))) / log(4) ) / log ( sqrt(4) / 4) = 3

      just add as many square root operators as you wish. Not difficult, no ?

    6. Re:Um, no. by vux984 · · Score: 4, Insightful

      But not suitable for Slashdot where we (should) already know this stuff, there is nothing new here.

      Give it a rest.

      It was really an elegant mathematical solution.

      Yes its not new, but its certainly 'esoteric enough'; I certainly hadn't seen it before. I can understand the expression on the wikipedia article, but its definitely not something i'd think most people would follow; and even i would have had to study it longer than it the 5 minutes it took to watch the video to have figured out how it all worked, so I enjoyed seeing the derivation.

      And if some youtuber makes a few pennies off demonstrating an elegant mathematical proof in an easy to follow and informative way... what exactly do you object to about it?

       

    7. Re:Um, no. by Aighearach · · Score: 2

      I can do it with 4's too, and I don't need concatenation...

      (4/4)+(4/4) etc

      The video being stupid doesn't bother me. Slashdot trying to pretend it is something intellectually interesting is what is offensive. Stupid videos are fine.

    8. Re:Um, no. by sexconker · · Score: 2

      Tell me the "normal math symbol" for concatenation. It must be distinct from / unambiguous considering string concatenation and set "concatenation" (really, joins/unions). I'll also need to "normal math symbol" that distinguishes/groups terms for evaluation vs. concatenation when it's ambiguous. (Where's your fucking escape character?) Oh, and it has to be valid for any base.

      Concatenation is not a mathematical operation it is a logical one that requires knowledge about how numbers how represented.

      Can you concatenate 0 and 1? 01 isn't a valid thing.
      Can you concatenate .1 and .2?
      Can you concatenate 7 and -3? Is it an expression? It sure isn't valid as a term on its own. What do you do when expressions are invalid? Do we throw out the entire output or do we throw out the concatenate call and keep the left hand side of the argument? Or the right hand side? Or maybe it's a divide by 0 error and we just shit the bed?
      Hell, when concatenate is unambiguous, is it left to right or right to left? What if shit is stored big endian or little endian? Do we have a concept of fundamental chunks of data (such bytes) and do we have to respect the byte order as well as endianness? How do you concatenate real numbers such as 1.111...? How do you concatenate a written expression read as "3 X over 4 plus X"? Do we just slam it on the end and leave the "over" line dangling?
      I've seen people post shit involving logs and ceils and addition to implement concatenation, but what I've seen was flawed (fails on 100, for example, they need to do floor + 1 not ceil). This doesn't work for unary. This assumes behavior of ceil (or floor) for positive and negative numbers. This assumes the input is a value you can run a log on (not 0 and not negative), etc. etc.

      Concatenation is not a "normal math symbol" (or "normal mathematical operation").

    9. Re:Um, no. by igny · · Score: 2

      You need to brush up on basic mathematical functions. Successor function is as basic as it can get, in fact it lies in the very foundation of axiomatic theory of arithmetic.

      --
      In theory there is no difference between theory and practice. In practice there is. - Yogi Berra
  2. Re:BS detector went off and is overheating by jeek · · Score: 5, Insightful

    arccos(-4*4/4/4)

    --
    If you want to be seen, stand up. If you want to be heard, speak up. If you want to be respected, sit down and shut up.
  3. Re:BS detector went off and is overheating by The+Rizz · · Score: 2

    Also, you can't actually get "any number" since you'll max out at a number when using the highest performing operator which I think would be the power operator, so the highest number you can make is 3.4028236692093846346337460743177e+38 (i.e. 4^4^4^4). And you'll be unable to get most of the numbers on the way there since you run out of the 4's to use to fill in gaps.

    My question would be, just how high can you get before you miss a whole number?

  4. This is an old problem by JoshuaZ · · Score: 5, Interesting

    Variants of this problem have been along for a very long time. It was popular as a recreational game in the 1930s and is now used more with Middle School students as a way of getting them more familiar with different operations.

    If one uses instead of 4 uses 1 and has a restricted operation set or the like then you can get some actually non-trivial math by asking how many 1s you need. For example, one can define the integer complexity of a number n, denoted by ||n|| as the minimum number of 1s needed to write n as a product or sum of 1s with any number of parentheses. Thus for example, 6=(1+1)(1+1+1) shows that ||n|| 1 one has 3log_3 n - a better result is actually known that what is in that post, and I'm writing it up now. The other person mentioned there is Harry Altman who probably has thought more about different notions of complexity of numbers than anyone else at this point (his dissertation was on the subject). We had a joint paper https://arxiv.org/abs/1207.4841 that is mostly readable.

    Another neat variant of this is again looking at 1s and allowing just addition, but allow that once you have made a number you can use it again, and now you count how many operations you have used. So for example, in this framework, you can use 3 additions to get 6 because 3=1+1+1 and 6=3+3. This is the addition chain complexity https://en.wikipedia.org/wiki/Addition_chain and is closely related to how to quickly exponentiate objects (such as matrices, or specific numbers mod another group) https://en.wikipedia.org/wiki/Addition-chain_exponentiation which is very important for doing a lot of practical algorithms efficiently (such as RSA and Diffie-Hellman).

    The problem in the original post is essentially silly but it connects to a lot of neat, serious math. (Also, Numberphile is in general great.)

    1. Re:This is an old problem by DickBreath · · Score: 3, Interesting

      Back in the (ahem) late 1970's when I got a new TI 57 programmable quackulator for college, I remember this game in the calculator's manual. For Four 4's.

      I seem to remember that it said the problem had been solved for all integers up to, oh, what was it, about 120 or something. I didn't realize the game went back further than that.

      I always thought that someday I might build a program to do this. Looking back several decades, I could not have imagined the kind of tools and languages that would make this easy today. Like Clojure core.logic. Or miniKanren in Scheme. Or even just old fashioned Prolog. Just specify the rules and let the computer do the search for all possible results.

      --

      I'll see your senator, and I'll raise you two judges.
  5. Numbers are boring by Anonymous Coward · · Score: 5, Funny

    Except 5318008, naturally...

    1. Re:Numbers are boring by zifn4b · · Score: 2

      Except 5318008, naturally...

      It's 8675309. Fixed that for you.

      --
      We'll make great pets
  6. Re:BS detector went off and is overheating by caseih · · Score: 5, Insightful

    Too funny. If you knew anything about the Numberphile channel, you'd know these are real mathematicians, not some BS. It's really just a math-related brain teaser. I really enjoy their videos. Even if you're not into math, they are sufficiently nerdy that I think many slashdotters would appreciate them. In fact a couple videos ago they had an interview with Ronald Rivest who was one of the inventors of RSA encryption. He's a down-to-earth, articulate person. He mentiones how he invented the MD5 hash which was later shown to be flawed.

    Anyway, yes it turns out with just log, square root, and multiplication, you can assemble any whole number between 0 and infinity with just four fours. Fairly useless, but a neat puzzle.

  7. Re:BS detector went off and is overheating by JoshuaZ · · Score: 2

    Yes, they meant positive integer. And yes, one can. Watch the video. In fact one only needs logs, division and square root operations to do it.

  8. Re:69! by sexconker · · Score: 2

    log(sqrt(4)/4) (log(4)(sqrt(sqrt(sqrt(4))))) = 3

    That's the same as
    log(base 1/2) of (log(base 4) of 4^(1/8))

    (log(base 4) of 4^(1/8)) = 1/8 (4 to what power = 4 to the power of 1/8?)

    So you have
    log(base 1/2) of 1/8

    Which is 3. Just add another sqrt() to increment the result.

    log(sqrt(4)/4) (log(4)(sqrt(sqrt(sqrt(sqrt(4)))))) = 4

    That's the same as
    log(base 1/2) of (log(base 4) of 4^(1/16))

    (log(base 4) of 4^(1/16)) = 1/16 (4 to what power = 4 to the power of 1/16?)

    So you have
    log(base 1/2) of 1/16

    Which is 4.

  9. Re:BS detector went off and is overheating by Anonymous Coward · · Score: 2, Funny

    Well I think it's triangular, so there.

  10. Re:Even simpler by religionofpeas · · Score: 2

    If you really want four fours, then do 4-4+4-4 and N times the increment operator.

  11. Re:BS detector went off and is overheating by mark-t · · Score: 2

    Actually, you can, if you allow complex arithmetic - ln(-4/4)/sqrt(-4/4)

  12. Re:Concat is not a math operator by omnichad · · Score: 2

    Factorial already breaks the rule by using integers less than 4.

  13. Re:Even simpler by sexconker · · Score: 2

    Except negative numbers.

    You just have to wait for the Universe to roll over.

  14. Re:BS detector went off and is overheating by Nemyst · · Score: 4, Insightful

    You seem to be confusing operators (or, more generally, functions) with constants here. arccos is just an operator, much like negation, addition, subtraction, etc. Pi is a constant, a numerical value, it has no other interpretation.

  15. This is bullshit by NotInHere · · Score: 2

    If you allow every function to be an "operator", the solution is pretty trivial, as to construct any number p you could just simply take the constant function with 4 input parameters that has value p. If you allow only a finite set of "operators" you won't be able to construct any real from it with only finitely many applications of your operators, as there are unaccountable many reals.

    If you restrict yourself to rationals you can get everywhere by just writing / somewhere between the four's and applying increment/decrement on both sides often enough.

  16. Re:any number? by mark-t · · Score: 2

    My bad... I forgot to parenthesize the i*pi in e^(i*pi)=-1, above... although it does not change the conclusion... I just did not correctly type the expression in that one equation.

  17. Re:BS detector went off and is overheating by The+Rizz · · Score: 2

    4^444 > 4^4^4^4

    Hmmm... no. 4^4 = 256. 4^256 = 1.3407807929942597099574024998206e+154. So 4^that = too big to easily calculate.

    It looks like my previous estimate of 4^4^4^4 got calculated as ((4^4)^4)^4, when it needs to be done as 4^(4^(4^4)) to give the correct biggest number with standard operators.

  18. Fourtran by Tablizer · · Score: 4, Funny

    In the spirit of Brainf*ck, I will use this to create a programming language called "Fourtran".

  19. Re:Concat is not a math operator by slew · · Score: 2

    Factorial already breaks the rule by using integers less than 4.

    Okay, then how about Gamma(x+4/4)...

  20. Re:One is lonely by clovis · · Score: 2

    And I can make any number I want with just ones and a single zero (if I want negative numbers or zero). Big deal.

    But you cannot make any integer using just 4 ones, and that's what makes this a bit more interesting.
    The summary uses the phrase "any number", but that is wrong. What they should have said was "any integer".
    If the summary had correctly said "any integer", I doubt I would have read any further, and probably half the comments would not have been posted.

    It's kind of a neat trick. If you already know what a logarithm is, you only need to watch from the 8:00 minutes in the video to 8:40 see the method.
    The method uses only log, square root, and division.

    BTW, making a googleplex by adding a long string of ones takes about the same amount of paper as their method that uses only 4 fours, depending on your handwriting.