Answer to Question #53708 in C++ for jeeva s

Question #53708
Alice and Bob are playing a game called "Stone Game". Stone game is a two-player game. Let N be the total number of stones. In each turn, a player can remove 1, 2 or 3 stones. The player who picks the last stone, loses. They follow the "Ladies First" norm. Hence Alice is always the one to make the first move. Your task is to find out whether Alice can win, if both play the game optimally
Expert's answer
Start By Considering the base cases:
• First for n=1, Obviously Alice Loses.
• For n = 2,3,4 Alice Wins.
• For n = 5, Bob Wins.
Now for further 3 positions (i.e. 6,7,8), we can make Alice reach Bob's Winning position but start-ing from Bob ( i.e. (6-1), (7-2), (8-3) ). Then, Bob can only return Alice her winning positions.
• So, Alice Wins for n = 6,7,8.
Similarly for n= 9 Bob Wins. Continuing this reasoning, we can say that for n=1,5,9 i.e for any number of form 4n-3, Bob wins and for the rest, Alice wins.

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

New on Blog