Explanation : By using haffman tree :
So, number of bit required for each alphabet:
T = 3 bit, R = 3 bit, Q = 2 bit, S = 2 bit, P = 2 bit
Then, average length per character is = (number of bits * frequency of occurance of each alphabets)
= 3 * 0.08 + 3 * 0.17 + 2 * 0.34 + 2 * 0.19 + 2 * 0.22 = 2.25 bits
And, average length for 100 character = 2.25 * 100 = 225 bits.
Hence, 225 bits is correct answer
Explanation : Derivative of gx(z) evaluated at z=1 gives expectation E(X) of X.
Therefore, take derivative of gY(z) with respect to z, and plug in z=1
Derivative is N.β.(1 - β + βz)(N-1), plug in z=1, gives Nβ.