46.03.04 · information-theory / 03-channel-capacity

Binary Symmetric Channel and Binary Erasure Channel: Capacity and Sphere-Packing

shipped3 tiersLean: none

Anchor (Master): Cover & Thomas 2006 Elements of Information Theory 2e (Wiley) §7.1-7.4; MacWilliams & Sloane 1977 The Theory of Error-Correcting Codes (North-Holland) §1.4-1.5; Shannon 1948 §13 (BSC capacity derivation)

Intuition Beginner

Imagine sending a message by flipping coins. You send heads or tails, but the channel flips each coin with probability . This is the binary symmetric channel (BSC). If , the channel is perfect — what you send is what arrives. If , the channel is useless — the output is a fresh coin flip, independent of the input.

Now imagine a different channel. You send heads or tails, but with probability the channel eats the bit entirely and returns a question mark. You know something was erased, but you do not know what. This is the binary erasure channel (BEC). The BEC is friendlier than the BSC because it tells you when an error happened, instead of silently corrupting the bit.

For the BSC, the capacity is bits per use, where is the binary entropy. At , the capacity is bits per use. You lose about half a bit to noise. At , the capacity is zero.

For the BEC, the capacity is bits per use. At , the capacity is 0.9. You lose exactly the fraction of bits that get erased. The BEC capacity is always higher than the BSC capacity for the same noise level, because knowing where the errors are is valuable.

The sphere-packing bound explains why capacity is finite. In a space of -bit strings, the number of strings within distance of any codeword is the volume of a Hamming ball. If you want to correct errors, the balls around your codewords cannot overlap, so the total number of codewords is bounded by divided by the ball volume.

The BSC and BEC are the workhorse channel models because they capture two fundamentally different types of noise. The BSC models errors — bits that flip silently — which is the hardest noise to handle because you do not know which bits are wrong. The BEC models erasures — bits that disappear but their locations are known — which is easier because you know exactly what is missing. Every practical communication system encounters a mixture of both, and understanding these two extreme cases provides the foundation for handling realistic channels.

Visual Beginner

Figure: a grid of points representing all 4-bit strings. Five codewords are marked as filled circles. Hamming balls of radius 1 around each codeword are shaded. The balls are disjoint (no overlap), illustrating the sphere-packing constraint.

Channel Noise parameter Capacity (bits/use) Interpretation
BSC, No errors 1.000 Perfect channel
BSC, 10% flip 0.531 About half the bits carry information
BSC, Random output 0.000 Completely useless
BEC, No erasures 1.000 Perfect channel
BEC, 10% erased 0.900 Lose only the erased fraction
BEC, Half erased 0.500 Half the bits survive

The BEC always has higher capacity than the BSC at the same noise level because erasures are easier to handle than errors.

Worked example Beginner

Consider the BSC with crossover probability . The capacity is .

Compute bits.

So the capacity is bits per channel use.

A code of length can transmit at most about 500 bits of information reliably. Using rate , we can send distinct messages in 1000 channel uses. This is an astronomically large number — far more than the number of atoms in the observable universe — which illustrates the power of channel coding: even through a noisy channel, reliable communication at positive rates allows an exponential number of distinct messages.

Now consider the sphere-packing bound for a code of length correcting error. The volume of a Hamming ball of radius 1 in 7 dimensions is . The sphere-packing bound gives at most codewords. The Hamming code achieves exactly 16 codewords with minimum distance 3, so it is a perfect code that saturates the bound.

For a larger example, consider and (the Golay code parameters). The ball volume is . The sphere-packing bound gives at most codewords. The binary Golay code achieves exactly this, making it another perfect code. These two codes — the Hamming and the Golay — are the only interesting perfect binary codes (beyond the degenerate repetition codes and the full space).

Check your understanding Beginner

Formal definition Intermediate+

Definition (Binary symmetric channel). The BSC with crossover probability is the channel with input alphabet , output alphabet , and transition probabilities

Definition (Binary erasure channel). The BEC with erasure probability is the channel with input alphabet , output alphabet , and transition probabilities

