Question: Suppose a file contains the letters a, b, c, and d. Nominally we require 2 bits per letter to store such a file. (a) Assume

Suppose a file contains the letters

a, b,

c, and

d. Nominally we require 2 bits per letter to store such a file.

(a) Assume the letter a occurs 50% of the time, b occurs 30% of the time, and c and d each occur 10% of the time. Give an encoding of each letter as a bit string that provides optimal compression. Use a single bit for a.

(b) What is the percentage of compression you achieve above?
(This is the average of the compression percentages achieved for each letter, weighted by the letter’s frequency.)

(c) Repeat this, assuming a and b each occur 40% of the time, c occurs 15% of the time, and d occurs 5% of the time.

Step by Step Solution

3.42 Rating (168 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a For optimal compression we want to assign shorter bit strings to more ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Computer Networking Questions!