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?
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.
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.