Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

Prove the following two properties of the Huffman encoding scheme.

(a) If some character occurs with frequency more than 25, then there is guaranteed to be a codeword of length 1 .

(b) If all characters occur with frequency less than13 , then there is guaranteed to be no codeword of length 1 .

Short Answer

Expert verified

(a). It is proved that, Huffman codeword has length 1 if some of the frequencies are greater than 25.

(b). It is proved that, Huffman codeword does not have a codeword of length 1 if all the frequencies are less than13 .

Step by step solution

01

Sum of frequencies

Sum of all the frequencies of a Huffman tree must be 1.Sum of frequencies in the left subtree and right subtree is 1.

02

Proof by contradiction method

(a)

A contradiction for the case is considered here. Let the full binary bree does not have codeword of length 1. Therefore, the root of the tree will not have frequencies as its children. Left child of the root be I and right child of the root be r . Assume children of l are a and b , children of r are c and d, where a,b,c,dare the frequencies.

Sum of frequencies is 1.

l+r=1

It is given that at least one character has frequency greater than 25. Let value of is greater than 25. Then value of r is:

localid="1657263872844" l+r=1r=1-lr<1-25r<35

Hence, r should be less than 35. If r is less than then 35one of the children of r should be maximum 310. If that is the case then that child of r will be less than and should be in the left subtree which is a clear violation of the case discussed. Hence, Huffman codeword has length 1 if some of the frequencies are greater than 25.

03

Proof by contradiction method

(b)

A contradiction for the case is considered here. Let the full binary bree has a codeword of length 1 . So, the root of the tree has a child of frequency less than13 . Let the left subtree be l and right subtree be r . Let value of r is less than13 .

Sum of the frequencies is 1 .

l+r=1l=1-rl>1-13l>23

Thus, l should be greater than 23. If l is greater than23 then one of the children of l should be greater than13 . But all frequencies should be less than 13which clearly violates the contradiction. Hence, Huffman codeword does not have a codeword of length 1 if all the frequencies are less than13 .

Thus, the two statements are proved.

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with Vaia!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

Let G=(V,E) be an undirected graph. Prove that if all its edge weights are distinct, then it has a unique minimum spanning tree

Give You are given a graphG=(V,E)with positive edge weights, and a minimum spanning tree T=(V,E)with respect to these weights; you may assume GandTare given as adjacency lists. Now suppose the weight of a particular edge eโˆ‰E'is modified fromw(e)to a new value w'(e). You wish to quickly update the minimum spanning tree T to reflect this change, without recomputing the entire tree from scratch. There are four cases. In each case give a linear-time algorithm for updating the tree.

(a) eโˆ‰E'and w'(e)>w(e) .

(b) role="math" localid="1658907878059" eโˆ‰E'and w'(e)>w(e) .

(c) role="math" localid="1658907882667" eโˆ‰E'and w'(e)>w(e) .

(d) role="math" localid="1658907887400" eโˆ‰E'and w'(e)>w(e) .

Consider the following graph.

(a) What is the cost of its minimum spanning tree?

(b) How many minimum spanning trees does it have?

(c) Suppose Kruskalโ€™s algorithm is run on this graph. In what order are the edges added to the MST? For each edge in this sequence, give a cut that justifies its addition.

Design a linear-time algorithm for the following task.

Input: A connected, undirected graphG.

Question:Is there an edge you can remove fromGwhile still leavingGconnected?

Can you reduce the running time of your algorithm toO(V)?

Consider an undirected graph G=(V,E)with nonnegative edge weights role="math" localid="1658915178951" weโ‰ฅ0. Suppose that you have computed a minimum spanning tree of G, and that you have also computed shortest paths to all nodes from a particular node role="math" localid="1658915296891" sโˆˆV. Now suppose each edge weight is increased by 1: the new weights are w0e=we+1.

(a) Does the minimum spanning tree change? Give an example where it changes or prove it cannot change.

(b) Do the shortest paths change? Give an example where they change or prove they cannot change.

See all solutions

Recommended explanations on Computer Science Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.

Sign-up for free