1.

Al Capone and his (n-1) friends are sitting in a circular fashion when Tintin meets him(To- tal of n people). Each of them owns a coin. First person passes 1 coin to the person sitting on his left side. The second person in turn passes 2 coins to the person sitting on the left. Third person passes 1 coin to the left, 4th passes 2 coin to his left and so on. So each person receiving 1 coin from the right has to pass 2 coins to the left. Similarly, a person receiving 2 coins from the right has to pass 1 coin to the left. If at any point of time, a person runs out of coin he is thrown out of the game. The game will terminate if at the end only 1 person is left with all the coins in his posses- sion. There might be values of n where the game may not terminate e.g. 3 persons left with 4 4 4 coins respectively. For how many different values of n from 4 to 100 does the game terminate?

Answer»

16
7
10
46

Solution :If you START observing behaviour of games starting from N=1, you can observe patternswhich you can generalize. It is easy to see that in the first round each person sitting at aneven numbered position will be thrown out of the game as he/she has 1 COIN initially,receives 1 coin from right but has to now pass both the coins to the left. ALSO observe thatthe 1st person will be always thrown out of the game. If n = 2k, after the first round k­1 willremain. If n = 2k+1, then k will remain.Case 1 :​ n is evenfor n=2k , after the first round configuration would look like3(4) 5(2) 7(2) … 2k­1(2)where a(b) denotes position a with b coins. at this point of time. Number of remainingpeople are k, if k is odd the game will not terminate because a person who looses one coinin a round will gain one coin in the next round.Case 2 :​ n is odd
for n=2k+1, after the first round configuration would look like3(3) 5(2) … `2k+1(2)`
If k is odd, the game will not terminate. If both the cases if k is even, at the end of tworounds exactly half will remain. Because a person who looses a coin will keep loosing insubsequent round.
After this elimination you again have to DEAL with cases where remaining people are odd oreven. Thus you can observe that if after the first roundpeople remain then the game willalways terminate. This can happen if initially there areorperson are there. 
Hence, the Answer is option: C)10


Discussion

No Comment Found

Related InterviewSolutions