Choosing $m-1$ consecutive cards

65 Views Asked by At

You have a deck of n cards with face values $1,...,n$, out of which you pick m cards u.a.r. without replacement. You want to know what is the probability that there are at least $m-1$ cards whose face values are consecutive among the m that you picked.

There is a simple formula that solves this question. How can I find it?

2

There are 2 best solutions below

3
On BEST ANSWER

Assume $m\ge 3$.

We will count the cases where there is a run of (at least) $m-1$ cards chosen.

If the earliest run of $m-1$ cards starts at $1$, then the values $1, 2, ...,m-1$ have all been chosen; and the remaining chosen card could be any of the remaining $n-m+1$ values.

If the earliest run of $m-1$ cards starts at $k$ with $k>1$ (and necessarily $k\le n-m+2$), then the remaining chosen card can be any of the remaining values except $k-1$. There are $n-m$ such cards.

So the total number of card combinations with at least $m-1$ consecutive values is given by $$\begin{array}{ccc}(n-m+1)&+ & \underbrace{(n-m)+(n-m)+\cdots+(n-m)} \\&& (n-m+1)\;\rm{terms} \end{array}=(n-m+1)^2$$

This gives a probability of $\frac{(n-m+1)^2}{n\choose m}$ of getting a run of $m-1$ consecutive values among the choice of $m$ cards.

0
On

Ok, we know that there are $n-(m-1)$ ways to select m consecutive cards from the given $n$ cards.
In addition, as pointed out by @paw88789, if we have a consecutive run of $m$ cards, we have two consecutive runs of $m-1$ cards. More specifically, out of the $m$ cards we chose, the element that is not part of the consecutive sequence can only be at the front or at the end of said sequence.
Finally, there are $(n-m)$ starting positions of consecutive runs of length $m-1$ and there are $n-m-1$ ways to choose the first element of the run. As the run must be consecutive, we have no choice for the other elements once we chose the first. Putting all together we get $\frac{(n-m)*(n-m-1) + (n-m) \cdot 2 + (n-m+1)}{n \choose m}$.
Interestingly enough, $\frac{(n-m+1)^{2}}{n \choose m}$ also seems to be a valid solution although I have not yet determined a good way of thinking about this.