Honor Code Acknowledgment: ___________________
Problem 1: Coda (2 points)
Use the Huffman tree shown to decode the bit-stream indicated:
10100010111010001000010011
Problem 2: Three pigs and a wolf (3 points)
The nodes shown below represent the initial forest of trees based on
frequency of character occurrences: a letter is shown with the number of
occurrences of that letter in each node. Draw a final Huffman tree
constructed from this initial forest of one-node trees.
Problem 3: Mr. Robertson and Mr. Wells (3 points)
Solve the recurrence relation T(n) = 2T(n/2) + n^2. Show work.
Problem 4: HR Huffnstuff (3 points)
If a file is to be compressed using Huffman coding by reading 4 bits at
a time and building a Huffman tree based on the frequency with which
each possible 4 bit sequence occurs, how many entries will there be in
the corresponding table? Recall that there must be an entry in the
table for the pseudo-end-of-file character. Answer the same question
when 16 bits are read at a time.
Problem 5: Prime of Life (2 points)
A postive integer n
is a prime number if its only divisors are 1
and n. There are infinitely many prime numbers. Using big-O
notation, give any correct bound on the number of primes less than a
positive integer p.