📋 Changes in this PR: Channel capacity, Entropy and mutual information, Error-correcting codes, Huffman codes, Information Theory for Data Science, KL divergence and maximum likelihood, Low-density parity-check codes, Min-entropy, Minimum description length, Perfect secrecy, Reed–Solomon codes and list decoding, Source coding, Stream codes, Variational inference
💡 Tip: If change highlighting is glitchy, add the no-preview-highlights label to this PR to disable it.
A channel carries symbols from a sender to a receiver, and some of them are corrupted along the way. This page asks how much information a channel can carry, using the mutual information between what goes in and what comes out.
Channels
Definition 1 (Discrete memoryless channel) A discrete channel has a finite input alphabet \(\mathcal{X}\), a finite output alphabet \(\mathcal{Y}\), and, for each input \(x \in \mathcal{X}\), a probability mass function \(p(y \mid x)\) on \(\mathcal{Y}\): the probability that the channel outputs \(y\) when it is sent \(x\). The channel is memoryless if, over \(n\) uses, each output depends only on the input sent at that use:
\[
\mathbb{P}(Y_1 = y_1, \dots, Y_n = y_n \mid X_1 = x_1, \dots, X_n = x_n)
= \prod_{i=1}^{n} p(y_i \mid x_i).
\]
This is the setup of Cover and Thomas (2006, chap. 7).
Definition 2 (Binary symmetric channel) The binary symmetric channel with crossover probability \(\epsilon \in [0, 1]\) is the discrete memoryless channel with \(\mathcal{X} = \mathcal{Y} = \{0, 1\}\) that flips its input with probability \(\epsilon\):
\[
p(y \mid x) =
\begin{cases}
1 - \epsilon & \text{if } y = x, \\
\epsilon & \text{if } y \ne x.
\end{cases}
\]
Definition 3 (Binary erasure channel) The binary erasure channel with erasure probability \(\alpha \in [0, 1]\) is the discrete memoryless channel with \(\mathcal{X} = \{0, 1\}\) and \(\mathcal{Y} = \{0, \mathrm{e}, 1\}\) that delivers its input with probability \(1 - \alpha\) and otherwise outputs the erasure symbol \(\mathrm{e}\):
\[
p(y \mid x) =
\begin{cases}
1 - \alpha & \text{if } y = x, \\
\alpha & \text{if } y = \mathrm{e}, \\
0 & \text{otherwise}.
\end{cases}
\]
Capacity
Definition 5 (Binary entropy function) The binary entropy function is
\[h(\epsilon) \stackrel{\text{def}}{=}-\epsilon \log_2 \epsilon - (1 - \epsilon) \log_2 (1 - \epsilon)\]
for \(0 < \epsilon < 1\), with \(h(0) = h(1) \stackrel{\text{def}}{=}0\).
Proof. Fix any probability mass function for \(X\). By mutual information as a reduction in entropy,
\[{\mathbb{I}\mathopen{}\left(X ; Y\right)\mathclose{}} = H(Y) - H(Y \mid X).\]
Given \(X = x\), the output equals \(x\) with probability \(1 - \epsilon\) and differs from it with probability \(\epsilon\), so the entropy of \(Y\) given \(X = x\) is \(h(\epsilon)\) for both values of \(x\). Averaging over \(x\), the conditional entropy is \(H(Y \mid X) = h(\epsilon)\), whatever \(X\) is.
\(Y\) takes two values, so \(H(Y) \le \log_2 2 = 1\) bit (Cover and Thomas 2006, sec. 2.6). Therefore
\[
\begin{aligned}
{\mathbb{I}\mathopen{}\left(X ; Y\right)\mathclose{}}
&= H(Y) - h(\epsilon) \\
&\le 1 - h(\epsilon).
\end{aligned}
\]
If \(X\) is uniform on \(\{0, 1\}\), then
\[
\begin{aligned}
\mathbb{P}(Y = 1)
&= \mathbb{P}(X = 0) \, \epsilon + \mathbb{P}(X = 1) \, (1 - \epsilon) \\
&= \tfrac{1}{2} \epsilon + \tfrac{1}{2} (1 - \epsilon) \\
&= \tfrac{1}{2},
\end{aligned}
\]
so \(H(Y) = 1\) bit and \({\mathbb{I}\mathopen{}\left(X ; Y\right)\mathclose{}} = 1 - h(\epsilon)\). This value is attained, so it is the maximum \(C\).
Example 1 (A channel that flips one bit in ten) For a binary symmetric channel with \(\epsilon = 0.1\),
\[
\begin{aligned}
h(0.1)
&= -0.1 \log_2 0.1 - 0.9 \log_2 0.9 \\
&\approx 0.332 + 0.137 \\
&\approx 0.469 \text{ bits},
\end{aligned}
\]
so by Theorem 1 the capacity is
\[C \approx 1 - 0.469 = 0.531 \text{ bits per channel use}.\]
Each use carries one bit, but on average only about half a bit of it gets through. At \(\epsilon = 1/2\), \(h(1/2) = 1\) and \(C = 0\): the output is independent of the input. At \(\epsilon = 1\), \(C = 1\) again, since the receiver can flip every bit back.
Exercise 1 (Capacity of the binary erasure channel) Send \(X\) through the binary erasure channel with erasure probability \(\alpha\), where \(0 < \alpha < 1\), and write \(\pi \stackrel{\text{def}}{=}\mathbb{P}(X = 1)\). Let \(E\) be \(1\) if the output \(Y\) is the erasure symbol \(\mathrm{e}\), and \(0\) otherwise. Use base-2 logarithms and the binary entropy function \(h\).
Show that \(H(Y \mid X) = h(\alpha)\).
\(E\) is a function of \(Y\). Use the chain rule for entropy, expanded in both orders, to show that \(H(Y) = H(E) + H(Y \mid E)\).
Show that \(H(Y) = h(\alpha) + (1 - \alpha) \, h(\pi)\).
Conclude that the capacity is \(C = 1 - \alpha\) bits per channel use.
Solution 1.
Given \(X = x\), the output is \(x\) with probability \(1 - \alpha\) and \(\mathrm{e}\) with probability \(\alpha\), so \(H(Y \mid X = x) = h(\alpha)\) for both values of \(x\), and averaging over \(x\) gives \(H(Y \mid X) = h(\alpha)\).
The chain rule gives
\[H(Y) + H(E \mid Y) = H(Y, E) = H(E) + H(Y \mid E).\]
Each value \(y\) of \(Y\) fixes \(E\), so \(H(E \mid Y = y) = 0\) for every \(y\), and \(H(E \mid Y) = 0\). Hence \(H(Y) = H(E) + H(Y \mid E)\).
The channel erases with probability \(\alpha\) whatever the input, so \(E\) is independent of \(X\) and \(H(E) = h(\alpha)\). Given \(E = 1\), \(Y = \mathrm{e}\) for certain, so \(H(Y \mid E = 1) = 0\). Given \(E = 0\), \(Y = X\), and since \(E\) is independent of \(X\), \(\mathbb{P}(Y = 1 \mid E = 0) = \mathbb{P}(X = 1) = \pi\), so \(H(Y \mid E = 0) = h(\pi)\). Therefore
\[
\begin{aligned}
H(Y)
&= H(E) + \mathbb{P}(E = 1) \, H(Y \mid E = 1) + \mathbb{P}(E = 0) \, H(Y \mid E = 0) \\
&= h(\alpha) + \alpha \cdot 0 + (1 - \alpha) \, h(\pi) \\
&= h(\alpha) + (1 - \alpha) \, h(\pi).
\end{aligned}
\]
Combining parts 1 and 3,
\[
\begin{aligned}
{\mathbb{I}\mathopen{}\left(X ; Y\right)\mathclose{}}
&= H(Y) - H(Y \mid X) \\
&= h(\alpha) + (1 - \alpha) \, h(\pi) - h(\alpha) \\
&= (1 - \alpha) \, h(\pi).
\end{aligned}
\]
Since \(h(\pi) \le 1\), with equality at \(\pi = 1/2\), the maximum over input probability mass functions is \(C = 1 - \alpha\). The receiver loses a share \(\alpha\) of the bits and learns the rest exactly; Cover and Thomas (2006, sec. 7.1) reach the same capacity.
The noisy-channel coding theorem
Definition 6 (Channel code) An \((M, n)\) channel code for a discrete memoryless channel sends one of \(M\) messages, \(w \in \{1, \dots, M\}\), in \(n\) uses of the channel. It has
- an encoder, which assigns each message \(w\) to a codeword \((x_1(w), \dots, x_n(w))\) of \(n\) symbols sent through the channel, and
- a decoder, which sends each list of \(n\) outputs to a guess at \(w\).
This is the definition of Cover and Thomas (2006, sec. 7.5).
Definition 7 (Rate of a channel code) The rate of an \((M, n)\) channel code is
\[R \stackrel{\text{def}}{=}\frac{\log_2 M}{n} \text{ bits per channel use}.\]
This is the definition of Cover and Thomas (2006, sec. 7.5).
Definition 8 (Maximal probability of error) The maximal probability of error \(\lambda^{(n)}\) of an \((M, n)\) channel code is the largest, over messages \(w\), of the probability that the decoder’s guess is wrong when \(w\) is sent. This is the definition of Cover and Thomas (2006, sec. 7.5).
Example 2 (Sending each bit three times) To send one bit over the binary symmetric channel with \(\epsilon = 0.1\), send it three times and decode by majority vote. This is a \((2, 3)\) channel code, with rate \(R = 1/3\). The decoder is wrong when two or three of the copies are flipped, so the maximal probability of error is
\[
\begin{aligned}
\lambda^{(3)}
&= 3 \epsilon^2 (1 - \epsilon) + \epsilon^3 \\
&= 3 (0.01)(0.9) + 0.001 \\
&= 0.028,
\end{aligned}
\]
down from \(0.1\) for sending the bit once. Repeating more often lowers the error further, but the rate falls toward \(0\) as it does. MacKay (2003, chap. 1) works through this code.
References
Cover, Thomas M., and Joy A. Thomas. 2006.
Elements of Information Theory. 2nd ed. Wiley-Interscience.
https://doi.org/10.1002/047174882X.
MacKay, David J. C. 2003. Information Theory, Inference, and Learning Algorithms. Cambridge University Press.
Shannon, C. E. 1948.
“A Mathematical Theory of Communication.” Bell System Technical Journal 27 (3): 379–423.
https://doi.org/10.1002/j.1538-7305.1948.tb01338.x.
Back to top