# Conditional probability - selecting balls from colored boxes based on previous pick

There are two boxes, one white, one black. The white box contains 3 white balls and 2 black balls. The black box contains four white balls and six black balls. This particular example 60%/40% and 40%/60% distribution split but in other versions of this problem the distribution could be uneven. I'm hoping for a generic algorithm/solution that can handle different distribution.

Balls are drawn from the boxes, the color is recorded, and the ball is returned to its box. You select a ball from the white box first. If the selected ball is white you choose from the white box next. If the ball is black you choose from the black box next. The probabilities of the first few selections are easy enough.

What is the probability that the 50th ball chosen is white? I'm thinking a very large decision tree would solve this but that seems an untenable manual process. Any suggestions much appreciated!

• I'm thinking figuring out how many balls there are total at the fiftieth level is the key comparing that to the number of white balls. – user451844 Aug 6 '17 at 21:18

## 2 Answers

Intuitive and approximate answer: At any stage, you have $40\%$ probability of switching boxes. After $50$ stages, you will (probably) have swapped back and forth so many times that the probability distribution hardly remembers what you started at, so you're (very close to) equally probable to be standing in front of the white box as the black box. Thus it's very close to even odds for drawing a white as a black ball.

• In this particular instance of color distribution, you are probably right. I'm looking for a more generic solution that can handle uneven distributions too. Say the probability was 20% white in the white box and 70% white in the black box. I'll edit my question. Thanks! – mba12 Aug 6 '17 at 21:42
• Have you heard about Markov chains? Stochastic matrices? I think that's the easiest way to solve it exactly, and also think about it approximately. – Arthur Aug 6 '17 at 21:52
• Thank you for the suggestions. I am helping a high school math student taking precalculus over the summer so I'm thinking there is a solution within that context. I'll look into your suggestions. – mba12 Aug 6 '17 at 22:18

When we have a two state Markov chain with a symmetric transition matrix, then the steady state will be $50\%$ probability for drawing from the white box.   After 50 transitions we will be approximately at steady state.

$${\begin{bmatrix}1 & 0 \end{bmatrix}}\lower{1.5ex}{\begin{bmatrix}0.60 & 0.40\\0.40 & 0.60\end{bmatrix}}^{50} \approxeq \begin{bmatrix}0.50&0.50\end{bmatrix}$$

If the transition matrix is not symmetric, then the steady state will be elsewhere. For example:

$${\begin{bmatrix}1 & 0 \end{bmatrix}}\lower{1.5ex}{\begin{bmatrix}0.60 & 0.40\\0.30 & 0.70\end{bmatrix}}^{50} \approx \begin{bmatrix}0.428571 & 0.571429\end{bmatrix}$$

Here $\begin{bmatrix}1 & 0 \end{bmatrix}$ describes the initial state (assuming you start from the white box). Then comes the transition matrix describing the probabilities of transiting to each state from a given state (can you see where the numbers derive?), and the exponent it the count of transitions. The result of this computation describes the probabilities of facing white and black after the transitions.