3

For practice, I decided to invent a variation on the problem of the expected number of cards to be drawn until the first ace is found. I would appreciate some feedback and clarification on certain details of my solution, which I describe at the end.

Problem: Given a deck of $52$ standard playing cards, what is the expected value of the highest card seen before drawing the first ace? (Where we set $J = 11, Q = 12, K = 13$, and we say that the value is $0$ if the first card is an ace.)

Solution: Let $H$ be the random variable corresponding to the value of the highest card. We note that the four aces divide the deck into five "boxes". Then, we may observe that:

$$\mathbb{P}(H \le n) = \mathbb{P}( \text{no card of value >} n \text{ is before the first } A )$$

For brevity, I will write this as $\mathbb{P}(S_n)$. We can imagine any permutation of the deck (ignoring permutation of the aces) as inserting cards into the gaps in between previously placed cards (including the aces).

Then, by considering this framing:

$$\mathbb{P}(S_n) = \prod_{k=0}^{4(13-n)-1} \mathbb{P}(\text{highest } (k+1) \text{ cards placed after } A \; | \text{ highest } k \text{ cards placed after } A)$$

$$ = \prod_{k=0}^{4(13-n)-1} \frac{4+k}{5+k} = \frac{4}{4(14-n)} = \frac{1}{14-n}$$

Then, noting that $\mathbb{P}(H = n) = \mathbb{P}(S_n) - \mathbb{P}(S_{n-1})$,

$$\mathbb{E}[H] = \sum_{n=2}^{13} n \bigg(\frac{1}{14-n} - \frac{1}{15-n}\bigg) \approx 10.74$$


Questions

  1. Why is the probability space above is equivalent to the uniform distribution on all shuffled decks? It seems obvious, but is there a way to justify it more rigorously?
  2. Why can we ignore the order of the cards when we insert them in the way described above?

The second question in particular may seem inane, but it's still quite difficult for me to determine if and when it's necessary to account for permutations, and I would appreciate an intuitive explanation if there is one.

RobPratt
  • 50,938
legionwhale
  • 2,505
  • "We can imagine any permutation of the deck": $52!$ ways. "We can imagine any permutation of the deck (ignoring permutation of the aces)": $52!/4!$ ways, though the earlier number may be easier to handle – Henry Sep 18 '23 at 09:26
  • 3
    The probability that an ace is the first card is $\frac4{52}$, which is not really negligible. But you can ask for the conditional expected value of the highest card before first ace given that the first card is not an ace. – Henry Sep 18 '23 at 09:28
  • @Henry I thought the impact of the event would further be deprecated by the weighting of the expected value, but in hindsight it does have an effect of order $1 \times 10^{-1}$. If we say that the highest card before $A$ has value $0$ if it doesn't exist factor it in, we get $\mathbb{P}(H \le 2) = \mathbb{P}(H = 2) - \mathbb{P}(H = 0)$ so we would need to subtract $\frac{2}{13}$ from the final expected value. Bizzarely enough, it seems the original solution already accounted for this unintentionally. – legionwhale Sep 18 '23 at 12:56
  • 1
    I have some doubts with your result. If we consider a smaller game, only 12 cards, only aces and 2 and 3, I adapt your formula, and I obtain 1.8333 which is obviously wrong. – Lourrran Sep 18 '23 at 13:08
  • 1
    The solution does allow for the first card to be an ace. Indeed, you calculate $\Bbb{P}(S_n)$ correctly, but you seem to have forgotten that $\sum_{j\leq 1}\Bbb{P}(S_j)$ is $\frac{1}{13}$, and should be interpreted as the probability that the first card is an ace. As these have weight $0$ in the sum implicitly, you adjust the average correctly. This also explains your answer @Lourrran, you get the correct result when allowing the ace to be the first card. – SomeCallMeTim Sep 18 '23 at 14:48
  • @SomeCallMeTim It's unclear to me what you mean by "weight $0$ in the sum implicitly". If no cards are drawn before the first ace, the value of the highest card is undefined. Yet the probability of that case is positive. This makes the entire sum undefined. – David K Sep 18 '23 at 15:29
  • @DavidK True. However, suppose that you arbitrarily construe the case of the first card being an Ace to represent that the maximum high card is $~0.~$ Further suppose that the sample space of equally likely choices has value $~A~$ for the number of ways that the first card can be an Ace and value $~B~$ for the number of ways that the first card can be other than an Ace. Then, by permitting the first card to be an Ace, you are simply scaling the final result by the factor $~\dfrac{B}{A+B}.$ – user2661923 Sep 18 '23 at 15:41
  • @DavidK If there is no highest card, then it is natural to let $H$ take the value of $0$. I discussed this in my earlier comment, and noted that my solution implicitly assumed this. Thus, as Tim and 2661923 point out, it is not impossible for the expected value in Lourrran's analogy to be less than $2$. But I will add this to the post, as it (understandably) seems to have caused confusion. I would also like to remark that no one has yet answered the two specific questions I asked -- though, of course, it would be relevant to know if my solution is incorrect. – legionwhale Sep 18 '23 at 16:04
  • @SomeCallMeTim Yes, you can set the "highest card" to $0$ explicitly in the problem statement, as has been done. It was "implicitly" setting it to $0$ that I found questionable. (You could explicitly set the "highest cared" to any value you like in that case, but $0$ works out especially neatly.) – David K Sep 18 '23 at 16:36

