Fog Creek Software
Discussion Board




food for thought puzzle

There are 10 muffins in a row

1 2 3 4 5 6 7 8 9 10


the game is that you and your friend have to play alternatively and can either take 1 or 2 muffins in one turn.

you are so hungry that you start to play first. what is the strategy you must follow in the game so that you always get the last turn to take the remaining muffins(i.e you can have either 1 or 2 left when on your last turm)

Abyss
Wednesday, June 22, 2005

Well, work it backwards...

How can you always take the last muffin(s) ?

If you leave your opponent with 3, whether he takes 1 or 2, you can always take the rest.

So how do we leave our opponent with 3?

Similarly, if you leave your opponent with 6, you can always take the right number to get to 3.

So the correct strategy is to start by taking 1, leaving 9, then make sure you leave your opponent with 6, 3, then 0.

Incidently, in the general case, 3 works because 3 = 1 (the least they can take) + 2 (the most they can take)
If each person could take 1, 2 or 3, for example, your "magic" number would be 4.

BradC
Wednesday, June 22, 2005

there you go BradC......good work.....


i gave this puzzle(true to its name) as a food for your thought on the larger puzzle MATCHSTICK  PUZZLE.......

your thought was in english(words)...wat if you can think the same thing in math.....i

i bet you can...for you solved this puzzle and math is the king of all sciences..it can just express anything.....

gud luck on the matchstick puzzle and kudos for your solution to this one.

Abyss
Wednesday, June 22, 2005

In math speak:
Initial state is not evenly divisble by three.
Player 1 will make the state divisible by three (take one muffin).
Player 2 must make the state not divisible by three.
Player 1 sticks to the "make it divisible by three" strategy and eventually wins.

WanFactory
Thursday, June 23, 2005

*  Recent Topics

*  Fog Creek Home