13 Huffman Codes Part 1

13 Huffman Codes Part 1 - Data Compression with Huffman...

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

View Full Document Right Arrow Icon
Data Compression with Huffman Codes 15-211 Fundamental Data Structures and Algorithms Margaret Reid-Miller 25 February 2009 Reading for today: Section 12.1
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 Announcements HW 3 programming due tonight Midterm exam next Tuesday: March 2 in lecture Bring student ID One 8.5" x 11" page of notes (both sides) Midterm review: Practice midterm posted Review session: Sunday 2:00 pm in WeH 7500
Background image of page 2
3 Last time…Splay Trees O(lg n) amortized time for search, insert, and delete O(n) worst-case for a single operation No internal balancing information Any BST is a splay tree! Incredibly easy to implement Most work done by a splay() operation http://www.link.cs.cmu.edu/cgi-bin/ splay/splay-cgi.pl?arg=20&op=new
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 Today’s outline: A bit of random information Compression, decompression, and codes Huffman Codes
Background image of page 4
Information
Background image of page 5

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

View Full DocumentRight Arrow Icon
6 What is information? information( n ): knowledge communicated or received, or the act or fact of informing Implicitly: a message, a sender, and a receiver How can we quantify how much information a message contains?
Background image of page 6
Which has more information? 023514 795 084664452746 (A) (B) (C)
Background image of page 7

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

View Full DocumentRight Arrow Icon
Information More Digits = More Information Right?
Background image of page 8
Memorizing Volunteer to memorize 10 digits 2737761413 Volunteer to memorize 100 digits 44444444444444444444444444444444 44444444444444444444444444444444 44444444444444444444444444444444 4444
Background image of page 9

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

View Full DocumentRight Arrow Icon
Memorizing 10-digit volunteer: What was the 8th digit? 100-digit volunteer: What was the 78th digit? Which is easier to memorize? Which contains more information?
Background image of page 10
Memorizing Another volunteer to memorize 100 digits 4859937766824805299839179081504751450913 5243678006736228445539731692238204213061 74607612086978543115 Is that harder to memorize than: 4444444444444444444444444444444444444444 4444444444444444444444444444444444444444 44444444444444444444 Why? Which contains more information?
Background image of page 11

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

View Full DocumentRight Arrow Icon
12 Let’s play a guessing game… Suppose I’m thinking of a very big number, with one thousand 1’s and a single 0 i.e., 111111…1111011…11111111… How much information do I convey if I tell you… The first digit is a 1? The first digit is a 0?
Background image of page 12
13 Quantifying information One metric: How many yes / no questions are needed to convey the message? Is the 0 the 500 th or higher digit?. .. Is the 0 the 250 th or higher digit?. .. Is the 0 the 375 th or higher digit?. .. Another metric: How many yes / no questions do you expect to ask? What if you also knew that half the time, the 0 would be in the first 10 digits?
Background image of page 13

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

View Full DocumentRight Arrow Icon
Shannon’s information theory Information is what provides an answer to a yes/no question, one bit . The more surprising the answer, the
Background image of page 14
Image of page 15
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 77

13 Huffman Codes Part 1 - Data Compression with Huffman...

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

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