The Problem:
You are sitting in front of two drawers. The left drawer contains 64 pennies, the right drawer contains nothing. Can you arrange things so that one of the drawers has 48 pennies, using combinations of the following two operations, l and r?
l: If the left drawer has an even number of pennies, you may transfer half of them to the right drawer. If the left drawer has an odd number of pennies, operation l is disallowed.
r: If the right drawer has an even number of pennies, you may transfer half of them to the left drawer. If the right drawer has an odd number of pennies, operation r is disallowed.
The Plan:
For this first problem of 48 pennies, the plan can be simply trial and error because this does not take many steps to achieve.
Carrying it out:
We will start by having 64 pennies first in the left drawer and none in the right.
L R
64 0
Then we transfer half of 64, which is 32, to the right drawer because the left drawer has an even number of pennies and this operation is allowed.
L R
32 32
Then we transfer half from the right drawer, which is 16, to the left drawer, and the result will be our solution, as 16 + 32 = 48
L R
48 16
Now, the second part:
Choose another number in the range [0,64]. Starting from the same initial position, can you arrange things so that one of the drawers has that number of pennies? Are there any numbers in that range that are impossible to achieve?
The Plan:
A good approach is to work backwards. This means starting with our desired result in one of the drawers, and the other HAS to be the amount for the total to add up to 64 pennies. Then, with each step we will double the amount instead of halving it.
Carrying it out:
Lets choose the number 17.
L R
17 47
We double what the amount of the left drawer has because each step requires us to half the previous amount.
L R
34 30
This time we double the right drawer because 34 * 2 is 68, which is not possible (we only have 64 pennies).
L R
4 60
8 56
16 48
32 32
64 0
What about just 1 penny?
L R
1 63
2 62
4 60
: :
(steps we already done in the previous example)
There are actually no penny values that are impossible to achieve in the range [0, 64]. Which means that all natural numbers from 0 to 64 are attainable from these penny arrangements.
Here's a good blog post I found on the same problem: http://juliaslog.wordpress.com/2014/10/27/a-series-of-unfortunately-inconclusive-events/