Saturday, 30 May 2015

Q14,paper3 ,J13. A data file of 1,00,000 characters contains only the characters g-l, with the frequencies as indicated in table :




g
h
i
j
k
l
Freq in thousands
45
13
12
16
9
5
 using the variable-length code by  Huffman codes, the file can be  encoded with .

(A) 2,52,000 bits
(B) 2,64,000 bits
(C) 2,46,000 bits
(D) 2,24,000 bits
Answer D.
Explanation.
Probability of g.= 45/100=.45
Probability of j= 16/100=.16.
Probability of H= .13
Probability of i=.12
Probability of k=.9
Probability of l=.5.
  A tree is formed.

G takes  I bit so it takes 45000 bits.
J takes 2 bits so it takes 32000 bits.
H takes 3 bits so it takes 39000 bits.
I takes 4 bits so it takes 48000bits.
K takes 5 bits so it takes 45000bits.
L takes 5 bits so it takes 25000bits
So it takes 224000 bits.

2 comments:

  1. How 224000 bits??? If we sum up all values of G-L the sum is 234000

    ReplyDelete
  2. I recently realized your website the other day and that i happen to be following it’s routinely. You’ve got great deal of tips proper here so i delight in your lifestyle of online site likewise. Preserve acknowledge that there are succeed! data science from scratch

    ReplyDelete

Note: only a member of this blog may post a comment.