0% found this document useful (0 votes)
29 views57 pages

STAT 111 Lecture 6

Uploaded by

risterb99
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views57 pages

STAT 111 Lecture 6

Uploaded by

risterb99
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 57

STAT 111: Introduction to Statistics and Probability I

Lecture 6: Random Experiments

Dr. Gabriel Kallah-Dagadu

University of Ghana
Department of Statistics and Actuarial Science

February 23, 2021

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 1 / 57


Outline

1 Random Experiment

2 Basic Concepts of Probability

3 Axioms and Laws of Probability


Axioms of Probability
Properties of Probability

4 Conditional Probability and Bayes’ Rule


Conditional Probability
Total Probability Rule and Bayes’ Theorem
Bayes’ Theorem
Applications of Bayes’ Theorem and TPR

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 2 / 57


Learning Outcomes

The purpose of this lecture is to equip students with the basic


knowledge and skills random experiments and the basic concept in
probability and its applications.
By the end of this lecture, students should be able to:
1 Defined and explained the concept of random experiment.
2 Differentiate between the three definition types of probability.
3 State and explained the Axioms and Laws of Probability.
4 State and explained the total probability rule and Bayes’s theorem.
5 Use the concept of total probability rule and Bayes’ theorem to solve
real life problems.

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 3 / 57


Random Experiment

An experiment is a process of observation.


A random experiment is any process of observation or activity in
which the results can not be predicted with certainty.
Alternatively, an experiment or random experiment is any specified
set of actions, where the results cannot be predicted with certainty.
Each repetition of an experiment is called a trial.
Typical examples of random experiments are:
the roll of a die, the toss of a coin, selecting a ball at random from a
box containing 3 balls marked “a”, “b”, “c”.
In describing an experiment, we use the following terms.

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 4 / 57


Definition of some Terminologies

In describing an experiment, the following terms are employed;


Outcomes, Events and Sample Space.

An outcome is a result of an experiment.

An event is any collection of outcomes, and a simple event is an


event with only one possible outcome.

The sample space, S of a given experiment is a set that contains all


possible outcomes of the experiment.

A set A is called a subset of B, denoted by A ⊂ B if every element of


is also an element of B Any subset of the sample space is called an
event.

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 5 / 57


Definition of some Terminologies

The sample point, s is defined as one possible outcome of a random


experiment.

Note that a set with one sample point, is often referred as an


elementary event.

The sample space, S is the subset of itself, that is S ⊂ S. Since S is


the set of all possible outcomes of the experiment, it is often referred
to as certain event.

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 6 / 57


Worked Examples

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, . . . }.

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 7 / 57


Examples Cont’d.

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)

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 8 / 57


Solution (b)

The sample space S2 contains 16 ordered pairs (i , j ), where 1 ≤ i ≤ 4 and


1 ≤ j ≤ 4, the first number indicates the first card drawn. Thus:

 (1, 1) (1, 2) (1, 3) (1, 4)


 

 (2, 1) (2, 2) (2, 3) (2, 4) 
S2 =  
 (3, 1) (3, 2) (3, 3) (3, 4) 

(4, 1) (4, 2) (4, 3) (4, 4)

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 9 / 57


Examples Cont’d.

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 < ∞}.

Note: It is useful to distinguish between two types of sample spaces:


Discrete and Continuous.

A sample space is discrete if it contains a finite or countable infinite set of


possible outcomes. In this case the elements in the sample space can be
listed or the list does not terminate as in example 1.
A sample space is continuous if it contains an interval (either finite or
infinite) of real numbers as seen in Example 3 above.

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 10 / 57


Introduction

Chance and the assessment of risk play a part in everyone’s life.


As a loan officer you may want to evaluate the probability that a
customer defaults.
As an investment officer you are interested in finding the likelihood of
an investment results in a loss.
Probability has found a wide range of business applications such as:
calculation of risk in the banking and insurance industries, quality
control and market research.
Most events in life are unpredictable, i.e. events in life are
non-deterministic.
If the world is treated as stochastic then we can measure the chances
of any particular outcome happening in a given situation.

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 11 / 57


Definition

Probability is the measure of the likelihood of the occurrence of an


event.
The probability of an event can be thought of as the relative frequency
of the event.
The probability of an outcome can also be interpreted as a subjective
probability, or degree of belief, that the outcome will occur.
Probabilities are numbers between 0 and 1.
An event with probability 0 has no chance of occurring, and an event
with probability 1 is certain to occur.
Other definitions of Probability are Relative Frequency and Classical
definitions.

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 12 / 57


Relative Frequency Definition

The probability of an outcome is interpreted as the limiting value of


