Lecture12

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

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

View Full Document Right Arrow Icon
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
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 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 ?
Background image of page 2
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.
Background image of page 3

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

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

This note was uploaded on 03/08/2011 for the course CS 161 at Stanford.

Page1 / 8

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

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

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