# sol6 - CSE 21: Solutions - Problem Set 6 1. X Y Pr ( X, Y )...

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

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.

Unformatted text preview: CSE 21: Solutions - Problem Set 6 1. X Y Pr ( X, Y ) '&amp; %\$ ! &quot;# 1 . 1 '&amp; %\$ ! &quot;# 2 . 04 Y = 1 j T T T T T t j j j j '&amp; %\$ ! &quot;# 1 . 2 q q q 8 q q q . 5 @ '&amp; %\$ ! &quot;# 1 . 06 root . 6 / . 2 o 7 o o o . 2 O ' O O O '&amp; %\$ ! &quot;# 2 . 1 q q q 8 q q q . 6 / '&amp; %\$ ! &quot;# 2 . 36 Y = 2 d J J J J J J o _ _ _ _ z t t t t t t '&amp; %\$ ! &quot;# 3 . 4 / . 4 N N N &amp; N N N '&amp; %\$ ! &quot;# 1 . 08 '&amp; %\$ ! &quot;# 2 . 08 Then Pr ( Y = 1) = 0 . 1 + 0 . 06 + 0 . 08 = 0 . 24 Pr ( Y = 2) = 0 . 04 + 0 . 36 + 0 . 08 = 0 . 48 2. (a) CS21E, CS12E, SC21E, SC12E, E12CS, E21CS, E12SC, E21SC; (b) AAA, AABA, AABBA, AABBB, ABAA, ABABA, ABABB, ABBAA, ABBAB, ABBB. 3. (a) a + b- 1 (from lecture). (b) If we merge a and b first, we need a + b- 1 comparisons, and we get a list of length a + b . Then we merge this longer list into c , which requires ( a + b ) + c- 1 comparison. The total number of comparisons is ( a + b- 1) + ( a + b ) + c- 1 = 2 a + 2 b + c- 2 = 2( a + b + c- 1)- c....
View Full Document

## This note was uploaded on 04/23/2008 for the course CSE 21 taught by Professor Graham during the Spring '07 term at UCSD.

### Page1 / 2

sol6 - CSE 21: Solutions - Problem Set 6 1. X Y Pr ( X, Y )...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online