Combinatorics: Number of ordered sets of neighbouring elements

36 Views Asked by At

A standard card deck contains of 4 suits of which every has 13 different cards = 52 different cards.

My point of interest is a single suit (13 cards of same color and shape).

I know that one suit contains 9 ordered subsets of neighbouring elements because I've counted it manually, like this:
1: A,2,3,4,5
2: 2,3,4,5,6
3: 3,4,5,6,7
4: 4,5,6,7,8
5: 5,6,7,8,9
6: 6,7,8,9,10
7: 7,8,9,10,J
8: 8,9,10,J,Q
9: 9,10,J,Q,K

But what is the correct formula for this?

1

There are 1 best solutions below

1
On

For $n$ cards and contiguous subsequences of length $k$, the formula is $n-k+1$. Here, $n=13$ and $k=5$, yielding $13-5+1=9$.