1 Answers1

2

I am not sure how to answer your second question, but my answer to your first question might be sufficient.

For Question 1, it seems to me that you are asking how to derive the equation $$ \mathbb P(\text{highest $k+1$ cards after $1^\text{st}$ A}\mid \text{highest $k$ cards after $1^\text{st}$ A})=\frac{4+k}{5+k}, $$ directly from the fact that all $52!$ orderings of the deck are equally likely.

Let $E_k$ be the event that the highest $k$ cards come after the first ace. Let $S_k$ be the set of $4+k$ cards consisting of the first $k$ high cards and the four aces. Using the Theorem below, all of the $(4+k)!$ orderings of the cards in $S_k$ that result when you delete the cards not in $S_k$ are equally likely, so each must occur with probability $1/(4+k)!$. Of these orderings, there are exactly $4\cdot (4+k-1)!$ orderings where the first cards is an ace (four choices for the first ace, $(4+k-1)!$ ways to arrange the remaining cards). Therefore, the probability of $E_k$ is $$ 4\cdot (4+k-1)!\times \frac{1}{(4+k)!}=\frac{4}{4+k} $$ You then immediately conclude that $$ P(E_{k+1}\mid E_k)=\frac{4/(5+k)}{4/(4+k)}=\frac{4+k}{5+k}. $$

Theorem: Let $S$ be a nonempty subset of $\{1,\dots,n\}$. When you shuffle a deck of $n$ cards, and delete every card in the ordering which is not a member of $S$, then every permutation of the cards in $S$ is equally likely.

Proof: Repeatedly apply the Lemma.

Lemma: Let $\mathbb U_n$ be the uniform distribution on all $n!$ ways to shuffle a deck of $n$ cards, numbered $1$ to $n$.
Let $\mathbb U_n'$ be the distribution obtained by shuffling a deck of $n+1$ cards numbered $1$ to $n+1$, and then deleting card number $n+1$.
Then $\mathbb U_n=\mathbb U_n'$.

Proof: Let $\pi$ be a particular ordering of the $n$ cards. The probability of $\pi$ with respect to $\mathbb U_n$ is $1/n!$, so we just need to show the the probability of $\pi$ with respect to $\mathbb U_n'$ is also $1/n!$. If $\pi=(\pi_1,\pi_2,\dots,\pi_n)$, there are exactly $n+1$ permutations of the deck of $n+1$ cards which will become $\pi$ when $n+1$ is deleted. Namely, they are $$ (n+1,\pi_1,\dots,\pi_n)\\ (\pi_1,n+1,\dots,\pi_n)\\ \vdots\\ (\pi_1,\dots,\pi_n,n+1)\\ $$ When you uniformly shuffle an $(n+1)$ card deck, the probability of each of these is $1/(n+1)!$. Therefore, the probability $\pi$ occurring in the $\mathbb U_n'$ distribution is $(n+1)/(n+1)!=1/n!$. $\square$

Mike Earnest
  • 84,902
  • Thanks for the answer, Mike. I think you've given a different and simpler approach to finding $\mathbb{P}(S_n)$ (for my def. of $S_n$) for which it's clearer that the reasoning valid, which has definitely helped. Intuitively, it feels like conditional probability is a sort of quotient (well, I guess, mathematically it is that also) by "irrelevant considerations" and the second question is roughly "How can I be sure about what exactly has been quotiented out?" -- a more general confusion which is probably best solved by myself getting more practice. Thanks again. – legionwhale Sep 18 '23 at 19:48
  • 1
    @legionwhale I think the topic in your comment is one of the hardest parts of probability. With the way you are practicing, I am sure you will improve. You are doing great already :) – Mike Earnest Sep 19 '23 at 01:40
  • Thank you. I appreciate the kind words. – legionwhale Sep 20 '23 at 18:08