Question: A Morse code is like a Huffman code, except that we drop the prefix-freeness requirement. To use a Morse code in practice, one needs to

A Morse code is like a Huffman code, except that we drop the prefix-freeness requirement. To use a Morse code in practice, one needs to insert a "blank" between each encoding. Suppose we have n letters and for i = 1, ..., n, letter i occurs with probability p_i. Since we do not require prefix-freeness, we may as well use the n shortest possible bit-strings to encode our n letters: 0, 1,00,01, 10, 11,000, .... To simplify notation, let l_i be the length of the ith bit string in this ordering. Note that the l_i's form a non-decreasing sequence. We want to assign letters to bit strings. Mathematically, such an assignment is a permutation on the index set {1, ..., n}, where we assign letter pi(i) to the ith bit string. For such an assignment pi, the average cost of transmitting a series of letters with the given probability distribution is Cost_pi: = sigma_i=1^n l)i p_pi (i). We want to prove that the "greedy strategy" of assigning the most likely letters to the shortest encoding minimizes Cost_pi. That is, we want to show that an optimal assignment is one where p_pi(i) greaterthanorequalto p pi(i+1) for i. (a) Prove the following "swapping property": if pi is an assignment such that p_pi(u)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
