Back to publications

Information

What a coin toss reveals about information

A fair coin is harder to predict than a heavily biased one. Shannon entropy puts a number on that uncertainty.

By Principia · 4 min read
H of p equals minus p times the base-two logarithm of p, minus one minus p times the base-two logarithm of one minus p.Binary entropy is highest for a fair coin, at p = ½, and zero when the outcome is certain.

The symbols, explained

H(p)
Average information per toss, measured in bits
p
Probability of heads
1 − p
Probability of tails
log₂
Logarithm to base two, which sets the unit to bits

Start before the coin lands

Imagine two coins. One has a one-half chance of heads. The other has a nine-in-ten chance of heads. You have not seen either result yet. Both coins have two possible outcomes, but the uncertainty is different: the biased coin offers a much stronger guess.

Information theory asks how much you learn when the result arrives. A predictable outcome resolves little uncertainty. An unlikely outcome resolves more. This is a mathematical use of surprise, based on probabilities, rather than a description of how excited someone feels.

One fair toss, one bit

For the fair coin, heads and tails each have probability 0.5. Learning which one occurred gives one bit of information. A bit is the unit used here because the logarithm has base two.

You could label heads 1 and tails 0. That is a way to record the result. The recorded binary digit and the amount of information happen to line up in this example, but they are different concepts. A digit can still occupy space even when its value is highly predictable.

Average surprise is the key

Claude Shannon introduced his mathematical theory of communication in 1948. Its entropy measure describes uncertainty across a set of possible outcomes. For our two-outcome example, the equation takes the information associated with each result, weights it by that result's probability and adds the contributions.

That weighting matters. A coin with a nine-in-ten chance of heads has entropy of about 0.469 bits per toss. This number comes from substituting p = 0.9 into the equation. It is lower than the fair coin's one bit because most tosses confirm the more predictable result.

The maximum is one bit when both outcomes are equally likely. If one outcome is certain, the entropy is zero. At probabilities of zero, the term p log₂(p) is taken as zero by its limiting value.

A rare result can still tell you more

For the biased coin, an individual heads result carries about 0.152 bits of information, calculated as −log₂(0.9). An individual tails result carries about 3.322 bits, calculated as −log₂(0.1). The rare tails result is much more informative under this model.

There is no contradiction with the lower entropy. Entropy averages across both outcomes: a small contribution that occurs frequently and a large contribution that occurs rarely. It does not say every result contains 0.469 bits, and it does not predict the next toss.

From coins to communication

Probability patterns matter when information is encoded. With a suitable code, repeated predictable outcomes can be represented more compactly on average than equally likely ones. Entropy helps describe the limits of that compression, rather than promising a particular file size for a short message.

The model measures information quantity. It does not measure a message's truth, usefulness or emotional meaning. Our example also assumes known, stable probabilities. Adding the entropies of successive tosses is appropriate when those tosses are independent. The small equation becomes useful when those assumptions remain visible.

One question to take with you

Does a biased coin's lower entropy mean its rare outcome is less informative?

See the answer

No. A rare outcome can be more informative. The entropy is lower because it averages that rare outcome with the frequent, more predictable result.

Sources & further reading