Monday, September 15, 2008

Piles of Pennies

After looking at the piles of pennies problem, I think that the initial goal (48 pennies in one drawer) can be easily reached:

1. move 32 pennies (half of 64) from left drawer to right. That gives 32 pennies in each drawer.

2. move 16 pennies (half of 32) from left to right or vice versa. That gives 48 pennies in the right or left drawer respectively.

Voila!

The general problem (any number of pennies between 0 and 64 in either drawer) is not reachable under these rules. As you transfer pennies back and forth, you will eventually reach an odd number of pennies in each drawer, at which point no move is possible. That means (at least) that you can only reach one odd number using the above rules. I suspect that this will also limit the number of even solutions as well.

3 comments:

Danny Heap said...

More than one path to a solution is a good thing. Induction is required here to get experience with the technique.

With the golden ration, I ask you to make a certain argument based on the assumption that n1/n2 is phi. The assumption may be false.

I'd be surprised if there were an easy pattern in the count of ternary trees. I'd be happy with a reliable (and proved) formula.

Danny Heap said...

Name a number of pennies in [0,64] that can't be produced in one drawer or the other. I'll take it as a challenge to try to produce that number.

I do agree that the game halts as soon as you reach an odd number. Perhaps we don't agree on the definition of the problem --- you get to start from the initial position and aim at a particular target in [0,64]

Gerald Britton, MCSA SQL Server, MVP said...

About the trees, I've basically given up on finding a formula. I can sketch out a proof structure but that's probably it,

About the pennies, first produce 1 penny in one drawer and 63 in the other. Then try anything else. You cannot, for now you have an odd number of pennies in each drawer, so no move is possible.

As another challenge, start over and switch the start state so instead of 0,64 you have 64,0