the proportion of times the outcome occurs in n repetitions of the
random experiment as n increases beyond all bonds.

For example if we assign a probability of 0.4 to the outcome that there


is a defective item in a production batch, we might interpret this
assignment as implying that, if we analyse many items in the
production batch, approximately 40% of them will be defective.

This example illustrates a relative frequency interpretation of


probability.

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 13 / 57


Relative Frequency Definition

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.

When the likelihood assumption is not valid, then the relative


frequency method can be used.
The relative frequency technique, lead one to conduct an experiment
n times and record the outcomes.
The probability of event A is assigned by P (A ) = fnA , where fA
denotes the number of experimental outcomes that satisfy event A .

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 14 / 57


Worked Example

The table below shows the frequency distribution of grades in Statistics


class.
Marks 60 75 78 80 83 86 88 90 92 96 98 99
Freq 1 3 4 5 7 11 13 5 7 4 2 1
The relative frequency for mark 90 is computed as:

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

Using the relative frequency definition, we can therefore estimate


probabilities. Thus the probability of obtaining a mark 90 is 0.079 and that
obtaining a mark less than or equal to 83 is 0.31.
Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 15 / 57
Classical Definition ( Equally Likelihood Model)

In an experiment for which the sample space is S and the outcomes


are equally likely (that is, each outcome has the same chance of
occurring), then the probability of an event A occurring is given by the
formula

number of outcome in A
P (A ) =
total number of outcomes

number of ways that A can occur


=
number of ways the sample space S can occur
n(A )
=
n(S )
In other words, P (A ) is the fraction of the total number of outcomes
that cause the event A to occur.

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 16 / 57


Example 1

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

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 17 / 57


Example 2

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 :

Science Majors Non -Science Majors Total


Women 55 120 175
Men 115 110 225
Total 170 230 400

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 18 / 57


Solution Cont’d

Let A denotes the event that a student is a science major, i.e.


n(A ) = 170; also let S denotes the total sample size, n(S ) = 400.

Ans 1: There are 170 science majors out of 400 students, so


n(A )
P (Sciencemajor ) = P (A ) = n(S ) = 170
400 .

Let W represents the event a student is a woman, n(W ) = 175, since


there are 175 women out of 400 students altogether, we have
n (W ) 175
P (Woman) = P (W ) = n(S )
= 400

There are 110 students who are neither women nor science majors
110
so P (neither woman nor science major) = 400

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 19 / 57


Axioms of Probability

Let S be a finite sample space, and A be an event in S. Then in the


axiomatic definition, the probability P (A ) of the event A is a real number
assigned to A which satisfies the axioms:
Axiom 1: 0 ≤ P (A ) ≤ 1.
Probability is a number between 0 and 1 (inclusive)
Axiom 2: P (S ) = 1 and P (φ) = 0.
In performing an experiment, we assume that the result will be one of
the simple outcomes. In other words, we assume that the event S will
occur.
Axiom 3: (a) If A and B are mutually exclusive events, then
P (A ∪ B ) = P (A ) + P (B ).

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 20 / 57


Axioms of Probability Cont’d.

If the sample space S is not finite (ie. infinite) then (a) must be
modified as follows:

(b) If A1 , A2 , . . . , is an infinite sequence of mutually exclusive events in


S, that is (Ai ∩ Bj = φ) for i , j, then
!

P (A1 ∪ A2 ∪ A3 ∪ . . . ) = P
S
Ai
i =1
= P (A1 ) + P (A2 ) + P (A3 ) + . . .

P
= P (Ai )
i =1

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 21 / 57


Axioms of Probability Cont’d.

This means for instance if A1 , A2 , A3 , . . . , are events that can not


occur simultaneously, then the probability that one among them will
occur is the sum of their probabilities.

For example, the probability of either a 2 or a 6 in a roll of a die is

1 1 2
+ = , (Axiom 3).
6 6 6

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 22 / 57


Elementary Properties of Probability

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 .

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 23 / 57


Finally, if A and B are mutually exclusive, then P (A ∩ B ) = 0 and the
formula becomes

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.

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 24 / 57


Worked Example

Suppose events A , B and C have probabilities; P (A ) = 12 , P (B ) = 31 and


P (C ) = 14 . Furthermore, assume that A ∩ C = φ, B ∩ C = φ and
P (A ∩ B ) = 61 . Use the axioms and properties of probabilities as well as
the facts concerning sets and events to find.
a P [(A ∩ B )0 ]
b P (A ∩ B 0 )
c P [(A ∪ B )0 ]
d P (A 0 ∩ B 0 )
e P (A ∪ B ∪ C )

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 25 / 57


Solution

