Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Huffman codes: The following table gives the frequencies of each character in a

ID: 648567 • Letter: H

Question

Huffman codes: The following table gives the frequencies of each character in a file with 1 000 characters.

1. How many bits do we need to store the file if using a fixed-length code? Show the code built by the Huffman algorithm, both as a tree and as a list (character, codeword). How many bits do we need to store the file with this Huffman code?

2. And Assume now that all the characters have the same frequency (= 125). Show the code built by the Huffman algorithm, both as a tree and as a list (character, codeword). How many bits do we need to store the file with this Huffman code? Generalizing from this example, what can you say about the code built by the Huffman algorithm for an alphabet with n = 2b characters each of which occurs with equal frequency f?
Explain your answer.

Huffman codes: The following table gives the frequencies of each character in a file with 1 000 characters. 1. How many bits do we need to store the file if using a fixed-length code? Show the code built by the Huffman algorithm, both as a tree and as a list (character, codeword). How many bits do we need to store the file with this Huffman code? 2. And Assume now that all the characters have the same frequency (= 125). Show the code built by the Huffman algorithm, both as a tree and as a list (character, codeword). How many bits do we need to store the file with this Huffman code? Generalizing from this example, what can you say about the code built by the Huffman algorithm for an alphabet with n = 2b characters each of which occurs with equal frequency f'? Explain your answer.

Explanation / Answer

1 . Since we are using fixed length encoding and there are 8 characters

so we will need 3 bits to represent any character

000

001

010

011

100

101

110

111

Since there are in total 1000 characteres so

bits required = 1000*3 = 3000

2.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote