8 red balls

You have a bag with 8 red balls in it.

Every turn you randomly select a ball from the bag. If it is red you replace it with a blue ball, and if it is blue you replace it with a red ball.

What is the expected number of turns you need to make before all 8 balls in the bag are blue?

If the answer is a b \dfrac{a}{b} , where a a and b b are coprime positive integers , what is a + b a+b ?


The answer is 32873.

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.

1 solution

Geoff Pilling
Jul 30, 2016

To solve this you need to solve the following set of linear equations:

  • E 0 = 1 + E 1 E_0 = 1 + E_1
  • E 1 = 1 + ( 1 / 8 ) E 0 + ( 7 / 8 ) E 2 E_1 = 1 + (1/8)*E_0 + (7/8)*E_2
  • E 2 = 1 + ( 2 / 8 ) E 1 + ( 6 / 8 ) E 3 E_2 = 1 + (2/8)*E_1 + (6/8)*E_3
  • E 3 = 1 + ( 3 / 8 ) E 2 + ( 5 / 8 ) E 4 E_3 = 1 + (3/8)*E_2 + (5/8)*E_4
  • E 4 = 1 + ( 4 / 8 ) E 3 + ( 4 / 8 ) E 5 E_4 = 1 + (4/8)*E_3 + (4/8)*E_5
  • E 5 = 1 + ( 5 / 8 ) E 4 + ( 3 / 8 ) E 6 E_5 = 1 + (5/8)*E_4 + (3/8)*E_6
  • E 6 = 1 + ( 6 / 8 ) E 5 + ( 2 / 8 ) E 7 E_6 = 1 + (6/8)*E_5 + (2/8)*E_7
  • E 7 = 1 + ( 7 / 8 ) E 6 E_7 = 1 + (7/8)*E_6

where E n E_n represents the expected number of moves given that you have n n blue balls in the bag.

Solving this for E 0 E_0 gives, E 0 = 32768 / 105 E_0 = 32768/105 .

32768 + 105 = 32873 32768 + 105 = \boxed{32873}

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...