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

  • 3
    $\begingroup$ Why don't you ask your lecturer? $\endgroup$ Commented Jan 11, 2017 at 13:26
  • 2
    $\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$ Commented Jan 11, 2017 at 23:45

1 Answer 1


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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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