Selected Problems on Huffman Code 01 - Binary Encoding
Selected Problems on Huffman Code 01 - Binary Encoding
Eltantawi
1. Obtain the Huffman Code for the following:
Character a b c
Frequency 3 1 2
a) Find a Huffman code for the character set using the given frequencies
b) Compute the weight of the code. c) Encode the message “aabac”.
d) Decode the message 01001001.
7. Use Huffman coding to encode these symbols with given frequencies: a: 0.20,
b: 0.10, c: 0.15, d: 0.25, e: 0.30. What is the average number of bits required to
encode a character?
8. Use Huffman coding to encode these symbols with given frequencies: A: 0.10,
B: 0.25, C: 0.05, D: 0.15, E: 0.30, F: 0.07, G: 0.08. What is the average number of
bits required to encode a symbol?
12. Use the table given below to draw the Binary Encoding Tree form which the
given table is constructed.
Character A B C D E F
Code 000 001 01 10 110 111
Probability 0.1 0.2 0.1 0.2 0.3 0.1
12.2 Does the given code has the Prefix Property? …………………………………………………………………………………………………………………………
12.3 Write the Huffman's binary code for each of the following words:
CAD & FACE
………………………………………………………………………………………………………………………… …………………………………………………………………………………………………………………………
13.1 P(A) = 0.10 & P(B) = 0.35 & P(C) = 0.05 & P(D) = 0.05
P(E) = 0.05 & P(F) = 0.05 & P(G) = 0.15 & P(H) = 0.2
13.2 P(A) = 0.15 & P(B) = 0.10 & P(C) = 0.05 & P(D) = 0.20
P(E) = 0.20 & P(F) = 0.20 & P(G) = 0.05 & P(H) = 0.05
15. Construct the binary tree with prefix codes representing these coding
schemes.
a) a: 11, e: 0, t : 101, s: 100
b) a: 1, e: 01, t : 001, s: 0001, n: 00001
c) a: 1010, e: 0, t : 11, s: 1011, n: 1001, i: 10001