Sample Space S21
Sample Space S21
Learning Objectives
DEFINITION :
The sample space is the set of all possible outcomes of an experiment.
EXAMPLE : When we flip a coin then sample space is
S = {H , T },
where
H denotes that the coin lands ”Heads up”
and
T denotes that the coin lands ”Tails up”.
1
EXAMPLE :
2
Application :
When we toss a coin 3 times and record the results in the sequence
that they occur, then the sample space is
S = ?
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
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?
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 :
(b) How many four-letter words are there are there in S that start
with the letter ”s ” ?
SOLUTION : .
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!
( 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 : 6 0
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
{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 },
• 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
{w1 , w2 } , {w3 , w4 } , {b1 , b2 } , {b3 , b4 } ,
{w1 , w3 } , {w2 , w4 } , {b1 , b2 } , {b3 , b4 } ,
{w1 , w4 } , {w2 , w3 } , {b1 , b2 } , {b3 , b4 } ,
{w1 , w2 } , {w3 , w4 } , {b1 , b3 } , {b2 , b4 } ,
{w1 , w3 } , {w2 , w4 } , {b1 , b3 } , {b2 , b4 } ,
{w1 , w4 } , {w2 , w3 } , {b1 , b3 } , {b2 , b4 } ,
{w1 , w2 } , {w3 , w4 } , {b1 , b4 } , {b2 , b3 } ,
{w1 , w3 } , {w2 , w4 } , {b1 , b4 } , {b2 , b3 } ,
{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
EXAMPLE :
How many nonnegative integer solutions are there to
x1 + x2 + x3 = 17 ?
SOLUTION :
Consider seventeen 1’s separated by bars to indicate the possible
values of x1 , x2 , and x3 , e.g.,
111|111111111|11111 .
37
EXAMPLE :
How many nonnegative integer solutions are there to the inequality
x1 + x2 + x3 ≤ 17 ?
SOLUTION :
Introduce an auxiliary variable (or ”slack variable ” )
x4 ≡ 17 − (x1 + x2 + x3 ) .
Then
x1 + x2 + x3 + x4 = 17 .
111|11111111|1111|11 .
38
111|11111111|1111|11 .
17 + 3 = 20 .
20 20! 20 × 19 × 18
= = = 1140 .
3 (20 − 3)! 3! 3×2
39
EXAMPLE :
How many positive integer solutions are there to the equation
x1 + x2 + x3 = 17 ?
SOLUTION : Let
x1 = x̃1 + 1 , x2 = x̃2 + 1 , x3 = x̃3 + 1 .
40
EXAMPLE :
What is the probability the sum is 9 in three rolls of a die ?
41
EXAMPLE : ( continued · · · )
Now the equation
x̃1 + x̃2 + x̃3 = 6 , ( 0 ≤ x̃1 , x̃2 , x̃3 ≤ 5 ) ,
1|111|11
has
8
= 28 solutions ,
2
28 − 3 25 ∼
= = 0.116 .
63 216
42
EXAMPLE : ( continued · · · )
612 , 621 }.
43
EXERCISE :
x1 + x2 + x3 ≤ 17 ,
if we require that
x1 ≥ 1 , x2 ≥ 2 , x3 ≥ 3 ?
EXERCISE :
44