You have a bag with some black balls and some white balls. You put your hand into the bag and pull out a pair of balls. (a) If both balls are black, you throw away one and return one to the bag. (b) If both balls are white, you throw them both away. (c) If the balls are of different colours, you throw away the black ball and return the white ball to the bag. You can keep doing this so long as there are at least two balls left in the bag. The process stops when the bag is empty or has only a single ball left. For instance, suppose we start with 2 black balls and 2 white balls. The various ways the game can evolve are described below.

Image :- http://www.iarcs.org.in/inoi/2012/zio2012/zio2012-qpaper.pdf

Suppose you start with a given number of black and white balls, play the game and you end up with a single ball in the bag. Let N denote the number of times you pulled out pairs of balls. We are interested in answering the following questions. • What are the minimum and maximum values for N for which you end with a single ball in the bag? • Is the last ball remaining in the bag always white, always black or of either colour? 1 In the example worked out above, if we end up with a single ball in the bag, it must be black. Also, the minimum and maximum values of N are both 2. Note that we are not interested in the value of N in situations where the bag becomes empty. Compute the minimum and maximum values of N as well as the possibilities for the colour of the last ball for each of the following initial contents of the bag. (a) 17 black balls, 23 white balls (b) 42 black balls, 32 white balls (c) 111 black balls, 99 white balls