The Gateway to Computer Science Excellence
+3 votes
2.1k views

Consider a source with symbols $A, B, C, D$ with probabilities $1/2, 1/4, 1/8, 1/8$ respectively. What is the average number of bits per symbol for the Huffman code generated from above information?

  1. $2$ bits per symbol
  2. $1.75$ bits per symbol
  3. $1.50$ bits per symbol
  4. $1.25$ bits per symbol
in Algorithms by
edited by | 2.1k views

3 Answers

+3 votes
Best answer

ans is B 

by
selected by
0
Can you please explain? how seven bits will come?
0
why only 2 bits for value 1/8 ?
+1 vote



 59
Bits required per symbol:
A – 0 (1 bit)
B – 10 (2 bit)
C – 110 (3 bit)
D – 111 (3 bit)
Average number of bits per symbol = 1 * 1 / 2 + 2 * 1 / 4 + 3 * 1 / 8 + 3 * 1 / 8 = 7 / 4 = 1.75.
So, option (B) is correct.

by
0 votes

Ans is B

Bits required per symbol: 
A – 0 (1 bit) 
B – 10 (2 bit) 
C – 110 (3 bit) 
D – 111 (3 bit) 
Average number of bits per symbol = 1 * 1 / 2 + 2 * 1 / 4 + 3 * 1 / 8 + 3 * 1 / 8 = 7 / 4 = 1.75. 
So, option (B) is correct.

https://www.youtube.com/watch?v=MXq9L5lstD4

by

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
52,375 questions
60,554 answers
201,952 comments
95,375 users