PDF 27jan25 0822 Splitted
PDF 27jan25 0822 Splitted
on
Eusebius Doedel
SAMPLE SPACES
DEFINITION :
The sample space is the set of all possible outcomes of an experiment.
1
EXAMPLE :
S = {1, 2, 3, 4, 5, 6}.
1
The probability the die lands with k up is 6
, (k = 1, 2, · · · , 6).
1 1 1 1
+ + = .
6 6 6 2
2
EXAMPLE :
When we toss a coin 3 times and record the results in the sequence
that they occur, then the sample space is
S = { HHH , HHT , HT H , HT T , T HH , T HT , T T H , T T T } .
1
Thus the probability of the sequence HT T is 8
.
1 1 1 3
+ + = .
8 8 8 8
3
EXAMPLE : When we toss a coin 3 times and record the results
without paying attention to the order in which they occur, e.g., if we
only record the number of Heads, then the sample space is
n o
S = {H, H, H} , {H, H, T } , {H, T, T } , {T, T, T } .
The outcomes in S are now sets ; i.e., order is not important.
Recall that the ordered outcomes are
{ HHH , HHT , HT H , HT T , T HH , T HT , T T H , T T T } .
Note that
{H, H, H} corresponds to one of the ordered outcomes,
{H, H, T } ,, three ,,
{H, T, T } ,, three ,,
{T, T, T } ,, one ,,
4
Events
S = {1, 2, 3, 4, 5, 6},
1 1 1 1
P (E) = + + = .
6 6 6 2
5
The Algebra of Events
Since events are sets, namely, subsets of the sample space S, we can
do the usual set operations :
Ec the complement of E
E∪F the union of E and F
EF the intersection of E and F
We write E ⊂ F if E is a subset of F .
EF instead of E ∩ F ,
E⊂F instead of E ⊆ F .
6
If the sample space S is finite then we typically allow any subset of
S to be an event.
7
We always assume that the set E of allowable events includes the
complements, unions, and intersections of its events.
S = {a , b , c , d} ,
8
Axioms of Probability
• 0 ≤ P (E) ≤ 1 ,
• P (S) = 1 ,
9
Further Properties
PROPERTY 1 :
P (E ∪ E c ) = P (E) + P (E c ) = 1 . ( Why ? )
Thus
P (E c ) = 1 − P (E) .
EXAMPLE :
What is the probability of at least one ”H” in four tosses of a coin?
1 15
P (at least one H) = 1 − P (no H) = 1 − = .
16 16
10
PROPERTY 2 :
P (E ∪ F ) = P (E) + P (F ) − P (EF ) .
P (E ∪ F ) = P (EF ) + P (EF c ) + P (E c F )
NOTE :
• Draw a Venn diagram with E and F to see this !
11
So far our sample spaces S have been finite.
S can also be countably infinite, e.g., the set Z of all integers.
S can also be uncountable, e.g., the set R of all real numbers.
12
Counting Outcomes
13
Permutations
NOTE :
For sets the order is not important. For example, the set {a,c,b} is
the same as the set {b,a,c} .
14
EXAMPLE : Suppose that four-letter words of lower case alpha-
betic characters are generated randomly with equally likely outcomes.
(Assume that letters may appear repeatedly.)
(a) How many four-letter words are there in the sample space S ?
SOLUTION : 264 = 456, 976 .
(b) How many four-letter words are there are there in S that start
with the letter ”s ” ?
SOLUTION : 263 .
15
EXAMPLE : How many re-orderings (permutations) are there of
the string abc ? (Here letters may appear only once.)
SOLUTION : Six, namely, abc , acb , bac , bca , cab , cba .
SOLUTION :
(n − 1)! 1
= . ( Why ? )
n! n
16
EXAMPLE : How many
words of length k
(where k ≤ n ) ,
SOLUTION :
n (n − 1) (n − 2) · · · (n − (k − 1))
= n (n − 1) (n − 2) · · · (n − k + 1)
n!
= ( Why ? )
(n − k)!
17
EXAMPLE : Three-letter words are generated randomly from the
five characters a , b , c , d , e , where letters can be used at most
once.
(a) How many three-letter words are there in the sample space S ?
SOLUTION : 5 · 4 · 3 = 60 .
18
(c) Suppose the 60 solutions in the sample space are equally likely .
SOLUTION :
18
= 0.3 .
60
19
EXERCISE :
• How many ”special” words are in S for which only the second
and the fourth character are vowels, i.e., one of {a, e, i, o, u, y} ?
20
Combinations
Then
a combination of k elements from S ,
is
any selection of k elements from S ,
21
EXAMPLE :
S = {a , b , c} ,
namely,
ab , ba , ac , ca , bc , cb .
22
In general, given
a set S of n elements ,
n
REMARK : The notation is referred to as
k
”n choose k ”.
n n! n!
NOTE : = = = 1,
n n! (n − n)! n! 0!
23
PROOF :
n!
n (n − 1) (n − 2) · · · (n − k + 1) =
(n − k)!
24
EXAMPLE :
In the previous example, with 2 elements chosen from the set
{a , b , c} ,
25
EXAMPLE : If we choose 3 elements from {a , b , c , d} , then
n = 4 and k = 3 ,
so there are
4!
= 24 words, namely :
(4 − 3)!
26
EXAMPLE :
(b) If each of these 210 outcomes is equally likely then what is the
probability that a particular person is on the committee?
SOLUTION :
9 10 84 4
/ = = . ( Why ? )
3 4 210 10
27
(c) What is the probability that a particular person is not on the
committee?
SOLUTION :
9 10 126 6
/ = = . ( Why ? )
4 4 210 10
28
EXAMPLE : Two balls are selected at random from a bag with
four white balls and three black balls, where order is not important.
29
EXAMPLE : ( continued · · · )
(Two balls are selected at random from a bag with four white balls
and three black balls.)
• What is the probability that both balls are white?
SOLUTION :
4 7 6 2
/ = = .
2 2 21 7
30
EXAMPLE : ( continued · · · )
In detail, the sample space S is
n
{w1 , w2 }, {w1 , w3 }, {w1 , w4 }, | {w1 , b1 }, {w1 , b2 }, {w1 , b3 },
{w2 , w3 }, {w2 , w4 }, | {w2 , b1 }, {w2 , b2 }, {w2 , b3 },
{w3 , w4 }, | {w3 , b1 }, {w3 , b2 }, {w3 , b3 },
| {w4 , b1 }, {w4 , b2 }, {w4 , b3 },
———– ———– ———–
{b1 , b2 }, {b1 , b3 }, o
• S has 21 outcomes, each of which is a set . {b2 , b3 }
1
• We assumed each outcome of S has probability 21
.
• The event ”both balls are white” contains 6 outcomes.
• The event ”both balls are black” contains 3 outcomes.
• The event ”one is white and one is black” contains 12 outcomes.
• What would be different had we worked with sequences ?
31
EXERCISE :
What is the probability of one red, one green, and one blue ball ?
32
EXAMPLE : A bag contains 4 black balls and 4 white balls.
Suppose one draws two balls at the time, until the bag is empty.
What is the probability that each drawn pair is of the same color?
Thus the probability each pair is of the same color is 9/105 = 3/35 .
33
EXAMPLE : ( continued · · · )
The 9 outcomes of pairwise the same color constitute the event
(
n o
{w1 , w2 } , {w3 , w4 } , {b1 , b2 } , {b3 , b4 } ,
n o
{w1 , w3 } , {w2 , w4 } , {b1 , b2 } , {b3 , b4 } ,
n o
{w1 , w4 } , {w2 , w3 } , {b1 , b2 } , {b3 , b4 } ,
n o
{w1 , w2 } , {w3 , w4 } , {b1 , b3 } , {b2 , b4 } ,
n o
{w1 , w3 } , {w2 , w4 } , {b1 , b3 } , {b2 , b4 } ,
n o
{w1 , w4 } , {w2 , w3 } , {b1 , b3 } , {b2 , b4 } ,
n o
{w1 , w2 } , {w3 , w4 } , {b1 , b4 } , {b2 , b3 } ,
n o
{w1 , w3 } , {w2 , w4 } , {b1 , b4 } , {b2 , b3 } ,
)
n o
{w1 , w4 } , {w2 , w3 } , {b1 , b4 } , {b2 , b3 } .
34
EXERCISE :
EXERCISE :
Two balls are selected at random from a bag with three white balls
and two black balls.
35
EXERCISE :
36
111|11111111|1111|11 .
17 + 3 = 20 .
20 20! 20 × 19 × 18
= = = 1140 .
3 (20 − 3)! 3! 3×2
39
CONDITIONAL PROBABILITY
EXAMPLE :
If a coin is tossed two times then what is the probability of two
Heads?
ANSWER : 1
.
4
EXAMPLE :
If a coin is tossed two times then what is the probability of two Heads,
given that the first toss gave Heads ?
ANSWER : 1
.
2
45
NOTE :
• Four suits :
Hearts , Diamonds (red ) , and Spades , Clubs (black) .
46
EXERCISE :
47
The two preceding questions are examples of conditional probability .
defined as
P (EF )
P (E|F ) ≡ .
P (F )
or, equivalently
P (EF ) = P (E|F ) P (F ) ,
48
P (EF )
P (E|F ) ≡
P (F )
E
S S E
F
F
49
P (EF )
P (E|F ) ≡
P (F )
S E S F
50
EXAMPLE : Suppose a coin is tossed two times.
We have
1
P (EF ) P (E) 4 1
P (E|F ) = = = 2 = .
P (F ) P (F ) 4
2
51
EXAMPLE :
Suppose we draw a card from a shuffled set of 52 playing cards.
• What is the probability of drawing a Queen, given that the card
drawn is of suit Hearts ?
ANSWER :
1
P (QH) 52 1
P (Q|H) = = 13 = .
P (H) 52
13
(Here Q ⊂ F , so that QF = Q .)
52
The probability of an event E is sometimes computed more easily
namely, from
53
EXAMPLE :
54
SOLUTION :
Thus
P (C) = P (C|U ) P (U ) + P (C|U c ) P (U c )
4 3 2 7
= +
100 10 100 10
26
= = 2.6% .
1000
55
EXAMPLE :
Two balls are drawn from a bag with 2 white and 3 black balls.
SOLUTION :
Then
c c 1 2 2 3 2
P (S) = P (S|F ) P (F ) + P (S|F ) P (F ) = · + · = .
4 5 4 5 5
56
EXAMPLE : ( continued · · · )
Is it surprising that P (S) = P (F ) ?
w2 w1 , w2 b 1 , w2 b 2 , w2 b 3 ,
b 1 w1 , b 1 w2 , b1 b2 , b1 b3 ,
b 2 w1 , b 2 w2 , b2 b1 , b2 b3 ,
o
b 3 w1 , b 3 w2 , b3 b1 , b3 b2 ,
57
EXAMPLE :
ANSWER :
P (2nd card Q) =
3 4 4 48 204 4 1
= · + · = = = .
51 52 51 52 51 · 52 52 13
58
A useful formula that ”inverts conditioning ” is derived as follows :
P (EF ) = P (E|F ) P (F ) ,
and
P (EF ) = P (F |E) P (E) .
P (EF ) P (E|F ) · P (F )
P (F |E) = = ,
P (E) P (E)
and, using the earlier useful formula, we get
P (E|F ) · P (F )
P (F |E) = ,
P (E|F ) · P (F ) + P (E|F c ) · P (F c )
59
EXAMPLE : Suppose 1 in 1000 persons has a certain disease.
A test detects the disease in 99 % of diseased persons.
The test also ”detects” the disease in 5 % of healthly persons.
With what probability does a positive test diagnose the disease?
SOLUTION : Let
D ∼ ”diseased” , H ∼ ”healthy” , + ∼ ”positive”.
We are given that
P (D) = 0.001 , P (+|D) = 0.99 , P (+|H) = 0.05 .
By Bayes’ formula
P (+|D) · P (D)
P (D|+) =
P (+|D) · P (D) + P (+|H) · P (H)
0.99 · 0.001 ∼
= = 0.0194 (!)
0.99 · 0.001 + 0.05 · 0.999
60
EXERCISE :
Suppose 1 in 100 products has a certain defect.
EXERCISE :
Suppose 1 in 2000 persons has a certain disease.
61
More generally, if the sample space S is the union of disjoint events
S = F1 ∪ F2 ∪ · · · ∪ Fn ,
then for any event E
P (E|Fi ) · P (Fi )
P (Fi |E) = .
P (E|F1 ) · P (F1 ) + P (E|F2 ) · P (F2 ) + · · · + P (E|Fn ) · P (Fn )
EXERCISE :
Machines M1 , M2 , M3 produce these proportions of a article
Production : M1 : 10 % , M2 : 30 % , M3 : 60 % .
Defects : M1 : 4 % , M2 : 3 % , M3 : 2 % .
62
Independent Events
P (EF ) = P (E) P (F ) .
In this case
P (EF ) P (E) P (F )
P (E|F ) = = = P (E) ,
P (F ) P (F )
Thus
63
EXAMPLE : Draw one card from a deck of 52 playing cards.
Counting outcomes we find
12 3
P (Face Card) = 52
= 13
,
13 1
P (Hearts) = 52
= 4
,
3
P (Face Card and Hearts) = 52
,
3
P (Face Card|Hearts) = 13
.
We see that
3
P (Face Card and Hearts) = P (Face Card) · P (Hearts) (= ).
52
Thus the events ”Face Card ” and ”Hearts ” are independent.
64
EXERCISE :
65
EXERCISE : Two numbers are drawn at random from the set
{1, 2, 3, 4}.
X( {i, j} ) = i + j , Y ( {i, j} ) = |i − j| .
(1) X = 5 and Y = 2 ,
(2) X = 5 and Y = 1 .
REMARK :
X and Y are examples of random variables . (More soon!)
66
EXAMPLE : If E and F are independent then so are E and F c .
= P (E) · ( 1 − P (F ) )
= P (E) · P (F c ) .
EXERCISE :
Prove that if E and F are independent then so are E c and F c .
67
NOTE : Independence and disjointness are different things !
E
S S E
F
F
If E and F are independent and disjoint then one has zero probability !
68
Three events E , F , and G are independent if
69
EXERCISE :
Suppose that
9
M1 functions properly with probability 10
,
9
M2 functions properly with probability 10
,
8
M3 functions properly with probability 10
,
and that
70