UGC NET JULY 2018 (Computer Science And Applications Paper-II) (Question 25)
Q 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:
Answer: 4). 2.15
Solution:
Given 0.08 + 0.40 + 0.25 + 0.15 + 0.12 = 1
B : 0
C : 1 0
D : 1 1 0
A : 1 1 1 0
E : 1 1 1 1 1
Now, B consume single bit, C consume 2 bits, D consume 3 bits, A and E consume 4 bits
Avg length =4 ∗(A)+1∗(B)+2∗(C)+3∗(D)+4∗(E)
Avg length =4 ∗(0.08)+1∗(0.4)+2∗(0.25)+3∗(0.15)+4∗(0.12) =
2.15
Q 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:
- 2.4
- 1.87
- 3.0
- 2.15
Answer: 4). 2.15
Solution:
Given 0.08 + 0.40 + 0.25 + 0.15 + 0.12 = 1
B : 0
C : 1 0
D : 1 1 0
A : 1 1 1 0
E : 1 1 1 1 1
Now, B consume single bit, C consume 2 bits, D consume 3 bits, A and E consume 4 bits
Avg length =
Avg length =
0 comments:
Post a Comment