# The Magic Money Machine

The brilliant scientist you are, you have built a magic money machine, capable of materializing money out of nowhere! Here's how it works:

• The machine has six boxes, numbered $1$ to $6$, each iniitally containing a single dollar coin.

• Beneath each of the boxes $1$ through $5$ is a button labeled "Poof!". Pressing the "Poof!" button beneath box number $i$ will remove a coin from box $i$, and cause two coins to magically appear in box $i+1$.

• Beneath each of the boxes $1$ through $4$ is a button labeled "Switch!". Pressing the "Switch!" button below box $i$ will cause a coin from box $i$ to disappear, and switch the contents of boxes $i+1$ and $i+2$.

• An exception to the previous two rules: pressing a button beneath an empty box does nothing.

• You may press the buttons as much as you like, but in order to collect the money inside, you must permanently break the machine.

Warren Buffet has heard of your machine, and will offer you one trillion dollars for it. Should you take this deal? Why or why not?

Source: I found this at The Puzzle Toad, but as Joe Z. points out, it was originally question 5 of the International Math Olympiad in 2010. The original phrasing was this: is it possible to make it so the first five boxes are empty, while the last has exactly $2010^{2010^{2010}}$ dollars?

• If the subject of this question was truly a "brilliant scientist" that could make a machine which creates money from nowhere, wouldn't he have just made a machine with a single button that popped out coins all day long? Just a thought. :P – Cubicon Apr 30 '15 at 4:35
• The Magic Money Machine - MMM. – Somnium Apr 30 '15 at 6:55
• Don't take the deal! Mr. Buffet doesn't have a trillion dollars to give you! It's a trick! :) – Golden Dragon Apr 30 '15 at 12:29
• Warren Buffet doesn't have a trillion dollars. And even if he did, you wouldn't be able to spend it without collapsing the currency, thus making your own holdings worthless. – Jiminion Apr 30 '15 at 13:45
• Also, how much volume would a trillion dollar coins occupy? – Jiminion Apr 30 '15 at 13:47

The answer, as I'm sure most people are guessing, is...

No. Don't sell!

Here's my solution:

Note, as I interpret the question, pressing "poof" adds two coins to the next box. May I be corrected if I'm wrong.

Solution:
1 1 1 1 1 1
0 3 0 3 1 1 (press poof on 1 and 3)
0 2 3 0 1 1 (press switch on 2)
0 2 0 6 1 1 (press poof on 3)
0 1 6 0 1 1 (press switch on 2)
0 1 0 12 1 1 (press poof on 3)
0 1 0 11 3 1 (press poof on 4)
0 0 11 0 3 1 (press switch on 2)
0 0 10 3 0 1 (press switch on 3)
0 0 10 0 6 1 (press poof on 4)
0 0 9 6 0 1 (press switch on 3)
0 0 9 0 12 1 (press poof on 4)
0 0 8 12 0 1 (press switch on 3)
... Each decrement of box 3 doubles the value of box 4, so once we've reduced box 3 to 0, box 4 will have 12 * 2 ^ 8 = 3072 in it.
0 0 0 3072 0 1 (press poof on 3)
0 0 0 3071 1 0 (press switch on 4)
0 0 0 3071 0 2 (press poof on 5)
...

As you can see, using the same logic as before, the final amount of money would be 2^3072, which is far more than a trillion (5.81 x 10^924, to be exact).
I'm sure this isn't even the highest value possible, but would answer the question.

PS: Don't trust Warren Buffett. He doesn't even have a trillion dollars!

Also, I apologise for the formatting. I'm new to SE.

• Your solution (and formatting) is excellent! – Mike Earnest Apr 30 '15 at 4:29
• Thanks! I'm never sure about the formatting. I see lots of other answers on puzzling.SE that are so much fancier. – Cubicon Apr 30 '15 at 4:31
• "Each decrement of box 3 doubles the value of box 4"? Each decrement of box 3 increases box 4 by 2. It doesn't double anything. – Holloway Apr 30 '15 at 14:43
• @Thebluefish - We're not pressing "poof" on box 3, we're pressing "poof" on box 4. If you exhaust the supply of coins in box 4, you'll have doubled that amount and added it to box 5. You'll end up with 0 0 8 0 24 1. Then you press "switch" on box 3. Every iteration of this loop will ultimately double the value in box 5. – Cubicon Apr 30 '15 at 15:23
• @itriedacrab You need a better calculator - 2^3072 is only around 10^925 – Rob Watts Apr 30 '15 at 18:52

Yes, you should definitely accept the deal.

