The Daily Reckoning
Why Is a Fair Coin Worth One Bit?
Binary entropy turns a coin's bias into a precise measure of uncertainty—and explains why one fair toss carries the most information possible from two outcomes.
- Difficulty
- Intermediate
- Area
- Probability and information theory
- Reading time
- 9 minutes
- Prerequisites
- Probabilities between 0 and 1 · Logarithms base 2 · Weighted averages
Suppose a distant buoy tosses a coin once every minute and sends you the result. If the coin is fair, either result is plausible. If the coin lands heads 99 times out of 100, the next head tells you very little; the rare tail does nearly all the surprising.
How many binary digits should one toss be worth on average?
The answer is not automatically one. A fair coin carries exactly one bit per toss, but a predictable coin carries less. The quantity that measures the difference is binary entropy.
Surprise first, then an average
An event with probability has self-information
bits. Here is a number between and , and is the logarithm base .
The logarithm gives the right behavior for independent events. If two events have probabilities and , their joint probability is , and
Independent surprises add.
For a coin, let be the probability of heads. The probability of tails is . A head contributes bits when it occurs, while a tail contributes bits. Average those two possible contributions using their probabilities as weights:
The function is the binary entropy function. Its value is measured in bits per toss. At or , the expression uses the limiting convention . A coin that never changes carries zero bits because its next result is already known.
The diagram below plots for every possible bias. Move the slider or use the preset buttons. The solid curve and the cross-shaped marker provide shape cues in addition to color.
Binary entropy explorer
Move the bias; measure the uncertainty
The curve is symmetric because changing the labels “heads” and “tails” changes to without changing the uncertainty. Its highest point occurs at :
One fair toss resolves one evenly balanced yes-or-no question. That is the unit called a bit.
Worked example: a coin with one-quarter heads
Now take . Substitute the two outcome probabilities into the definition:
Evaluate the heads term first. Because ,
For the tails term, , so
Add the weighted contributions:
The answer is below one bit because heads and tails are not equally uncertain. A head is more surprising than a tail, but heads occur only one-quarter of the time. Entropy accounts for both the surprise of an outcome and how often that outcome appears.
Why the fair coin is the maximum
The graph suggests that peaks at . A derivative verifies the claim. For ,
When , the fraction is greater than , so and the curve rises. At , the fraction equals , so . When , the fraction is less than , so and the curve falls. Therefore the fair coin gives the largest possible binary entropy.
There is also a counting intuition. A string of fair tosses has equally likely possibilities. Naming one possibility requires yes-or-no digits because
For a biased coin, most long strings cluster around the usual proportion of heads. Those probable strings occupy a much smaller part of the full set of strings. A well-designed lossless code can give shorter descriptions to the probable strings and longer descriptions to rare strings.
Shannon’s source-coding theorem makes the last idea precise: for a long sequence of independent tosses with fixed heads probability , the average length of a uniquely decodable lossless code can approach bits per toss, but cannot remain below that limit. The claim concerns long-run average length. It does not say that every individual message can be compressed.
From telegraph choices to information theory
Engineers were quantifying communication before entropy received its modern formula. In 1928, Bell Telephone Laboratories researcher Ralph Hartley published “Transmission of Information” in the Bell System Technical Journal. Hartley proposed a logarithmic measure for a message selected from a fixed number of alternatives. The measure treated the alternatives as equally available and connected information to the physical limits of telegraph and telephone systems.
Claude Shannon worked at Bell Labs from 1941 to 1972. During World War II, he studied cryptography and secrecy systems as part of the laboratory’s military communications work; an MIT account of Shannon’s career also records his team’s work on anti-aircraft fire-control systems. Wartime research did not create every ingredient of information theory, but secrecy, noise, signaling, and reliable transmission were concrete problems in Shannon’s working environment.
Shannon’s 1948 paper “A Mathematical Theory of Communication” acknowledged earlier work by Hartley and Harry Nyquist, then built a theory that allowed symbols to have unequal probabilities. Shannon named the weighted logarithmic quantity entropy and proved fundamental limits for data compression and reliable communication through noise. The paper appeared in the July and October issues of the Bell System Technical Journal; MIT OpenCourseWare’s historical notes preserve that publication history.
The institutional setting mattered. Bell Labs was the research arm of the regulated Bell telephone system, whose nationwide network created both the money and the engineering problems for sustained research on communication. Bell Labs research on communication crossed military and civilian uses. After the war, Shannon’s mathematics became a foundation for digital telephony, computer storage, satellite links, and the internet.
Where entropy earns its keep
Lossless compressors exploit unequal probabilities. Text compressors, for example, can represent frequent patterns with shorter codewords and reserve longer codewords for rarer patterns. The achievable average length is governed by the entropy of the source model, although practical files also contain structure, headers, and model errors that the single-coin formula does not capture.
Communication engineers use entropy when separating two jobs. Source coding removes predictable redundancy so that a message uses fewer bits on average. Channel coding adds carefully structured redundancy so that a receiver can detect or repair damage. The earlier Reckoning on Hamming’s seven-bit code studies the second job. Shannon’s theory supplies limits for both jobs, while practical codes determine how closely a real system approaches those limits.
Entropy also appears in statistical inference, machine learning, cryptography, and the study of random processes. In each setting, the probability model must be stated. “The entropy of the data” is not a complete quantity until the possible outcomes and their probabilities are specified.
Test the measure
Problem 1
A coin lands heads with probability . Find its binary entropy to three decimal places.
Reveal the solution
Here and . Substitute:
Because , the first term is
Also, , so the second term is
Therefore
or bits per toss to three decimal places.
Problem 2
Without calculating two separate logarithmic expressions, compare the entropy of a coin with to the entropy of a coin with .
Reveal the solution
The two entropies are equal. Replacing by swaps the two terms in
without changing their sum. The coin with is as predictable as the coin with ; only the labels of the common and rare outcomes have changed. Both entropies are approximately bits per toss.
One idea to remember
Information measures resolved uncertainty, not the mere presence of a symbol. A fair binary choice carries one bit because neither result is favored; prediction squeezes the average information below one.
A useful next step is to derive entropy for three or more outcomes, where the binary formula becomes , or to study prefix codes that turn those probabilities into decodable bit strings.
Sources
- Claude E. Shannon, “A Mathematical Theory of Communication”, Bell System Technical Journal 27 (July and October 1948), 379–423 and 623–656.
- Ralph V. L. Hartley, “Transmission of Information”, Bell System Technical Journal 7, no. 3 (July 1928), 535–563.
- Massachusetts Institute of Technology News Office, “Professor Emeritus Claude Shannon, founder of digital communications, dies at 84”, February 27, 2001.
- Massachusetts Institute of Technology OpenCourseWare, “Claude Shannon and ‘A Mathematical Theory of Communication’”, from Information and Entropy, Spring 2008.
- Larry Hardesty, “Explained: The Shannon limit”, MIT News, January 19, 2010.