Consider the following tree for a prefix code A text file co

Consider the following tree for a prefix code: A text file contains only characters from the set {a, b, c, d, e, f}. The frequency of each letter in the file is: 5% 5% 10% 15% 25% 40% What is the average number of bits per character used in encoding the file? Is there a prefix tree for the set {a, b, c, d, e, f} that would result in fewer bits per character on average for the given frequencies of the characters?

Solution

a.) avarage number of bits per char. = [0.5 *2 + 0.5 *2 + 0.1*3 + 0.15*3 + 0.25*3 + 0.4*3]/5 = 0.94

 Consider the following tree for a prefix code: A text file contains only characters from the set {a, b, c, d, e, f}. The frequency of each letter in the file i

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site