- 2081 Chaitra · 7+2+3 marks
Huffman coding of "Engineer Ko Betha Arulai Ke Thaha"
Short answer
Huffman coding on 33 symbols gives entropy 3.542 bits/symbol, average length 3.576 bits/symbol, efficiency 99.05%. For 'Engineer Ko Betha Ke Ke', substitute symbols from code table: e=000, n=1010, g=01110, i=1100, etc., producing a 83‑bit codeword.
Encode "Engineer Ko Betha Arulai Ke Thaha" using Huffman Encoder and calculate the transmission efficiency. Find the codeword if the message is received as "Engineer Ko Betha Ke Ke".
Assumptions: upper and lower case are treated as the same letter, and the space is counted as a symbol because it must also be sent. The message "engineer ko betha arulai ke thaha" has 33 symbols, with 14 distinct symbols.
Huffman encoding
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.
Merge steps (weights are counts out of 33):
- {g} (1) + {b} (1) → 2
- {o} (1) + {l} (1) → 2
- {i} (2) + {u} (1) → 3
- {n} (2) + {k} (2) → 4
- {t} (2) + {r} (2) → 4
- {o, l} (2) + {g, b} (2) → 4
- {i, u} (3) + {h} (3) → 6
- {t, r} (4) + {n, k} (4) → 8
- {space} (5) + {o, l, g, b} (4) → 9
- {e} (5) + {a} (5) → 10
- {t, r, n, k} (8) + {i, u, h} (6) → 14
- {e, a} (10) + {space, o, l, g, b} (9) → 19
- {e, a, space, o, l, g, b} (19) + {t, r, n, k, i, u, h} (14) → 33
| Symbol | Count | Code | |||
|---|---|---|---|---|---|
| space | 5 | 5/33 = 0.1515 | 010 | 3 | 0.4545 |
| a | 5 | 5/33 = 0.1515 | 001 | 3 | 0.4545 |
| e | 5 | 5/33 = 0.1515 | 000 | 3 | 0.4545 |
| h | 3 | 3/33 = 0.0909 | 111 | 3 | 0.2727 |
| i | 2 | 2/33 = 0.0606 | 1100 | 4 | 0.2424 |
| k | 2 | 2/33 = 0.0606 | 1011 | 4 | 0.2424 |
| n | 2 | 2/33 = 0.0606 | 1010 | 4 | 0.2424 |
| r | 2 | 2/33 = 0.0606 | 1001 | 4 | 0.2424 |
| t | 2 | 2/33 = 0.0606 | 1000 | 4 | 0.2424 |
| b | 1 | 1/33 = 0.0303 | 01111 | 5 | 0.1515 |
| g | 1 | 1/33 = 0.0303 | 01110 | 5 | 0.1515 |
| l | 1 | 1/33 = 0.0303 | 01101 | 5 | 0.1515 |
| o | 1 | 1/33 = 0.0303 | 01100 | 5 | 0.1515 |
| u | 1 | 1/33 = 0.0303 | 1101 | 4 | 0.1212 |
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 14 symbols needs bits/symbol (). Huffman saves 10.61% of the bits.
Answer: average length = 3.576 bits/symbol, entropy = 3.542 bits/symbol, transmission efficiency η ≈ 99.05%.
Codeword for the received message "Engineer Ko Betha Ke Ke"
Each character (including the 4 spaces) is replaced by its code from the table above:
| Part | Code |
|---|---|
| engineer | 000 1010 01110 1100 1010 000 000 1001 |
| space | 010 |
| ko | 1011 01100 |
| space | 010 |
| betha | 01111 000 1000 111 001 |
| space | 010 |
| ke | 1011 000 |
| space | 010 |
| ke | 1011 000 |
Full codeword (83 bits for 23 characters):
000 1010 01110 1100 1010 000
000 1001 010 1011 01100 010
01111 000 1000 111 001 010
1011 000 010 1011 000
The Huffman code is a prefix code, so the receiver can decode this bit stream without separators.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Types of noise; Shannon-Fano and Huffman coding efficiency · Communication Systems, chapter 6
- Information rate and coding efficiency: BCD vs Huffman · Communication Systems, chapter 6
- Coding efficiency: binary, Shannon-Fano and Huffman · Communication Systems, chapter 6
- Huffman coding of "Mississippi is missing" · Communication Systems, chapter 6
- Huffman and Shannon-Fano coding of A0–A4 · Communication Systems, chapter 6
- Source coding aim; Huffman "Kun Mandir Ma Janchhau Yatri" · Communication Systems, chapter 6
- Huffman code for a sentence (Phool ko) · Data Communication, chapter 8
- Dataword vs codeword; error coding techniques · Data Communication, chapter 8
- Huffman coding of a sentence (Khoji Rahechha) · Data Communication, chapter 8
- Line coding: properties; encode 01001100011 · Data Communication, chapter 5