# Dice, coin and card probability calculator

> Exact probability of dice sums, coin-flip heads and streaks, drawing special cards from a deck and each 5-card poker hand, as a fraction and 1 in N.

Interactive version: https://www.calcopenly.com/statistics/dice-coin-card-probability-calculator
Subject: Statistics and probability calculators

Dice sums are counted exactly: one die's outcomes are convolved N − 1 times, so all Sᴺ rolls of N dice with S sides are counted rather than simulated. Heads in coin flips follow the binomial distribution, and runs of heads use Feller's recurrence for success runs. Card draws use the hypergeometric distribution, because each card leaves the deck, and poker hands are counted over all 2,598,960 five-card hands.

The default, two six-sided dice summing to 7, is the most likely total: 6 of the 36 rolls, a chance of 1/6. With three dice, a sum of at least 11 comes up exactly half the time, 108 of 216 rolls, and 3 or more heads in a row turn up in 50.8% of 10-flip sequences.

The results assume fair dice, independent flips and a well-shuffled deck; for a biased coin, enter its chance of heads. Answers are exact fractions unless the numbers grow too large.

## Inputs

- **Game** (options: Dice, Coins, Cards)
- **Number of dice**
- **Sides per die**
- **Sum is** (options: Exactly, At least, At most, Between)
- **Target sum**
- **Lowest sum**
- **Highest sum**
- **Number of flips**
- **Chance of heads**: 0.5 for a fair coin.
- **Heads** (options: Exactly, At least, At most, A run of heads in a row)
- **Number of heads**
- **Run of at least**
- **Question** (options: Special cards in a draw, 5-card poker hand)
- **Cards in the deck**
- **Special cards in the deck**: e.g. 4 aces, 13 hearts, 12 face cards.
- **Cards drawn**
- **Special cards drawn** (options: Exactly, At least, At most)
- **How many special cards**
- **Hand** (options: Royal flush, Straight flush (not royal), Four of a kind, Full house, Flush (not straight), Straight (not flush), Three of a kind, Two pair, One pair, High card (nothing))

## Results

- Probability — main result
- Exact fraction
- Chance as 1 in N
- As a percentage
- Favourable outcomes
- Equally likely outcomes

## Formula

