Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

If we compressed our data using Huffman coding, but had to send this code word d

ID: 3727174 • Letter: I

Question

If we compressed our data using Huffman coding, but had to send this code word dictionary along with the compressed data, then we obviously only get an advantage if the Huffman coded data saves us at least as many bits as we’re going to have to add to define the dictionary. If Huffman coding generated a file (without the code word dictionary) that is 25% smaller than the original, how big would the original text file have to be before it was worth Huffman coding, if we wanted to send the code word dictionary along with the compressed data?

Explanation / Answer

Answer)

We have to send compressed data with Huffman coding. If we want to send the data code word dictionary along with the compressed data then the advantage will be if the Huffman coded data saves us at least as many bits as we’re going to have to add to define the dictionary. Correct.

So when we generate a coding generated compressed file which is 25% smaller than the original, it saves us 25% space. If we want to save the compressed file along with the code word dictionary, then the Huffman coding won't be a good logic if it occupies the 25% space freed up by data compression. Thus anything less than 25% of the data word dictionary would be good.

This goes as,

Size of Compressed data using Huffman coding + Seize of code word dictionary < Uncompressed data size

If the above is true then it is worth for Huffman coding.

Otherwise there is no benefit for Huffman coding.

So even if the encoded message is 99% that'll also save 1% size.

The more savings the better.

Whether to use or not depends upon the usage and the requirements of the system.

Considering a file size 100bits, it'll have to be less than 99 bits after encoding and code word dictionary to be worth for Huffman coding.