Answer:
a) we have the numbers 0, 2, 3, 5, 5. The mean and the median are both 3
b) we have the numbers 0, 0, 3, 5, 7. The mean and the median are both 3
In both cases the mean and the median are 3, but the mode differs. The mean and the median do not uniquely determine the mode.
Step-by-step explanation:
The expected length of code for one encoded symbol is

where
is the probability of picking the letter
, and
is the length of code needed to encode
.
is given to us, and we have

so that we expect a contribution of

bits to the code per encoded letter. For a string of length
, we would then expect
.
By definition of variance, we have
![\mathrm{Var}[L]=E\left[(L-E[L])^2\right]=E[L^2]-E[L]^2](https://tex.z-dn.net/?f=%5Cmathrm%7BVar%7D%5BL%5D%3DE%5Cleft%5B%28L-E%5BL%5D%29%5E2%5Cright%5D%3DE%5BL%5E2%5D-E%5BL%5D%5E2)
For a string consisting of one letter, we have

so that the variance for the length such a string is

"squared" bits per encoded letter. For a string of length
, we would get
.
For this case we have the following expression:
(x ^ 2 + 2x + 1 / x ^ 2-8x + 16) / (x + 1 / x ^ 2-16)
Rewriting we have:
(((x + 1) (x + 1)) / ((x-4) (x-4))) / (x + 1 / ((x + 4) (x-4)))
Then, we cancel similar terms:
((x + 1) / (x-4)) / (1 / (x + 4))
Rewriting:
((x + 1) (x + 4)) / (x-4)
Answer:
((x + 1) (x + 4)) / (x-4)