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

5) Professor Larry needs to store a file made up of the characters A with freque

ID: 3685060 • Letter: 5

Question

5) Professor Larry needs to store a file made up of the characters A with frequency 6, B with frequency 2, C with frequency 3, D with frequency 2, and E with frequency 8.

a)(5 pts) Apply the Huffman algorithm discussed in class to compute an optimal prefix code. Write the Huffman codeword of each character.

b)(5 pts) What is the length of the file using your Huffman code?

c)(5 pts) Professor Larry suggests using the variable-length code:

which he argues, stores the text in less space than that used by an optimal Huffman code. What is the  length of the file using professor Larry's code?

d)(5 pts) Is professor Larry correct? Explain.

6)

Consider the matrix chain A3A4A5, where A3 has dimension 5 × 20, A4 has dimension 20 × 80 and A5 has dimension 80 × 4. Which of the following parenthesizations require the minimum number of scalar multiplications?

((A3A4)A5)

(A3(A4A5))

This chain of matrices cannot be parenthesized because the sequence of matrices is incompatible.

All parenthesizations have the same number of scalar multiplications.

character code A 1 B 00 C 01 D 10 E 0

Explanation / Answer

Multiple Questions : Answering 1 (6th)

((A3A4)A5) = 5*20*80 + 5*80*4 = 9600
(A3(A4A5)) = 20*80*4 + 5*20*4 = 6800

Answer is : (A3(A4A5))

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