intersections and unions of events
play

Intersections and Unions of Events CS 70, Summer 2019 Lecture 17, - PowerPoint PPT Presentation

Intersections and Unions of Events CS 70, Summer 2019 Lecture 17, 7/23/19 1 / 25 Last Time: Conditional Probability I P [ A | B ] : restricting the sample space to B P [ A B ] = P [ A | B ] P [ B ] = P [ B | A ] P [ A ] I Total


  1. Intersections and Unions of Events CS 70, Summer 2019 Lecture 17, 7/23/19 1 / 25

  2. Last Time: Conditional Probability I P [ A | B ] : restricting the sample space to B P [ A ∩ B ] = P [ A | B ] P [ B ] = P [ B | A ] P [ A ] I “Total probability rule:” probability by disjoint cases I “Bayes’ Rule”: definition of conditional probability + total probability rule I Lets you “flip” the conditioning 2 / 25

  3. Computing Intersections For any events A , B : . PCB ] PLA IB ] P [ A ∩ B ] = . PCA ] PCBIA ] = What about any (three) events , A , B , C ? Pfc ] Plan B/C ] ( ) P [ A ∩ B ∩ C ] = - . IPCC ] . IPCBK ] ↳ = IPCAIB , C ] .pfAhB①←' 3970k ! PCCIANB ) - PCBLA BIBI PIA ] ] . ④ = usually . 3 / 25

  4. Computing Intersections: Chaining For any events A 1 , A 2 , . . . , A n : , ] DEAN ANANA If " n # - \ = P [ A 1 ] · P [ A 2 | A 1 ] · P [ A 3 | A 1 ∩ A 2 ] · . . . P A i i = 1 'nofAi Tintoretto As , given Hultz Proof: Details are in the notes. ! ! ! Induction General Idea : Key Insight : Treat ( A 1 ∩ A 2 ∩ . . . ∩ A n − 1 ) as one event, - - treat A n alone as another. PHAM ] ' Uwsenditiond MAN - e) NAN . . . . Very similar to... o- MTI induction , question . 4 / 25

  5. Drawing Cards I I draw 4 cards sequentially from a standard deck, without replacement. What is the probability that all 4 are clubs? counting ith card club C i = is a clubs ] . Rft " and i' " ' ' = P [ C 1 ∩ C 2 ∩ C 3 ∩ C 4 ] = hands W/ " " f 49 # . [ Calc , ]elP[ Csl oh Cz ] = Ipcc , ] it-and . =¥÷ , = = 1312-11-40527 5251.5049 ¥48 ! 5 / 25

  6. Drawing Cards II (Modified from notes.) I am dealt 5 cards. What is the probability that all five cards are the same suit, and none of them are face cards? face 1st not card is C 1 = . AND same not face ith card For 2 ≤ i ≤ 5: C i = is suit first as - = i P [ C 1 ∩ C 2 ∩ C 3 ∩ C 4 ∩ C 5 ] = ' Ea ' Eis II. IT - " ceases " Notes by count : . IPC 5 I 4 hearts suit ⇒ by cases : . 6 / 25

  7. ith Cj card A face = is non - spade . . Es Ii ' Fi 's Ea . suits X 4 all

  8. Independent Events 0 For any events A , B : skit P [ A \ B ] = P [ A | B ] · P [ B ] = P [ B | A ] · P [ A ] to independent doe be hate . Two events A , B are independent if and only if: PEA ] PCB ] P [ A \ B ] = which is equivalent to both: PEAT P [ A | B ] = PCB ] P [ B | A ] = 7 / 25

  9. Independent or Not? ¥¥¥ I Flipping two fair coins: A = flip 1 is heads, B = flip 2 is tails. # ✓ " Tanis , " ¥93 :{ Fizz check : I Rolling one red die, one blue die: A = sum is 3, B = red die is 1. - -1,13=2] - PER = 23-6 PCA ] If BT PC An - . 136 = IT = PCB ] - ZEIT : Is X check 8 / 25

  10. Independent or Not? I Rolling one red die, one blue die: A = sum is 7, B = red die is 1. = ft - IPCR 1,13=6 ] 6- PCANBT ' IDEA ] - - - 36 = 136 - T DEBT . to ✓ check To : I Throwing 3 labeled balls into 3 labeled bins: A = Bin #1 is empty, B = Bin #2 is empty. . } .z pCAhBI=PCbbifnm¥p¥y ] - Ey PEA ] I - . - Ey Ime - IT - I PCB ] . I =3 - - Also by X symmetry . 9 / 25

  11. Independent or Not? A , B are generic events. The table shows probabilities of the intersections of the row and column. Event A Event A Event B P [ A \ B ] = 0 . 4 P [ A \ B ] = 0 . 3 Event B P [ A \ B ] = 0 . 2 P [ A \ B ] = 0 . 1 PCA ABT B ] 0.4-10.2--0.6 IP [ = An t What is P [ A ] ? = n B ] PEE 0.4-10.3 0.7 B ] = = IP C An t What is P [ B ] ? = I ( O . 6) L 0.7 ) X 0.4 Are A and B independent? 10 / 25

  12. Mutual Independence How do we generalize independence from two events A , B , to multiple events A 1 , A 2 , . . . , A n ? Definition (Mutual Independence, Ver. 1) A 1 , A 2 , . . . , A n are mutually independent if: For every I ✓ { 1 , 2 , . . . , n } , with | I | � 2, "\ # subset any Y P A i = P [ A i ] . , N } { I , Of 2 , . . i ∈ I i ∈ I Ex: For 3 events: PCA it P[ Az ) PCA , ] Ai ] IPC ?eq = . , , , 11 / 25

  13. Mutual Independence Definition (Mutual Independence, Ver. 2) A 1 , A 2 , . . . , A n are mutually independent if: For every choice of B i 2 { A i , A i } : n Y P [ B 1 \ B 2 \ . . . \ B n ] = P [ B i ] i = 1 Ex: For 3 events: P C AIT PEAT P CA it n At , I P [ n AT = A . , PC AT I IP E Aid PC AT n AI I P [ AT n Az = 12 / 25

  14. A Weaker Idea: Pairwise Independence Definition (Pairwise Independence) A 1 , A 2 , . . . , A n are pairwise independent if: For every i 6 = j in { 1 , 2 , . . . , n } : P [ A i \ A j ] = P [ A i ] · P [ A j ] Q: Does mutual imply pairwise? " every pairs includes " subset possible NO Q: Does pairwise imply mutual? . ↳ Discussion 13 / 25

  15. Using (Mutual) Independence: Coin Flips # - Hair What is the probability that after n flips, we have k heads k and ( n � k ) tails? K n - - - H H T T . . . . . . . " - (1) P' 4h55 biased ) ltfknheads N - , In - k ) k H # sequences → , PCSYemfifin.se?--PCmCaHnestPKmZas-cnesT---PCIItcnes ! Winn n = = . k¥5 , ] = @ynyPCspep99c.s.e.9.jsEfiu.p , TH - up = biased ? PCH ] n KT What if - pp - - = pkg - k 14 / 25

  16. Using (Mutual) Independence: Dice Rolls We roll n red dice and n blue dice. What is the probability that all the red dice are even, and all the blue dice are � 5? Exercise . 15 / 25

  17. Break Back by popular demand... Would you rather only use spoons (no forks) or only use forks (no spoons) for the rest of your life? A joke... Why was 6 afraid of 7? Because seven ate nine. Now, why was 7 afraid of 8? 16 / 25

  18. Unions of Events Same exact story as in counting... r A B plan B ] IP f AT t PCB ] P [ A [ B ] = - 17 / 25

  19. Unions of Events Same exact story as in counting... r . A n Bnc B C t IPCC ] + PCB ] p [ AT P [ A [ B [ C ] = - PCA n CT n C ] PCB n BT PCA - - IP CA A B n C ] t 18 / 25

  20. Unions Example: Rolling 3 Die I roll a red die, a blue die, and a green die. What is the probability that at least one of these happen? Inion ! ! A) The red die’s number is 3, or 4 B) The blue die’s number is 5. C) The green die’s number is 1 or 6. ¥ I P [ A ] = - - f- P [ B ] = = E I P [ C ] = - - 63 19 / 25

  21. Example: Rolling 3 Die Continued... = E- is ⇒ ÷÷÷ then ¥ } P [ A \ B ] = ! subtract - FG I I KE ) - = P [ A \ C ] = - ¥ , E I TX E) - = P [ B \ C ] = = If add ← I ¥ ) ( to X Z ) P [ A \ B \ C ] = t 4 - I 2 24 t 3 b 72 I 2 7 2 t - - P [ A [ B [ C ] = zL¥ = 20 / 25

  22. Principle of Inclusion and Exclusion Same exact story as in counting... For probability: Let A 1 , A 2 , . . . , A n be events in our probability space. Denote { 1 , 2 , . . . , n } by [ n ] . Then: " " " " " n # [ X X = P [ A i ] � P [ A i \ A j ] P A i i = 1 { i } ✓ [ n ] { i , j } ✓ [ n ] # . :* X + P [ A i \ A j \ A k ] � . . . . u { i , j , k } ✓ [ n ] . . . . + ( � 1 ) n + 1 P [ A 1 \ A 2 \ . . . \ A n ] three - way intersections 21 / 25

  23. The Union Bound Q: What is the maximum possible value of the following? P [ A 1 [ A 2 [ . . . [ A n ] A: At pfa ,uAzUA3 ) Az =pfADtPCAI t PEAS ] As P [ A 1 [ A 2 [ . . . [ A n ] is always upper bounded by - . .tlPCAn7=§ Pati ] , ]t SPCA . , 22 / 25

  24. Union Bound Example: Rolling 3 Die I roll a red die, a blue die, and a green die. What is an easy upper bound on the probability that at least one of these happen? A) The red die’s number is 3 or 4. B) The blue die’s number is 5. C) The green die’s number is 1 or 6. EIPCATTPCBTHPKJ I =Z+ttE' ' - puffed Feer ' 23 / 25

  25. Summary I Computing event intersections = chaining conditional probabilities I Independent events = directly multiply probabilities I Mutual independence 6 = pairwise independence I Computing event unions = same exact strategy from counting ! I Draw the Venn diagram for 2 events, 3 events I Principle of Inclusion-Exclusion for multiple events I Union bound = worst case, the events are disjoint ! 24 / 25

  26. Tips for Counting and Probability I Don’t overthink it! Consider one thing at a time. I Label your events!! Be cognizant of whether or not you are conditioning. I If you have time, try a di ff erent strategy and see if it gets you the same answer (e.g. cases vs. complement) I Try small examples to sanity-check your strategy! I Practice, practice, practice! 25 / 25

Recommend


More recommend