You Can Make Any Number Out of Four 4s Because Math Is Amazing (youtube.com) 309
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).
Um, no. (Score:5, Informative)
"and concatenation"
No, that's not really maths,
Re:Um, no. (Score:4, Insightful)
Yup. They say "normal math symbols" and then include concatenation. Fucking horse shit.
Re: (Score:2)
Depends on your definition of 'normal', really. But yes, this is just a silly game. I mean, you normally construct the integers out of just one number, zero, and the successor function called an arbitrary number of times.
So there's no reason you need four 4s. Just construct the integers normally, e.g. 0, ++0, ++(++0), etc. with ++ denoting the successor function in a way familiar to C-syntax programmers.
For those who haven't seen this before, just look up set theory on Khan academy or such.
Re: (Score:2)
I think the idea is the specific puzzle, not deriving Peano numbers out of it.
Anyway, it's a nice recreational math puzzle, and perhaps a nice symbolic programming/generative grammar puzzle, too. The mere presence of unary operators such as factorial makes the number of answers inifinite, of course.
Re: (Score:2)
Depends on your definition of 'normal', really.
If you're even trying to define "normal" in a special way to make something true, then you've already left the realm of normalcy and entered the realm of "alternate facts."
What do you have against facts, anyhow? (Score:2)
> If you're even trying to define "normal" in a special way to make something true, then you've already left the realm of normalcy and entered the realm of "alternate facts."
Bad example. Math already has many different kinds of normal [wolfram.com]. You might think that a 'normal operator' is 'something my calculator has a button for', but instead it's a continuous linear operator N : H -> H that commutes with its hermitian adjoint N*, that is: NN* = N*N on a complex Hilbert space H [wikipedia.org].
There are also many different
Re:Um, no. (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.
Re: (Score:2)
But not suitable for Slashdot where we (should) already know this stuff, there is nothing new here. Slashdot should not be treated as a astroturfing site to garner video reviewers so the author can get a few more pennies from youtube.
Re:Um, no. (Score:5, 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?
The angry mob doth protest (Score:2)
When I considered the description of the problem I was actually quite puzzled, but even if I knew the solution I hope I wouldn't have reacted like the angry mob that Slashdot is devolving into. My initial confusion regarded extremely large numbers and the increasingly large gaps I expected to appear as you juggled your small supply of digits.
Meanwhile the most frequent Slashdot reaction was to attack the problem. Well, maybe I shouldn't say "most frequent" since I didn't really tally all of the comments for
Re:The angry mob doth protest too much (Score:2)
Three footnotes after watching the rest of it...
All of the angry mobsters protesting about concatenation obviously didn't watch the entire video.
No one commented on the acknowledgement to Alex Bellos that appears in the video. He wrote a couple of excellent books on mathematical topics, and I'm glad to recommend them. I guess the lack of related comments indicates that the angry mobsters who actually did watch the entire video didn't watch it that closely or they don't read that much.
Having said that, I hav
Re: (Score:2)
I agree, and "If you have nothing to say, then why don't you say nothing." should (unfortunately) be a moderation choice on Slashdot.
Re: (Score:2)
Wait, was there a math test that I was supposed to take before visiting Slashdot? Because I missed it. I certainly don't already know this stuff. Then again I don't know much beyond Algebra 1 (and there I don't know much beyond x +1 = 5).
Re: (Score:2)
Oh fuck off.
Sincerely.
Re: (Score:2)
Re: (Score:3)
Re: (Score:2)
That's stupid. It should read 0, 0++, 0++++, 0++++++,...
Re: (Score:3)
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.
Re: (Score:2)
Re: (Score:2)
It's almost like you skipped over the phrase " To start reaching bigger numbers, the video explains, you must pull in more sophisticated operations"
Re: (Score:2)
No I didn't.
I'm taking issue with calling "concatenation" a "normal math symbol". The concatenation they're referring to is string concatenation.
I already know you don't need concatenation to generate any integer.
Re: (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(
Re: (Score:2, Funny)
I quit my job at the McDonald's register 40 years ago to move on to what I was trained for, electronics repair.
And concatenation is still not math. It's something else. Next thing you know, ALL Excel functions will be math. Calling your kitten 'biscuit' because it was born in the oven doesn't make it a biscuit.
Re: (Score:2)
...doesn't make it a biscuit.
In fairness, you'd really have to test the recipe out before making that call.
But I don't have to run a concatenation operator to know it isn't math.
Re: Um, no. (Score:2)
It means 4 concat 4. This is typical notation. PostgreSQL even supports it for text concatenation.
Re: (Score:3)
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 yo
Re:Um, no. (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!
Re:Um, no. (Score:5, Funny)
Checkmate, atheists.
Re: (Score:2)
That's the most Zapp Brannigan-esque reply I've seen all year.
Re: (Score:2)
Oh really? Then how come "4" + "4" = 44? I just tested it in JavaScript, and it works!
That's a great point, but they should have mentioned explicitly that they meant Programmer Math - i.e. Bullshit.
Re: (Score:2)
Re: (Score:2)
a = "4" + "4";
a = a - 1 ;
Um, still no (Score:2)
Completely accurate, yet incredibly stupid response.
Re: (Score:2)
Re: (Score:2)
concat(x,y) = x * 10^(ceil(log_10(y+1))) + y
for x, y real and >0
Re: (Score:2)
My point is, if you can invent the operators / functions you need, then at what point is this cheating? At what point does the game become uninteresting?
Now I can see the fun if you are limited to a pre-defined set of operations, including maybe concatenation.
Not *ARITHMETIC* (Score:2)
Concatenation is not *arithmetic*. There's a whole lot of math that isn't arithmetic. For example, relational algebra has six fundamental operators, and one of those is essentially concatenation.
Re: (Score:2)
Think of concatenation as a simple function:
f(x,y) = 10**ceil(log10(y+1)) * x + y
BS detector went off and is overheating (Score:2, Insightful)
Re:BS detector went off and is overheating (Score:5, Insightful)
arccos(-4*4/4/4)
Re: (Score:2, Insightful)
Re: (Score:2, Funny)
Well I think it's triangular, so there.
Re: (Score:2)
sqrt((gamma(4/(4+4))^4)
Re: (Score:2)
Re: (Score:2)
I'm not sure where you think I defined a new function. Are you rectally-sourcing your information?
https://en.wikipedia.org/wiki/... [wikipedia.org]
Re:BS detector went off and is overheating (Score:5, Insightful)
Re: (Score:2)
4-(4/4) = 3.
pi = 3
https://www.youtube.com/watch?... [youtube.com]
Re: (Score:3)
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?
Re: (Score:2)
4!!! + 4 + 4 +4... Boom, bigger than your "biggest possible".
Re: (Score:2)
Ah, so you're allowed to arbitrarily stack an infinite number of operators? Lame. In that case, you probably don't need this to be Four 4's, but can probably be four of any number except 0, 1, or 2. It also just turns this into more of a computational slog than a clever math trick.
Re: (Score:2)
I see you didn't RTFM, or watch the video. You can in fact create any whole number, to infinity if you like. You need the log operator. Watch the video, it's good and short.
Re: (Score:2)
Which is fine, but does make the concept much less interesting to me. It's interesting from a pure math standpoint, but becomes rather stale rather quickly when it's simply an "infinite iterations = infinite amount of numbers" mathematical slog.
Much more interesting to me is how far you can go with only a basic set of operators, and no recursive nesting of operators inside each other.
Re: (Score:2)
Yeah, it reminds me too much of brainfuck (the programming language). And is not all that interesting for much the same reasons.
A more challenging problem is how high can you get in counting natural numbers using any digit or basic arithmetic operator, but without re-using any. That requires thought, and not just an iterative script.
Re: (Score:2)
Are you talking about something like https://arxiv.org/pdf/1302.147... [arxiv.org] ?
Re: (Score:2)
Actually, looking at that, using sqrt(x) is cheating, as that's properly 24 - so you're actually getting a 2 pushed into the equation. If you're going to do that, why not just say you can use inc(x) or dec(x) and skip the whole nested log4(sqrt(x)) stuff? Really, if you're going to allow shortcut operators that have other numbers inside them, why not just allow one(x) defined as x-x+1, two(x) defined as x-x+2, etc. etc.?
If you limit yourself to actual unary operators, is it still as easy to find a similar a
Re: (Score:2)
Note: Slashdot formatting strikes again. That "24" was supposed to be "2 {radical sign} 4".
Re: (Score:3)
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.
Re:BS detector went off and is overheating (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.
Re: (Score:2, Interesting)
To be fair though, sometimes they do come out with complete BS. The claim that the sum of all natural numbers is -1/12 is a good example. It's not.
Re: (Score:2)
They don't claim -1/12 is the only answer, only that it is a valid answer. IIRC they present three or four possible answers and explain why each of them is valid, however unintuitive the theory behind them may be. They did not claim one was a -1/12 is "more correct" than the others.
Re: (Score:3)
Re: (Score:2)
But a square root is actually 'to the power of -2' so they need to generate a -2 for each square root they use.
They fail. They basically defined a set of rules then cheated. Fuck 'em. I can do that and I don't need any fancy fucking maths.
Re: (Score:2)
1/2 even. ffs. It's late and I have a cat lying on me.
See, I can't even do basic maths and I'm able to spot the flaws in their approach. Muppets.
Re: (Score:3)
Re: (Score:2)
I'd agree that arccos and similar are "circular" for getting to pi. But it's math (and pi) - isn't it all circular, by definition?
-1 = e^(i pi)
ln(-1) = i pi
ln(-1) / i = pi
ln(negate(4/4)) / sqrt(negate(4/4)) = pi
If you don't like negate() you can just do unary -.
ln(-(4/4)) / sqrt(-(4/4)) = pi
Normally logarithmic function (including the natural logarithm) wouldn't be defined for negative inputs. But we're using the natural exponent's identity that relies on imaginary numbers anyway, so fuck it.
This is an old problem (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 [arxiv.org] 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 [wikipedia.org] 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 [wikipedia.org] 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.)
Re:This is an old problem (Score:4, Interesting)
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.
Numbers are boring (Score:5, Funny)
Except 5318008, naturally...
Re: (Score:3)
Except 5318008, naturally...
It's 8675309. Fixed that for you.
Re: (Score:2)
Even simpler (Score:2)
Re: (Score:2)
Except negative numbers.
The intriguing bit about the article is not the simplicity, but working within the limitation of four fours with operators.
Re: (Score:2)
The intriguing bit about the article is not the simplicity, but working within the limitation of four fours with operators.
Then you must really like working within the limitation of a single zero and one operator.
Re: (Score:3)
Re: (Score:3)
Except negative numbers.
You just have to wait for the Universe to roll over.
Re: (Score:2)
I'll accept negate(x) or -(x) using unary -. Far more cromulent than concatenation.
any number? (Score:2)
Pi
Re: (Score:2)
Re: (Score:2)
Re: (Score:3)
Re: (Score:2)
-1 = e^(i pi)
ln(-1) = i pi
ln(-1) / i = pi
ln(negate(4/4)) / sqrt(negate(4/4)) = pi
If you don't like negate() you can just do unary -.
ln(-(4/4)) / sqrt(-(4/4)) = pi
Normally logarithmic function (including the natural logarithm) wouldn't be defined for negative inputs. But we're using the natural exponent's identity that relies on imaginary numbers anyway, so fuck it.
But this is existing decomposition.... (Score:2, Informative)
Easy Peasy (Score:2)
For each natural number define a binary operation M_i such that for all x,y we have x M_i y = i. Basically an infinite family of trivial constant functions. Then for each i we have 4 M_i 4 + 4 - 4 = i. If you're allowed arbitrary operations it is this trivially easy. What is interesting is the interplay between what operations you are allowed, and what results are possible. Now if you work in reverse polish notation (like Forth), you write things as 4 4 4 4 A B C, where A, B and C are your choices of binary
This is bullshit (Score:3)
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.
Re: (Score:2)
This is bullshit
Most maths is.
All fours (Score:2)
Plus, it's the doggy style of maths!
The relevant quote for today (Score:2)
Stephen Fry once nailed it on the QI show (which I highly recommend watching, BTW). He was talking about some obscure but interesting topic when one of the contestants asked "Stephen, are we ever going to use this information?"
He lit up and went off on her, saying:
"It’s extraordinary, it’s always the children who say ‘Sir, sir, what’s the point of geometry’, or ‘What’s the point of Latin,’ that end up having no job, being alcoholic, and they don’t notice that the ones who actually find knowledge for its own sake, and pleasure in information, in history, in the world and nature around us, actually getting on and DOING things with their fucking lives it’s an odd thing"
But unlucky! (Score:2)
4 is unlucky number to Chinese. :(
Fourtran (Score:5, Funny)
In the spirit of Brainf*ck [wikipedia.org], I will use this to create a programming language called "Fourtran".
Re: (Score:2)
It's not fundamentally different from 4×10+4×1. And if you can define the factorial symbol and call it valid math, you can certainly define an operator that results in a series of multiplications to achieve concatenation.
Re: (Score:3)
Factorial already breaks the rule by using integers less than 4.
Re: (Score:3)
Factorial already breaks the rule by using integers less than 4.
Okay, then how about Gamma(x+4/4)...
Re: (Score:2)
That's more than four 4s.
Re: 69! (Score:2)
Yeah, almost never happens
Re: (Score:3)
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.
Re: (Score:2)
Look, if all you have is a 1 and a 0, there's no way to represent the entirety of practical numeration. If it could be done, somebody would have already done it.
Re: (Score:2)
The rules say you have to use all 4 4s. You can't just use 2 4s. That's why you have to effectively add zero to get one.
Re: (Score:2)
We all know the world's largest number is 45 billion [youtube.com]. Anything larger is FAKE NEWS!
Well, that's one way to get rid of the national debt.
Re: (Score:2)
y'all didn't watch the video [...] IF YOU CONTINUE WATCHING
The problem is that it's a video in the first place. This means I can't skim it and then reread parts in detail. I can't Ctrl+F it. I can't see it at all it with w3m. And because sites use live streaming to discourage downloading a durable copy, I can't open it in a new tab while online and read it later while riding transit, during which I am offline.
Re: (Score:3)
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