Expected value of getting a matching pair of socks given 2 kinds

conditional probabilityexpected valueprobability

We have $n$ socks in a drawer, $\frac n 2$ of which are black, and $\frac n 2$ of it are white. We draw two socks from the drawer. If they are different colors we put them both back. If they are the same color then we are done.

I've found that the probability that we draw socks of the same color would be $\frac n {2(n-1)}$

What I'm trying to figure out is the expected number of times we would have to draw a pair of socks before we get a matching pair. I've computed that it would be $\sum_{i=1}^{\infty}(1-\frac n {2(n-1)})^i\frac n {2(n-1)}$, but that sum is divergent, so I believe I'm doing something wrong.

Best Answer

First of all, your probability of drawing socks of the same color is not quite right. After we draw one sock, there are $n/2-1$ socks of the same color remaining, and $n-1$ total socks remaining, so the probability of picking a matching sock is $$\frac{n/2-1}{n-1}=\frac{n-2}{2n-2}$$ not $\frac{n}{2(n-1)}$. Now we may write the expected value of the number of times you need to pick socks as the following infinite series: $$\sum_{i=1}^\infty \bigg(1-\frac{n-2}{2n-2}\bigg)^{i-1}\cdot\frac{n-2}{2n-2}\cdot i$$ which is not divergent, since $1-\frac{n-2}{2n-2}\in (0,1)$. Can you compute the value of this sum?