The puzzle clearly states that pushing a button labeled "Poof!" will remove a coin (emphasis mine) from box $i$, and cause two coins to magically appear in another box. By means of swapping and poofing you can keep increasing the amount of money inside the machine to over one trillion coins, but this process takes time: pushing the "Poof!" button adds only one coin at a time, so in order to get one trillion, not counting the \$6 already inside, you'd need to push buttons no less than one trillion times. Being the bright scientist that you are, you could create a machine that pushes a button, say, up to 100 times a second, if the button is extremely sensitive. Now ask yourself: how long would it take to push a button a trillion times? With basic maths, we find the answer to be$10^{10}$seconds, or more than 300 years. Unless you're also immortal, besides being such a genius, you won't be finished with that job in your lifetime. And even if you were immortal and could finish the job, the present value of that box is at most \$127.8 billion assuming an inflation rate of 2.5% and 100 button presses per second. (Increasing the button-press rate increases the present value; you'd need about 781 button presses per second to get it to \$1 trillion.) So get your trillion dollars quickly, as long as Warren Buffett is still alive and willing to pay for it, and retire for the rest of your life chilling out and solving puzzles. • While I'm not sure that real world considerations have any merit on a Puzzling site, I find your logic irrefutable. +1. – Bill Michell Apr 30 '15 at 8:56 • He doesn't want to prove it. He has proven to himself that he doesn't have the time to use it even if it were possible, therefore a single near instataneous transaction is perfect. – LeppyR64 Apr 30 '15 at 16:12 • @JoeZ. But if you can't get to one trillion, that's even more reason to take the deal. Apply$(A \rightarrow B), (\neg A \rightarrow B) \vdash B$. You should still always take the deal. – Dorus Apr 30 '15 at 16:14 • What if you link the button (s) to a 800GHz transistor? – March Ho Apr 30 '15 at 20:18 • Also, what is the effect of the existence of a money-making machine on the value of money? Would the very existence of this machine not lead to inflation, assuming that now more similar machines can be made? In which case the best course of action would be to take the one trillion and convert it asap out of money to goods which would resist inflation better. – Pranab May 1 '15 at 7:01 The machine is capable of making the following amount of money: 2*2^(2^...^2) dollars, where the tower is 2^...^2 + 1 twos high, where that tower is 16384 twos high. Here is an explanation: Let's start simple. It is clear that if box 5 contains n coins, and box 6 contains 0, then pressing Poof! n times on box 5 will result in box 5 containing 0 coins and box 6 containing 2n. Thus we have the following rule, which we'll call Rule 5: * * * * n 0 --> * * * * 0 2n Now if box 4 contains n coins, and boxes 5 and 6 are empty, we can end up with 0 coins in boxes 4 and 6, and 2^n coins in box 5. To do this, we press Poof! on box 4 once, so that we have * * * n-1 2 0 Then we apply Rule 5 and press Switch! on box 4, and repeat this process n-1 times. Since each time we apply Rule 5, we double what's in box 5, we end up with 2^n coins in box 5 in the end (after the final switch). Thus we have Rule 4: * * * n 0 0 --> * * * 0 2^n 0 Now suppose we start with n coins in box 3, and boxes 4, 5, and 6 are empty. Then, similarly to the previous case, we press Poof! on box 3 once and then repeat the following until box 3 is empty: apply Rule 4, and press Switch! on box 3. At each step, the number of coins in box 4 will be 2 raised to the number of coins in box 4 from the previous step. Thus we have Rule 3: * * n 0 0 0 --> * * 0 2^...^2 0 0, where the tower consists of n twos. Here, it seems prudent to introduce some notation to simplify these expressions. I will use Knuth's up-arrow notation. The process of building a tower of exponentiation is called tetration, and I will use the symbol ^^ for it, so 2^^n is a tower of 2's that is n high. Thus Rule 3 can be better stated as * * n 0 0 0 --> * * 0 2^^n 0 0 Similarly, by repeatedly applying Rule 3 and pressing Switch! on box 2, we could obtain Rule 2 that involves pentation, which is repeated tetration (so 2^^^n = 2^^(2^^...^^2) with n twos in total), but since we start with only 1 coin in box 1, this rule won't get applied exactly, so we'll skip it. To obtain the promised amount, proceed as follows: 1 1 1 1 1 1 0 2 2 2 2 3 (Press Poof! on all 5 boxes) 0 2 2 2 0 7 (Poof! twice more on box 5) 0 2 2 1 7 0 (Press Switch! on box 4) 0 2 2 1 0 14 (Apply Rule 5) 0 2 2 0 14 0 (Press Switch! on box 4) 0 2 1 14 0 0 (Press Switch! on box 3) 0 2 1 0 2^14 0 (Apply Rule 4) 0 2 0 2^14 0 0 (Press Switch! on box 3) 0 1 2^14 0 0 0 (Press Switch! on box 2) 0 1 0 2^^(2^14) 0 0 (Apply Rule 3) 0 0 2^^(2^14) 0 0 0 (Press Switch! on box 2) 0 0 0 2^^(2^^(2^14)) 0 0 (Apply Rule 3) 0 0 0 0 2^(2^^(2^^(2^14))) 0 (Apply Rule 4) 0 0 0 0 0 2*2^(2^^(2^^(2^14))) (Apply Rule 5) I believe that is the maximum amount of money you could potentially get out of this machine, but I'm not entirely sure. • To give an idea of how fast tetration grows, suppose you were aiming for 2^^5 (much less than 2^^(2^14)). This is 2^(2^(2^(2^2)))=2^(2^(2^4))=2^(2^16)=2^65536 which is about 2*10^19729. That's way more than enough to give everyone currently alive on Earth a trillion dollars for every Planck time from the Big Bang to the heat death of the universe. – Rob Watts Apr 30 '15 at 18:45 Accept. How would you legally own the money you created with the machine? If you just start to spend a lot of money (or just turn up at a bank with trillions of coins) and you can't prove where you got it from, you will be imprisoned for tax fraud. If you show them the machine, from the point of view of the government, you just made counterfeit money, so it will be confiscated and you will end up in jail. Unless you want to start a criminal enterprise and launder that money somehow, which, without good connections and experience in the criminal underworld only with a bunch of coins, will not be an easy and risk-free task. (The hundreds of years mentioned in GOTO 0's answer will be increased by orders of magnitude while you launder more than a trillion coins) Much easier to just accept the one trillion dollars, which can happen legally, as you just sold a device to someone. You pay the taxes for it, and you have hundreds of billions of dollars left, which you now own legally. • If you're getting paid$1Tn and can't get past taxes you seriously need to reconsider your accountancy advice. – NPSF3000 May 4 '15 at 4:27

