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).
"and concatenation"
No, that's not really maths,
deleting the extra space after periods so i can stay relevant, yeah.
String concatenation is not a mathematical operator/symbol!
Any number? I'm pretty sure that you can't make pi with four 4's. Looks like the much lamer "any whole number", although I find even that pretty hard to believe.
I'm an American. I love this country and the freedoms that we used to have.
Yeah, almost never happens
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.)
Except 5318008, naturally...
You can make any number from a single zero and the increment operator.
Everybody's complaining about concatenation and some people saying it has to max out at some point, but y'all didn't watch the video, I guess.
They initially do a naive approach, with just four basic operators: + - * /
But then they add some more questionable operators, like concatenation or throwing a % sign on the end of a result. Okay, that's sketchy. But those examples are just for demonstrating a naive approach. The real magic is the final answer.
IF YOU CONTINUE WATCHING, they do, indeed, show that any number, including the ones already generated, can be created using a single non-questionable function, simply a couple log base 4's with a nested root function, and each time you nest it, the result increases by 1. So a million nested roots in the right location in this function, the result is 1,000,000. Add another and the result is 1,000,001. Continue nesting as long as you like and produce any (whole number) you like.
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.
Pi
This is essentially a 2^n + 0 or 1 formula which describes all natural numbers. Using 4 as a placeholder (2^2) is just lame, but the character of operations is the same.
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 operations. If you have a choice of N binary operations, naturally you can produce at most N^3 distinct results. So really what you are studying is the function from the power set (set of all subsets) of the set of all binary operations on numbers (for some notion of number, e.g. real, complex, surreal, etc.), to the power set of the numbers (for some notion of number).
John_Chalisque
It makes me wonder what we could, theoretically, do with technology if we applied similar principles to "bits".
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.
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.
Surely thats a string operation, not an arithmetic one.
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.
For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
Plus, it's the doggy style of maths!
My ism, it's full of beliefs.
We all know the world's largest number is 45 billion. Anything larger is FAKE NEWS!
Well, that's one way to get rid of the national debt.
"Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
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"
Drill baby drill - on Mars
4 is unlucky number to Chinese. :(
Ant(Dude) @ Quality Foraged Links (AQFL.net) & The Ant Farm (antfarm.ma.cx / antfarm.home.dhs.org).
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 positive and negative sentiments, but I can certainly say that all of the negative ones I saw (and there were bunch of them) could have been filed under "If you have nothing to say, then why don't you say nothing."
Now if I were a real mathematician, I'd be off studying the generalized cases... How many of which digit will suffice?
Freedom = (Meaningful - Coerced) Choice != (Speech | Beer^2), and sad sock puppets' bad mods avail them naught.
Completely accurate, yet incredibly stupid response.
"There is more worth loving than we have strength to love." - Brian Jay Stanley
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 have to regard it as an amusing trick, but not really that profound. The introductory over-dramatization of the video probably might merit a bit of criticism.
Freedom = (Meaningful - Coerced) Choice != (Speech | Beer^2), and sad sock puppets' bad mods avail them naught.
> 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. 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.
There are also many different axiomatic systems, e.g. ZF vs. ZFC, which are built from different rules and which admit different factual statements. It's not like either one is more 'correct' either. In that example, both accepting and denying the Axiom of Choice leads to strange results.
So if you want to make a point about "alternate facts," you might want to make sure that your knowledge doesn't have big gaps in it. It's fascinating just how many different accounts you have to read these days to get a more complete picture of what's going on these days. So many stories (on *all* sides) like to omit and possibly denigrate whichever parts of a story they find inconvenient. You cannot trust any single source, best to read them all and figure out who is leaving out which bits of the story (and why). Personally, I think that a skeptical reading of the news is a good approach.
In the spirit of Brainf*ck, I will use this to create a programming language called "Fourtran".
Table-ized A.I.
I agree, and "If you have nothing to say, then why don't you say nothing." should (unfortunately) be a moderation choice on Slashdot.
I don't trust atoms -- they make up stuff.
In one of his popular books on physics (Biography of Physics - a delightful book) George Gamow tells the story of Dirac, when visiting some university in Denmark (I think.) The guys there were trying to solve the following problem: represent every single positive integer using the number 2 alone, and standard mathematical symbols. Dirac came up with the following solution: N = -log_2 log_2(sqrt(sqrt(...(sqrt(2))...) where the number of square roots is equal to N.
Ugh, apparently Slashdot doesn't like some symbols and so ate part of the post. Rewriting middle paragraph avoiding notation. 6=(1+1)(1+1+1) shows that ||6|| is at most 5. One has the upper bound for ||n|| of 3log_2 n, and a lower bound of 3log_3 n. The upper bound was best for about 50 years, and the link that got eaten that mentions an improvement was http://religionsetspolitics.blogspot.com/2010/08/integer-complexity-upper-bound-update.html. I think that's most of the eaten content in that paragraph.
An operator is essentially a little function that has one or two arguments. It hides the information you use to make those numbers. If you want, you can invent infinite number of so called operators, to produce each number. They don't even have to take an argument of 4s.
What exactly is a "real" operation? Shouldn't that be one defined on R? Yet you seem to want to restrict me to N if you're talking about rocks. So tell me, can I multiply 4 rocks by 4 rocks? Why or why not? Because multiplication, logarithms and floor are all I need to define concatenation in some base. Do I have to define that in terms of splitting rocks into smaller pieces, measuring their length, or shaving them off to an even size? Do I have to use unary? Help me out here.
Concatenation may be base-dependent, but it's not exactly hard to give a formula for. Basically you shift the first number to the left by however many digits and add the second one. You use logarithms to figure out how many places to slide it over. You raise the base to that power and multiply by the first number to shift it to the left. Then you just add the second number, which overwrites all the 0 spaces you just created.
log(x, base) = { ln x / ln base }
concat(x, y, base) = { (x * base^(floor(log(y, base)) + 1)) + y }
This is probably easier to see in binary. You're just doing a left shift, filling everything with 0s and doing an OR to add them.
Calculate concat(1101, 0011):
Shift 1101 by 4 places (i.e. the length of the 2nd number) -
11010000
OR the other number:
11010000
OR 0011
=======
11010011
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.
I take it back. I just figured out how to make any integer using exactly four ones.
It's a really stupid trick, but it does not break the rules as stated.
Asimov: The Feeling of Power
We know where leadership by an anti-intellectual "strongman" who scapegoats minorities and likes boisterous rallies goes
In the absence of an xkcd, have some SMBC instead.
I knew I needed to stop reading Slashdot and finish my PhD when I started to miss articles by Bennett Haselton.
I haven't watched the numberphile video but here's a related pedophile link: https://www.theguardian.com/au...
How do you make 20747222 467734852078216 952221076085874 80996474721117292 752992589 912196684750549658 310084416732550077 out of four ones?
(Spaces added to work around "Filter error: That's an awful long string of letters there.", please ignore them)
CLI paste? paste.pr0.tips!
If they're going to allow concatenation which returns a different number value depending on the number base of the concatenated numerals, then we get to choose the number base. I don't recall their stating a requirement for base 10.
Just make the decimal number you offered be the number base, N.
N = fisted's number = 20747222 467734852078216 952221076085874 80996474721117292 752992589 912196684750549658 310084416732550077
So in number base (N), N= 10
in base 10, ten = 10
in hexadecimal, base (decimal16) then decimal 16 = 10 hex
octal, base 8, decimal 8 = 10 octal
base 2, 2 = 10 binary
in base N (fisted's number);
1||(1-1) = 10, which is N
1||(1-1) * 1 to use the required four one's
Yes, I should be, and am, ashamed for doing this.
Okay that's pretty fucked up. I like it.
CLI paste? paste.pr0.tips!
You need to define your challenge more tightly, or I can do stuff like this: Op1(a,b,0) == a+b; Op1(a,b,1) == a*b; etc.. An indexed stack removes the need for variable names.
Contribute to civilization: ari.aynrand.org/donate
Hmm, I'm not sure about changing the base from 10 as an acceptable method. Can't I just decide that, for the problem of 20747222 467734852078216 952221076085874 80996474721117292 752992589 912196684750549658, I am working in base 20747222 467734852078216 952221076085874 80996474721117292 752992589 912196684750549658?
Think I mostly agree with you and don't even see a nit that could be picked. Just an ACK as I am in the process of putting my Slashdot affairs in order for another hiatus, perhaps permanent. This is basically a boilerplate response drafted for the pending replies.
Freedom = (Meaningful - Coerced) Choice != (Speech | Beer^2), and sad sock puppets' bad mods avail them naught.