Question: 1 Shannon code. Consider the following method for generating a code for a random variable x that takes on m values { 1 , 2
Shannon code.
Consider the following method for generating a code for a random variable x that takes
on m values cdots,m with probabilities ppcdots,pm Assume that the probabilities
are ordered so that ppcdotspm Define
Fisumki pk
the sum of the probabilities of all symbols less than i Then the codeword for i is the
number Fiin rounded off to li bits, where li~logpi~
a Show that the code constructed by this process is prefixfree and that the average
length satisfies
li~logpi~logpililogpilipiliFjjiFiliFjjiljliFiliHxL
Hints: Since li~logpi~ we have logpililogpi and lipiliFj
for ji differs from Fi by at least li The codeword for Fjji which has length
ljli differs from the codeword for Fi at least once in the first li places.
b Construct the code for the probability distribution
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
