In Huffman’s coding, if the symbol A has probability 0.3, B has probability…
2018
In Huffman’s coding, if the symbol A has probability 0.3, B has probability 0.15, C has probability 0.1, D has probability 0.25 and E has probability 0.2, then the minimum number of bits required to represent all the symbols together is —
- A.
14
- B.
11
- C.
12
- D.
15
Attempted by 315 students.
Show answer & explanation
Correct answer: C
Using Huffman Coding : Arrange probabilities in ascending order: C(0.1), B(0.15), E(0.2), D(0.25), A(0.3)
Combine lowest probabilities step by step: C + B = 0.25
E + (C+B) = 0.45
D + A = 0.55
0.45 + 0.55 = 1.0
Assign code lengths from the Huffman tree: A → 2 bits
D → 2 bits
E → 2 bits
B → 3 bits
C → 3 bits
Total bits required: 2+2+2+3+3=12