Theorem (BSC capacity). bits per channel use, achieved by the uniform input distribution.

Proof. . For the BSC with input distribution , :

since (the output entropy given the input is the binary entropy of the crossover probability). This is maximised when is maximised, which occurs at (uniform input), giving . Therefore .

Theorem (BEC capacity). bits per channel use, achieved by the uniform input distribution.

Proof. . With uniform input, . The conditional entropy : when (probability ), is unknown, contributing . When (probability ), is known, contributing 0. So . Therefore .

Counterexamples to common slips

  • The BSC capacity is not . The capacity involves , not . At small , , which is much larger than .

  • The BEC capacity formula only applies to the binary erasure channel. For a -ary erasure channel, the capacity is .

  • The sphere-packing bound is not tight in general. It gives an upper bound on code size, but the largest achievable codes may be much smaller. Perfect codes (like the Hamming and Golay codes) are exceptions where the bound is tight.

Key theorem with proof Intermediate+

Theorem (Sphere-packing bound). An code over (length , size , minimum distance ) satisfies

where .

Proof. The Hamming balls of radius around each of the codewords are pairwise disjoint (since any two codewords differ in at least positions, and ensures the balls do not overlap). Each ball contains points (the codeword itself plus all strings within Hamming distance ). The total number of points covered by all balls is , and this cannot exceed the total number of points in the space.

Theorem (Hamming bound). The Hamming bound is the sphere-packing bound rewritten as a bound on :

A code achieving equality is called perfect. The only interesting perfect binary codes (beyond the repetition codes and the full space) are the Hamming codes and the Golay code.

Bridge. The sphere-packing bound builds toward the channel coding theorem converse in 46.03.03, where Fano's inequality provides the information-theoretic impossibility result that complements the geometric packing constraint derived here. The foundational reason the sphere-packing bound matters is that it converts a geometric constraint (non-overlapping balls in Hamming space) into a rate constraint (the code rate is bounded above), and this is exactly the combinatorial shadow of the capacity for the BSC. The central insight generalises to the Gilbert-Varshamov lower bound in 40.06.06, where a packing argument in the reverse direction shows that large codes exist, and appears again in 46.07.01 where the weight enumerator gives algebraic control over code size, and putting these together the Hamming bound and Gilbert-Varshamov bound sandwich the maximal code size.

Exercises Intermediate+

Lean formalization Intermediate+

Mathlib lacks channel capacity, the BSC/BEC models, and the sphere-packing bound. Hamming distance exists informally via type-class instances, but the volumetric analysis of Hamming balls (binomial sum bounds) is not connected to the information-theoretic framework. A Codex.InformationTheory.BSC module would need to define the BSC transition matrix, compute for binary inputs, prove the capacity formula, and derive the sphere-packing bound from counting. This unit ships without formal verification.

Advanced results Master

The Plotkin bound and its relation to sphere-packing

The Plotkin bound gives a tighter constraint than the sphere-packing bound for codes with large minimum distance. For a binary code with :

This follows from double-counting the total pairwise distance: , but also since the average distance between any two points in is . Combining gives the Plotkin bound.

The Plotkin bound is tighter than the sphere-packing bound when , but the sphere-packing bound is tighter for small . Together, they provide complementary constraints on the trade-off.

The Gilbert-Varshamov bound

The Gilbert-Varshamov lower bound shows that large codes exist:

This is proved by a greedy construction: start with an empty code and repeatedly add any vector not within distance of existing codewords. The process continues until the balls of radius cover the entire space.

Asymptotically, the GV bound gives codes with rate . Comparing with the sphere-packing upper bound , there is a gap of between the best known lower and upper bounds on the rate-distance trade-off. Closing this gap is one of the central open problems in coding theory.

Capacity as a function of the noise level

For the BSC, the capacity is a concave, strictly decreasing function of on . Its derivative is , which diverges as , reflecting the fact that even tiny noise levels reduce capacity.

