Information Theory: Claude Shannon and the Mathematics of Communication
Imagine trying to measure something that seems fundamentally immeasurable: meaning. How much information is in a sentence? How much uncertainty does a coin flip contain? How many bits does your DNA actually need? These questions sound philosophical, but in 1948, a mathematician at Bell Labs named Claude Shannon gave them precise, computable answers — and in doing so, invented a new branch of science.
Information theory is the mathematics of communication, uncertainty, and knowledge. It underlies every file you compress, every message you encrypt, every song streamed on Spotify, and every error-correcting code that lets your data survive a noisy channel. Shannon's work is everywhere, yet almost invisible — one of the silent foundations of the digital age.
The Concept
Shannon's key insight was deceptively simple: information is about surprise.
Think about what it means to receive a message. If someone tells you the sun will rise tomorrow, you learn essentially nothing — you already knew that. But if someone tells you your flight has been cancelled, that's genuinely surprising, and you've learned something significant. Shannon proposed that the amount of information in a message is inversely related to how expected it was.
Mathematically, the information content of an event with probability p is:
I = -log₂(p)
If p = 1 (certain), log₂(1) = 0, and you learn nothing. If p = 1/2 (a fair coin flip), you get log₂(2) = 1 bit. If p = 1/4, you get 2 bits. Each time the probability halves, you gain another bit of information — which makes intuitive sense, since one more bit doubles the number of possible outcomes.
From this, Shannon derived entropy — the average information content across all possible outcomes of a random variable X:
H(X) = -Σ p(x) log₂(p(x))
The word "entropy" deliberately echoes thermodynamics. When Shannon showed the formula to the mathematician John von Neumann, von Neumann reportedly told him: "You should call it entropy, for two reasons. In the first place your uncertainty function has been used in statistical mechanics under that name, so it already has a name. In the second place, and more important, nobody knows what entropy really is, so in a debate you will always have the advantage."
Shannon proved something remarkable about this formula: it — and essentially only it — satisfies three intuitive axioms about what information should behave like. Entropy must be continuous in the probabilities, it must increase when you have more equally-likely outcomes to choose among, and it must be consistent when you compute it in stages rather than all at once. These three natural requirements are enough to uniquely determine the formula.
The unit of entropy? One bit — a word coined by statistician J. W. Tukey, who suggested the contraction of "binary digit" in a January 1947 Bell Labs memo. Shannon introduced the term formally in the 1948 paper. A fair coin has exactly 1 bit of entropy: maximum uncertainty over two equally-likely outcomes. A loaded coin that lands heads 90% of the time has only about 0.47 bits — less entropy, less surprise.
Entropy also tells you something about the extremes: it equals zero when one outcome is certain, and it reaches its maximum when all outcomes are equally likely. Both feel right intuitively. Certainty contains no information; complete randomness contains the most.
Why It Matters
The fundamental limit on compression
Here's where things get practically astounding. Shannon proved his source coding theorem: the entropy H of a source is an absolute mathematical lower bound on how much you can compress data from that source without losing any information. No algorithm — no matter how clever — can do better.
This is why ZIP files can't compress already-compressed images. A JPEG or MP3 has already been squeezed close to its informational minimum; the remaining bytes are nearly incompressible because they're close to random. ZIP uses a technique called DEFLATE — a combination of pattern-matching compression and Huffman entropy coding — but it can't extract bits that simply aren't there. The Shannon bound isn't a challenge to engineer around; it's a mathematical wall.
English text has about 1 to 1.5 bits of entropy per character (compared to a theoretical maximum of log₂(26) ≈ 4.7 bits for truly random letters), which is why text compresses so dramatically. Predictable patterns mean low entropy, which means lots of room to squeeze.
Your internet connection has a speed limit you can't engineer around
Shannon's channel capacity theorem states that for a communication channel of bandwidth W hertz, with signal power P and noise power N, the maximum achievable error-free data rate is:
C = W log₂(1 + P/N) bits per second
This is staggering. It says that no matter how clever your modulation scheme, no matter how sophisticated your signal processing, you cannot reliably transmit more than C bits per second over this channel. You can approach C arbitrarily closely — Shannon proved that good codes exist that get there — but you cannot exceed it.
This single formula explains why upgrading your router's antenna (increasing P/N) helps, why wider radio bands (higher W) are so valuable that spectrum auctions routinely fetch billions of dollars from governments, and why engineers talk about "approaching the Shannon limit" as an achievement rather than a goal. Modern cellular networks operate within a few percent of the Shannon limit — a testament to how practically useful pure mathematics can be.
Reed-Solomon: the code that saved your CDs and Mars rovers
Error correction codes are Shannon's other great legacy. When you send data over a noisy channel — or store it on a scratched disc — some bits get corrupted. Shannon proved that reliable communication is mathematically possible even over noisy channels, and his work launched the entire field of error-correcting codes.
One particularly elegant family is Reed-Solomon codes, used in CD players, DVDs, QR codes, and deep-space communications. A Reed-Solomon code RS(n, k) adds n-k redundancy symbols to a k-symbol message. The decoder can then correct up to t symbol errors, where 2t = n-k. Crucially, if the positions of errors are known (called "erasures"), it can recover up to 2t erasures — twice as many as unknown errors.
The CD standard uses RS(255, 223): 223 data bytes padded with 32 redundancy bytes. This means a CD player can fully reconstruct data even if up to 16 bytes in a block are completely corrupted — which translates to tolerating visible scratches, smudges, and manufacturing defects that would otherwise make playback impossible. The same mathematical machinery was carried into deep space: the brutal bit error rates of interplanetary radio transmission are tamed by Reed-Solomon codes, letting scientists receive clean images from hundreds of millions of miles away.
The Details
Who was Claude Shannon, and when did this happen?
Shannon spent World War II at Bell Labs, where he worked on cryptography for the U.S. government — work that remained classified for years but clearly sharpened his thinking about the nature of information. The ideas behind information theory were substantially complete by the end of 1944, though the paper didn't appear until 1948.
His landmark paper, "A Mathematical Theory of Communication," was published in the Bell System Technical Journal in two parts: Volume 27, No. 3 (July 1948, pages 379-423) and No. 4 (October 1948, pages 623-656). A year later, the work was expanded into a book co-authored with mathematician Warren Weaver and retitled The Mathematical Theory of Communication.
The paper was not an incremental advance. It created a new field from scratch. Before Shannon, engineers knew intuitively that signals carried information and that noise degraded them, but there was no mathematical framework to quantify either. Shannon built that framework in one document — complete with precise definitions, rigorous proofs, and theorems establishing hard mathematical limits.
What makes this even more remarkable is that Shannon did it while working at the boundary of practice and theory. He wasn't a pure mathematician disconnected from engineering. Bell Labs was in the business of building telephone networks, and Shannon was trying to answer a concrete question: how much can we say over a wire, and how reliably? The resulting theory turned out to answer that question for every communication channel imaginable.
Information in DNA
One of the most surprising places Shannon's ideas have migrated is genetics. DNA is, at its core, a storage medium — a four-symbol alphabet (A, T, G, C) encoding the instructions for building living organisms. Each position in a DNA sequence has a theoretical maximum of log₂(4) = 2 bits of information, but real genomes are far from random.
Researchers have found that dinucleotide frequencies — the relative rates at which pairs of nucleotides appear adjacent to each other — constitute a kind of informational fingerprint unique to each species. The log-odds ratios of observed versus expected dinucleotide frequencies differ significantly both within and between species, creating species-level signatures embedded in the DNA itself. This isn't just a curiosity: these genomic signatures have practical applications in identifying sample contamination, classifying ancient DNA, and understanding evolutionary relationships between organisms.
The framework here is Shannon's: you're comparing an observed distribution against an expected one and measuring the informational discrepancy. The same math that answers "how compressible is English text?" turns out to also answer "which species did this DNA fragment come from?"
Machine learning is doing information theory
Modern machine learning uses information theory constantly, often without explicitly calling it that. The cross-entropy loss function used to train nearly every neural network classifier is the information-theoretic measure of how many extra bits you need to describe the true distribution using your model's predicted distribution. Minimizing cross-entropy is literally minimizing the informational inefficiency of your model's predictions.
Decision trees split nodes using information gain — choosing the attribute that reduces entropy the most at each step. The "perplexity" metric used to evaluate language models is literally 2 raised to the power of cross-entropy per word — a direct measure of how many bits per word the model uses, compared to the Shannon entropy of natural language.
When a language model produces a probability distribution over the next word, samples from it, and continues, it's doing exactly what Shannon described: sampling from a learned probabilistic source. The model's job is to assign high probability to likely next words, which minimizes entropy, which minimizes cross-entropy loss, which is what the training process directly optimizes. Shannon wrote this framework in 1948. It took machine learning sixty years to fully converge on it.
Takeaways
- Information is mathematically measurable: Shannon defined information as surprise — the less likely an event, the more information it carries. Entropy H = -Σ p log p averages this across all outcomes and is uniquely determined by three natural axioms.
- Compression has a hard floor: The Shannon limit is not an engineering challenge but a mathematical law. No lossless algorithm can compress data below its entropy, which is why already-compressed files don't compress further.
- Noisy channels have a speed ceiling: Channel capacity C = W log₂(1 + P/N) is an absolute upper bound on reliable communication rate, regardless of encoding cleverness. Modern networks operate close to this limit.
- Error correction is provably possible: Shannon showed that reliable communication over noisy channels is mathematically achievable, not just aspirational. Reed-Solomon codes bring this directly to your CD player, your DVDs, and NASA's deep-space transmissions.
- The same math lives everywhere: Information theory connects communications engineering, genetics, cryptography, and machine learning under a single set of equations — one of the most cross-disciplinary mathematical frameworks ever invented.
Resources: Shannon's original 1948 paper is freely available and remains remarkably readable. The Information by James Gleick is an excellent popular history of the field.