If it is your turn and there are 1 or 2 balls in the basket you take
them and win.
If it is your turn an there are 3 balls in the basket, you must leave
1 or 2 after your turn, so you lose.
If the number of balls on your turn is not divisible by 3, you can
take 1 or 2 balls and make it divisible by three. Your opponent will
then have to make it not divisible by three, so the process repeats
until you win.

So the first player wins if N is not divisible by 3.

Don

On Jan 12, 8:03 am, siva <sivavikne...@gmail.com> wrote:
> consider there are N balls in a basket. 2 players play the turns
> alternatively ..AT each turn,the player
>
> can take 1 or 2 balls from the basket. the first player starts the game..
> Both the players play optimally.
>
>    i)   Given N,tell whether the 1st player win or loss ?
>
>    ii) If player 1 wins, how many balls he should take at this first turn(1
> or 2) ?

-- 


Reply via email to