The Bhattacharyya parameter provides an alternative characterisation of channel quality. For the BSC, with (perfect) and (useless). The capacity relates to the Bhattacharyya parameter via , though the exact relationship is transcendental. The Bhattacharyya parameter is the key quantity in polar code analysis 46.08.03.

Synthesis. The BSC and BEC are the two canonical channel models of information theory; their capacity formulas and are the benchmarks against which all codes are measured. The central insight is that capacity converts noise into a rate penalty, and the sphere-packing bound provides the geometric reason: non-overlapping Hamming balls constrain the packing density. The foundational reason the BEC has higher capacity than the BSC is that erasures preserve the location of errors, and this builds toward polar codes in 46.08.03 where the BEC admits a particularly clean analysis. The sphere-packing bound generalises to the Plotkin and Elias-Bassalygo bounds, appears again in 46.07.01 where algebraic methods tighten the constraints, and putting these together the geometric and algebraic bounds sandwich the achievable rates for binary codes.

Full proof set Master

Proposition (Volume of Hamming ball). The volume of the Hamming ball of radius in is

For , this satisfies .

Proof. The number of binary strings of length at Hamming distance exactly from a fixed string is (choose which positions to flip). Summing from 0 to gives the volume.

For the bounds, the dominant term in the sum is when . Using the entropy bound and the lower bound :

The polynomial factor is absorbed into a slightly adjusted exponent for the asymptotic statement.

Connections Master

  • 46.03.01 — Discrete memoryless channels and mutual information; the BSC and BEC are the primary examples.
  • 46.03.03 — Fano's inequality provides the converse; the sphere-packing bound provides a combinatorial converse.
  • 40.06.07 — Perfect codes achieve the sphere-packing bound with equality; the Hamming and Golay codes are the only interesting examples beyond repetition codes.
  • 46.08.03 — Polar codes achieve BSC and BEC capacity with explicit constructions.
  • 40.06.06 — The Gilbert-Varshamov bound provides the complementary lower bound on code size.

Historical & philosophical context Master

Shannon introduced the BSC in his 1948 paper (Section 13), deriving the capacity and giving the geometric interpretation of codes as sphere packings in Hamming space. The geometric analogy — codewords as non-overlapping spheres, errors as perturbations within a sphere — became the organising picture for coding theory.

The sphere-packing bound was known implicitly in Shannon's work but was first stated explicitly by Hamming in his 1950 paper ("Error detecting and error correcting codes," Bell System Technical Journal 29, pp. 147-160). Hamming used it to prove that his code was optimal for .

The BEC was introduced by Elias in 1955 ("Coding for noisy channels," IRE Convention Record 3, pp. 37-46). Its clean capacity formula makes it the preferred channel model for theoretical analysis, particularly for polar codes where the BEC admits exact analysis of the channel polarization phenomenon.

Bibliography Master

@article{shannon1948,
  author  = {Shannon, C. E.},
  title   = {A Mathematical Theory of Communication},
  journal = {Bell System Technical Journal},
  volume  = {27},
  pages   = {379--423 and 623--656},
  year    = {1948},
}
@article{hamming1950,
  author  = {Hamming, R. W.},
  title   = {Error Detecting and Error Correcting Codes},
  journal = {Bell System Technical Journal},
  volume  = {29},
  pages   = {147--160},
  year    = {1950},
}
@inproceedings{elias1955,
  author    = {Elias, P.},
  title     = {Coding for Noisy Channels},
  booktitle = {IRE Convention Record},
  volume    = {3},
  pages     = {37--46},
  year      = {1955},
}
@book{cover-thomas2006,
  author    = {Cover, T. M. and Thomas, J. A.},
  title     = {Elements of Information Theory},
  edition   = {2nd},
  publisher = {Wiley},
  year      = {2006},
}
@book{macwilliams-sloane1977,
  author    = {MacWilliams, F. J. and Sloane, N. J. A.},
  title     = {The Theory of Error-Correcting Codes},
  publisher = {North-Holland},
  year      = {1977},
}