How to calculate expected code length?
Asked
Active
Viewed 868 times
-2
-
This question belongs to Math or even better Theoretical Computer Science stack exchange. – Michel Keijzers Apr 22 '20 at 13:14
-
3The calculation is done for you, right before your eyes. Which part don't you understand? – Neil_UK Apr 22 '20 at 13:16
-
I don't understand how there are two times 0.25 and 0.2 – Apr 22 '20 at 13:32
-
The five 2-length codewords have probabilities 0.25, 0.25 and 0.2. The two 3-length codewords each have probability 0.15, all given in the table at the top. The contribution of each codeword to the expected length is length*probability, so the total expected length is the sum of all these expectations. The terms have been grouped in a straightforward way, which unfortunately makes the sum slightly less obvious – Neil_UK Apr 22 '20 at 14:05


