When all outcomes are equally likely, a probability is a count divided by a count. Poker: the number of five-card hands of each type, such as 13·C(4,3)·12·C(4,2) = 3744 full houses, out of C(52,5) = 2,598,960. Lottery: the number of tickets that match exactly w of the m winning white balls is C(m,w)·C(N−m, m−w), with or without the extra ball. The bars (teal) are the exact probabilities on a log scale; the white diamonds are the frequencies in R simulated deals or tickets, and the highlighted row is the case under discussion. Rare classes need many trials, which is the practical limit of Monte Carlo (Section 2.8).
Poker: ace high or low in a straight; a royal flush is the straight flush 10–ace, listed separately as in Table 2.7.2. Each hand is the first five cards of a shuffled deck. Lottery: the drawing is fixed at white balls 1 to m (and extra ball 1); each ticket is a random set of m distinct numbers and a random extra number, so a ticket matches w white balls with the probability above. With M = 1 the extra ball always matches and only w is shown.
code/ch02_probability.py (poker_counts, poker_classify, powerball_table, demo_poker, demo_lottery); counts in data/ch02-combinatorics.json.