We have $n$ numbered boxes from $1$ to $n$. Box $i$ contains $i-1$ red balls and $n-i$ yellow balls. We randomly chose a box and we draw two balls without substitution.
- Find the probability that the second ball is yellow.
Let $X_i$ be the event that we pick the box $i$. Thus
$\rightarrow \mathbb{P}(g_2)=\sum_{i=1}^{n}\mathbb{P}(g_2,X_i)=\sum_{i=1}^{n}\mathbb{P}(X_i)\mathbb{P}(g_2|X_i)=\frac{1}{n}\cdot \frac{n-i}{n-1}$
- Find the probability that the second ball is yellow if the first is yellow.
$\rightarrow \mathbb{P}[(g_2|g_1)|X_i]=\frac{\mathbb{P}(g_1|X_i)\mathbb{P}[(g_1|g_2)|X_i]}{\mathbb{P}[g_2|X_i]}=\frac{\frac{n-i}{n-1}\cdot \frac{n-i-1}{n-2}}{\frac{n-i}{n-1}}=\frac{n-i-1}{n-2}$
$\Rightarrow \mathbb{P}(g_2|g_1)=\sum_{i=1}^{n}\mathbb{P}(X_i)\mathbb{P}[(g_2|g_1)|X_i]=\frac{n-i-1}{n(n-2)}$
- Find the probability to draw the box 1, knowing that the two balls are both yellow.
$\rightarrow \mathbb{P}(X_i|g_1,g_2)=\frac{\mathbb{P}(X_i)\mathbb{P}(g_1|g_2)\mathbb{P}(g_2|X_i)}{\mathbb{P}(g_1,g_2)}$ where
$\mathbb{P}(g_1,g_2)=\sum_{i=1}^{n}\mathbb{P}(g_1,g_2,X_i)=\sum_{i=1}^{n}\mathbb{P}(X_i)\mathbb{P}(g_1,g_2|X_i)=\sum_{i=1}^{n}\mathbb{P}(X_i)\mathbb{P}(g_1|g_2)\mathbb{P}(g_2|X_i)=\frac{1}{n}\sum_{i=1}^{n}\frac{n-i}{n-1}\cdot \frac{n-i-1}{n-2}$
$\Rightarrow \frac{\frac{1}{n}\cdot \frac{n-i}{n-1}\cdot \frac{n-i-1}{n-2}}{\frac{1}{n}\sum_{i=1}^{n}\frac{n-i}{n-1}\cdot \frac{n-i-1}{n-2}}$
Is it correct?
Thanks in advance.