practice_final_sol_haim

practice_final_sol_haim - Solutions to Practice Final 1....

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Solutions to Practice Final 1. Huffman code Give a Huffman encoding into an alphabet of size D = 4 of the following probability mass function: p = ( 8 36 , 7 36 , 6 36 , 5 36 , 4 36 , 3 36 , 2 36 , 1 36 ) Solution: Huffman code (1) 8 8 15 36 (2) 7 7 8 (3) 6 6 7 (00) 5 5 6 (01) 4 4 (02) 3 3 (030) 2 3 (031) 1 (dummy) (dummy) 2. Ternary Huffman word lengths Which of the following sequences of word lengths cannot be the word lengths of a 3-ary Huffman code and which can ? (a) L = (1 , 1 , 2 , 2 , 3 , 3 , 3) (b) L = (1 , 1 , 2 , 2 , 3 , 3) (c) L = (1 , 1 , 2 , 2 , 3) (d) L = (1 , 2 , 2 , 2 , 2 , 2 , 2) (e) L = (1 , 2 , 2 , 2 , 2) Solution: Ternary Huffman word lengths The simplest way is to draw a ternary tree for each case. Once we have 1 the tree, we can easily determine whether the set of codes derived from that tree can be Huffman codes (no redundancy) or not. Based on this approach, we can easily see that only codes in (a), (b), and (d) are valid ternary Huffman codes....
View Full Document

This document was uploaded on 12/01/2010.

Page1 / 5

practice_final_sol_haim - Solutions to Practice Final 1....

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online