Help with conditional probability Assume a box contains 11 balls: 5 red, 4 blue, and 2 yellow. A ball is drawn and its color noted. If the ball is yellow, it is replaced; otherwise, it is not. A second ball is then drawn and its color is noted.
What is the probability that the first ball was yellow, given that the second was red?
I believe I can use Bayes' theorem to solve this problem. I calculated the probabilities of the different scenarios but I can't figure out this one. Any advice is appreciated. 
 A: Have a short look. Stop looking and then try to do it yourself.

$$P\left(Y_{1}\mid R_{2}\right)=\frac{P\left(Y_{1}\cap R_{2}\right)}{P\left(R_{2}\right)}=\frac{P\left(R_{2}\mid Y_{1}\right)P\left(Y_{1}\right)}{P\left(R_{2}\mid Y_{1}\right)P\left(Y_{1}\right)+P\left(R_{2}\mid Y_{1}^{c}\right)P\left(Y_{1}^{c}\right)}$$

A: There are $5$ cases where $\color{red}{\text{the second ball is red}}$, out of which, in $3$ cases $\color{green}{\text{the first ball is yellow}}$:


*

*$\color{red  }{P( RR)=                 \frac{5}{11}\cdot\frac{4}{10}}$

*$\color{black}{P( RB)=                 \frac{5}{11}\cdot\frac{4}{10}}$

*$\color{black}{P( RY)=                 \frac{5}{11}\cdot\frac{2}{10}}$

*$\color{red  }{P( BR)=                 \frac{4}{11}\cdot\frac{5}{10}}$

*$\color{black}{P( BB)=                 \frac{4}{11}\cdot\frac{3}{10}}$

*$\color{black}{P( BY)=                 \frac{4}{11}\cdot\frac{2}{10}}$

*$\color{green}{P(YRR)=\frac{2}{11}\cdot\frac{5}{11}\cdot\frac{4}{10}}$

*$\color{black}{P(YRB)=\frac{2}{11}\cdot\frac{5}{11}\cdot\frac{4}{10}}$

*$\color{black}{P(YRY)=\frac{2}{11}\cdot\frac{5}{11}\cdot\frac{2}{10}}$

*$\color{green}{P(YBR)=\frac{2}{11}\cdot\frac{4}{11}\cdot\frac{5}{10}}$

*$\color{black}{P(YBB)=\frac{2}{11}\cdot\frac{4}{11}\cdot\frac{3}{10}}$

*$\color{black}{P(YBY)=\frac{2}{11}\cdot\frac{4}{11}\cdot\frac{2}{10}}$

*$\color{green}{P(YYR)=\frac{2}{11}\cdot\frac{2}{11}\cdot\frac{5}{10}}$

*$\color{black}{P(YYB)=\frac{2}{11}\cdot\frac{2}{11}\cdot\frac{4}{10}}$

*$\color{black}{P(YYY)=\frac{2}{11}\cdot\frac{2}{11}\cdot\frac{1}{10}}$


So the probability that the first ball was yellow given that the second ball was red is:
$$\frac{\color{green}{P(YRR)}+\color{green}{P(YBR)}+\color{green}{P(YYR)}}{\color{red}{P(RR)}+\color{red}{P(BR)}+\color{green}{P(YRR)}+\color{green}{P(YBR)}+\color{green}{P(YYR)}}=\frac{100}{540}\approx18.5\%$$
