{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture12

Lecture12 - Lecture 12 Nov 4 2010 Summary Take locally best...

This preview shows pages 1–4. Sign up to view the full content.

1 144 Summary Take locally best choice and commit to it. Main issue: proof that we can commit without loosing our chance to get an optimum solution. Lecture 12, Nov 4 2010 145 Huffman encoding Idea: represent often encountered letters by shorter codes . Prefix code: a code for x is not a prefix for any code-word for y . In this example: c=010, e=100

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

View Full Document
2 146 Huffman encoding Assume that a is a very common symbol. Now: a = 0 b = 100 e = 1100 147 Huffman encoding Assume we know symbol frequencies : 50 40 5 3 2 a b c d e 50 * 1+40 * 2+5 * 3+3 * 4+2 * 4 = 165, 1.65b/symbol instead of 3 ! What is the best we can hope for if there are more than 2 letters ?
3 148 Generating optimum encoding Claim: Let x&y be lowest freq. characters. Then there exists code where x&y differ only in 1 bit . Consider a and b being the “deepest” symbols in the tree sharing parent. (Is it possible that deepest symbol does not have a sibling ?) So does this mean that we do not need any other codes ? » [Hint: consider a sequence abcabcabc….] () , () :( )( ) , ( ) , can only help! WLOG f a f b f x f y also f x f a f y f b exchanging x a y b   Graphs A set of nodes (vertices), denoted by V. A set of edges, denoted by E. What is an edge ? » Conceptually, an edge specifies 2 nodes (u,v) that it connects.

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 8

Lecture12 - Lecture 12 Nov 4 2010 Summary Take locally best...

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

View Full Document
Ask a homework question - tutors are online