Dip Part-C PDF
Dip Part-C PDF
1. a) Develop the Huffman coding for the word “COMMITTEE” and determine the average length
and efficiency.
Fixed length code
• Consider the message “COMMITTEE” – C, O, M, I, T, E
• Total no. of symbols 9, No. of unique symbols 6.
C 1 000
E 2 001
I 1 010
M 2 011
O 1 100
T 2 101
• Now obtain the Huffman code for the same message (COMMITTEE).
Symbol Probability
C 1/9
E 2/9
I 1/9
M 2/9
O 1/9
T 2/9
E 2/9
M 2/9
T 2/9
C 1/9
I 1/9
O 1/9
E 2/9 01 2
M 2/9 10 2
T 2/9 11 2
C 1/9 001 3
I 1/9 0000 4
O 1/9 0001 4
• In variable word length:
• “00100011010000011110101”
• Therefore 27>23.
OR
b) Develop the Arithmetic coding to code the string “CAB” with the given table.
Solution:
A 0.9+0.6*0.1=0.96
B 0.96+0.3*0.1=0.99
C 0.99+0.1*0.1=1.0
• Next character is : A
• Range is 0.9 – 0.96 i.e (0.06).
A 0.9+0.6*0.06=0.936
B 0.936+0.3*0.06=0.954
C 0.954+0.1*0.06=0.96