$$
P(\text{sum} = t) = \frac{\#\{\text{rolls with sum } t\}}{S^N},\qquad P(k \text{ special}) = \frac{\binom{K}{k}\binom{D-K}{n-k}}{\binom{D}{n}}
$$

## Worked examples

### Two dice sum to 7 (defaults)

- Game: Dice
- Number of dice: 2
- Sides per die: 6
- Sum is: Exactly
- Target sum: 7
- **Probability: 0.166667**
- **Exact fraction: 1/6**
- **Favourable outcomes: 6**
- **Equally likely outcomes: 36**
- Checked against: 6 of the 36 ordered rolls give 7 (standard two-dice table)

### Three dice sum to at least 11

- Game: Dice
- Number of dice: 3
- Sides per die: 6
- Sum is: At least
- Target sum: 11
- **Probability: 0.5**
- **Exact fraction: 1/2**
- **Favourable outcomes: 108**
- Checked against: Python brute force over all 216 rolls of 3d6: 108 have sum ≥ 11 (symmetry about 10.5)

### Four dice sum between 10 and 14

- Game: Dice
- Number of dice: 4
- Sides per die: 6
- Sum is: Between
- Lowest sum: 10
- Highest sum: 14
- **Favourable outcomes: 595**
- **Exact fraction: 595/1296**
- Checked against: Python brute force over all 1296 rolls of 4d6

### Run of 3 heads in 10 fair flips

- Game: Coins
- Number of flips: 10
- Chance of heads: 0.5
- Heads: A run of heads in a row
- Run of at least: 3 heads
- **Probability: 0.507813**
- **Exact fraction: 65/128**
- **Favourable outcomes: 520**
- Checked against: Python brute force over all 2¹⁰ sequences: 520 contain HHH

### Biased coin: exactly 3 heads in 5

- Game: Coins
- Number of flips: 5
- Chance of heads: 0.6
- Heads: Exactly
- Number of heads: 3
- **Probability: 0.3456**
- **Exact fraction: 216/625**
- Checked against: C(5,3)·0.6³·0.4² = 0.3456 (Python fractions)

### At least one ace in 5 cards

- Game: Cards
- Question: Special cards in a draw
- Cards in the deck: 52
- Special cards in the deck: 4
- Cards drawn: 5
- Special cards drawn: At least
- How many special cards: 1
- **Probability: 0.341158**
- **Exact fraction: 18472/54145**
- **Equally likely outcomes: 2,598,960**
- Checked against: 1 − C(48,5)/C(52,5) (Python math.comb)

## Questions

### What is the most likely sum when rolling two dice?

7, which 6 of the 36 equally likely rolls produce (1+6, 2+5, 3+4 and their reverses), a probability of 1/6 or 16.67%. The extremes 2 and 12 each need one exact roll, 1/36 or 2.78%. With three dice the peak shifts to 10 and 11, each 27 of 216 rolls, or 12.5%.

### What are the odds of flipping heads 10 times in a row?

1 in 1,024 with a fair coin, because each flip halves the chance: (1/2)¹⁰ = 1/1,024, about 0.098%. After 9 heads in a row, the 10th flip is still 50% heads, since flips are independent; expecting tails to be "due" is the gambler's fallacy. Any other specific sequence of 10 flips, such as HTHTHTHTHT, is exactly as unlikely.

### What are the odds of each poker hand?

Of the 2,598,960 five-card hands, 4 are royal flushes (1 in 649,740), 624 are four of a kind (1 in 4,165) and 3,744 are full houses (about 1 in 694). One pair turns up in 42.26% of deals, and 50.12% of hands hold nothing better than a high card. These are standard counts for the first five cards dealt, with no draws or community cards.

### What is the probability of drawing an ace from a deck?

4/52 = 1/13, about 7.69%, for one card from a full 52-card deck. For at least one ace in a 5-card hand, subtract the chance of none: 1 − C(48, 5)/C(52, 5) = 34.12%. Cards drawn without replacement follow the hypergeometric distribution, so each ace drawn lowers the chance that the next card is an ace.

### How likely is a streak of heads in a row?

More likely than most people guess. In 10 fair flips there is a 65/128 = 50.78% chance of at least one run of 3 or more heads, because a run can start at any of the 8 positions from flip 1 to flip 8. Long real sequences therefore contain streaks, and a streak alone is weak evidence that a coin is biased.

### How accurate is the dice, coin and card probability calculator?

Accuracy depends on your inputs and the method's assumptions. Decimal arithmetic uses 50 significant digits, but estimates, numerical methods and source data can be less precise; the displayed rounding does not remove those limits. It is checked against 9 worked examples whose answers come from independent sources; for example, “Two dice sum to 7 (defaults)” is checked against 6 of the 36 ordered rolls give 7 (standard two-dice table).

### Where does the method come from?

Feller, An Introduction to Probability Theory and Its Applications, Vol. 1, 3rd ed. — §XIII.7 (success runs) and §II.6 (hypergeometric); Wikipedia — Poker probability: frequency of 5-card poker hands; NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.6.6.18 Binomial distribution.

## Sources

- Feller, An Introduction to Probability Theory and Its Applications, Vol. 1, 3rd ed. — §XIII.7 (success runs) and §II.6 (hypergeometric)
- [Wikipedia — Poker probability: frequency of 5-card poker hands](https://en.wikipedia.org/wiki/Poker_probability)
- [NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.6.6.18 Binomial distribution](https://www.itl.nist.gov/div898/handbook/eda/section3/eda366i.htm)
