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 $\dfrac{a}{b}$ , where $a$ and $b$ are coprime positive integers , what is $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.

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

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

Solving this for $E_0$ gives, $E_0 = 32768/105$ .

$32768 + 105 = \boxed{32873}$