We discuss another application that sheds light on meaning of entropy, the message transmission problem. In this model, a sender transmits a message to the receiver through a channel. In real world, the channel could be an optical fiber, a wireless channel, a hard disk etc. In the final application, the computer that writes and reads information from the hard disk is both the sender and the receiver.
In real world the channel is not perfect and the message transmitted is distorted by noise. It is natural to ask whether the message can be transmitted accurately under the noise, i.e., whether the receiver can recover the noisy message.
To study the problem, we need a mathematical model for both the channel and the noise. We focus on the simplest binary channel with bits of 0 and 1. The noise causes the bits to flip and is modelled by the distribution on the bit-flips. We study the simplest one that flips each bit independently with some identical probability p<0.5. For a message with length n, the number of bit flips follows a Binomial distribution B(n,p). We call such channel a binary symmetric channel.
To protect the message against noise, a naïve way is to send the each bit multiple times. For example, if the sender wants to send a bit 1, it sends 10 copies of 1 as 1111111111. The receiver decides that the bit sent is 1, if the majority of the 10 bits it receives is 1.
Could it be improved? Repeating each bit may not be the mot efficient way against the noise. In general, if the sender wants to send a message of k bits, it can convert it into a new message of n bits and sends the new one. The receiver considers the n bits received as a whole, and try to recover the k-bit message the sender wants to send.
We call the method used by the sender to convert the original message the encoding function, and the one used by the receiver to recover the message the decoding function.
Definition. A (k,n) encoding function Enc:{0,1}k→{0,1}n and a (k,n) decoding function Dec:{0,1}n→{0,1}k, where n≥k.
Since the noise flips the bits randomly, it is impossible to have an encoding function and a decoding function without error (unless p=0). Instead, we aim to control the probability of error within some specified threshold δ. To achieve this, we add redundancy to the message and encode a k-bit one into an n-bit one. Now, n−k is the amount of redundancy introduced. We would like to make n−k as small as possible. On the other hand, the value of n−k should positively related to p. The larger p is, the noisier the channel is and the larger n−k should be.
For fixed δ and p, the Shannon's Theorem says that the smallest possible value of n−k we can achieve is roughly nH(p). Intuitively, H(p) is the amount of randomness the noise exerts on each bit. Therefore 1−H(p) is the maximum amount of information we can transmit by one bit.
The first inequality follows from that (in) is increasing for i≤n/2 and that the summation is over at most (n+1)/2 terms. The last one follows from that H(x) is increasing for x≤1/2 and that ⌊qn⌋/n≤qn/n=q<1/2.
■
Shannon's Theorem
Given a binary symmetric channel with flip probability p<1/2 and for any any ϵ,δ>0, when n is large enough,
if k≤n(1−H(p)−ϵ), there exist (k,n) encoding and decoding functions such that the receiver fails to obtain the correct message with probability at most 2δ.
∄(k,n) encoding and decoding functions with k≥n(1−H(p)+ϵ) such that the decoding is correctly is at most δ for a k-bit input message chosen uniformly at random.
Proof of 1.
Intuition. When an n-bit message s is transmitted through the channel, the number of flipped bits is roughly np. As p<1/2, we can find a λ>0 such that p+λ<1/2. Let R be the received n-bit message and define d(s,R) the number of different bits between s and R, i.e., the Hamming distance between s and R. Given s and p, let D(s,p) be the distribution of R on {0,1}n.
By Hoeffding's inequality, it holds that
R∼D(s,p)Pr[∣d(s,R)−pn∣≥λn]≤exp(−2λ2n).
Define the (p+λ)n ball centered s as
Bs,(p+λ)n≐{r∈{0,1}n:d(s,r)<(p+λ)n}.
The the Hoeffding's inequality implies that for large enough n, we have
R∼D(s,p)Pr[R∈/Bs,(p+λ)n]≤δ.
That is, with probability at most δ, the received message fall outside the ball Bs,(p+λ)n. This motivates to decode each message in Bs,(p+λ)n as the original message the sender wants to send.
Further, by Lemma 1, the size of Bs,(p+λ)n is bounded by
i=0∑⌊(p+λ)n⌋(in)≤2nH(p+λ)+log2n+1
Therefore, the maximum number of non-overlapped balls we can pack into the message space {0,1}n is
2nH(p+λ)+log2n+12n=2n(1−H(p+λ)−n1log2n+1)
When n is large enough, this is at least 2n(1−H(p)−ϵ).
Remark: Hoeffding's inequality is an overkill. Chebyshev's inequality suffices for this proof.
Designing Encoding and Decoding Functions.
This motivates one to design of encoding and decoding function as follows: find a set of messages s1,s2,...,s2k∈{0,1}n, such that
Bs1,(p+λ)n,Bs2,(p+λ)n,...,Bs2k,(p+λ)n
are disjoint balls, and assign the messages in {0,1}k to the ones in {si}′s one by one. If the sending want to send i, it sends si. On receiving a message r, the receiver determines which ball r belongs to. The probability of decoding error is at most δ.
Question to ponder: can we find such a set efficiently, such that
Bs1,(p+λ)n,Bs2,(p+λ)n,...,Bs2k,(p+λ)n
are disjoint?
Finding the Codewords.
It is left to find a set of satisfactory s1,s2,...,s2k∈{0,1}n. The method we show here does not find a set of non-overlapped balls. Instead it aims to find a set such that
if si is transmitted, then the probability received message r falls into the another ball, i.e., r∈Bsj,(p+λ)n (j=i), is less than δ.
The property implies that the overlap between Bsi,(p+λ)n and ∪j=iBsj,(p+λ)n is less than δ (measured by probability). To formalize the statement, define the random variable S to be the message sent and R to be the one received. Given that S=si is sent, the conditional probability of receiving R=r is
R∼D(si,p)Pr[R is not recovered correctly∣S=si]=R∼D(si,p)Pr[R∈/Bsi,(p+λ)n∨R∈∪j=iBsj,(p+λ)n∣S=si]≤R∼D(si,p)Pr[R∈/Bsi,(p+λ)n∣S=si]+Pr[R∈∪j=iBsj,(p+λ)n∣S=si]≤2δ
That is, si is transmitted and decoded correctly with probability at least 1−2δ.
In what follows, we will prove the following claim:
Claim 1. If we generate 2k+1 codewords uniformly at random from {0,1}n, then in expectation
If we send each si with probability 1/2k, then the expected error probability is already δ. But we can have a stronger result: we can find a set of 2k codewords, such that for each i,
R∼D(si,p)Pr[R∈∪j=iBsj,(p+λ)n∣S=si]≤2δ
W.L.O.G., suppose that s1,s2,...,s2k are the ones with the smallest PrR∼D(si,p)[R∈∪j=iBsj,(p+λ)n∣S=si] 's, it must be that
The difficulty here is to prove that the claim holds for arbitrary (k,n) encoding and decoding functions. The proof relies on an important property:
the decoding function Dec is a function on {0,1}n
For any r∈{0,1}n, there is a unique output Dec(r)∈{0,1}k. The decoding function needs to decide the unique message {0,1}n the sender want to send.
Now, define
Si≐{r∈{0,1}n:r is decoded correctly if si is sent}
The Si's are non-overlapped and we have,
∪i=12kSi⊂{0,1}n
If si is sent, then by Hoeffding inequality, with probability at least 1−exp(−2λ2n), the received message R is likely to fall into a ring centered at si:
ring(si)≐{r∈{0,1}n:∣d(r,si)−pn∣<λn}
Finally, if the messages s1,s2,...,s2k are sent uniformly at random, i.e., i∼U[1,2k], then
Pr[R is decoded correctly]=i=1∑2kr∈Si∑R∼D(si,p)Pr[R=r∣S=si]i∼U[1,2k]Pr[S=si]=2k1i=1∑2kr∈Si∑R∼D(si,p)Pr[R=r∣S=si]
Observed that Si⊂ring(si)∪(Si∩ring(si)), we get
Pr[R is decoded correctly]≤2k1i=1∑2kr∈/ring(si)∑R∼D(si,p)Pr[R=r∣S=si]+r∈Si∩ring(si)∑R∼D(si,p)Pr[R=r∣S=si]≤2k1i=1∑2kexp(−2λ2n)+r∈Si∩ring(si)∑R∼D(si,p)Pr[R=r∣S=si]
Note that for r∈Si∩ring(si), as p<1/2, it holds that
R∼D(si,p)Pr[R=r∣S=si]≤p⌈(p−λ)n⌉(1−p)n−⌈(p−λ)n⌉
We obtain
Pr[R is decoded correctly]≤exp(−2λ2n)+2k1i=1∑2kr∈Si∩ring(si)∑p⌈(p−λ)n⌉(1−p)n−⌈(p−λ)n⌉≤exp(−2λ2n)+2k1i=1∑2kr∈Si∩ring(si)∑p(p−λ)n(1−p)n−(p−λ)n=exp(−2λ2n)+p(p−λ)n(1−p)n−(p−λ)ni=1∑2kr∈Si∩ring(si)∑2k1=exp(−2λ2n)+ppn(1−p)n−pn(p1−p)λn2n−k=exp(−2λ2n)+2n−k−nH(p)(p1−p)λn
Conditioning on that k≥n(1−H(p)+δ),
Pr[R is decoded correctly]≤exp(−2λ2n)+2−n(δ+λlogp1−p)
By choosing sufficient small λ and large enough n, Pr[R is decoded correctly] can be arbitrary small.
■
Reference
[1] M. Mitzenmacher and E. Upfal, Probability and computing: an introduction to randomized algorithms and probabilistic analysis. New York: Cambridge University Press, 2005.