Consider a sequence of letters of the English alphabet with

Consider a sequence of letters of the English alphabet with

Consider a sequence of letters of the English alphabet with their probabilities of occurrence as given here:
Letter a ilmno p y
Probability 0.1 0.1 0.2 0.1 0.1 0.2 0.1 0.1
Compute two different Huffman codes for this alphabet. In one case, move a combined symbol in the coding procedure as high as possible, and in the second case, move it as low as possible. Hence, for each of the two codes, find the average code-word length and the variance of the average code-word length over the ensemble of letters.