- 2080 Chaitra · 8 marks
Huffman coding of "Mississippi is missing"
Short answer
For 'Mississippi is missing', counts: i=7, s=7, space=2, m=2, p=2, g=1, n=1. Huffman tree yields average length 2.455 bits/symbol, entropy 2.400 bits/symbol, efficiency 97.79%. Total message encoded in 54 bits vs 66 bits with fixed 3‑bit code.
Encode the message "Mississippi is missing" using weighted Huffman code and calculate transmission efficiency.
Weighted Huffman coding builds the Huffman tree from the actual symbol counts (weights) in the message. Assumptions: case is ignored, and the space is counted as a symbol. The message "mississippi is missing" has 22 symbols and 7 distinct symbols: i = 7, s = 7, space = 2, m = 2, p = 2, g = 1, n = 1.
Huffman tree construction
Huffman procedure: list the symbols by probability. Repeatedly combine the two least probable entries into one node whose weight is their sum, until only one node is left. In each merge, the first group listed gets bit 0 and the second group gets bit 1. Each symbol's code word is read from the root down to that symbol.
- {n} (1) + {g} (1) → 2
- {m} (2) + {space} (2) → 4
- {n, g} (2) + {p} (2) → 4
- {n, g, p} (4) + {m, space} (4) → 8
- {s} (7) + {i} (7) → 14
- {s, i} (14) + {n, g, p, m, space} (8) → 22
(22)
0 / \ 1
(14) (8)
0/ \1 0/ \1
s:7 i:7 (4) (4)
0/ \1 0/ \1
(2) p:2 m:2 sp:2
0/ \1
n:1 g:1
Code table
| Symbol | Count | Code | |||
|---|---|---|---|---|---|
| i | 7 | 7/22 = 0.3182 | 01 | 2 | 0.6364 |
| s | 7 | 7/22 = 0.3182 | 00 | 2 | 0.6364 |
| space | 2 | 2/22 = 0.0909 | 111 | 3 | 0.2727 |
| m | 2 | 2/22 = 0.0909 | 110 | 3 | 0.2727 |
| p | 2 | 2/22 = 0.0909 | 101 | 3 | 0.2727 |
| g | 1 | 1/22 = 0.0455 | 1001 | 4 | 0.1818 |
| n | 1 | 1/22 = 0.0455 | 1000 | 4 | 0.1818 |
Efficiency
Average code length:
Here the numerator is the total number of bits in the encoded message: bits.
Entropy:
Efficiency:
Redundancy .
A fixed-length code for 7 symbols needs bits/symbol (). Huffman saves 18.18% of the bits.
Answer: bits/symbol, bits/symbol, transmission efficiency η ≈ 97.79%. The whole message takes 54 bits, compared with 66 bits using a 3-bit fixed code.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Types of noise; Shannon-Fano and Huffman coding efficiency · Communication Systems, chapter 6
- Coding efficiency: binary, Shannon-Fano and Huffman · Communication Systems, chapter 6
- Information rate and coding efficiency: BCD vs Huffman · Communication Systems, chapter 6
- Huffman coding of "Engineer Ko Betha Arulai Ke Thaha" · Communication Systems, chapter 6
- Variable length coding; entropy and fixed code efficiency · Communication Systems, chapter 6
- Source vs channel coding; Huffman for five symbols · Communication Systems, chapter 6
- Weighted Huffman encoding and decoding · Data Communication, chapter 8
- Huffman code for eight symbols (1/2 ... 1/128) · Data Communication, chapter 8
- Line coding: properties; encode 01001100011 · Data Communication, chapter 5
- Huffman coding of a sentence (Khoji Rahechha) · Data Communication, chapter 8