Get the final balls

Logic Level 3

There are 100 balls in a bucket. Starting with Alice, Alice and Bob take turns taking out up to 5 balls from the bucket. The person who takes the last ball is the winner.

How many balls should Alice take on her first turn to ensure that she'll win the game if played optimally?


The answer is 4.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

4 solutions

You can work this backwards. The idea here is you want to pick the last batch ( 1-5 balls) to be the winner. Hence, you want the end resulting in a batch of 6 balls, so no matter how many your opponent picks (5 to 1), there will be at least a (1-5) balls for you to pick last. 100 mod 6 = 4. so pick 4.

Mr Yovan
Feb 20, 2016

There is a ´´ lose position´´ that would be 94 94 because the person who got this cant reach the 100 100 and any choice of this person will give the opponent a ´´winning position´´.As she start with 4,she just need to add either 5 5 or a number that makes Bob number becomes a multiple of 5 5 till Bob reach the 94 94

Wong Bigc
Feb 14, 2016

who change the question for me ?

Parth Dodia
Feb 13, 2016

Alice can always make the sum six after bob's turn. Nearest multiple of 6 near 100 is 96. Hence she has to take 4 balls out first.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...