# Median of waiting time for $k$-th ace from bridge cards

I can't figure out how to get median of a waiting time from the exercise 36 from W. Feller's book An Introduction to Probability Theory and Its Applications Vol.1 (bold in the quote):

1. Distribution of aces among $r$ bridge cards. Calculate the probabilities $p_0(r), p_1(r), \dotso, p_4(r)$ that among $r$ bridge cards drawn at random there are $0, 1, \dotso, 4$ aces, respectively. Verify that $p_0(r) = p_4(52-r)$.

2. Continuation: waiting times. If the cards are drawn one by one, find the probabilities $f_1(r), f_2(r), \dotso, f_4(r)$ that the first, ..., fourth ace turns up at the $r$th trial. Guess at the medians of the waiting times for the first, ..., fourth ace and then calculate them.

$p_k(r)$ and $f_k(r)$ were easy (I'm not sure about $f_k(r)$ though):

$$p_k(r) = \frac{\binom{4}{k} \binom{48}{r-k}}{\binom{52}{r}} = \frac{\binom{4}{k} (r)_k (52-r)_{4-k}}{(52)_4}$$

$$f_k(r) = \frac{\binom{4}{k} \binom{r-1}{k-1} (48)_{r-k}}{(52)_r} = \frac{\binom{4}{k} \binom{r-1}{k-1} (52-r)_{4-k}}{(52)_4}$$

In answers section, Mr. Feller introduces probabilities that the waiting times for the first,..., fourth ace exceed $r$ ($k$ is for k-th ace):

$$w_k(r) = \sum_{i=0}^{k-1} p_i(r)$$

From this he arrives at $f_k(r)$:

$$f_k(r) = w_k(r-1) - w_k(r)$$

And then he gives computed medians (see spoiler below) without any explanation of how they were derived.

$9$, $20$, $33$, $44$

If I'm not mistaken, the median is the solution of $$w_k(r) = 0.5$$ for $r$. This however leads to quite complicated equation with many factorials which I wasn't able solve even with Stirling approximation. How can I easily compute those medians?

Graph of functions above:

• That graph is real pretty Jul 27, 2015 at 0:52
• Are you looking for a pencil and paper solution? It's easy enough to automate (even in Excel or equivalent).
– lulu
Jul 27, 2015 at 2:18
• @lulu yep. For instance, median of waiting time for first ball to hit the desired cell is function of the population size. This is from 1968 book so I thought it could be computed by hand (with Stirling approximation perhaps).
– woky
Jul 27, 2015 at 2:59
• Well, I could do it with a hand calculator, but not with pencil and paper. The probability that you get the first A in 8 draws or fewer is 0.498564964. I don't believe you are going to see that it is less than .5 without a machine (or an enormous amount of time and patience!)
– lulu
Jul 27, 2015 at 3:02

Not a complete answer, but too long for a comment: Technically, the definition of a median is any number $m$ such that $\Pr(X\le m)\ge0.5$ and $\Pr(X\ge m)\ge0.5$. Note that the first one may also be written as $1-\Pr(X>m)\ge0.5$, with the inequality being strict. If your random variable is continuous, then the strictness of the inequality doesn't matter(since $\Pr(X=m)=0$), and so the median does turn out to be the solution to $w_k(m)=0.5$. However, in dealing with discreet variables, this condition is important. In this case, $\Pr(X>r)=w_k(r)$, and so $\Pr(x\ge r)=w_k(r-1)$. As such, to find the median you'd want some kind of algorithm that keeps track of both $w_k(r-1)$ and $1-w_k(r)$ for increasing steps of $r$ and gives the value when both are greater than or equal to $0.5$.