Problem Set 6 Solutions

Problem Set 6 - CSE 21 Solutions Problem Set 6 1 X Y Pr X Y&%$" 1 1&%$" 2 04 Y = 1 j T T T T T t j j j j&%$" 1 2 q q q 8 q q q

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon
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 ) '& %$ ! "# 1 . 1 '& %$ ! "# 2 . 04 Y = 1 j T T T T T t j j j j '& %$ ! "# 1 . 2 q q q 8 q q q . 5 @ '& %$ ! "# 1 . 06 root . 6 / . 2 o 7 o o o . 2 O ' O O O '& %$ ! "# 2 . 1 q q q 8 q q q . 6 / '& %$ ! "# 2 . 36 Y = 2 d J J J J J J o _ _ _ _ z t t t t t t '& %$ ! "# 3 . 4 / . 4 N N N & N N N '& %$ ! "# 1 . 08 '& %$ ! "# 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 12/03/2009 for the course CSE 21 taught by Professor Graham during the Spring '07 term at UCSD.

Page1 / 2

Problem Set 6 - CSE 21 Solutions Problem Set 6 1 X Y Pr X Y&%$" 1 1&%$" 2 04 Y = 1 j T T T T T t j j j j&%$" 1 2 q q q 8 q q q

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online