Conditional Probability and Bayes

Updating Beliefs About a Possibly Biased Coin

Walk through belief updating on coin tosses with simple illustrative priors, comparing a fair coin and a heads-biased coin, with every figure checked.

On this page
  1. The setup
  2. After three heads
  3. After five heads
  4. What a tail does
  5. What changes if the prior changes
  6. Cautions

The setup

You are handed a coin. Most coins are fair, but this one comes from a pile where a few might be rigged to land heads more often. You toss it several times and get a run of heads. How suspicious should you be?

Belief updating answers this by combining two things: how plausible each explanation was to begin with (the prior), and how well each explanation predicts what you saw (the likelihood). Bayes theorem does the combining.

To keep the arithmetic clean, this example uses only two hypotheses, and all numbers are invented for illustration:

  • Fair: heads comes up with chance 0.5.
  • Biased: heads comes up with chance 0.8.

And a prior: 90% that the coin is fair, 10% that it is biased.

Real biases are not usually this neat, and in practice a coin could have any bias, not only two. Using two hypotheses simplifies the process without changing its logic.

After three heads

The chance of three heads in a row, in that order, is the single-toss chance cubed.

  • If fair: 0.5 × 0.5 × 0.5 = 0.125
  • If biased: 0.8 × 0.8 × 0.8 = 0.512

Multiply each by its prior:

  • Fair: 0.9 × 0.125 = 0.1125
  • Biased: 0.1 × 0.512 = 0.0512

Total: 0.1125 + 0.0512 = 0.1637. This total is the overall chance of seeing three heads, found with the law of total probability.

Divide to get the updated beliefs:

  • Biased: 0.0512 / 0.1637 ≈ 0.313, about 31%
  • Fair: 0.1125 / 0.1637 ≈ 0.687, about 69%

Three heads moved suspicion from 10% to about 31%. That is a large jump, but the coin is still more likely fair than not. The prior counted for something.

A frequency view is the same. Imagine 1,000 such coins, with 900 fair and 100 biased. Of the fair ones, 12.5% show three heads: 112.5 coins. Of the biased ones, 51.2% do: 51.2 coins. Among the coins showing three heads, the biased share is 51.2 / (112.5 + 51.2) ≈ 31%. (The fractional coins are only a way of keeping the proportions exact.)

After five heads

Continue to five heads in a row. Now:

  • If fair: 0.5 to the fifth power = 1/32 = 0.03125
  • If biased: 0.8 to the fifth power = 0.32768

Priors times likelihoods:

  • Fair: 0.9 × 0.03125 = 0.028125
  • Biased: 0.1 × 0.32768 = 0.032768

Total: 0.060893. Biased share: 0.032768 / 0.060893 ≈ 0.538, about 54%.

With five heads, the biased explanation has edged ahead. Each additional head multiplies the odds in favour of “biased” by 0.8 / 0.5 = 1.6. Five heads multiply the odds by 1.6 five times, about 10.5. The starting odds of 1 to 9 become roughly 10.5 to 9, which is about 54% for biased. This odds form is a handy shortcut: every head multiplies the odds by the same factor.

What a tail does

Now toss once more and get a tail. The chance of a tail is 0.5 if fair and 0.2 if biased. Starting from the five-head figures, multiply:

  • Fair: 0.028125 × 0.5 = 0.0140625
  • Biased: 0.032768 × 0.2 = 0.0065536

Total: 0.0206161. Biased share: 0.0065536 / 0.0206161 ≈ 0.318, about 32%.

One tail dragged belief from about 54% back to about 32%. Updating works in both directions, and evidence against a hypothesis counts as much as evidence for it. In this setup, a tail is a stronger blow to “biased” than a head is a boost, since a tail is 2.5 times as likely under fair as under biased (0.5 against 0.2), while a head is 1.6 times as likely under biased as under fair.

What changes if the prior changes

The starting belief matters, particularly with limited data. Suppose you were 99% sure the coin was fair instead of 90%. Then after three heads, the posterior for biased would be 0.01 × 0.512 = 0.00512 against 0.99 × 0.125 = 0.12375, giving 0.00512 / 0.12887, about 4%. The same three heads leave you much less suspicious.

This is no flaw. It reflects the fact that unusual runs are easy to produce from fair coins, and stronger prior confidence calls for stronger evidence. With a lot of data, people starting from different reasonable priors tend to end up close to each other, because the evidence eventually dominates. This is related to the law of large numbers, though with a modest number of tosses the priors still matter.

Cautions

  • Order and independence. The calculation assumes each toss is independent and the coin’s bias does not change. That is the standard fair coin assumption for the fair case; the biased case assumes a fixed unequal chance.
  • Short runs are common. Streaks happen in fair sequences more than intuition suggests, as covered in discussions of coin toss streaks. A short run of heads is weak evidence.
  • The hypotheses are a choice. If the true bias is 0.6, a model limited to 0.5 and 0.8 will give distorted answers. A fuller treatment allows a continuum of biases.
  • No guarantee. Even a coin that you believe is biased can land on either side on the next toss. The estimate is a belief, not a prediction of a particular result.

None of this suggests a way to profit from games of chance. Casino games come with a house edge, results of separate plays are independent, and gambling can be harmful. Anyone having trouble should consider contacting a local support service.

The complete guide to conditional probability and bayes

Bayes Theorem Explained with Everyday Examples
Read the guide

Keep exploring

Guides from other topics

All topics →