The entropy in bits of a discrete random variable is
where the summation is over the support of , namely over all values in the range of . Equivalently,
The binary entropy function for a random variable that assumes only two possible outcomes, one of which occurs with probability , is
If is chosen uniformly at random from real interval , derive .
Since is symmetric, hence we derive the part on the left hand side by
where the second equality holds by integration by parts. Therefore, . ∎
Consider an -sided die, where the face comes up with probability . Show that the entropy of a die roll is maximized when each face comes up with equal probability.
Let be the random variable for the face showing up for the -sided die. The probability of the face showing up can be decided by a set of probabilities where , such that and .
On an index , take partial derivative over for ,
where . By symmetry, can be arbitrary over , hence if the partial derivative is 0 for any pair of , the only solution would be for any . ∎
For a fair -faced die, the entropy is bits of randomness.
Let , and show that is finite. Let integer-valued discrete random variable has distribution for , show that is unbounded.
Let , then . Hence,
| (1.9) |
which is upper bounded by a bounded value. For the entropy, we have
The sum over the first term is bounded by eq. 1.9 or by definition of . For the sum over the third term, the sum over the first few terms with is bounded. For , the sum over the third term is bounded by
where , and the summation is finitely bounded. The sum over the second term is
which is unbounded. We conclude that is unbounded. ∎
Let be independent random variables, and let . Then .
Let has support , and has support . We show by
where the second and the last equality holds by the independence between and . ∎
The conditional entropy is defined by
If , show that .
This can be seen as an extended version of lemma 1.10.7. We show by
where the third equality holds by summing over preserves the marginal probability of . ∎
The mutual information of a pair of random variables is defined by
For mutual information in definition 1.10.11, we can expand the expression by
The Kullback-Leibler (KL) divergence is a statistical distance defined as
In KL divergence by definition 1.10.13 and mutual information with remark 1.10.12, if we consider , that is the joint distribution of , and , which is the marginal distribution of , mutual information fits into KL divergence by
Moreover, we can again expand the expression in remark 1.10.12 by
where is conditional distribution of given with distribution .
Given 2 distributions and over the same support,
For lemma 1.7.1, we give a tighter version as follows, to be used soon.
For an integer , we have
We begin with the upper bound. Since
then
The lower bound is trivial when , and it is also trivial when or for . We derive the lower bound for and using the following upper and lower bounds by lemma 1.10.17:
and therefore
| (1.10) |
Let such that , then
which is negative for , and when , so eq. 1.10 is minimized when , giving
Moreover,
for all , then
∎
When ,
When ,
Let be the number of bits in a sequence of bits . An extraction function takes as input the value of a random variable , and outputs a sequence of bits. For every sequence of bits with ,
whenever .
We can view the input as the outcomes of biased coin flips, and the output as fair coin flips. In this sense, if the biased coin comes up heads with probability , the entropy of the input is , which is the maximum possible expected number of fair bits that any extraction function can output.
There is no guarantee that is efficient (runs in polynomial time).
Consider a construction of for uniformly distributed over . The elements in can be represented in 3 bits, while we can associate the 4 probabilities in with 2 bits. Associate each input to each 2 or 3 bit output, such that they output with the same probability. Hence, the probability of outputting 3 bits is , while the probability of outputting 2 bits is , and
for being 2 or 3, such that definition 1.10.20 is satisfied.
Suppose the value of a random variable is uniform over , such that , then there is an extraction function for that outputs on average at least independent and unbiased bits.
Suppose is a power of 2, the extraction function trivially outputs the value’s bits representation.
In the general case where is not a power of 2, we first show in an inductive way. Let , be the random variable for the length of output bits, and for the elements in , the theorem 1.10.23 still holds, that
Let , then since
we have
as holds for any .
We show in an explicit construction. Consider distinct indices in descending order, satisfying
such that is partitioned into subsets, and the subset is , of size , then
and since ,
Considering
then . ∎
We have shown in theorem 1.10.23 that an extraction function for a random variable uniform over extracts on average at least unbiased bits. Show that there is an extraction function for independent random variables uniform over extracting on average at least unbiased bits.
Apparently, one can invoke times the extraction function in theorem 1.10.23, and by linearity of expectation, outputting on average at least unbiased bits. The idea is to construct over by
and . The average number of output bits by theorem 1.10.23 is
∎
Suppose we have an oracle of generating independent fair coin flips, and is not a power of 2.
Show that one cannot uniformly sample over with exactly fair coin flips, for any fixed .
Show that one cannot uniformly sample over with at most fair coin flips, for any fixed .
Give an algorithm using fair coins to sample uniformly over , with expected flips at most .
We first rule out the case that , as it is impossible to associate outcomes with numbers.
If one tries to uniformly sample over with exactly fair coins, as is not a power of 2, and one cannot associate numbers with outcomes in an equal-sized partition manner.
In the at most flips case, pad each execution to exactly flips: if the algorithm stops after flips with , then all possible continuations are counted as producing the same outcome. Hence each output corresponds to some integer number of the length- bit strings, so
Uniformity requires for every , so , which is impossible because is not a power of , failing in the same manner as the exact tosses.
An algorithm sampling uniformly over is rejection sampling: keep tossing fair coins, until the outputting integer is within range . A round being rejected has probability at most , and the expected number of rounds is therefore at most 2, thus the expected runtime is at most . ∎
Suppose we have an oracle of generating independent fair coin flips.
Give an algorithm using the fair coin that simulates flipping a biased coin that comes up heads with probability . The expected number of flips should be at most 2.
Give an algorithm using the coin to sample uniformly over with expected flips at most .
Write into its binary form, such that there exists bits , to binary decompose into the form . Keep tossing independent fair coins until . If , the biased coin comes up tails, otherwise heads. Since , the expected number of sampling is at most 2, as there might be finite number of .
A first attempt at sampling uniformly over is an extension of the biased coin sampling, with probability the biased coin comes up heads, where . In each attempt, fair coins are tossed sequentially, and they are used both to simulate the biased coin, and maintained as the prefix of an -bit integer.
If the biased coin comes up tails, then any completion of the current prefix ties to an integer at least , so restart.
If the biased coin comes up heads, the generated number is within ; keep tossing until fair coins have been sampled, and output the resulting -bit integer.
Let be the random variable for the biased coin simulation, where is the number of fair coins tossed, and is the outcome of the biased coin simulation. Let be a stopping time for on the first heads of the biased coin. Then the total number of fair coin flips is
Since is heads with probability , then . Moreover, for each ,
Since and are both bounded, by theorem 1.13.18,
By linearity of expectation,
where the second inequality holds by , and the last inequality holds by .
This falls short of the desired bound, because rejected attempts discard all previously sampled bits. We now give a recycling version that keeps the remaining randomness after rejection. Consider the following algorithm:
Let and . Keep looping:
Sample , and update , .
Continue looping if , otherwise if :
If , update , .
Otherwise, output .
The invariant here is is always uniform over , and the algorithm is rejection sampling over .
Indeed, if is uniform over , then after sampling , the value is uniform over . On , conditioning on gives a uniform output over ; conditioning on makes uniform over , preserving the invariant.
The new algorithm always runs steps up to the first comparison against , then let be the step for the output. We have the following observation: At the step, we have possible bit strings, separated into 2 classes:
Resolved prefixes: On reading the prefix of a -bit string, the algorithm stops at some bit and outputs a sample. Any continuation for a resolved prefix is considered stopped.
Unresolved prefixes: The algorithm does not output after consuming all of the bits as inputs.
After the first bits, the unresolved prefixes at the step form a possibly empty interval .
We prove by induction. Let . When , the unresolved prefixes are , since .
Suppose the claim holds for . After tossing one more fair coin, each unresolved prefix has two continuations, so before the next rejection step the unresolved interval doubles to
Once the algorithm sees an entire block of size in the interval at the bottom of the interval, the block is removed, as that goes to the new resolved prefixes. Hence the unresolved interval that remains is
This proves the induction step. ∎
With lemma 1.10.27, we upper bound the number of unresolved prefixes at the step by , and thus
The last equality can be roughly relaxed to an upper bound of , as for , and the sum of the last 2 terms is upper bounded by 2. ∎
Suppose a coin comes up heads with probability . For any constant and sufficiently large ,
There exists an extraction function that on input sequences of independent flips, outputs an average of at least independent random bits.
The average number of bits output by any extraction function on an input of independent flips is at most .
We begin by describing an extraction function that extracts on average at least random bits from flips of the biased coin. After flips, the number of heads coming up concentrates around , which means the outcome is most likely to be one of the sequences with heads up.
Conditioned that heads coming up, the sequence with heads is uniformly distributed over all sequences, which can be bijectively mapped to . We apply the randomness extraction function for uniform random variable in theorem 1.10.23 to extract on average fair bits. Moreover, by lemma 1.10.18, we bound the number of fair bits within the range of , where .
We now formalize the derivation of the bounds for the number of fair bits extracted from flips of biased coins with probability coming up heads. Let be a random variable representing the number of heads flipped, and let be the random variable representing the bits extracted by the extraction function, then by conditional expectation,
and by theorem 1.10.23,
Now consider the fact that the number of heads concentrates around , to lower bound the average number of fair bits extracted, we consider only , where . By monotonicity,
| (1.11) |
By standard Chernoff’s bound, let and ,
Alternatively, by KL Divergence driven Chernoff’s bound in 1.4.4,
Moreover, we can further lower bound eq. 1.11 by theorem 1.10.23, that
| (1.12) |
Therefore,
where the last inequality holds by eq. 1.12. We conclude that, for any , we have
for sufficiently small and sufficiently large .
We now show no extraction function on average obtains more than fair bits. Suppose input bits occurs with probability , and the extraction function outputs corresponding to input , then by definition 1.10.20,
that conditioned the output number of bits from the extraction function is , the probability of outputting is . Hence, for a fixed with bits, the probability of outputting is immediate by the probability of outputting bits,
Moreover, since
then , giving an upper bound on . Therefore,
where the second inequality is by upper bounding the output length, and the last equality holds by lemma 1.10.7. ∎
Consider the extraction function whose input is a sequence of independent flips of a coin that comes up heads with probability . Break the sequence into pairs, such that , and consider the pairs in order. If is heads and tails, it outputs a 0; if is tails and heads, it outputs a 1; otherwise, move up to the next pair.
Show that the bits extracted by are independent and unbiased, and the expected number of bits extracted is
We derive another set of flips from : Let be 1, and repeat until : If is both heads, is heads and increment and ; if is both tails, is tails and increment and ; otherwise increment .
The intuition here is to take some randomness cannot use effectively and reuse it. Show that the bits produced by running over are independent and unbiased, and further argue that they are independent of those produced by running over .
We derive another set of flips from : is heads if is both heads or tails, otherwise tails. Show that the bits produced by running over are independent and unbiased, and further argue that they are independent of those produced by running over , and .
After we run over and , we can recursively derive two further sequences from each of the sequences, namely and , in the same way, run on those, and so on.
Let be the average number of bits extracted for each flip in the sequence , in the limit as the length of the sequence goes to infinity. Let , and argue that satisfies the recurrence
Show that satisfies the same recurrence as .
First, for the bits directly extracted by , since the are mutually independent, and for , the biased coin tosses are mutually independent, each output bit by is independent of the others. The probability of a bit sampled by being 1 is the same as the probability of a bit sampled by being 0; both are , requiring a head and a tail in , so the bits are unbiased. Since a bit is output with probability by , by linearity of expectation, the expected number of bits extracted is .
To show the bits produced by over are independent and unbiased, we first show are independent. Since are independent, then are independent. Since the retained are both heads or both tails, then are independent, so are the output by over . To show the outputs by from are unbiased, since each can be modeled by a biased coin with probability coming up heads, applying the same argument for producing unbiased bits over , the outputs by over are unbiased.
To show the bits produced by over are independent of the bits produced by over , observe that the former uses only the same-faced , while the latter uses only the distinct-faced . In the latter case, HT and TH are equally likely, and the corresponding are independent across index . In the former case, the same-faced are independent across index , and the values of these are independent of the orders of the distinct-faced . Hence, the bits extracted by over are independent of the bits extracted by over .
To show the bits produced by over are independent and unbiased, we show are independent of each other, as are independent. Each can be modeled by a biased coin coming up heads with probability , then the bits extracted by are independent and unbiased.
To show the bits produced by over are independent of the bits from over , for a bit produced by over , supposing it is extracted through , which are determined by , then it is possible that the bit overlaps with the bits extracted over and/or . Since the are independent of each other, then all the other bits extracted over are independent of the bit extracted over . Conditioned that the bit extracted over overlaps with the bit extracted from , then can be HT or TH, the bit extracted from can be 0 or 1, and is tails regardless, and thus the bit extracted over is 1, which is independent of the bit extracted from . Symmetrically, if the bit extracted over overlaps with the bit extracted over , the same argument applies, that the bit extracted over is 0.
To show the bits produced by over are independent of the bits from over , the strategy is similar to the last independence argument. Supposing a bit is extracted through , determined by , then by being independent of each other, it suffices to only argue that the bit is independent of the bit extracted from using a that comes from or . Supposing is overlapped, regardless of being HH or TT, is heads, and the bit extracted from is 0, independent of the bit extracted using . Symmetrically, if the overlap is with the second coordinate, then that coordinate is heads, and the bit extracted from the pair is 1.
For , the biased coin comes up heads with probability , and the expected number of retained is . For , the biased coin has probability of coming up heads. For directly extracting from , the expected number of bits extracted is . Thus, when , the average number of bits extracted per flip approaches
To show that , we have
and finally
∎
1.10.29 is called the Peres extractor [Von51, Eli72, Per92]. The von Neumann method [Von51] extracts the bits pairwise from , but throws away the randomness from the structure of the bit string, and there are two leftover sources of randomness: One is the structure of both heads or both tails, which gives , and the other is the structure of being equal or not, which gives . The von Neumann method took care of the symmetry case of a head and a tail, and the two leftovers are taken care of in the Peres extractor.
Suppose we only have a biased 6-sided die with entropy instead of a fair coin. Modify the extraction function in theorem 1.10.28 so that it extracts, on average, almost random bits per roll from a sequence of die rolls.
We consider a variant construction based on theorem 1.10.28, where we roll the die times. Conditioned on seeing occurrences of the face, the sequence is uniformly distributed over all
sequences. We apply the theorem 1.10.23 extractor to extract the random variable uniform over .
Let be the random variable for the number of times the face comes up, be the probability that the face comes up, and be the random variable for the bits extracted. Define
By conditional expectation,
where the second inequality holds by union bounding, and the third inequality holds by theorem 1.10.23.
We now consider a variant of lemma 1.10.18 for the biased 6-sided die.
For integers in and , we have
where .
We begin with the upper bound. Since
then we complete the upper bound proof by
The lower bound is trivial for . Let be the subset of indices such that . By lemma 1.10.17,
and therefore
By AM-GM inequality,
then
On the other hand, since each for , then
and for the coefficient
which completes the proof. ∎
By the KL-divergence-driven Chernoff bound in 1.4.4,
Together with lemma 1.10.32,
where . Since is continuous over , there exists a constant as , such that
proving the lower bound.
To show an extraction function extracts on average at most fair bits, the idea is similar to the theorem 1.10.28. Let be the random variable of the outcome of die rolls, then for an input-output pair with ,
the second inequality was discussed in theorem 1.10.28 from the conditional probability and definition 1.10.20, then
By conditional expectation,
where the last equality is from lemma 1.10.7, and we complete the proof. ∎
Consider a biased coin that comes up heads with probability . Let HH map to , HT map to , TH map to , and TT map to . Then on average, the number of bits we use for each pair of flips is
This is an example of compression, as on average a biased coin flip can be represented with less than 1 fair coin flip.
Moreover, it is worth noting that this construction allows for breaking a sequence of biased coin flips into pairs, and concatenating the compression results. The result can be uniquely decoded by simply parsing from left to right. For example, 011110 stands for HHTTHT. The construction preserves the property that the bit representation of any pair of coin flips is not a prefix of the bit representation of any other pair of coin flips.
Representations with this property are called prefix codes.
We wish to compress a sequence of i.i.d. random variables , where each takes on one of possible values, into a prefix code like example 1.10.33. We map the value among all values to a codeword, which is a sequence of bits. Prove that the must satisfy
Consider a binary tree of depth , then the length of a codeword is the distance to the root, and a codeword is a prefix of the path to leaves: 0 stands for the left subtree, and 1 stands for the right subtree. For a codeword of length , there are leaves whose root-to-leaf paths begin with that codeword. These sets of leaves are disjoint, since otherwise one codeword would be a prefix of another codeword, contradicting the prefix code property.
Now that every leaf in the binary tree is owned by at most 1 codeword, the number of owned leaves are
which completes the proof. ∎
A compression function takes as input a sequence of coin flips, given as an element of , and outputs a sequence of bits, such that each input sequence of flips yields distinct output sequences.
We consider the case of compressing the outcome of a sequence of biased coin flips, similar to theorem 1.10.28.
Suppose a coin comes up heads with probability . For any constant and sufficiently large,
There exists a compression function such that the expected number of output bits on an input sequence of independent coin flips is at most .
The expected number of output bits by any compression function on an input sequence of independent coin flips is at least .
We begin with the upper bound, with an explicit construction of a compression function.
Let be a sufficiently small constant with . On input a sequence of independent coin flips, output the first bit as a flag bit, 0 when the input has at least heads, 1 otherwise. When the first flag bit is 1, the compression function translates a head to a 1, and a tail to a 0, which requires bits to output. When the first flag bit is 0, let the number of coin flip sequences be , and map a sequence to a value in .
If there are less than heads, we upper bound the probability using Chernoff’s bound by
where , and .
If there are at least heads, we upper bound the number of coin flip sequences by
where the second and the third inequality holds by , and the fourth inequality holds by corollary 1.10.19. Including the flag bit, it takes at most bits for the sequences with at least heads.
Let be the number of output bits of the compression function. The upper bound of its expectation is
where the is a constant similar to the one in 1.10.31, since is continuous and monotone over , as . For sufficiently small, when is sufficiently large, the first boxed term approaches to 0, and the second boxed term is upper bounded by for some constant .
We now show the lower bound. It suffices to consider a compression function minimizing the expected output number of bits. We observe a fact: if an input string is more likely than , then the output number of bits on input should be at least as long as the one of . Otherwise, swapping the two outputs decreases the expectation. Since the probability of deriving a specific sequence with heads is , it is more likely for a string to have more heads. Hence, by Chernoff’s bound,
where , , and sufficiently small so that .
Another fact: for a random variable uniform over , on average any compression function outputs at least bits. By mapping to , and let be the first integer that , hence . Hence, the average output bit of the compression function is at least . Averaged over sequences with heads, the compression function outputs at least
bits. By the ordering of an optimal compression function, sequences with fewer heads have average output length at least this large. The expected number of output bits of the compression function is lower bounded by ignoring the strings with more than heads, then
By choosing a sufficiently small , and then a sufficiently large , we can lower bound the expected number of output bits to . ∎
Suppose we only have a biased 6-sided die with entropy instead of a fair coin. Modify the compression function in theorem 1.10.37 so that it compresses a sequence of die rolls to almost bits on average.
We begin with the lower bound by reusing lemma 1.10.32 and the ideas in 1.10.31 and theorem 1.10.37. Let be the random variable for the number of times the face comes up, be the probability that the face comes up, and be the random variable for the bits of the compression outcome. Recall the defined in 1.10.31, by union bound over Chernoff’s bound in 1.4.4,
Moreover, by previous discussion in theorem 1.10.37, a compression function minimizing the expected output bits outputs fewer bits on inputs that are more likely than the others, then let be the face counts that
and conditioned on , the inputs are uniform over sequences, hence within the , the compression function outputs at least
where the second inequality holds by lemma 1.10.32, and . Since this choice maximizes the probability of each individual sequence with these counts, every other sequence in is less likely, so its output length is at least the average output length over this type. Then
where is a constant such that when as is continuous over . Hence, for a sufficiently small , and a sufficiently large , there exists such that the lower bound is proved.
Now for the upper bound, we follow the main architecture of theorem 1.10.28, by introducing a flag bit separating the case where the dice rolling sequence is not in and the case where the dice rolling sequence is in . If some count deviates too far, then output in its vanilla form where each face is represented in 3 bits. Otherwise, we count the number of possible sequences in to be , and map a sequence to a value in , and we have
where maximizes over , the last inequality holds by lemma 1.10.32, and . Hence,
where is a constant such that when as is continuous over . Hence, for a sufficiently small , and a sufficiently large , there exists such that the upper bound is proved. ∎
We wish to compress a sequence of i.i.d. random variables , where each takes on one of values. The value occurs with probability , where . The compressed result follows. Let , and let the codeword to be the first bits of . Show that it is a prefix code example 1.10.33. Let be the average number of bits used for each . Show that .
We observe that, for the binary representation of , the first positive bit is the bit. Since the first positive bit is the bit for any value in , proving the claim. Moreover, as , then , and it suffices to show that any pair of neighboring adjacent codewords does not violate the prefix code property.
On a pair of and , since , the first bits are distinct for the and codeword, proving the prefix code property.
Now for the average number of bits output by the compression function,
as . Moreover, by , then
and we proved . ∎
Flip a fair coin repeatedly times until the first heads occurs. Find .
Now a friend flips the fair coin repeatedly until the first heads occurs. One wants to determine how many flips required, and is allowed to ask a series of yes-no questions of the following form: give the friend a set of integers, and the friend answers “yes” iff the number of flips is in the set, and “no” otherwise. Find a strategy such that the expected number of questions asked before determining the number of flips is . Give an intuitive explanation of why one cannot come up with a strategy that would ask fewer than questions on average.
follows geometrically distributed random variable with success probability , then , and
Intuitively, on the question, ask if , then the number of questions is same distributed as . For a strategy, it is impossible to have a same terminating transcript of the yes-no answers from distinct values of . Moreover, a terminating transcript cannot be continued, as it converges to a single value, ruling out other values, namely other suffixes. Hence, they form a prefix code. By 1.10.39, at least questions are needed on average. ∎
Arithmetic coding is a standard compression method. In the case where the string to be compressed is a sequence of biased coin flips, it can be described as follows. For a sequence of i.i.d. Bernoulli trials with success probability . The sequences can be ordered lexicographically, so that for , we say if and in the first coordinate that . If is the number of zeroes in the string , define , and .
Suppose we are given sequentially, explain how to compute in time.
Argue that are disjoint subintervals over , show that can be represented by any point in , and a codeword can be chosen in the interval by the first bits, such that the codeword is a prefix code.
On a codeword, show how to decompress to determine the corresponding .
Using a Chernoff’s bound, argue that is close to with high probability.
To derive in , count : when , move forward; otherwise, add to , where is the probability corresponding to . Eventually, one sub-hypercube at a time, and
Let be defined as adding by 1 to the number with binary representation , then is monotonically increasing for each , such that are disjoint, as , and .
By 1.10.39, the first positive bit of is , then there exists a dyadic interval of length in , as . The codeword can be chosen by the lower bound of the dyadic interval, requiring bits. If a codeword is a prefix of a codeword , then in a dyadic interval of , while the exterior intervals are disjoint, which is a contradiction.
Decoding the codeword is in the reverse order of deriving : Count , and let the left endpoint . If , the bit is 1, , and add to ; otherwise, the bit is 0 and .
Let be the number of tails in , then , and
such that . If , deterministically. Otherwise, as for independent being 1 on the flip, we can apply Chernoff’s bound, such that
∎
Consider the following type of channel.
The input to a binary symmetric channel with parameter is a sequence of bits and the output is a sequence of bits such that independently for each .
Consider encoding functions that bring redundancy to help protect against the introduction of errors.
A encoding function takes as input a sequence of bits and outputs a sequence of bits. Conversely, a decoding function takes as input a sequence of bits and outputs a sequence of bits.
Alice wants to send Bob the result of a fair coin flip over a binary symmetric channel that flips each bit with probability . To avoid errors in transmission, she encodes heads as a sequence of zeroes and tails as a sequence of ones.
Consider the case where . For each possible received sequence of 3 bits, determine the probability that Alice flipped a heads conditioned on Bob receiving that sequence.
Bob decodes by examining the 3 bits. If two or three of the bits are 0, Bob decides the corresponding coin flip was heads. Prove that this rule minimizes the probability of error for each flip.
Argue that, for general , Bob minimizes the probability of error by deciding the flip was heads if at least of the bits are 0.
Give a formula for the probability that Bob makes an error that holds for general .
Let , , be the number of zeroes of the , be a fair coin outcome, tails on , otherwise heads, and be the received bits. Hence,
and by Bayes’ Rule,
Consider decoding the flip: if at least bits are 0, then we have heads; otherwise we have tails. Then
Since , then for , which proves the error minimizing when . ∎
For a binary symmetric channel with parameter and for any constant , when is sufficiently large, for any and a uniformly distributed -bit input message, there exist encoding and decoding functions such that the probability the receiver fails to obtain the correct message is at most .
We begin by describing a probabilistic algorithm constructing codewords in , one for each message, and the inefficient encoding and decoding functions.
Let be the distinct codewords sampled uniformly at random from . The encoding function is a lookup table mapping the -bit inputs to their corresponding codewords. The decoding function maintains the look up table, iterates through the codewords, and checks if a codeword differing from the received bits in between bits. If there is only one codeword in this interval, output the corresponding -bit message; otherwise, decoding function fails and outputs . Since the decoding runtime is exponential in , the decoding is not efficient, and we are not requiring it to be efficient.
When it comes to decoding failure or failure to obtain the correct message, it falls into 2 cases:
The noisy channel made less than or more than errors.
There are other codeword(s) that are differing from the received bits in between bits.
The goal is to prove the existence of a set of codewords, whose probability of failures above is at most . The strategy here is probabilistic method, via averaging argument lemma 1.6.12, if probability of failures above on average among all is at most , then there must exist a set of codewords whose failure probability is at most . The first failure event can be upper bounded via concentration inequalities, while the second failure event can be upper bounded via counting argument.
We continue by introducing notation and random variable formulations. Let be the Hamming weight of for the number of positions and differing from each other. We say pair has weight
corresponding to the probability of being altered into by the binary symmetric channel. Let be the sets of bits that decodes to , which are bits that are close to , and are far from other . Let be the set of probabilities that fails in decoding correctly, where
It can also be expressed in a way that, let be an indicator 0/1 random variable that is 1 iff , then
Note that, both and are random variables dependent on .
WLOG, we analyze with respect to , as by symmetry the following results applies to other . Write
| (1.13) |
where , and .
For the first term, let be independent Bernoulli trials with success probability , then is the random variable for the number of bits flipped by the channel, and by Chernoff’s bound, for ,
| (1.14) |
where and . For any threshold , there is sufficiently large such that .
For the second term, consider the following symmetry: On a set of codewords , we have such that , and . Then can be obtained by XORing with elements in , and the can be expressed by
where , and . The symmetry holds for the claim in the first term, while the symmetry allows us to argue the second term with respect to , then
is a random variable depending on . Moreover, for a , averaging over ,
Supposing we have
then the second term can be upper bounded by
We continue by upper bounding the number of possible bits around , such that we upper bound the second term:
threshold is chosen such that , and the second inequality holds by corollary 1.10.19. The probability of a particular codeword with having a Hamming distance to causing a decoding failure, when is sent is at most
where is a constant similar to the one appearing in theorem 1.10.28 and theorem 1.10.37. Union bounding over all other codewords, the probability of other codeword failing decoding is upper bounded by
| (1.15) |
where the last inequality holds by . Since eq. 1.15 approaches 0 as with , then it is at most on a sufficiently large , and by symmetry, we conclude
| (1.16) |
Combining eqs. 1.13, 1.14 and 1.16, on a sufficiently large , the probability of decoding incorrectly is
Since the -bit message is uniform over , the probability of decoding incorrectly is averaging over all by
By an averaging argument lemma 1.6.12, there must exist a set of codewords , such that
∎
The decoding failure probability in lemma 1.10.45 is obtained by averaging over all -bit messages and all possible codeword samplings. We will obtain a stronger result than lemma 1.10.45 in theorem 1.10.46: for all ,
holds simultaneously.
For a binary symmetric channel with parameter and for any constants , when is sufficiently large:
for any , there exist encoding and decoding functions such that the probability the receiver fails to obtain the correct message is at most for every -bit input message; and
there are no encoding and decoding functions with such that the probability decoding correctly is at least for a -bit input message chosen uniformly at random.
WLOG we let be sorted in increasing order of . Hence, for , each has , or otherwise we contradict by
In this way, we prove there exist encoding and decoding functions for bits messages over codewords, and the probability of each codeword being decoded incorrectly is simultaneously at most , when . Since and can be any constant, the first part of the proof is completed.
Having the first part of the proof finished, we move on to the second part of the proof, which is the converse of lemma 1.10.45. We begin by an observation in lemma 1.10.45 to build an intuition: The decoding function maps the received bits to the only one codeword within many errors, and the number of such bits is lower bounded by
where the last inequality holds by corollary 1.10.19. Since there are possible messages, and , on a sufficiently large ,
Hence, given and sufficiently large, conditioned that the number of bits flipped by the channel is within , there is no such set of codewords always decode successfully, namely it is getting too dense, such that in the “unique decoding” range defined in lemma 1.10.45, there are more than 1 valid codeword.
More specifically, we can show how to rule out lemma 1.10.45. Let be the set of received -bit strings that are correctly decoded to the codeword in lemma 1.10.45, then the probability of successful decoding is
by averaging over all messages. Since for any , it is within many bit flips from ,
then the averaging probability is upper bounded by
| (1.17) |
where the last inequality holds by , so conditioned that
| (1.18) |
then when is sufficiently large, the probability is upper bounded by .
We proceed by analyzing the general case. For the set of codewords , let be the set of bits that are uniquely decoded to , and , be defined as follows: , and . Then the probability of successful decoding is
where the first term is upper bounded by Chernoff’s bound with the same bound in eq. 1.14, and the second term is upper bounded in the same procedure of eq. 1.17, conditioned that eq. 1.18 holds. ∎
Consider the following channel. The sender can send a symbol from , the channel introduces errros: when the symbol is sent, the recipient receives with probability , or with probability . The errors on each symbol are mutually independent of each other.
Define the encoding and decoding functions for this channel by: A encoding function maps a number in into a sequence in . A decoding function maps a sequence in into a number in .
There are encoding and decoding functions with zero probability of error, as the decoder maps 1 and 4 to 0, and maps 0 and 2 to 1. Hence at least 1 bit can be sent without error per channel use. Show that:
There are encoding and decoding functions with zero probability of error. Argue that more than one bit of information can be sent per use of the channel.
If there exists encoding and decoding functions with zero probability of error, then .
Consider the encoding and decoding function. The encoder encodes with a pair . The decoder performs by the following lookup table
| encode | received | decode to |
|---|---|---|
| 0 | ||
| 1 | ||
| 2 | ||
| 3 | ||
| 4 |
.
The encoding scheme can also be instantiated by 999 The story is, I brute-forced adding constant, additive inverse, multiplicative inverse, and finally scalar multiplication. .
In fact, the channel operates over a cycle graph , mapping to each with probability . Moreover, since we want a set of codewords avoiding overlapping received symbols on the decoding side, we can construct the following graph for the single coordinate encoding and decoding, by pairing up symbols bringing “confusion” after transmitted through the channel. Hence, is an independent set of size 2 over the illustrated as folows, and it happens to be the codewords for encoding and decoding.
On a pair of confusion graphs, we want to define a graph product such that any neighboring brings overlaps on the decoding side. On a pair of and , they are adjacent iff
, and are adjacent on confusion graph;
, and are adjacent on confusion graph;
and , and are both adjacent on confusion graph.
We then define the symbol such that is illustrated as follows:
The new codewords form an independent set of size 5 on , each is ordered as so that adjacency corresponds to difference .
When it comes to general encoding and decoding functions, supposing it exists, then there must be , such that for each of the values, the decoding boundary is , and the total area of decoding is no more than , or confusion must exists, and hence
∎
A binary erasure channel transfers a sequences of bits. Each bit either arrives successfully without error or fails to arrive, and is replaced with a “?” symbol. Failure occur independently with probability . Define encoding and decoding functions for BEC similar to ones in the BSC, except that . Prove that, for any and any constants , if is sufficiently large, then there exists encoding and decoding functions with such that the probability that the receiver fails to obtain the correct message is at most for every possible -bit message.
The proof architecture is similar to lemmas 1.10.45 and 1.10.46, with a same setup of the randomized codewords, and the same encoding function. The decoder finds a codeword that has within number of “?”, and the other symbols must match. If there is one such codeword, output the corresponding message; otherwise, reject by .
We reuse a few notations in lemma 1.10.45: Applying Hamming weight over and where , and overrides to a symbol in . Then the weight defined in between and is
Let be the set of decodable to , be the set of probabilities that fails in decoding correctly, where
It can also be expressed in the way that, let be an indicator 0/1 random variable that is iff , then
by letting and .
WLOG we analyze , as by symmetry the same analysis hold for all other .
The first term is bounded in the same way as eq. 1.14 via Chernoff’s bound. Let be the independent Bernoulli trials with success probability , then is the number “?”s, for ,
For any threshold , there is sufficiently large such that .
It suffices to argue with respect to for the second term by the same symmetry discussed in lemma 1.10.45, then the random variable
is dependent on . For , averaging over ,
Supposing we have
then the second term can be upper bounded by
We continue by upper bounding the number of possible bits to derive by , then the probability of a particular codeword with being able to produce is at most . Union bounding over all other codewords, the probability of other codeword failing decoding is upper bounded by
where the last inequality is by . Since as if , then it is at most on an . By symmetry, we conclude
Combining the separated cases, we have
By symmetry and linearity of expectation,
By the same ranking argument in theorem 1.10.46, there exists a set of codewords with at least codewords with , and we choose the half of the set of codewords with small , and we complete the proof. ∎
In lemmas 1.10.45 and 1.10.46, we let decoder find a codeword with Hamming distance to the bits received within . Instead, let decoder find the codeword by looking for the codeword with least number of differences, and break ties arbitrarily. Show how to modify the proof for lemmas 1.10.45 and 1.10.46 to obtain a similar result.
Just use the Hamming ball of radius around the codeword. The “too far” Chernoff case still decays exponentionally fast, and the “in radius” case should approach 0 as . ∎