Math · Exploration
Poker Hand Probabilities
Count the possible hands, calculate their exact probabilities, and compare them with simulation.
How likely is each five-card hand?
Exactly five cards are drawn from a 52-card deck. Every five-card combination is one possible outcome, so the sample space is .
We count combinations rather than deal orders: A♠ K♣ 7♦ 4♥ 2♠ is the same hand in any order. Count a category, divide by the sample space, and you have its theoretical probability.
Deal 5 cards
Classify one possible outcome from the sample space.
Count it → divide → get probability
Frequency is the exact number of five-card combinations in a category. Probability is that frequency divided by 2,598,960. The table makes both parts of the calculation visible.
Categories are mutually exclusive. A Straight Flush has the properties of a Straight and a Flush, but is counted only once as a Straight Flush. Therefore Straight and Flush exclude Straight Flushes, and every row together accounts for exactly 100% of the sample space.
Royal Flush is a subset
A Royal Flush is 10-J-Q-K-A of one suit. There are 4—one per suit. It is not a tenth, separate category here: it is the highest kind of Straight Flush. Of the 40 Straight Flushes, 4 are Royal Flushes and 36 are other Straight Flushes. On average, a Royal Flush appears in about 1 in 649,740 five-card deals.
Details define the count
A-2-3-4-5 is a valid ace-low straight, so there are 10 possible straight rank sequences from A-2-3-4-5 through 10-J-Q-K-A. Sequences do not wrap around: Q-K-A-2-3 is not a straight.
Probability and odds are not the same thing. Probability asks what fraction of all hands belong to a category; odds against compare non-matching hands with matching hands. This exploration stays with probability.
Theory vs simulation
Exact probabilities come from counting combinations. Simulation repeats independent deals and shows how observed frequency tends to approach theoretical probability as the sample grows.
Choose a sample size to compare observed frequencies with theory. Rare hands may not appear in a small simulation—and may still vary noticeably after 100,000 deals.
What the code has to recognize
Mathematics asks how many hands of each type exist. Programming asks which type a particular set of cards is. The simulation combines both: classify many dealt hands, then compare their observed frequencies with the counted theory.
This exploration is deliberately about exactly five cards. Variants that choose the best five-card hand from seven cards use a different sample space, , and require a more complicated classification problem.