The Exercise
A source emits letters from a finite alphabet , independently, each equal to the letter with probability , so that a block of letters has probability . Each block is to be written as a string of bits without error: two different blocks never receive the same string, though the strings may differ in length. The code numbers the typical blocks apart from the others and spends one bit to say which list a block is in. The exercise is to show that for any rate above the entropy of the source in bits per letter, the tolerance that defines typicality can be chosen, and the blocks taken long enough, so that the expected length of the string is at most bits.
The Entropy and the Code
The Shannon entropy of a distribution on a finite alphabet is the real number (1)✦ with the natural logarithm, so that is measured in nats and is the entropy in bits.
Fix a block length and a tolerance , and let be the set of blocks of length with within of , the blocks typical with tolerance .
The typical sequence code sends a block to the string of bits (2)✦ where is a string of fixed length that numbers among the typical blocks, with , and is a string of fixed length that numbers among all blocks, with . The length of the codeword, bits for a typical block and bits for any other, is written .
The Claim
Theorem 1. Let be a probability distribution on a finite alphabet and a rate above its entropy in bits, . Then there are a tolerance and a block length such that for every the code gives distinct blocks distinct codewords and its expected length obeys (3)✦
What Is Checked
The claim is stated over the Shannon entropy (1), against which the rate is measured, and over the code of (2).