Question: (i) What is an optimal Huffman code for the following set of frequencies based on the first 8 Fibonacci numbers? a : 1, b :
(i) What is an optimal Huffman code for the following set of frequencies based on the first 8 Fibonacci numbers? a : 1, b : 1, c : 2, d : 3, e : 5, f : 8, g : 13, h : 21. (ii) Can you generalize your answer to find the optimal code when the frequencies are the first n Fibonacci numbers? (iii) Under a Huffman encoding of n symbols with frequencies f1, f2, . . . , fn, what is the longest a codeword could possible be? Give an example set of frequencies that would produce this case. (iv) Suppose that a data file contains a sequence of 8-bit characters such that all 256 characters are about equally common: the maximum character frequency is no more than twice the minimum character frequency. Prove that Huffman coding in this case is no more efficient than using an ordinary 8-bit fixed-length code.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
