Problem 10.29 Easy Free 4 variations

Cards Until the First Ace

A standard, well-shuffled 52-card deck is dealt face-up one card at a time. Find the expected number of cards dealt up to and including the first ace.

Work it out, then compare with the answer.

SolutionShow the worked solution

Key idea. Count the non-aces dealt before the first ace using indicators.

Label the 4848 non-aces c1,…,c48c_1,\dots,c_{48}. Let IjI_j be the indicator that cjc_j is dealt before all four aces. The number of cards dealt up to and including the first ace is

N=1+∑j=148Ij.N = 1 + \sum_{j=1}^{48} I_j .

Fix jj and look only at the relative order of the five cards cjc_j and the four aces. In a uniformly shuffled deck, each of these five is equally likely to come first. Hence P(Ij=1)=15\mathbb{P}(I_j=1)=\frac15. By linearity of expectation,

E[N]=1+485=535.\mathbb{E}[N] = 1 + \frac{48}{5} = \frac{53}{5}.

Generalisation. Suppose a well-shuffled deck of nn cards contains kk special cards. Each of the n−kn-k ordinary cards precedes all the special cards with probability 1k+1\frac1{k+1}. So the first special card is at expected position

1+n−kk+1=n+1k+1.1+\frac{n-k}{k+1}=\frac{n+1}{k+1}.

Equivalently, the kk special cards cut the others into k+1k+1 gaps of equal expected size n−kk+1\frac{n-k}{k+1}.

E[N]=535=10.6\boxed{\mathbb{E}[N]=\frac{53}{5}=10.6}

Variations

The same idea with a twist. Each solution gives only the changed step.

Variation 10.29a

Five identical boxes are shuffled, with exactly one containing $150 and the rest empty, all arrangements equally likely. You pay $X to open a box, proceeding one box at a time and stopping as soon as you find the box with the money. Find the value of XX that makes the game fair, i.e. for which your expected net profit (money found minus total amount paid) is zero.

Work it out, then compare with the answer.

Solution

The money box is equally likely to be in each of positions 1,…,51,\dots,5. So the number of boxes opened, NN, satisfies

E[N]=1+2+3+4+55=3.\mathbb{E}[N]=\frac{1+2+3+4+5}{5}=3.

This agrees with n+1k+1=62\frac{n+1}{k+1}=\frac{6}{2}.

You always collect $150, so the expected profit is 150−3X150-3X. Setting this to zero gives X=50X=50.

X=50\boxed{X=50}
Variation 10.29b

A game show hides $200 behind two of seven doors, chosen uniformly at random; the other five doors are empty. You open doors one at a time, uniformly among those not yet opened, stopping as soon as you open a door with money behind it. Each door you open, whether or not it hides money, costs $x. Find the value of xx that makes the game fair, i.e. for which your expected net profit is zero.

Work it out, then compare with the answer.

Solution

We take the statement to mean that you collect $200 when you open the first door with money behind it.

Consider each of the 55 empty doors together with the two money doors. Each of these three is equally likely to be opened first, so each empty door is opened before both money doors with probability 13\frac13. The number of doors opened, NN, therefore has

E[N]=1+53=83.\mathbb{E}[N]=1+\frac53=\frac83.

You always win $200, so the expected profit is 200−83x200-\frac83x. Setting this to zero gives x=200⋅38=75x=200\cdot\frac38=75.

x=75\boxed{x=75}
Variation 10.29c

A standard 52-card deck, which contains 13 hearts, is dealt face-up one card at a time until every heart has appeared. Find the expected total number of cards dealt, i.e. the position at which the last heart appears.

Work it out, then compare with the answer.

Solution

Consider each of the 3939 non-hearts together with the 1313 hearts. Among these 1414 cards, the non-heart is last with probability 114\frac1{14}. So the expected number of non-hearts dealt after the last heart is 3914\frac{39}{14}.

The last heart therefore sits at expected position

52−3914=68914.52-\frac{39}{14}=\frac{689}{14}.
68914≈49.21\boxed{\frac{689}{14}\approx 49.21}
Variation 10.29d

A basket contains 4 green apples and 50 red apples. Apples are drawn one at a time without replacement until all 4 green apples have been removed. Find the expected number of apples remaining in the basket at that moment.

Work it out, then compare with the answer.

Solution

The apples left in the basket are exactly the red apples drawn after all 44 green ones.

Consider each red apple together with the 44 green apples. Each of these five is equally likely to be drawn last, so the red apple comes after all the greens with probability 15\frac15. By linearity, the expected number of apples remaining is

505=10.\frac{50}{5}=10.
10\boxed{10}