You reject the deal. Warren Buffet has only a small fraction of a trillion dollars. In fact, you'd need the top 22 richest people in the world's combined net worth to reach a trillion dollars. If this potential buyer is making an initial offer of more than 10x his available capital (and has to expect some negotiation), that should be a red flag that this will not end well for you.

(Of course, he could be lying by a factor of a thousand and you'd still become a billionaire, so you would have that going for you...)

• I would not doubt Warren Buffet's ability to raise the needed money. – Loren Pechtel Apr 30 '15 at 21:10

Another reason you should take the deal is the fact that one trillion dollar coins will undoubtedly take up more space that your machine's 6th box can hold, let alone the amount of space that would be needed for the machine's other five boxes.

To help put it in perspective check out this link: http://www.kokogiak.com/megapenny/fourteen.asp

1,000,000,016,640 pennies occupy a space much larger than the Lincoln Memorial. Now keep in mind that each one dollar coin occupies even more space than a single penny.

Unless you spent tons of money creating an unfathomably large machine to hold all of these coins in the six boxes, I would definitely take the money being offered to you.

You accept the offer, but on grounds different to that of GOTO 0, which appears to be brute force logic but not an analysis of the underlying system.

Simply put, if you 'poof' a coin, the two coins created move over to the next box.

You can't swap the coins back because "pressing a button beneath an empty box does nothing." (Edit: it's also not possible because "Pressing the "Switch!" button below box i will cause a coin from box i to disappear, and switch the contents of boxes i+1 and i+2 ." - which isn't i itself but the next two boxes along) - swapping back is therefore not possible.

If you 'poof' the coins in box two (or swap them), they will eventually end up in box three, so on and so forth until they reach box 6.

Once all coins end up in box 6, as per the term "pressing a button beneath an empty box does nothing.", it's no longer possible to swap the coins back. They become trapped in box 6, with no 'poof' button.

Your total amount of earnings would be 63 dollars (presuming the condition that once all coins are inside box 6 result in the machine breaking).

So yes, accept the offer: the machine is a scam.

• You need to use a bit of lateral thinking to see the algorithm for swapping coins in a way that allows you to get a lot of them. – Joe Z. Apr 30 '15 at 13:24
• The algorithm wouldn't exist, because swapping takes a coin from the current box, but does not swap back. So say you had boxes [1][2][3] - the coin in 1 would disappear, but the coins in 2 and 3 would swap (which doesn't move back into 1). Even if you 'poofed' a later box, like [5] - that coin disappears, and no coin can be recovered. – Layton Apr 30 '15 at 14:10
• Have you read the way the algorithm does it in the solution? It takes a bit of time (until the third or fourth box) for the algorithm to really explode. – Joe Z. Apr 30 '15 at 14:11
• A box doesn't regain any coins, it just moves them along. Have you seen the above solutions? – Joe Z. Apr 30 '15 at 15:02
• This is very wrong. If you look at Lothar's proof, you'll see exactly how you can create more coins than there are Planck volumes in the observable universe. – Rob Watts Apr 30 '15 at 18:51