# Introduction

This was brought up by accident when I was playing poker with friends last year. A friend thought that the probability of a flush is greater than a straight, so I calculated it for him.

At that time, I thought it was very interesting to come up with a formula.

Write it down now.

This is a purely mathematical problem and does not involve game theory. ~~You will learn some useless knowledge after reading it, but it will not improve your poker level.~~

There is something wrong with the LATEX of the blog now… all the curly braces and percent signs can’t be used, so I just make up for it…

## Notation

Let:

denote the set of ranks in a deck: **{****}**(or**{****}**for short deck poker). (We can think that.) denote the set of suits in a deck: **{****}**.denote the set of cards in a deck: . (Here, the multiplication operation represents the Cartesian product of the sets and ).

# Problem 1. The probability of Flushes

### Describe

Find the probability of obtaining a flush when considering a player’s hole cards and the community cards (a total of seven cards).

### Mathematical description

For a set **{****}**

Let:

denote the set of all subsets of with a cardinality of . denote the set of flushes among subsets of with a cardinality of .

The probability we require is

### Solving process

First, we need to determine

And calculate **{****}****{****}**

For suit **{****}****{****}****{****}**

For **{****}****{****}**, and then select **{****}**

For **{****}****{****}**, and then select **{****}**

For **{****}****{****}**:

so :

# Problem 2. The probability of Straights

### Describe

Find the probability of obtaining a straight when considering a player’s hole cards and the community cards (a total of seven cards).

### Mathematical description

Let **{****}**

For a set

or **{****}**

Let:

denote the set of all subsets of with a cardinality of . denote the set of Straights among subsets of with a cardinality of .

The probability we require is

### Solving process

First, we need to determine

And calculate ~~(Ctrl+C and Ctrl+V)~~

#### Difficulty

OK. A straight is not as easy to find as a flush. For a flush, there is only one suit, so we can enumerate the suits. If we enumerate **{****}** In this way, it is counted twice in **{****}** and **{****}** respectively. Similarly, if there are two or more different suits for the same rank, it will be counted multiple times. If we want to use the enumeration method, we need to consider too many situations.

#### Minimal Representation

For each straight E, we count the solution with E as the minimum straight to avoid redundant calculations. Here, ‘minimum’ refers not only to the card rank, but for the convenience of computation, we can define the hierarchy of suits.

For example, if **{****}**, **{****}**, not when **{****}** and **{****}**.

We call **{****}** is the Minimal Representation of **{****}**.

(assume

So we only need to calculate

and **{****}**

separately.

#### Generating Function

https://en.wikipedia.org/wiki/Generating_function

Ok. If I have a chance later, I would like to talk about Generating Function and combination counting.

~~(Cujus rei demonstrationem mirabilem sane detexi. Hanc marginis exiguitas non caperet.)~~

In situation

We first assign a suit to each of the

For example, we want to count **{****}**.

We consider which cards cannot be selected:

First of all, we cannot choose all cards with **{****}**.

Secondly, according to the different suits assigned, for example, if we calculate that the

Excluding a total of

In situation **{****}**:

We don’t need to consider the smaller straights on the Rank than this straight, so there will be

There are

So:

# Conclusion

So it is reasonable for a flush to be greater than a straight.