a Applying property 1, we have


1 5
P [(A ∩ B )0 ] = 1 − P (A ∩ B ) = 1 − 6 = 6
b We use the relation: A = (A ∩ B 0 ) ∪ (A ∩ B )
Now, P (A ) = P [(A ∩ B 0 ) ∪ (A ∩ B )]
= P (A ∩ B 0 ) + P (A ∩ B )
=⇒ 2 = P (A ∩ B 0 ) + 16
1

=⇒ 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

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 26 / 57


Solution Cont’d

e Since A ∩ C = φ and B ∩ C = φ, it follows that (A ∪ B ) ∩ C = φ. Also


P (A ∪ C ) = 32 and P (C ) = 14 , then

P (A ∪ B ∪ C ) = P [(A ∪ B ) ∪ C ]

2 1
= P (A ∪ B ) + P (C ) = +
3 4
11
= .
12

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 27 / 57


Example 2

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

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 28 / 57


Theorem

Definition: Two events A and B are said to be equally likely if


P (A ) = P (B ). Event A is said to be more likely than B if
P (A ) > P (B ).

Theorem 2: If all the outcomes of a random experiment consist of n


equally likely simple events, then the probability of an event E made
up of k simple events is
k
P (E ) = .
n
The proof is left as an Exercise.

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 29 / 57


Trial Questions

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.

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 30 / 57


Conditional Probability

Suppose S is the sample space for an experiment with events A and


B.
Then for experiments with equally likely outcomes, the conditional
probability of A given B is the fraction of outcomes in B that are also
in A .
Since only outcomes in B are taken into consideration, in effect, B
becomes the sample space, so we have:

n(event A occurs given that event B occurs)


P (A |B ) =
n(event B occurs)
P (A ∩ B )
P (A |B ) = , where P (B ) > 0
P (B )

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 31 / 57


Conditional Probability Cont’d.

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.

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 32 / 57


Example 1

A survey of attitudes about one’s job yields the data in the following table

Jobs Happy Unhappy Total


Bus Drivers 50 75 125
Lawyers 40 35 75
Total 90 110 200

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.

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 33 / 57


Example Cont’d: Solution

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 )

Now, using the conditional probability formula we have:


P (H ∩ B )
P (H |B ) =
P (B )
50 125
From the table, P (H ∩ B ) = and P (B ) =
200 200
Therefore,
50/200 50
P (H |B ) = = = 0.4
125/200 125

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 34 / 57


Example 2

There are 8 boxes, 3 of type A and 5 of type B. Type A boxes each


contain 3 green marble and 4 red marbles. Type B boxes each contain 2
green marble and 4 red marbles. A box is selected at random and a
marble is drawn at random from the selected box.
i Find the probability that a red marble is selected.
ii A marble was selected and was found to be red, what is the
probability that it came from a type A box.
Solution:
Let R denote the event that a red marble is selected, let A represent the
event that a type A box is selected, and let B denote the event that a type
B box is selected.

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 35 / 57


Solution

i The required probability is P (R ).


Note: a red marble may either come from box A or box B but not
both, hence R = (R ∩ A ) ∪ (R ∩ B ), since (R ∩ A ) and (R ∩ B ) are
mutually exclusive events,

=⇒ 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.

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 36 / 57


Solution Cont’d.

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

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 37 / 57


Solution

ii The required probability is P (A |R ).


Using the conditional probability formula, we have:

P (A ∩ R ) 0.21
P (A |R ) = = = 0.33
P (R ) 0.63
From (i) above.

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 38 / 57


Independents Events

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.

Alternatively; Two events A and B are said to be independent if


knowledge of the occurrence of A, in no ways influences the
probability of the occurrence of B and vice versa.

Statistically, events A and B are said to be independent, if and only if

P (A ∩ B ) = P (A ) × P (B ).

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 39 / 57


Independent Events Cont’d.

It follows from the definition of conditional probability that if A and B


are independent, then

P (A |B ) = P (A ) and P (B |A ) = P (B ).

We say that three events A, B, and C are jointly or mutually


independent if and only if the following conditions hold:
1 P (A ∩ B ) = P (A ) × P (B )
2 P (A ∩ C ) = P (A ) × P (C )
3 P (B ∩ C ) = P (B ) × P (C )
4 P (A ∩ B ∩ C ) = P (A ) × P (B ) × P (C )

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 40 / 57


Example 3

A ball is drawn at random from an open box containing four balls


numbered 1, 2, 3, 4. Let A = {1, 2}, B = {1, 3}, C = {1, 4}.
Examine whether or not A , B , C are independent.

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

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 41 / 57


Solution Cont’d.

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 ).

