1
$\begingroup$

My lecturer for information theory says that "Huffman coding produces efficient codes but is unsuitable for text files where the letters are represented by a fixed length ASCII code".

I do not understand this statement. I understand that as you change the text file, you'll have to update the probabilities and thus the Huffman table/code itself but I don't think this is what is being referred to here.

Can someone explain?

Thank you so much for all your help

$\endgroup$
  • 3
    $\begingroup$ Why don't you ask your lecturer? $\endgroup$ – Yuval Filmus Jan 11 '17 at 13:26
  • 1
    $\begingroup$ The lecture course is finished and have attempted contact with the lecturer; I wouldn't be asking on here if I hadn't tried to get an answer already. $\endgroup$ – SomePhysicsStudent Jan 11 '17 at 23:45
5
$\begingroup$

It's not unsuitable, it is just not optimal. That's because letters in human readable text are not independent, but quite strongly correlated. That correlation can be used to get huge savings. For example, the letters q and Q are almost always followed by u. Comma and period are almost always followed by a space character, and period space is almost always followed by an uppercase character. These correlations mean text can be compressed a lot more than by using Huffman coding. But Huffman coding does work and will you get some amount of compression.

| cite | improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.