Taking coins away randomly from 2 piles

105 Views Asked by At

Suppose we have 2 piles of coins, each with $n$ coins. Every time we randomly pick a pile and take away 1 coin. When one of the piles becomes empty, what is the expectation of the number of coins in the remaining pile?

1

There are 1 best solutions below

3
On BEST ANSWER

Let $X_i$ be the number of potential draws from pile $i\in \{0,1\}$ until the other pile is empty. Then $$ \mathsf{P}(X_i=k)=\binom{n+k-1}{k}\left(\frac{1}{2}\right)^{n+k}. $$ Letting $Y$ denote the number of remaining coins in a non-empty pile after the other pile has been emptied, for $m\in\{1,\ldots,n\}$ one gets \begin{align} \mathsf{P}(Y=m)&=\mathsf{P}(Y=m,X_1<n)+\mathsf{P}(Y=m,X_2<n) \\ &=\mathsf{P}(X_1=n-m)+\mathsf{P}(X_2=n-m) \\ &=\binom{2n-m-1}{n-m}\left(\frac{1}{2}\right)^{2n-m-1}. \end{align} Finally, \begin{align} \mathsf{E}Y&=\sum_{m=1}^n m\binom{2n-m-1}{n-m}\left(\frac{1}{2}\right)^{2n-m-1}=\binom{2(n-1)}{n-1}\frac{2n-1}{2^{2(n-1)}} \\ &=\frac{(2n-1)!!}{(2n-2)!!}\approx\frac{2n-1}{\sqrt{\pi(n-1)}}\approx 2\sqrt{\frac{n-1}{\pi}}. \end{align}