Run-length coding:-
Consider a source consisting of the symbols 0 and 1, where the probability p of a 0 is very close to 1. In this case, it might be considered advantageous to assign symbols to various runs of 0's. That is, one lets s1 = 1, s2= 01, s3 = 001 and so forth for all possible run lengths. Then, for example, the sequence 001010001 would be represented as s3,s2,s4.
(a) Let H0 be the entropy of the original source, and let HR be the entropy of the run-length source of symbols. Find the ratio HR/H0.
(b) Find the average length L of the runs, and then the ratio of the entropy per unit length for the two methods.