STAT 111 Lecture 6
STAT 111 Lecture 6
University of Ghana
Department of Statistics and Actuarial Science
1 Random Experiment
Example 1
Find the sample space for an experiment of tossing a coin repeatedly and
counting the number of tosses required until the first head appears.
Solution :
It is easy to realize that all possible outcomes for this experiment are the
terms of the sequence 1, 2, 3, . . . .
Thus the sample space is given by; S = {1, 2, 3, . . . }.
Example 2
Consider an experiment of drawing two cards at random from a bag
containing four cards marked with the integers 1, 2, 3, 4.
a Find the sample space S1 of the experiment if the first card drawn is
not replaced. Let the first number indicates the number of the first
card drawn.
b Find the sample space S2 of the experiment if the first card drawn is
replaced before the second one is drawn.
Solution (a)
The sample space S1 contains 12 ordered pairs (i , j ), where i , j, 1 ≤ i ≤ 4
and 1 ≤ j ≤ 4; the first number indicates the first card drawn. Thus:
(1, 2) (1, 3) (1, 4)
(2, 1) (2, 3) (2, 4)
S1 =
(3, 1) (3, 2) (3, 4)
(4, 1) (4, 2) (4, 3)
Example 3
Find the sample space for the experiment of measuring (in hours) the life
time of a transistor.
Solution (3): Clearly all possible outcomes are all positive real numbers,
i.e. the life time can take all values on a positive number line. Thus the
sample space S is given by; S = {0 ≤ X < ∞}.
n(A )
P (A ) = lim ,
n→∞ n
n(A )
where n is called the relative frequency of event A .
Stated differently, the relative frequency can be stated as the ratio
n(A )
n , for the probability of A , if n is a large number.
5
= 0.079
63
Also the relative frequency for obtaining a mark less than or equal to 83 is
1+3+4+5+7 20
= = 0.31
63 63
number of outcome in A
P (A ) =
total number of outcomes
Suppose there are 5 balls in a box, 3 balls are red and 2 are black.
The box is shaken, and a ball selected without looking. What is the
probability that this ball is red?
Solution :
The event that a ball selected is red consists of 3 outcomes out of 5
possible outcomes in all. According to the basic probability formula,
the probability of selecting a red ball is
3
P (red ball) = .
5
In a group of 400 college students, there are 170 science majors and 230
non-science majors. Of the science majors, 55 are women, and there are
120 women non-science majors. One student is selected at random from
the group. Find the probability that the selected student is:
1 A Science major
2 A Woman
3 Neither a woman nor a science major
Solution :
There are 110 students who are neither women nor science majors
110
so P (neither woman nor science major) = 400
If the sample space S is not finite (ie. infinite) then (a) must be
modified as follows:
1 1 2
+ = , (Axiom 3).
6 6 6
Property 1: P (Ā ) = 1 − P (A )
This means that if the probability of occurrence of an event A is P (A ),
then the probability of non occurrence of the event A is
P (Ā ) = 1 − P (A ).
1
For instance if the probability of obtaining a 6 in a roll of die is 6 then
the probability of not obtaining a 6 is 1 − ( 16 ) = 56 .
Property 2: P (φ) = 0, the probability of null or empty set or an
impossible event is zero.
Property 3: The probability of a union (addition rule)
P (A ∪ B ) = P (A ) + P (B ) − P (A ∩ B ).
P (A ) ≤ P (B ), if the event A ⊆ B .
P (A ∪ B ) = P (A ) + P (B )
.
Theorem 1: If A , B and C are any three events, then
P (A ∪ B ∪ C ) = P (A ) + P (B ) + P (C ) − P (A ∩ B ) − P (A ∩ C )
−P (B ∩ C ) + P (A ∩ B ∩ C )
The Proof is left as an Exercise.
=⇒ P (A ∩ B 0 ) = 12 − 16 = 31
c P [(A ∪ B )0 ] = 1 − P (A ∪ B )
= 1 − [P (A ) + P (B ) − P (A ∩ B )]
= 1 − [ 12 + 31 − 16 ] = 13
d According to De Morgan’s law, we have
P (A 0 ∩ B 0 ) = P [(A ∪ B )0 ] = 13
P (A ∪ B ∪ C ) = P [(A ∪ B ) ∪ C ]
2 1
= P (A ∪ B ) + P (C ) = +
3 4
11
= .
12
In the toss of a fair die, find the probability that the result is even or
divisible by 3.
Solution: Let A be the event that the result is even and B the event that
the result is divisible by 3.
Then A = {2, 4, 6} and B = {3, 6}, it implies that A ∩ B = {6}. Now, the
required probability is P (A ∪ B ).
P (A ∪ B ) = P (A ) + P (B ) − P (A ∩ B )
3 2 1 2
= + − =
6 6 6 3
1 A box contains 10 green balls and 8 red balls. Six balls are selected
at random. Find the probability that:
a all 6 balls are green.
b that exactly 4 out of the 6 balls are red.
c at least one of the 6 balls is red.
d 3 or 4 of the 6 balls are red.
2 A bag contains two red, three green and four black balls of identical
size except for colour. Three balls are drawn at random without
replacement.
a Show that the probability that two balls have the same colour and the
third is different is 55
84
.
b What is the probability that at least one is red.
Similarly;
P (A ∩ B )
P (B |A ) = where P (A ) > 0.
P (A )
Also a very useful formula in computing the joint probability of events
is
P (A ∩ B ) = P (A |B )P (B ) = P (B |A )P (A )
In general, for events Ai (i = 1, 2, 3, . . . )
P (A1 ∩ A2 ∩ A3 ∩ · · · ∩ An )
= P (A1 )P (A2 |A1 )P (A3 |A1 , A2 )P (A4 |A1 , A2 , A3 ) . . . P (An |A1 , A2 , . . . , An−1 )
The above formula is known as Multiplication Rule.
A survey of attitudes about one’s job yields the data in the following table
A person from this group is selected at random. Given that the selected
person is a bus driver, find the probability that he or she is happy.
Let H denote the event that a person is happy and B, the event that a bus
driver is selected. The required probability is P (H |B )
=⇒ P (R ) = P (R ∩ A ) + P (R ∩ B )
Using the multiplication formula, we have:
P (R ∩ A ) = P (R |A )P (A )
Given that 3 of the 8 boxes are of type A, P (A ) = 38 .
Next, type A box contains 7 marbles, of which 4 are red.
i Continued:
Therefore, the conditional probability is; P (R |A ) = 47 .
By the multiplicative rule,
4 3 3
P (R ∩ A ) = P (R |A )P (A ) = × = .
7 8 14
5 4 2
However, P (B ) = 8 and P (R |B ) = 6 = 3 and multiplicative rule yield
the result;
2 5 5
P (R ∩ B ) = P (R |B )P (B ) = × = .
3 8 12
3 5
∴ P (R ) = P (R ∩ A ) + P (R ∩ B ) = + = 0.63
14 12
P (A ∩ R ) 0.21
P (A |R ) = = = 0.33
P (R ) 0.63
From (i) above.
Two events, A and B that are related in such a way that the
occurrence of either one has no bearing on the occurrence of the
other are said to be independent.
For instance, if a coin is tossed repeatedly, the result of one toss does
not affect the result of any other toss.
P (A ∩ B ) = P (A ) × P (B ).
P (A |B ) = P (A ) and P (B |A ) = P (B ).
Solution:
For events A, B, C to be independent then, the conditions stated above
must hold
A ∩ B = {1} =⇒ P (A ∩ B ) = 14
A ∩ C = {1} =⇒ P (A ∩ C ) = 41
B ∩ C = {1} =⇒ P (B ∩ C ) = 14
2 2 1
1 P (A ∩ B ) = P (A ) × P (B ) = 4 × 4 = 4
2 2 1
2 P (A ∩ C ) = P (A ) × P (C ) = 4 × 4 = 4
2 2 1
3 P (B ∩ C ) = P (B ) × P (C ) = 4 × 4 = 4
1
Also; A ∩ B ∩ C = {1} =⇒ P (A ∩ B ∩ C ) = 4
2 2 2 1
But P (A ) × P (B ) × P (C ) = 4 · 4 · 4 = 8 , P (A ∩ B ∩ C ).
Figure: 1
Then
n
X
P (B ) = P (B |Ai )P (Ai ), where P (Ai ) > 0.
i =1
B = (B ∩ A1 ) ∪ (B ∩ A2 ) ∪ (B ∩ A3 ) ∪ · · · ∪ (B ∩ An )
P (B ) = P (B ∩ A1 ) + P (B ∩ A2 ) + P (B ∩ A3 ) + · · · + (B ∩ An )
n
X
⇒ P (B ) = P (B ∩ Ai )
i =1
And the;
P (B ∩ Ai )
P ( B |A i ) = , where P (Ai ) > 0
P (Ai )
Therefore
n
X
P (B ) = P (B |Ai )P (Ai ) (1)
i =1
P (Ai )P (B |Ai )
P (Ai |B ) =
P (A1 )P (B |A1 ) + P (A2 )P (B |A2 ) + · · · + P (An )P (B |An )
Sketch Proof:
Now,
P (Ai ∩ B )
P (Ai |B ) = , where P (B ) > 0
P (B )
P (B ∩ Ai )
Also, P (B |Ai ) = , where P (Ai ) > 0
P (Ai )
⇒ P (B ∩ Ai ) = P (B |Ai )P (Ai ).
Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 47 / 57
Bayes’ Theorem Cont’d.
Hence,
P (B |Ai )P (Ai )
P (Ai |B ) = Pn (2)
i =1 P (B |Ai )P (Ai )
Equations (1) and (2) are known as Total Probability Rule and Bayes’
Theorem, respectively.
(a) Let B be the event that the relay is defective, and let Ai be the
event that the relay is manufactured by plant i , where(i = 1, 2, 3). The
desired probability is P (B ).
Therefore, we have
P3
P (B ) = i =1 P (B |Ai )P (Ai )
It is estimated that 50% of emails are spam emails. Some software has
been applied to filter these spam emails before they reach your inbox.
A certain brand of software claims that it can detect 99% of spam emails,
and the probability for a false positive (a non-spam email detected as
spam) is 5%.
Now if an email is detected as spam, then what is the probability that it is
in fact a non-spam email?
Solution:
Let define the following events:
A = event that an email is detected as spam,
B =event that an email is spam,
B̄ = event that an email is not spam.
P (A |B̄ )P (B̄ )
P (B̄ |A ) =
P (A |B )P (B ) + P (A |B̄ )P (B̄ )
0.05 × 0.5
= = 0.048
0.99 × 0.5 + 0.05 × 0.5
Solution:
Let RR, BB, and RB denote, respectively, the events that the chosen card
is the red-red, the black-black, or the red-black card. Letting R be the
event that the upturned side of the chosen card is red, we have that the
desired probability is obtained by
P (RB ∩ R )
P (RB |R ) =
P (R )
P (R |RB )P (RB )
P (RB |R ) =
P (R |RB )P (RB ) + P (R |RR )P (RR ) + P (R |BB )P (BB )
1 1
2 · 3 1
= 1 1 1 1
= .
2 · 3 +1· 3 +0· 3
3
Note that there were 3 black sides and 3 red sides, yielding the
P (RB ) = 13 = P (RR ) = P (BB )
Solution:
Let M1 , M2 , M3 denote the sets of products produced by three machines of
the company, respectively. Let D denote the event that an item is
0
defective. The required probability is P [(M1 |D ) ].
P (D |M1 )P (M1 )
P (M1 |D ) =
P (D |M1 )P (M1 ) + P (D |M2 )P (M2 ) + P (D |M3 )P (M3 )
(0.02)(0.30)
=
(0.02)(0.30) + (0.03)(0.25) + (0.04)(0.45)
= 0.19
0
∴ P [(M1 |D ) ] = 1 − P (M1 |D ) = 0.81