Turning Cards Until the First Ace

Expectation · Medium · Free problem

A standard 52-card deck is shuffled and you turn over cards one at a time from the top. Let $N$ be the number of cards you turn over up to and including the first ace.

(a) Find $E[N]$.

(b) Generalize: a deck contains $m$ ordinary cards and $n$ special cards. What is the expected number of cards turned over until the first special card appears?

Hints

  1. $N = 1 + (\text{number of non-aces that appear before the first ace})$. Write that count as a sum of indicator variables, one per non-ace.
  2. For a particular non-ace card, what is the probability that it sits before all four aces? Only the relative order of that card and the 4 aces matters.
  3. Each of the 48 non-aces precedes all 4 aces with probability $1/5$, so $E[N] = 1 + 48/5$.

Worked Solution

How to Think About It: The distribution of the position of the first ace is a hypergeometric-flavored mess, but its expectation is easy if you count the non-aces sitting in front of it with indicators. Each non-ace is either before all the aces or not, and symmetry gives that probability immediately.

Quick Estimate: Four aces split the 48 other cards into 5 segments of equal expected size, $48/5 = 9.6$ cards. The first ace comes after the first segment, so at position $9.6 + 1 = 10.6$.

Formal Solution:

Part (a): The 52-card deck

*Step 1 -- Indicators.* Label the 48 non-aces $1, \ldots, 48$ and let $I_j = 1$ if non-ace $j$ appears before all four aces. Then $N = 1 + \sum_{j=1}^{48} I_j$.

*Step 2 -- Probability of each indicator.* Consider only the five cards consisting of non-ace $j$ and the four aces. In a uniformly random shuffle all $5!$ relative orders of these five cards are equally likely, so non-ace $j$ is first among them with probability $1/5$: $E[I_j] = 1/5$.

*Step 3 -- Linearity.*

$$E[N] = 1 + 48 \cdot \frac{1}{5} = 1 + 9.6 = 10.6 = \frac{53}{5}.$$

Part (b): $m$ ordinary and $n$ special cards

By the identical argument each ordinary card precedes all $n$ special cards with probability $1/(n+1)$, so

$$E[N] = 1 + \frac{m}{n+1}.$$

With $m = 48$, $n = 4$: $1 + 48/5 = 10.6$. Sanity checks: $n = 0$ special cards is degenerate; $m = 0$ gives $E[N] = 1$; $n = 1$ gives $1 + m/2$, the expected position of a single marked card in a deck of $m + 1$, i.e. $(m+2)/2$, which is correct.

*Direct check.* $P(N = k) = \binom{52-k}{3}/\binom{52}{4}$ for $k = 1, \ldots, 49$, and $\sum_k k\, P(N = k) = 53/5$.

Answer: (a) $E[N] = 1 + \dfrac{48}{5} = 10.6$. (b) $E[N] = 1 + \dfrac{m}{n+1}$.

Intuition

Each non-ace is an independent-looking "obstacle" that sits before all four aces with probability $1/5$, because among that card and the four aces every relative order is equally likely. Linearity of expectation then gives $1 + 48/5 = 10.6$ without touching the messy distribution of $N$. The same "one indicator per ordinary item, each ahead of all $n$ special items with probability $1/(n+1)$" argument shows that $n$ special cards split a deck into $n + 1$ segments of equal expected length; it is the discrete analogue of uniform spacings and the workhorse for "expected position of the first success without replacement" questions.

Open the full interactive solver →