8
$\begingroup$

I have a deck of $20$ different cards.

Each time, a card is pulled randomly, then put back in the deck. We shuffle and proceed to pull another card (thus keeping the randomness of pulls).

The question is this:

After how many pulls the probability of seeing all cards in the deck is $50$$\%$?

  • 1
    The more general form: In a deck of $n$ cards, after how many random pulls (with replacement) is the probability of having seen all cards $A$? (Where $n$ is a positive integer and $A$ is a real number in the interval $[0,1)$.)2017-01-12
  • 5
    This is a variation of Coupon Collector's problem2017-01-12
  • 0
    Following on from Alex's comment, setting $m=k=20$ and $p=0.5$ [here](http://www.distributome.org/js/calc/CouponCollectorCalculator.html) tells you that the number of pulls is $67$.2017-01-12

1 Answers 1

4

Suppose a deck consists of $n$ cards $1,...,n$, where $n$ is a fixed positive integer. For $0 \le k \le n$, and $d \ge 0$, let $p(k,d)$ be the probability, with $k$ cards not yet seen in previous draws, of seeing all the unseen cards (each at least once) in the next $d$ draws, where each draw consists of randomly selecting one card with replacement from a shuffled deck. Then $p(k,d)$ can be computed via the following recursion: $$ p(k,d)=\begin{cases} 1, & \text{if $k=0$} \\ 0, & \text{if $0 \le d < k$}\\ \left(\dfrac{k}{n}\right)p(k-1,d-1)+\left(\dfrac{n-k}{n}\right)p(k,d-1) & \text{otherwise} \end{cases} $$

Explanation:

If $k = 0$, there are no cards yet unseen, so the probability of seeing all the unseen cards is $1$.

If $0 \le d < k$, the $d$ remaining draws are not enough to see the $k$ yet unseen cards, so the probability of seeing all the unseen cards is 0.

Otherwise, draw one card. If the drawn card is one of the $k$ unseen cards, that leaves $k-1$ unseen cards; if not, it's still $k$ unseen cards. Either way, the number of remaining draws goes down by $1$, from $d$ to $d-1$.

Setting $n=20$ and applying the above recursion, Maple gets

$$p(20,66) < 1/2 < p(20,67)$$

so the answer is $67$.

  • 0
    How you came up with that formula?2017-01-12
  • 0
    @Gyanshu -- I edited my answer to address your question.2017-01-12