Saturday, August 9, 2008

Strategy to Win

Two players A and B play a game where there n coins. In the first turn, A picks up some coins under the constraint that he can't pick up all of them. In the next turn, B can pick up any number of coins less than or equal to what A picked up before his turn. In the next turn A picks up coins with the same restriction..i.e. not more than what B picked up before his turn. The restriction is any player has to pick up at least one coin in his turn.

Update: A player wins if he picks up the last coin.

Give a strategy for winning for A

Level: Easy to moderate

4 comments:

Ero-Sennye said...

It is easy to verify that with n = 2^k, A can never win. For every other situation - if n is odd, A will pick one coin, and will win. if n is even, and not = 2^k, then A will pick as many coins (x) to make n-x = 2^k and x < n/2 . By the first property, A will surely win from here. The strategy, to clarify, here would be that if B picks 2^x, then A must also pick that, and if B picks any other form, then A should pick 2. We are done. Anyone who picks odd for n = even will certainly lose.

Pravesh said...

An interesting variant of the above problem is the change in the constraint as : a player can't pick up more than twice of what the other player picked up right before his turn.

Jagmohan said...

Hey Pravesh, Please explain question. I mean what is the criteria of winning in this game ?

Pravesh said...

I have added an update to specify the winning condition. Sorry for the omission of the same.

To rephrase it, the player who has no more coins left to pick , loses.