Information Theory and Coding Basics
The 36 characters made up of the 26 capital letters and the 10 digits are to be distinguished by bit strings all of the same length (a fixed-length code). Which of the following is the minimum number of bits needed per character?
- A5 bits
- B6 bits
- C36 bits
Show answer and explanation
Answer: B. 6 bits
n bits can distinguish 2ⁿ cases, so we need the smallest n with 2ⁿ ≥ 36. 2⁵ = 32 is not enough and 2⁶ = 64 is, so the answer is 6 bits. It is also log₂ 36 ≈ 5.17 rounded up to a whole number.
- A. 5 bits can distinguish only 2⁵ = 32 cases, too few for 36 characters.
- B. Correct. 2⁶ = 64 ≥ 36.
- C. 36 bits is the case where each character gets its own bit and exactly one bit is 1 (one-hot), which is not the minimum.
Continue: 9 more Information Theory and Coding Basics questions