If 4 cards are picked from the 36 number cards in a deck, how many ways can you choose the cards so that no two are consecutive numbers? The number cards range from 2-10; there is 4 of each card, and 36 in total.

*

*The order of the cards matters: the order in which they are chosen is the order in which they are displayed.

*No consecutive cards can be together: 2,3, 3,4, 5,6. This also means 3, 4, 5, 6 cannot be included.

*If the numbers are not next to each other, they are not classified as a pair of consecutive numbers. For example: 2, 5, 7, 3. In this instance, there are no consecutive numbers, as 3 and 2 are not directly after the other.

*The cards are drawn without replacement.

*The consecutive numbers must be in ascending order, such as 3, 4, 5, 6. Numbers such as 5, 4, 3, 2 do not fall under this classification.

What I've predetermined: -

*

*There are 36P4 ways of choosing the 4 cards.

*There are 8 pairs of consecutive numbers.

*Subtracting the number of ways of choosing any amount consecutive numbers from the total ways you can choose from the deck will achieve the answer.

I'm lost as to how to start this question. Please help!
 A: Inclusion-exclusion is the way to go.
Let $S$ be the set of all ways to deal four cards, without regards to consecutive numbers. As you said, $|S|=36!/32!=36\cdot 35\cdot 34\cdot 33$. Furthermore, let

*

*$A$ be the set of deals where the first two cards are consecutive,


*$B$ be the set of deals where the middle two cards are consecutive,


*$C$ be the set of deals where the last two cards are consecutive.
You want to find $|S-(A\cup B\cup C)|$, which can be calculated using the principle of inclusion exclusion as follows:
$$
|S|-|A|-|B|-|C|+|A\cap B|+|A\cap C|+|B\cap C|-|A\cap B\cap C|
$$

*

*$|A|=|B|=|C|=8\cdot 4\cdot 4\cdot 34\cdot 33$. There are $8$ choices for the ranks of the consecutive pair, $4\cdot 4$ ways to choose the suits of the consecutive pair, then $34\cdot 33$ ways to choose the other two cards.


*$|A\cap B|=|B \cap C|=7\cdot 4^3\cdot 33$. In $A\cap B$, the first three cards are all consecutive. The run of three can be chosen in $7$ ways (2 - 3 - 4 is smallest, 8 - 9 - 10 is largest), the suits in $4^3$ ways, and the last card in $33$ ways.


*By similar logic, $|A\cap B\cap C|=6\cdot 4^4$.
The trickiest intersection is $A \cap C$, where the first two cards are consecutive, as well as the last two. Letting $(x,x+1,y,y+1)$ denote the ranks of the four cards dealt, we count this by breaking into sub-cases.

*

*If $x,x+1,y,y+1$ are all distinct, then $x$ and $y$ can be chosen in $8\cdot 7-7\cdot 2$ ways. The suits can then be chosen in $4^4$ ways.


*If $x=y$, then you can choose $x$ in $8$ ways (any number between $2$ and $9$ inclusive), then choose the suits in $4\cdot 4\cdot 3\cdot 3$ ways.


*If $x=y+1$, then you can choose $x$ in $7$ ways (you can no longer have $x=9$), then choose the suits in $4\cdot 4\cdot 4\cdot 3$ ways. The same logic applies when $y=x+1$.
Therefore,
$$
|A\cap C|=(8\cdot 7-7\cdot 2)\cdot 4^4+8\cdot 4^2\cdot 3^2+2\cdot 7\cdot 4^3\cdot 3
$$
Putting this altogether, it turns out there are exactly $1{,}025{,}496$ ways to deal four cards without any consecutive pairs. The following brute-force python code confirms this number. Try it online!
from itertools import permutations, product
deck = product(range(2, 11), ['S', 'H', 'C', 'D'])
num_valid = 0
for ((r1, _), (r2, _), (r3, _), (r4, _)) in permutations(deck, 4):
    if r2 - r1 != 1 and r3 - r2 != 1 and r4 - r3 != 1:
        num_valid += 1
print(num_valid)

