{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

quiz6_solution

# quiz6_solution - Quiz 6 solution Math 187 Prof Garsia Alex...

This preview shows pages 1–4. Sign up to view the full content.

Quiz 6 solution Math 187, Prof. Garsia Alex Brik UC San Diego May 21, 2010 1. a) H = 16 60 log 2 60 16 + 3 ° 4 60 log 2 60 4 + 8 60 log 2 60 8 + 24 60 log 2 60 24 = 2 : 2 Minimum number of binary registers 60 ° H = 60 ° 2 : 2 = 132 b) Hu/man tree: 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
letter code length A 10 2 B 11110 5 C 11111 5 D 110 3 E 0 1 F 1110 4 bit= 2 ° 16 + 5 ° 4 + 5 ° 4 + 3 ° 8 + 24 + 4 ° 4 = 136 2. Heights h 1 , h 2 , ... , h n are a tree if S = n X i =1 1 2 h i ± 1 with equality i/ the tree is complete. Sequence 1: S = 1 4 + 1 4 + 1 8 + 1 8 + 1 16 + 1 16 + 1 32 = 29 32 incomplete tree Sequence 2: S = 1 2 + 1 8 + 1 8 + 1 8 + 1 16 + 1 32 + 1 32 = 1 complete tree. Sequence 3: S = 1 4 + 1 8 + 1 8 + 1 8 + 1 8 + 1 8 + 1 16 = 15 18 incomplete tree. 3. a). 2 i + 2 = 2 mod 4 i = 0 Plaintext: m 0 b) all keys are equally likely. Fix c s , m i s = 2 i + j mod 4 if i = 0 s = j - unique if i = 1 j = s ² 2 mod 4 unique Thus for every pair ( m; c ) there is a unique key k s.t. E k ( m ) = c . Thus by the theorem given in class the perfect secrecy is achieved. 2
c) H ( K j C ) = H ( K ) ² H ( C ) + H ( M ) H ( K ) = 4 ° 1 4 ° 2 = 2 k 0 : 0 ! 0 1 ! 2 k 1 : 0 ! 1 1 ! 3 k 2 : 0 ! 2 1 ! 0 k 3 : 0 ! 3 1 ! 1 P ( C ) = 1 4 H ( C ) = 4 1 4 log 2 4 = 2 H ( M ) = 2 1 2 log 2 2 = 1 H ( K j C ) = 2 ² 2 + 1 = 1 d) P ( M = 0 ; C = 1) = P ( C = 1 j M = 0) P ( M = 0) = 3 8 ° 1 2 = 3 16 P ( M = 0 ; C = 0) = P ( C = 0 j M = 0) P ( M = 0) = 1 8 ° 1 2 = 1 16 P ( M = 0 ; C = 2) = P ( C = 2 j M = 0) P ( M = 0) = 1 8 ° 1 2 = 1 16 P ( M = 0 ; C = 3) = P ( C = 3 j M = 0) P ( M = 0) = 3 8 ° 1 2 = 3 16 P ( M = 1 ; C = 0) = P ( C = 0 j M = 1) P ( M = 1) = 1 16 P ( M = 1 ; C = 1) = 3 16 P ( M = 1 ; C = 2) = 1 16 P ( M = 1 ; C = 3) = 3 16 P ( C = 3) = P ( C = 1) = 1 2 ° 3 8 + 1 2 °

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}