The Lumenary · Advanced undergraduate
Information theory
Name: ______________________
Date: ______________________
You will learn to
- Compute entropy, joint and conditional entropy, relative entropy and mutual information, and prove their basic inequalities from Gibbs' inequality
- Prove Kraft's inequality, construct Huffman codes and prove that the optimal expected length of a prefix code satisfies
- Explain the asymptotic equipartition property and state Shannon's source coding theorem
- Compute the capacity of the binary symmetric and erasure channels, and state the noisy-channel coding theorem and its converse
- Distinguish Shannon information from meaning, and prove that no compressor can shorten every file
- 1.
A source emits one of symbols, all equally likely. What is its entropy, in bits?
- 2.
A binary prefix code already contains the codewords and . What is the largest number of further codewords of length exactly that can be added while keeping the code prefix-free?
- 3.
Which statements about the mutual information of finite random variables are true? (Choose all that apply.)
- A..
- B., with equality if and only if and are independent.
- C..
- D.Applying a function to can increase the information it carries: may exceed .
- 4.
In the proof of Gibbs' inequality we bound . Which fact justifies this step?
- A. for all , applied with and multiplied by .
- B. is increasing.
- C..
- D. for .
- 5.
Build a Huffman code for four symbols with probabilities . What is the expected codeword length, in tenths of a bit (so bits would be )?
- 6.
A binary symmetric channel flips each bit independently with probability . For which values of is its capacity exactly bit per use? (Choose all that apply.)
- A.
- B.
- C.
- D.
- 7.
A start-up claims its lossless compressor shortens every file of exactly bits by at least one bit. What is wrong?
- A.There are such files but only files shorter than bits, so two files would get the same output and could not both be recovered.
- B.Nothing in principle: with a good enough model, every file can be compressed below its entropy.
- C.It is possible, but the compressor would be too slow.
- D.Only files with meaningful content can be compressed, and random files have no meaning.
- 8.
Which Lean statement formalises Kraft's inequality for prefix codes? (
u <+: vmeansuis a prefix ofv.)- A.
(hpf : ∀ u ∈ C, ∀ v ∈ C, u <+: v → u = v) : ∑ w ∈ C, (1 / 2 : ℝ) ^ w.length ≤ 1 - B.
(hpf : ∀ u ∈ C, ∀ v ∈ C, u <+: v → u = v) : ∑ w ∈ C, (1 / 2 : ℝ) ^ w.length = 1 - C.
(hpf : ∀ u ∈ C, ∀ v ∈ C, u ≠ v) : ∑ w ∈ C, (1 / 2 : ℝ) ^ w.length ≤ 1 - D.
(hpf : ∀ u ∈ C, ∀ v ∈ C, u <+: v → u = v) : ∑ w ∈ C, (2 : ℝ) ^ w.length ≤ 1
- A.
- 9.
Write
entropy(probs)returning in bits (skipping zero probabilities), andkl(p, q)returning (also skipping terms with ). The tests check examples from the lesson, Gibbs' inequality on random distributions, and the asymmetry of relative entropy.Computational — Practice