You are on page 1of 12

lOMoARcPSD|29849464

As each branch divides binary value 0 of 1 are assigned to each new branch a 0 for left and 1 for right.
Codewords used for each character (shown in leaf nodes) are got by tracing the path from
root node to each leaf node and forming a string of binary values associated with each
branch traced.
Set of codes associated with this tree is 4*1+2*2+1*3+1*3=14bits is required to transmit the
complete string – AAAABBCD.
Figure below shows Huffman tree with information frequency of occurrence of each
character here characters listed in a column in decreasing weight order.
lOMoARcPSD|29849464

Tree

(a) Average number of bits per codeword using Huffman coding is:
2(2×0.25) + 2(3×0.14) +4(4×0.055)= 2.72 bits per codeword which is 99.8% of the
Shannon value.
Using fixed-length binary codewords:
There are 8 characters –A through H – and hence 3 bits per codeword is sufficient which is
90.7% of the Huffman value.
Using 7-bit ASCII codewords:
7 bits per codeword which is 38.86% of the Huffman value.
lOMoARcPSD|29849464

To improve the implementation of the algorithm, we adopt an additional rule: if any


character/symbol is to be sent the first time, it must be preceded by a special symbol NEW.
The initial code for NEW is 0. The count for NEW is always kept as 0.

ADVANTAGES:
1) Saving in transmission bandwidth start only when characters begin to repeat
themselves. Savings with text files can be significant.
2) Used in number of common applications that involves the transmission of text.
lOMoARcPSD|29849464
lOMoARcPSD|29849464
lOMoARcPSD|29849464
lOMoARcPSD|29849464
lOMoARcPSD|29849464
lOMoARcPSD|29849464
lOMoARcPSD|29849464

1 Illustrate the operation of arithmetic coding, consider the transmission of a message comprising a string of characters with
probabilities as given below: e= 0.3, n= 0.3, t= 0.2, w=0.1, .= 0.1

The word needed to be transmitted is “WENT.”

Therefore, the codeword for the string “went.” Should lie in the range given below:
0.81602<codeword >0.8162
lOMoARcPSD|29849464

Problems on Arithmetic Coding:

2.Illustrate the operation of arithmetic coding, consider the transmission of a message


comprising a string of characters with probabilities as given below:

e= 0.3, n= 0.3, t= 0.2, w=0.1, .= 0.1


The word needed to be transmitted is “etnw.”

Solution:
d = upper limit – lower limit
Symbol ranges = lower limit + d*(probability of the symbol)
1) To transmit e : d= 0.3 - 0.0= 0.3

e = 0 + (0.3 * 0.3) = 0.09


n = 0.09 + (0.3 * 0.3) = 0.18
t = 0.18 + (0.3 * 0.2) = 0.24
w = 0.24 + (0.3 * 0.1) = 0.27
. = 0.27 + (0.3 * 0.1) = 0.3

2) To transmit t , range= 0.24 - 0.18= 0.06

e = 0.18 + (0.06 * 0.3) = 0.198


n = 0.198 + (0.06 * 0.3) = 0.216
t = 0.216 + (0.06 * 0.2) = 0.228
w = 0.228 + (0.06 * 0.1) = 0.234
. = 0.234 + (0.06 * 0.1) = 0.24
lOMoARcPSD|29849464

3) To transmit n , range= 0.216 - 0.198= 0.018

e = 0.198 + (0.018* 0.3) = 0.2034


n = 0.2034 + (0.018 * 0.3) = 0.2088
t = 0.2088 + (0.018* 0.2) = 0.2124
w = 0.2124 + (0.018* 0.1) = 0.2142
. = 0.2142 + (0.018* 0.1) = 0.216

4) To transmit w , range= 0.2142 - 0.2124= 0.0018

e = 0.2124 + (0.0018* 0.3) = 0.21294


n = 0.21294 + (0.0018* 0.3) = 0.21348
t = 0.21348 + (0.0018* 0.2) = 0.21384
w = 0.21384 + (0.0018* 0.1) = 0.21402
. = 0.21402 + (0.0018* 0.1) = 0.2142

 Since we encounter period (.), the transmission is stopped.

 Therefore, the codeword for the string etnw. Should lie in the range given below:
0.212402<codeword <0.2142
 Any value sent between the above range will be interpreted as the string “etnw.”

You might also like