chisigma said:
Indicating with A and B the two boxes, it is enough to observe the state of A, that extablishes the state of B. The number of states of A is eight... 1) 0 W + 0 B
2) 0 W + 1 B
3) 1 W + 0 B
4) 1 W + 1 B
5) 2 W + 0 B
6) 2 w + 1 B
7) 3 W + 0 B
8) 3 W + 1 B
... and the problem can be treated as a Markov chain with adsorbing state 1 or 8. If the initial state is not specified then any state can be the initial state with probability $\frac{1}{8}$. The first step is of course to write the transition matrix... finding an explicit formula of the probability that the game ends at the n-th iteration as function of n seems in any case an hard task...
If the colour of the balls is not important [we are searching the event of all balls in A or B] and at each iteration one ball change address with equal probability, the problem can be reduced to a five states Markov chain and each stated represents simply the number of balls in A. The transition matrix is...
$\displaystyle T = \left | \begin{matrix} 1 & 0 & 0 & 0 & 0 \\ \frac{1}{4} & 0 & \frac{3}{4} & 0 & 0 \\ 0 & \frac{1}{2} & 0 & \frac{1}{2} & 0 \\ 0 & 0 & \frac{3}{4} & 0 & \frac{1}{4} \\ 0 & 0 & 0 & 0 & 1 \end{matrix} \right| $ (1)
... that can be reduced in 'canonical form' as follows...
$\displaystyle P = \left | \begin{matrix} 0 & \frac{3}{4} & 0 & \frac{1}{4} & 0 \\ \frac{1}{2} & 0 & \frac{1}{2} & 0 & 0 \\ 0 & \frac{3}{4} & 0 & 0 & \frac{1}{4} \\ 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 1 \end{matrix} \right| $ (2)
The problem has two adsorbing states [0 and 4] and, if we assume that the initial state is a transient state [1, 2 or 3] with the same probability, the probability that the process terminates at the n-th iteration is...
$\displaystyle P_{n} = \frac{1}{5}\ (\sum_{i=1}^{3} p_{n,i,0} + \sum_{i=1}^{3} p_{n,i,4})\ (3)$
... where the terms p are the elements of the rows 0 and 4 of the matrix $P^{n}$.
The effective computation of (3) gives...
$\displaystyle P_{1}= \frac{2}{3}\ \frac{1}{4}= \frac{1}{6}$
$\displaystyle P_{2}= \frac{2}{3}\ (\frac{1}{4} + \frac{1}{8}) = \frac{2}{3}\ \frac{3}{8}= \frac{1}{4}$
$\displaystyle P_{3} = \frac{2}{3}\ (\frac{11}{32} + \frac{3}{32} + \frac{1}{8} ) = \frac{2}{3}\ \frac{9}{16}= \frac{3}{8}$
$\displaystyle P_{4} = \frac{2}{3}\ (\frac{11}{32} + \frac{7}{32} + \frac{3}{32} ) = \frac{2}{3}\ \frac{21}{32}= \frac{7}{16}$
$\displaystyle P_{5} = \frac{2}{3}\ (\frac{53}{128} + \frac{7}{32} + \frac{21}{128} ) = \frac{2}{3}\ \frac{102}{128}= \frac{34}{64}$
Of course more terms can be computed… the convergence to 1 of the $P_{n}$ if n tends to infinity is very slow, as expected…
Kind regards
$\chi$ $\sigma$