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

A prefix-free encoding of a finite alphabet Γ assigns each symbol in Γ a binary codeword, such that no codeword is a prefix of another codeword. A prefix-free encoding is minimal if it is not possible to arrive at another prefix-free encoding (of the same symbols) by contracting some of the keywords. For instance, the encoding {0,101} is not minimal since the codeword 101 can be contracted to 1 while still maintaining the prefix-free property.

Show that a minimal prefix-free encoding can be represented by a full binary tree in which each leaf corresponds to a unique element of Γ, whose codeword is generated by the path from the root to that leaf (interpreting a left branch as 0 and a right branch as 1 ).

Short Answer

Expert verified

Every symbol in a binary codeword is assigned a finite alphabet in a prefix free encoding. The encoding {0,10} for example, is not a tiny codeword and has been reduced to 1 while retaining the prefix base characteristic.

Step by step solution

01

Step 1: Prefix-free encoding

• This code is prefix-free encoding, which implies that there are no codewords that are prefixes to other codewords.

• Its prefix-free encode with finite alphabet " Γ" allots as well as every symbolΓ in a binary codeword that represents the entire binary tree and constructs the route from the root to the leaf node.

o There seem to be based on two different nodes: left leaf & right leaf, with the path from the tree's root to the left leaf node indicating " 0 " and the path from the tree's root to the right leaf node indicating " 1 ."

02

Step 2: Proof of minimal prefix-free encoding

Consider the whole binary tree with both the string " s " and a length of " k " for all strings.

• This binary tree has two branches that are labelled "left" and "right."

o Its left branching is labelled " 0 ," while the right branch is labelled " 1 ."

• To achieve the maximum string length, all binary strings are encoded.

o To put it another way, only utilise the total number of levels in all strings.

• Also, encode all of the path's intermediary nodes.

o That is, the path through root node towards intermediate node " a " must be prefix-free, as well as the strings of intermediate node " a " must be encoded as left node with codeword " s0 ."

• Every binary tree currently has to be a full binary tree. Assume that perhaps the intermediate node "b" corresponds to the string " s ." However, the string " s " only has one node, such as " a," which is the value of the codeword " s0."

• The intermediate node " b " is a subtree of the prefix-free string " s " with the codeword " s0."

o To get the superior encoding scheme, change the codeword " s0" with " s " for intermediate node " b."

o As a result, the prefix-free encoding is kept to a minimum.

As a result of this contradiction, the minimum prefix-free encoding is established.

03

Conclusion

Binary tree has to be perhaps the intermediate node “ b ” corresponds to string “ S ”. Base on this we can get result prefix – free encoding is kept to a minimum. As a result, we can get contradiction, the minimum prefix encoding is established.

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

The following table gives the frequencies of the letters of the English language (including the blank for separating words) in a particular corpus.

blank

18.3%

r

4.8%

y

1.6%

e

10.2%

d

3.5%

p

1.6%

t

7.7%

l

3.4%

b

1.3%

a

6.8%

c

2.6%

v

0.9%

o

5.9%

u

2.4%

k

0.6%

i

5.8%

m

2.1%

j

0.2%

n

5.5%

w

1.9%

x

0.2%

s

5.1%

f

1.8%

q

0.1%

h

4.9%

g

1.7%

z

0.1%

  1. What is the optimum Huffman encoding of this alphabet?
  2. What is the expected number of bits per letter?
  3. Suppose now that we calculate the entropy of these frequencies

H=t=026ptlog1pt

(see the box in page 143). Would you expect it to be larger or smaller than your answer above? Explain.

d. Do you think that this is the limit of how much English text can be compressed? What features of the English language, besides letters and their frequencies, should a better compression scheme take into account?

In this problem, we will develop a new algorithm for finding minimum spanning trees. It is based upon the following property:

Pick any cycle in the graph, and let e be the heaviest edge in that cycle. Then there is a minimum spanning tree that does not contain e.

(a) Prove this property carefully.

(b) Here is the new MST algorithm. The input is some undirected graph G=(V,E) (in adjacency list format) with edge weights {we}.sort the edges according to their weights for each edge eE, in decreasing order of we:

if e is part of a cycle of G:

G = G - e (that is, remove e from G )

return G , Prove that this algorithm is correct.

(c) On each iteration, the algorithm must check whether there is a cycle containing a specific edge . Give a linear-time algorithm for this task, and justify its correctness.

(d) What is the overall time taken by this algorithm, in terms of |E|? Explain your answer.

Suppose you are given a weighted graph G=(V,E) with a distinguished vertex s and where all edge weights are positive and distinct. Is it possible for a tree of shortest paths from s and a minimum spanning tree in G to not share any edges? If so, give an example. If not, give a reason.

Let T be an MST of graph G. Given a connected subgraph H of G, show that TH is contained in some MST of H

Give a linear-time algorithm that takes as input a tree and determines whether it has a perfect matching: a set of edges that touches each node exactly once.

A feedback edge set of an undirected graph G(V,E) is a subset of edgesE'Ethat intersects every cycle of the graph. Thus, removing the edges will render the graph acyclic.

Give an efficient algorithm for the following problem:

Input: Undirected graph G(V,E) with positive edge weights we.

Output: A feedback edge set E'Eminimum total weight eE'we.

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