Textbook Chapter 16.3 – Huffman codes
2
3
▪ Put stickers in a single row on each tube to indicate its color.
▪ There are 𝑘 types of stickers.
▪ Tubes with the same color should have the same sticker pattern and should be prefix free.
▪ Minimize the total number of stickers put on all tubes
▪ 3-ary prefix tree (each node can have at most 𝑘 children).
Color red pink orange yellow green blue purple black
#Tubes 25 15 12 19 7 12 8 2
Color red pink orange yellow green blue purple black
#Tubes 25 15 12 19 7 12 8 2
Why?
▪ Given a file containing a sequence of 8-bit characters (256 characters), if the maximum character frequency is less than k of the minimum character frequency in the file, then a binary Human code is always
worse than or equal to an 8-bit fixed length code (in terms of the length of the encoded file).
▪ What is the minimal value of k?
▪ https://stackoverflow.com/questions/8960698/huffman-coding-prove-on-a- 8-bit-sequence
5