History of Math

Shannon and the Bit of Information

In 1948 Claude Shannon founded information theory with “A Mathematical Theory of Communication”. This demo plots the binary entropy H(p), marks the current probability, and connects log2(N) to the number of yes/no questions needed to identify one of N equally likely outcomes.

6 minLevel 2/3The interactive stage stays ad-free.
p0.50H(p)1.000 bitsOutcomes8Entropy log2(N)3 bitsYes/no questions3
0.000.250.500.751.000.000.250.500.751.001.000 bitsH(p) in bitsprobability p of heads

H(p) = −p·log2(p) − (1−p)·log2(1−p) = 1.0000 bits · outcomes H = log2(8) = 3 bits

Equally likely outcomes

8 equally likely outcomes need 3 bits, i.e. 3 yes/no questions at most. Entropy is the minimum average number of questions.

20 questions, one answer

Each yes/no question has at most 2 answers, so 20 questions distinguish at most 2^20 ≈ 1,048,576 items. One million equally likely items carry log2(1,000,000) ≈ 19.93 bits, so 20 questions are enough.

2^20 = 1,048,576log2(1M) ≈ 19.93 bits20 questions suffice
Claude Shannon, “A Mathematical Theory of Communication”, 1948Shannon defined information as the reduction of uncertainty and named the unit the bit. His binary entropy H(p) is maximized at p = 0.5, where a fair coin carries exactly one bit and a biased coin carries less. Today bit is the basic unit of storage and transmission.

A fair coin (p = 0.5) carries one full bit of uncertainty. Push p toward 0 or 1 and the outcome becomes predictable, so H(p) drops toward zero. The outcome buttons show the same idea for many equally likely results: N outcomes carry log2(N) bits, the number of yes/no questions needed to identify one.

What you are seeing

1

The binary entropy H(p) = −p·log2(p) − (1−p)·log2(1−p) measures the average uncertainty of a coin with heads probability p.

2

With N equally likely outcomes, the entropy is log2(N) bits. That equals the minimum number of yes/no questions needed on average to find the answer.

3

The bit is the unit: one fair coin flip has entropy exactly 1. Predictable outcomes have entropy near 0.

Why it matters

Shannon’s framework underlies compression, error correction, cryptography, and machine learning. It explains both the limits of data compression and why 20 yes/no questions can pinpoint one item out of a million.

Complexity & details

Evaluating H(p) is O(1). Checking N outcomes costs O(1) for log2(N); building a full decision tree would cost O(N).

Frequently asked questions

Why is entropy zero when p is 0 or 1?+

If the outcome is certain, observing it tells you nothing new. There is no uncertainty to reduce, so the information gained is zero bits.

Why 20 questions for a million items?+

Each yes/no question can at most double the number of distinguishable cases. After k questions you can separate at most 2^k items, and 2^20 is slightly more than one million.