Download presentation
Presentation is loading. Please wait.
1
1 Intro to Probability Supplementary Notes Prepared by Raymond Wong Presented by Raymond Wong
2
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
3 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} TTT TTF TFT FTT TFF FTF FFT FFF Sample Space
4
4 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? Sample space = {,,,,, }
5
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
6 e.g.5 (Page 13) Suppose that there are three questions in the final exam. TTT TTF TFT FTT TFF FTF FFT FFF Sample Space What is the event E that the first two answers are true? TTT TTF Event
7
7 e.g.6 (Page 15) Suppose that there are three questions in the final exam. TTT TTF TFT FTT TFF FTF FFT FFF Sample Space What is the event E that the first two answers are true? TTT TTF Event 1/8 P(E) = 1/8 + 1/8 = 2/8 = 1/4
8
8 e.g.7 (Page 15) Suppose that there are three questions in the final exam. TTT TTF TFT FTT TFF FTF FFT FFF Sample Space What is the event E that the first two answers are true? TTT TTF Event 3/16 1/16 3/161/16 3/16 P(E) = 3/16 + 3/16 = 6/16 = 3/8
9
9 e.g.8 (Page 16) Suppose that there are three questions in the final exam. TTT TTF TFT FTT TFF FTF FFT FFF Sample Space What is the event E that the first two answers are true? TTT TTF Event 1/8 P(E) = 1/8 + 1/8 = 2/8 = 1/4 What is the event V that the first two answers are false? FFT FFF Event 1/8 P(V) = 1/8 + 1/8 = 2/8 = 1/4 These two sets are disjoint. P(E U V) = 1/8 + 1/8 + 1/8 + 1/8 = 4/8 = ½ Note that P(E) + P(V) = ¼ + ¼ = ½ Thus, P(E U V) = P(E) + P(V)
10
10 e.g.9 (Page 24) Suppose that there are three questions in the final exam. TTT TTF TFT FTT TFF FTF FFT FFF Sample Space What is the event E that the first two answers are true? TTT TTF Event What is the complement of event E? TFT FTT TFF FTF FFT FFF Complement of Event E
11
11 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 3 Slot 3 Slot 0 Slot 1 Slot 2 Slot 3 Slot 4 Slot 5 Slot 6 Slot 7 3 12 Slot 4 12 15 Slot 7 15 8 Slot 0 8 11 Slot 3 11 5 Slot 5 5 3, 12, 15, 8, 11, 5 Outcome: (3, 4, 7, 0, 3, 5) (l 1, l 2, l 3, l 4, l 5, l 6 ) Each l i is a number between 0 and 7 (or between 1 and 8) How many possible 6-tuples are there? 8686 A 6-tuple
12
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, (l 1, l 2, l 3 ) 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 l 1, l 2 and l 3 are all not equal.
13
13 1 2 … 20 20 choices 1 2 … 20 1 2 … l1l1 l2l2 l3l3 19 choices18 choices Total no. of 3-tuples without collisions = 20 x 19 x 18 = 20 3
14
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, (l 1, l 2, l 3 ) 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
15 e.g.13 (Page 30) Slot 0 Slot 1 Slot 2 Slot 3 Slot 4 Slot 5 … Slot 19 3 15 5 Slot 0 Slot 1 Slot 2 Slot 3 Slot 4 Slot 5 … Slot 19 315 5 Case (i)Case (ii)
16
16 e.g.14 (Page 33) Given p n = show that p n+1 < p n 20 n p n+1 = 20 n+1 20 x 19 x 18 x … x (20 – (n-1)) x (20 – n) 20 n x 20 = 20 x 19 x 18 x … x (20 – (n-1)) 20 n = 20 (20 – n) x 20 n = 20 (20 – n) x = p n x 20 (20 – n) < p n = p n x (1 – ) 20 n This is because < 1 1 – 20 n
17
17 e.g.15 (Page 35) Suppose that there are three questions in the final exam. TTT TTF TFT FTT TFF FTF FFT FFF Sample Space Let E be the event that the first two answers are true. TTT TTF Event P(E) = 2/8 = 1/4
18
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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.