Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The basic intuition behind Huffman's algorithm, that frequent blocks should have short encodings and infrequent blocks should have long encodings, is also at work in

image text in transcribed

The basic intuition behind Huffman's algorithm, that frequent blocks should have short encodings and infrequent blocks should have long encodings, is also at work in English, where typical words like I, you, is, and, to, from, and so on are short, and rarely used words like velociraptor are longer. However, words like fire!, help!, and run! are short not because they are frequent, but perhaps because time is precious in situations where they are used. To make things theoretical, suppose we have a file composed of m different words, with frequencies f_1, ellipsis, f_m. Suppose also that for the ith word, the cost per bit of encoding is c_i. Thus, if we find a prefix-free code where the ith word has a codeword of length l_i, then the total cost of the encoding will be sigma_i f_i middot c_i middot l_i. Show how to modify Huffman's algorithm to find the prefix-free encoding of minimum total cost. The basic intuition behind Huffman's algorithm, that frequent blocks should have short encodings and infrequent blocks should have long encodings, is also at work in English, where typical words like I, you, is, and, to, from, and so on are short, and rarely used words like velociraptor are longer. However, words like fire!, help!, and run! are short not because they are frequent, but perhaps because time is precious in situations where they are used. To make things theoretical, suppose we have a file composed of m different words, with frequencies f_1, ellipsis, f_m. Suppose also that for the ith word, the cost per bit of encoding is c_i. Thus, if we find a prefix-free code where the ith word has a codeword of length l_i, then the total cost of the encoding will be sigma_i f_i middot c_i middot l_i. Show how to modify Huffman's algorithm to find the prefix-free encoding of minimum total cost

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Bioinformatics Databases And Systems

Authors: Stanley I. Letovsky

1st Edition

1475784058, 978-1475784053

More Books

Students also viewed these Databases questions

Question

Assessment of skills and interests.

Answered: 1 week ago

Question

Psychological, financial, and career counseling.

Answered: 1 week ago