UGC-NET | UGC NET CS 2018 July – II | Question 25

A text is made up of the characters A, B, C, D, E each occurring with the probability 0.08, 0.40, 0.25, 0.15 and 0.12 respectively. The optimal coding technique will have the average length of :
(A) 2.4
(B) 1.87
(C) 3.0
(D) 2.15


Answer: (D)

Explanation: The diagram for above question:

Length of A = 1110 = 4 * 0.08 = 0.32
Length of B = 0 = 1 * 0.4 = 0.4
Length of C = 10 = 2 * 0.25 = 0.5
Length of D = 110 = 3 * 0.15 = 0.45
Length of E = 1111 = 4 * 0.12 = 0.48
Average length = 0.32 + 0.4 + 0.5 + 0.45 + 0.48
= 2.15
So, option (D) is correct.

Quiz of this Question



My Personal Notes arrow_drop_up


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.