Question #171303

Question 1 Given that the messages y1, y2, y3, y4, y5 with the corresponding probabilities 0.4, 0.2, 0.2, 0.1, and 0.1 a) Construct a binary code by using a Shannon Fano Algorithm to determine?

I. Code efficiency ii. Redundancy of the code iii. Code tree


Question 2 a) Consider a Huffman’s Algorithm that uses a variable-length encoding scheme to compress the original text: GOOD DAY to determine the following?

I. Code tree ii. Codeword iii. Average code length


Question 3 a) Write a short note on the following and state any two (2) practical examples under each? I. Impact printer ii. Non-impact printer b) What is the difference between Additive Color and Subtractive Color and two (2) examples under each?


1
Expert's answer
2021-03-17T20:18:52-0400

Question 2

a) Code:

D: 00, O: 01, Space: 100, A: 101, G: 110, Y: 111

i) Code tree:



II) Codeword:

11001010 01000010 11110000

III) Average code length:

E(L)=L(xi)P(xi)=20.25+20.25+430.125=2.5 bitsE(L)=\sum L(x_i)P(x_i)=2\cdot0.25+2\cdot0.25+4\cdot3\cdot0.125=2.5\ bits


Question 1

a)

iii) Code tree:



Code:

y1:11,y2:011,y3:00,y4:10,y5:010y_1: 11, y_2:011,y_3:00,y_4:10,y_5:010


i) Code efficiency:

η=H/L\eta=H/L

LL is the average codeword length

E(L)=L(yi)P(yi)=20.4+30.2+20.2+20.1+30.1=2.3 bitsE(L)=\sum L(y_i)P(y_i)=2\cdot0.4+3\cdot0.2+2\cdot0.2+2\cdot0.1+3\cdot0.1=2.3\ bits

HH is the entropy per source symbol

H=PilogPiH=-\sum P_{i}logP_i

PiP_i is probability of symbol.

H=(0.4log0.4+0.2log0.2+0.2log0.2+0.1log0.1+0.1log0.1)=1.47H=-(0.4log0.4+0.2log0.2+0.2log0.2+0.1log0.1+0.1log0.1)=1.47

η=1.47/2.3=0.64\eta=1.47/2.3=0.64


ii) Redundancy of the code:

R=LHR=L-H

R=2.31.47=0.83R=2.3-1.47=0.83


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!
LATEST TUTORIALS
APPROVED BY CLIENTS