1 / 18

Intro to Probability

Intro to Probability. Supplementary Notes. Prepared by Raymond Wong. Presented by Raymond Wong. e.g.1 (Page 10). Suppose that there is only one question in the final exam. What is the sample space of all possible patterns of correct answers?.

kapila
Télécharger la présentation

Intro to Probability

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Intro to Probability Supplementary Notes Prepared by Raymond Wong Presented by Raymond Wong

  2. e.g.1 (Page 10) • Suppose that there is only one question in the final exam. • What is the sample space of all possible patterns of correct answers? Sample space = { T , F }where T corresponds to the answer being true and F corresponds to the answer being false

  3. FTT TTF TTT TFT Sample Space FFF FTF TFF FFT e.g.2 (Page 10) • Suppose that there are three questions in the final exam. • What is the sample space of all possible patterns of correct answers? Sample space = {TTT, TTF, TFT, FTT, TFF, FTF, FFT, FFF}

  4. Sample space = { , , , , , } e.g.3 (Page 11) • Suppose that I want to throw one 6-sided dice. • What is the sample space of all possible outcomes of throwing this dice?

  5. e.g.4 (Page 12) • Suppose that I want to throw one two-sided coin (One side is a head H and the other side is a tail T) • What is the sample space of all possible outcomes of throwing the coin? Sample space = { H , T }

  6. FTT TTF TTT TFT Sample Space Event TTF TTT FFF FTF TFF FFT e.g.5 (Page 13) • Suppose that there are three questions in the final exam. • What is the event E that the first two answers are true?

  7. 1/8 1/8 1/8 1/8 FTT TTF TTT TFT Sample Space Event TTF TTT FFF FTF TFF FFT e.g.6 (Page 15) • Suppose that there are three questions in the final exam. 1/8 1/8 1/8 1/8 • What is the event E that the first two answers are true? 1/8 1/8 P(E) = 1/8 + 1/8 = 2/8 = 1/4

  8. 3/16 1/16 1/16 1/16 FTT TTF TTT TFT Sample Space Event TTF TTT FFF FTF TFF FFT e.g.7 (Page 15) • Suppose that there are three questions in the final exam. 3/16 3/16 3/16 1/16 • What is the event E that the first two answers are true? 3/16 3/16 P(E) = 3/16 + 3/16 = 6/16 = 3/8

  9. P(E U V) = 1/8 + 1/8 + 1/8 + 1/8 = 4/8 = ½ 1/8 1/8 1/8 1/8 FTT TTF TTT TFT Sample Space Event Event TTF FFF TTT FFT FFF FTF TFF FFT e.g.8 (Page 16) Note that P(E) + P(V) = ¼ + ¼ = ½ Thus, P(E U V) = P(E) + P(V) • Suppose that there are three questions in the final exam. 1/8 1/8 1/8 1/8 These two sets are disjoint. • What is the event E that the first two answers are true? 1/8 1/8 P(E) = 1/8 + 1/8 = 2/8 = 1/4 • What is the event V that the first two answers are false? 1/8 1/8 P(V) = 1/8 + 1/8 = 2/8 = 1/4

  10. FTT TTF TTT TFT Sample Space FTT TFT Complement of Event E Event TTF TTT FFF FTF TFF FFT FFF FTF TFF FFT e.g.9 (Page 24) • Suppose that there are three questions in the final exam. • What is the event E that the first two answers are true? • What is the complement of event E?

  11. Slot 0 Slot 1 Slot 2 Slot 3 Slot 4 Slot 5 Slot 6 Slot 7 e.g.10 (Page 27) • Consider that we hash a list of 6 keys into a hash table with 8 locations (or slots) (namely, slot 0, slot 1, slot 2, slot 3, …., slot 7)? e.g. we have 6 keys: 3, 12, 15, 8, 11, 5 8 3 12 15 8 11 5 3 11 Slot 3 Slot 4 Slot 7 Slot 0 Slot 3 Slot 5 12 A 6-tuple 3, 12, 15, 8, 11, 5 5 Each li is a number between 0 and 7(or between 1 and 8) Outcome: (3, 4, 7, 0, 3, 5) (l1, l2, l3, l4, l5, l6) 15 86 How many possible 6-tuples are there?

  12. e.g.11 (Page 29) • There are 20 locations/slots in the hash table. • Suppose that we are given 3 keys. • We can represent the slot no. of these 3 keys by a 3-tuple, (l1, l2, l3) • We want that these 3 keys have no collisions. • That is, these 3 keys are hashed to different locations/slots. • How many possible 3-tuples without collisions are there? We know that l1, l2 and l3 are all not equal.

  13. 1 1 1 2 2 2 … … … 20 20 20 l2 l1 l3 20 choices 19 choices 18 choices = 203 Total no. of 3-tuples without collisions = 20 x 19 x 18

  14. e.g.12 (Page 30) • There are 20 locations/slots in the hash table. • Suppose that we are given 3 keys. • We can represent the slot no. of these 3 keys by a 3-tuple, (l1, l2, l3) • Let A be the event that all 3 keys have no collisions. • What is the probability that A occurs? Total no. of 3-tuples without collisions = 20 x 19 x 18 Total no. of 3-tuples = 20 x 20 x 20 Probability that A occurs = (20 x 19 x 18)/(20 x 20 x 20) = 0.855

  15. Slot 0 Slot 0 Slot 1 Slot 1 Slot 2 Slot 2 Slot 3 Slot 3 Slot 4 Slot 4 Slot 5 Slot 5 … … Slot 19 Slot 19 e.g.13 (Page 30) Case (i) Case (ii) 5 3 15 5 3 15

  16. 20n+1 20n+1 20 x 19 x 18 x … x (20 – (n-1)) x (20 – n) = 20n x 20 20n 20 x 19 x 18 x … x (20 – (n-1)) (20 – n) = x 20n 20n 20 20n (20 – n) This is because n x = 1 – (20 – n) 20n n 20 20 < 1 = pn x (1 – ) = pn x 20 20 e.g.14 (Page 33) • Given pn = • show that pn+1 < pn pn+1 = < pn

  17. FTT TTF TTT TFT Sample Space Event TTF TTT FFF FTF TFF FFT e.g.15 (Page 35) • Suppose that there are three questions in the final exam. • Let E be the event that the first two answers are true. P(E) = 2/8 = 1/4

  18. e.g.16 (Page 36) • Probability • Rule 1: P(A)  0 for all A  S • Rule 2: P(S) = 1 • Rule 3: P(A U B) = P(A) + P(B)for any two disjoint events A and B

More Related