Bits of Intuition
bits collected

Information is what you can rule out.

Eight small games take you from a jar of marbles to Shannon's noisy channel coding theorem. Each level you clear flips one bit in the meter above. Collect all 8 bits, one full byte of intuition.

p(blue)=1/2   p(gray)=1/4   p(yellow)=1/8   p(green)=1/8

Built from Pinkard & Waller, "A visual introduction to information theory" and Chris Olah's "Visual Information Theory".

Level 1 · What is information?

Ruling out probability mass

Two marbles are drawn (with replacement) from the urn above. There are 16 possible two-color sequences. Learning a fact about the draw lets you cross some of them off. Rarer facts rule out more, so they carry more information.

information of a fact with probability p  =  log₂(1/p) bits

Every halving of the remaining probability mass is worth exactly 1 bit.

GAME How many bits is this clue worth?
Surviving mass: 32/32  →  bits gained?
Level 2 · Entropy and source coding

Build the shortest code

Entropy is the probability-weighted average information per draw, and it is the shortest possible average encoding of the source. For this urn, H(X) = ½·1 + ¼·2 + ⅛·3 + ⅛·3 = 1.75 bits.

H(X) = Σ p(x) · log₂(1/p(x))

A short codeword is expensive: choosing "0" burns half of all possible codewords, since nothing else may start with 0 (the prefix rule). Spend your codeword budget in proportion to how often each color appears.

GAME Assign binary codewords. Beat 2.00 bits/marble, reach 1.75 to win.
colorpcodeword (0s and 1s)length
1/22
1/42
1/82
1/82
avg bits / marble
2.00
entropy floor
1.75
code status
valid prefix code

A typical 16-draw sequence encoded with your code:

Level 3 · Cross-entropy and KL divergence

Bob, Alice, and the wrong code

Bob mostly says "dog"; Alice mostly says "cat". Each has a code optimized for their own word frequencies. Cross-entropy Hₓ(p) is the average message length when a speaker with distribution p borrows the code built for q. The extra cost over the speaker's own entropy is the KL divergence.

Dₓ(p) = Hₓ(p) − H(p)
GAME Mix and match speaker and code, then answer the quiz.
speaker
code
avg message length
1.750
speaker's entropy
1.750
KL penalty
0.000
Quiz: which combination is the most expensive?
Level 4 · The asymptotic equipartition property

Where the probability goes

Take sequences of N draws. Plot each possible sequence by its information per draw, −log₂p / N. In black: how many sequences sit at each value. In magenta: where the probability mass actually lands. As N grows, nearly all the mass piles onto "typical sequences" whose information per draw ≈ H(X).

≈ 2^(N·H(X)) typical sequences, each with probability ≈ 2^(−N·H(X))
GAME Slide N and watch the mass concentrate.
sequence length N = 1
count of sequences probability-weighted H(X) = 1.75
Quiz: as N → ∞, the magenta mass converges to information/draw of…
Level 5 · Mutual information

What shape tells you about color

Now the urn holds colored shapes. You see only a black-and-white photo, so you learn the shape Y but not the color X. Mutual information I(X;Y) measures how much observing shape shrinks your uncertainty about color. Each bit of mutual information halves the remaining possibilities.

I(X;Y) = H(X) − H(X|Y)  ·  H(X,Y) = H(X) + H(Y) − I(X;Y)
GAME Pick a coupling, study the map, then play detective.
The photo shows a . Select every color it could be:
Level 6 · Entropy rate of stochastic processes

The sticky urn

A magical urn repeats the previous color with probability s and switches otherwise (a Markov chain). Every single draw still looks uniform on its own, yet the sequence becomes predictable. The entropy rate, your uncertainty about the next draw given the last one, drops below 2 bits. That gap is redundancy.

entropy rate = H(Xₖ₊₁ | Xₖ) = s·log₂(1/s) + (1−s)·log₂(3/(1−s))
GAME Predict the next marble. Beat 45% accuracy over 10 rounds.
stickiness s = 0.625  ·  entropy rate = 1.55 bits (vs 2.00 for IID)
Your prediction for the next draw:
round
0 / 10
correct
0
chance (IID) would get
25%
Level 7 · Channels and capacity

Feeding a noisy channel

A channel maps inputs to outputs with noise: here a Z-channel where 0 always arrives as 0, but 1 flips to 0 thirty percent of the time. How much information gets through, I(X;Y), depends on the input distribution you choose. The best achievable value is the channel capacity C.

C = max over p(x) of I(X;Y) = H(Y) − H(Y|X)

Two forces compete: use the noisy input more to fill the output space (raise H(Y)), or use it less to avoid noise (lower H(Y|X)). Capacity balances them.

GAME Tune p(1) to hit the capacity within 0.005 bits.
p(input = 1) = 0.50
I(X;Y) now
0.000
H(Y)
0.000
H(Y|X) noise
0.000
capacity C
???
Level 8 · The noisy channel coding theorem

Redundancy fights noise

Send 4 marbles (8 source bits) through a binary channel that flips each bit with probability 0.1. Raw bits get corrupted. Repetition coding votes its way to safety but slashes the rate. Block codes like Hamming(7,4) protect several bits together and keep the rate high. Shannon proved that with long enough blocks, any rate below capacity can be made error-free.

rate R = source bits / transmitted bits  ·  reliable iff R < C
GAME Transmit with all three encoders. Compare rate and errors.
transmitted bits
8
marbles wrong
msg error over 500 trials