[Math] Math probability that “5-out-of-36” lottery draw has at least one pair of numbers with difference = 1.

lotteriesprobabilityprobability theory

Given a $5$ out of $36$ lottery ($5$ unique numbers out of pool of $36$ numbers ranging $[1,2,…,36]$).

How to calculate probability that a draw has at least one pair of consecutive numbers (like $22, 23$ -a pair of numbers whose difference $23-22 = 1$)?

Every draw ($5$ numbers) has $10$ pairs. For dif1 we have total of $35$ pairs ($1$ and $2$, $2$ and $3$$34$ and $35$). There are total of $630$ pairs (binomial(35, 2)).

Problem is I think cannot think like that:

$1$ concrete pair out of $630$ appears with $1/630$ chances. Probability to have any of $35$ dif1 pairs is $35/630$ (if I choose $2$ numbers randomly). But I choose $5$ numbers (which give $10$ pairs) – and it is not the same as just drawing $2$ pairs out of $630$ pairs.

I cannot figure out how to reason in this case.

The question is about not dif1 but also dif2, dif3… dif35 (there is only single such pair!).

How to mathematically calculate the probability?

Can I think of a single 5-out-of-36 draw as an equivalent of 10 independent "pick a pair out of all possible pairs"? It would give dif1 ($35$ dif1 pairs out of $630$ all pairs) as $((35/630)+(34/629)+(33/628)+(32/627)+(31/626)+(30/625)+(29/624)+(28/623)+(27/622)+(26/621))$. But it differs greatly from a real lottery, which makes me think that formula (and reasoning) above is not applicable!

P.S. Stars and bars method is described here (wiki), example how to use it is here

Best Answer

It is easier to count the draws where no two numbers are consecutive, by a stars-and-bars-like method. Let there be 31 0s, which represent the 31 numbers not drawn. These define 32 spaces between and around them (at the ends); place five 1s representing the numbers that are drawn in those spaces, at most one per space. There is a bijection between such placements and draws with no consecutive numbers, and there are $\binom{32}5$ placements in total, so this is the number of excluded cases. The final probability that the draw contains some consecutive pair of numbers is $$1-\frac{\binom{32}5}{\binom{36}5}$$

Now consider a forbidden difference of 2. Then the 36 numbers split into 18 even and 18 odd numbers, and if a combination avoids using consecutive numbers in both these sub-lists, it is valid. Then the number of difference-2-avoiding combinations is the sum of the numbers of combinations with $a$ even and $5-a$ odd numbers, $0\le a\le 5$, avoiding consecutive even or odd numbers, which reduces to the previously solved problem: $$\sum_{a=0}^5\binom{18-a+1}a\binom{18-(5-a)+1}{5-a}$$ From here the probability that a combination avoids the difference of 2 can be computed. Higher differences mean more residue classes of numbers, more partitions and more cases, but the principles remain the same.

Related Question