How many hands does it take to draw all 52 different cards from an infinite deck of cards?

114 Views Asked by At

Say you have a deck of cards 52 distinct cards labeled numbers 1 through 52. Each turn you are given a hand of 5 different cards, each of which are labeled 1–52. Each card has an equal chance of being drawn. Each turn all cards labeled 1–52 are in play; ex: if you draw a 7 one turn, you can draw the 7 again on a future turn. How many expected turns does it take until you have collected all cards labeled 1 through 52?

2

There are 2 best solutions below

2
On

If you study the link about the coupon collector's problem, suggested by @lulu in the comments, you will find out that, if you've turned just 1 card each time, and $T_n$ is the number of turns to get all the $n=52$ distinct cards, the expected number of turns will be given by $$E(T_{52})=52\left(1+\frac{1}{2}+\frac{1}{3}+\ldots+\frac{1}{52}\right)=236.$$ A good approximation for $E(T_n)$, considering $n$ in general can be given by: $$E(T_n)=n\log n+\gamma n+\frac{1}{2}+O(1/n)$$ in which, $\gamma=0.5772156649$ (Euler-Mascheroni constant). In this case the approximation considering $n=52$ by this formula is $235.48$.

But you are getting hands of 5 cards each time, and this 5 cards are being returned to the deck before the next draw of 5 cards. That´s why this is a variation.

0
On

To find the exact number of expected moves, I used a dynamic programming-technique. If $X_i$ (with $i<n$) is the random variable describing the number of turns left if we already have $i$ unique cards, then the following equation holds (because of linearity of expected values): $$ E[X_i] = 1+\sum_{j=0}^{k} P(j \text{ new cards | } i \text{ unique cards})\cdot E[X_{i+j}] $$ (for the appropriate probability function $P$, in this case involving three binomial numbers).

The important thing to note here is that the right-hand side of the equation only contains $E[X_r]$ with $r\geq i$. This gives us the opportunity to work backwards: first calculate the expected number of moves left if we already have $n-1$ unique cards. Based of that information, calculate the expected number of moves starting from $n-2$ cards, and so on. You could also see it as a large system of linear equations that can be solved with standard tools. Or as a Markov chain of which you look for the expected first passage time.

I solved it exactly for $n=180$ and $k=16$, but the exact ratio requires more than 4000 digits to write down! ;) Approximately it takes $66.62$ turns. [But beware that this is just the average; the variance on this number might be quite large.]