20105ee211A_1_HW7Solutions

20105ee211A_1_HW7Solutions - Average Length = Total Bits /...

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

View Full Document Right Arrow Icon
1 EE 211A Digital Image Processing I Fall Quarter, 2010 Handout 23 Instructor: John Villasenor Homework 7 Solutions Solutions: 1. 1 = M Symbol Code Prob 0 0 0 0.95 1 1 0.05 1 Entropy = , 286 . 0 05 . 0 log 05 . 0 95 . 0 log 95 . 0 2 2 = - - Ave. length = , 1 1 ) 05 . 0 ( 1 ) 95 . 0 ( = + Efficiency = 0.286 = 28.6% 2 = M Symbol Code Prob 00 0 0.9025 0 1 01 10 0.0475 0 1 10 110 0.0475 0 1 11 111 0.0025 Entropy = 0.573, Ave. length = 0.9025 + 2(0.0475) + 3(0.0475) + 3(0.0025) = 1.147, Efficiency = 49%. 2. a) log 2 (k) b) The Huffman code achieves entropy when k = 2 n and 2 n+1 so L-H = 0 in either case. c) To answer this question, it is most intuitive if we describe k as follows k = 2 n + m, where m is an offset from a power of two. m is in the range 0 m 2 n We can draw the Huffman tree for a uniform source as follows:
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 So we now can describe the average length of a Huffman codeword as follows:
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Average Length = Total Bits / number of symbols ( 29 ( 29 ( 29 ( 29 ( 29 ( 29( 29 ( 29 ( 29 ( 29 1 2 2 2 -2 1 Average Length = 2 -2 1 = 2 2 the average length in terms of is as follows: 2 - 2 Average Length = The entropy from part a is: log log 2 n n n n n n m n m n k m n m n m m k kn k k k m + + + + + + + + = + Efficiency = Entropy / Average Length m # codewords of length n # codewords of length n+1 1 15 2 2 14 4 3 13 6 m 2 n-m 2m 3 ( 29 ( 29 ( 29( 29 ( 29 ( 29 ( 29 ( 29 ( 29( 29 ( 29 ( 29 2 2 2 2 1 1 log 2 2 log 2 = 2 -2 1 2 -2 1 2 the efficency in terms of is as follows: log log = 2 - 2 2 - 2 n n n n n n n n m m m m n m n m n m n m k k k k kn k kn k k + + + + + = + + + + + = + +...
View Full Document

Page1 / 3

20105ee211A_1_HW7Solutions - Average Length = Total Bits /...

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