Hence A, B, C are pairwise independent but not jointly or mutually


independent.

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 42 / 57


Theorem 3:

If A and B are independent events, then


i. A 0 and B 0 are independent.
ii. A 0 and B are independent.
iii. A and B 0 are independent.
The proofs are left as an Exercise.

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 43 / 57


Total Probability Rule

Suppose that the sample space, S of a random experiment, can be


partitioned into a set of n mutually exclusive and exhaustive events,
say A1 , A2 , . . . , An (Figure 1).
Let B be another event in the sample space with a strictly positive
probability of taking place.

Figure: 1

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 44 / 57


Total Probability Rule Cont’d

Then
n
X
P (B ) = P (B |Ai )P (Ai ), where P (Ai ) > 0.
i =1

Sketch of the Proof:


From Figure 1 above, we can write

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

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 45 / 57


Total Probability Rule (Cont..)

Since, (B ∩ Ai ), where i = 1, 2, . . . , k are mutually exclusive events.

And the;
P (B ∩ Ai )
P ( B |A i ) = , where P (Ai ) > 0
P (Ai )

=⇒ P (B ∩ Ai ) = P (B |Ai )P (Ai ), where i = 1, 2, . . . , n

Therefore
n
X
P (B ) = P (B |Ai )P (Ai ) (1)
i =1

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 46 / 57


Bayes’ Theorem

Suppose that the events A1 , A2 , . . . , An , is a partition of S, sample


space and B is any event. Then for any i,

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.

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 48 / 57


Example 1:

A company producing electric relays has three manufacturing plants


producing 50, 30 and 20 percent, respectively of its products. Suppose
that the probabilities that a relay manufactured by these plants is defective
are 0.02, 0.05 and 0.01, respectively.

a. If a relay is selected at random from the output of the company, what


is the probability that it is defective?

b. If a relay selected at random is found to be defective, what is the


probability that it was manufactured by plant 2?

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 49 / 57


Solution

(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 )

P (B ) = 0.02(0.5) + (0.05)(0.3) + (0.01)(0.2) = 0.027

(b) The desired probability is

P (B |A2 )P (A2 ) (0.05)(0.3)


P (A2 |B ) = = = 0.556
P (B ) 0.027

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 50 / 57


Example 2:

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.

Given that, P (B ) = P (B̄ ) = 0.5, P (A |B ) = 0.99, P (A |B̄ ) = 0.05

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 51 / 57


Solution Cont’d.

Using Bayes’ theorem or formula, we have:

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

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 52 / 57


Example 3:
Suppose we have 3 cards identical in form except that both sides of the
first card are coloured red, both sides of the second card are coloured
black, and one side of the third card is coloured red and the other side is
coloured black.The 3 cards are mixed up in a hat, and 1 card is randomly
selected and put down on the ground.
If the upper side of the chosen card is coloured red, what is the probability
that the other side is coloured black?

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 )

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 53 / 57


Solution Cont’d.

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 )

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 54 / 57


Example 4:

In certain juice production company there are three production machines


involved in the production. Suppose that machine M1 produces 30% of the
day’s production of the product, while machines M2 and M2 produce 25%
and 45%, respectively. Suppose further that, machines M1 , M2 and M3
turn out 2%, 3% and 4% defective products, respectively, each day. If an
item is picked at random and found to be defective, what is the probability
that it did not come from machine M1 ?

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 ) ].

Now, we have P (M1 ) = 0.30, P (M2 ) = 0.25, P (M3 ) = 0.45,


P (D |M1 ) = 0.02, P (D |M2 ) = 0.03 and P (D |M3 ) = 0.04.

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 55 / 57


Solution Cont’d.

By Bayes’ formula, we have

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

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 56 / 57


Trial Questions:

1 In a study, physicians were asked what the odds of breast cancer


would be in a woman who was initially thought to have a 1% risk of
cancer but who ended up with a positive mammogram result (a
mammogram accurately classifies about 80% of cancerous tumors
and 90% of benign tumors). Ninety-five (95) out of a hundred
physicians estimated the probability of cancer to be about 75%. Do
you agree?
2 Three manufactures M1 , M2 and M3 , supply all of the electronic
components to a manufacturer of VCR’s. Each VCR uses one unit of
the components. Suppose M1 supplies 41 units, 15% of which are
defective; that M2 supplies 63 units, 10% of which are defective; and
M3 supplies 54 units, 12% of which are defective. A VCR is selected
at random and is found to be defective. Which manufacturer is most
likely to have provided the components for the defective VCR?
Explain your answer.

Dr. Gabriel Kallah-Dagadu STAT 111 February 23, 2021 57 / 57

You might also like