135k views
2 votes
Say that the input for an Huffman coding contains 256 letters. Each appearing the the same number of times. (a) If we choose to code all letters by codes of the same length, what is the number of bits required

User Synthomat
by
6.8k points

1 Answer

4 votes

Complete Question

Say that the input for an Huffman coding contains 256 letters. Each appearing the the same number of times.

(a) If we choose to code all letters by codes of the same length, what is the number of bits required?

(b) Is the Huffman code better than the code of the first item?

Answer:

a


N = 8 bits

b

Huffman coding.Hence for this question Huffman's code is equivalent to the code of the first item

Explanation:

From the question we are told that

The input for an Huffman coding contains n = 256 letters

Generally in the case where it has been decided to code all letters by code of the same length , the of bits required is mathematically represented as


N = log _2 {256}

=>
N = 8 bits

Generally from the question we are told that each letter appears the same number of time ,in Huffman coding this letter will be on the same level of leaf nodes for the sake of the reason stated above,and what this mean is that the number of bits required for the code of the first item is equal to the number of bit required for Huffman coding.Hence for this question Huffman's code is equivalent to the code of the first item

User MetastableB
by
6.2k points