Presentation is loading. Please wait.

Presentation is loading. Please wait.

Q&A II – Sunday Feb 13 th 2011 BITS. Signed binary  What are the following numbers in signed binary?  00001111  00010000  10000000  11111111  11111110.

Similar presentations


Presentation on theme: "Q&A II – Sunday Feb 13 th 2011 BITS. Signed binary  What are the following numbers in signed binary?  00001111  00010000  10000000  11111111  11111110."— Presentation transcript:

1 Q&A II – Sunday Feb 13 th 2011 BITS

2 Signed binary  What are the following numbers in signed binary?  00001111  00010000  10000000  11111111  11111110  01111111

3 Huffman Tree Rules  Steps for generating a Huffman code tree: 1. Collect the symbols into a list and sort by frequency 2. Start with the two symbols that have the lowest frequency. These are going to be the top most leaves of the tree. Put the one with the lowest frequency on the LHS. Make a node combining the two symbols. This node now has a combined frequency of the two symbols above it. 3. Now insert your combined node back into the list and sort by frequency 4. Repeat until you have used up all the symbols. 5. Start labeling with 0’s and 1’s – 0’s on the left, 1’s on the right. 6. You can now read off the encoding for each symbol!

4 Huffman Tree Example I  In 2005, auto manufacturers had market share in the United States according to the following table:  Create a Huffman code that is optimal for this distribution ManufacturerMarket Share GM26.2% Ford18.6% Chrysler14.9% Toyota13.3% Honda8.6% Nissan6.3% Hyundai2.7% Other9.4%

5 5 ManufacturerMarket Share GM26.2% Ford18.6% Chrysler14.9% Toyota13.3% Honda8.6% Nissan6.3% Hyundai2.7% Other9.4% ManufacturerMarket Share ManufacturerMarket Share ManufacturerMarket Share ManufacturerMarket Share ManufacturerMarket Share

6 6

7 Huffman Tree Example I  Write down a bit string for the sequence:  Ford, VW, Honda, Ford, Chrysler, Toyota, Chrysler, GM, GM, Hyundai, BMW, GM, Toyota, Nissan  What is the entropy of this sequence. What about the efficiency of the Huffman Code?

8 Huffman Tree Example II Character# of occurances e3320 h1458 l1067 o1749 p547 t2474 w266 TOTAL10881 Build a huffman code for this distribution

9 Huffman Tree Example II Character# of occurancesProbability e332030.5119 h145813.3995 l10679.8061 o174916.0739 p5475.0271 t247422.7369 w2662.4446 TOTAL10881100

10 10 CharacterProbability e30.5119 h13.3995 l9.8061 o16.0739 p5.0271 t22.7369 w2.4446 TOTAL100 CharacterProbability CharacterProbability CharacterProbabilityCharacterProbability CharacterProbability

11 11


Download ppt "Q&A II – Sunday Feb 13 th 2011 BITS. Signed binary  What are the following numbers in signed binary?  00001111  00010000  10000000  11111111  11111110."

Similar presentations


Ads by Google