Download Conditional Probabilities and Independence

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

History of statistics wikipedia , lookup

Ars Conjectandi wikipedia , lookup

Inductive probability wikipedia , lookup

Probability interpretations wikipedia , lookup

Probability wikipedia , lookup

Transcript
Conditional Probabilities
and Independence
(Session 03)
SADC Course in Statistics
Learning Objectives
At the end of this session you will be able to
• explain what is meant by a conditional
probability
• distinguish the concepts of mutual
exclusiveness and independence of events.
• identify events which are independent
• state and apply Bayes’ theorem
• construct a tree diagram for a specific
scenario and compute probabilities
associated with events along branches of
the tree
To put your footer here go to View > Header and Footer
2
Conditional probability
There are situations where we want to find the
probability of one event, say A, when we know
that some related event B has occurred.
For example, we may ask
• what is the probability of rain later today given
that it is now very windy
• what is the probability that a person is HIV
positive given that he has Tuberculosis (TB)
Such probabilities are called conditional
probabilities. In the first example the known
condition was that it was windy while in the
second example the known condition was that a
person is suffering from TB.
To put your footer here go to View > Header and Footer
3
Definition of conditional probability
The conditional probability of event A, given event
B has occurred, written P(A|B), is defined as
P( A  B)
P( A | B) 
,
P( B)
provided P(B)>0.
It is estimated as the proportion of the event B in
which A occurs (Note: A  B is a sub-event of B).
B
A
AB
To put your footer here go to View > Header and Footer
4
Practical quiz
If the red (lighter) object represents the event that
a person has AIDS and the blue (darker) object
represents the event that a person has TB, write
down a statement that each of the two figures
below represents.
Which of the two figures below is a better
representation of reality, explain.
Fig. 1
Fig. 2
To put your footer here go to View > Header and Footer
5
Independence of events
• Events are independent if the occurrence of
one does not affect the occurrence of the
others.
• In other words events are independent if
knowledge of one does not supply
information about the other.
• Events which are not independent are said
to be dependent.
To put your footer here go to View > Header and Footer
6
Conditional Probability and
Independence
• If events A and B are independent,
P(A  B) = P(A) x P(B)
• If P(B) is not equal to zero then
P(A|B) = P(A  B) / P(B)
= P(A) x P(B) / P(B)
= P(A)
The above says that if A and B are
independent, then the occurrence of B does
not change the probability of occurrence of A.
To put your footer here go to View > Header and Footer
7
Other ways of determining
independence
• Independence cannot always be
determined by the formula given above.
• The most common way is to assume
independence on the basis of knowledge of
the physical or natural phenomenon.
• In the following table draw lines joining
pairs of events A and B that you believe
are dependent. Give an argument for your
answers.
To put your footer here go to View > Header and Footer
8
Which pairs of events are dependent?
Set A
1. Mortgage rate
increase
2. Thunderstorm
3. A tuberculosis
epidemic
4. Crime wave
5. Decline of the
number of locals
touring abroad
Set B
1. Many people are poor
2. Depreciation of the local
currency by 20%
3. Interest rates hike by 5%
4. Increase of HIV
prevalence
5. Heavy rain
To put your footer here go to View > Header and Footer
9
Which repetitions of each experiment
will produce independent outcomes?
Experiment
Outcome
1. Childbearing
Sex of a child
2. Measuring lifetimes of
electric bulbs
3. Monitoring air pollution level
daily at a city centre
4. Poverty level of a rural
household over time
5. Rolling of a die
Lifetime in hours
Air pollution index
Monthly consumption
expenditure
The number that
appears on the
upper face
To put your footer here go to View > Header and Footer
10
Law of Total Probability
Recall from previous session that
c
P(B) = P(B  A) + P(B  A ).
A generalisation of this is:
P(A) = P(A|E1) P(E1) + P(A|E2) P(E2) + ….
……. + P(A|Ek) P(Ek)
where E1, E2, …., Ek are mutually exclusive
events such that E1 U E2 U …. U Ek = S.
i.e. the Ei’s form a partition of S.
Above generalisation is called the Law of
Total Probability.
To put your footer here go to View > Header and Footer
11
Bayes’ Theorem
Using above, we can write
P(B) = [P(B|A)*P(A) ] + [P(B|Ac)*P(Ac) ]
Combining this and the definition of
conditional probability we obtain
P( B | A) P( A)
P( A | B) 
.
c
c
P( B | A) P( A)  P( B | A ) P( A )
This is called Bayes’ Theorem. This may be
generalised to several mutually exclusive
events E1, E2, …., Ek that partition S.
To put your footer here go to View > Header and Footer
12
An application of Bayes’ rule
Consider the following events
• A is the event that a person is HIV infected.
c
• A is the event that a person is not HIV
infected.
• B is the event that a person tests as HIV
positive.
Suppose we also know that 15% of the people
in the area are HIV infected and research has
c
shown that P(B|A) = 0.98, P(B|A ) = 0.01.
What is the probability that a person who tests
positive is actually infected with HIV, that is
P(A|B)?
0.98  0.15
P( A | B) 
 0.95.
0.98  0.15  0.01 0.85
To put your footer here go to View > Header and Footer
13
The multiplication rule
• One of the major problems in calculating
probabilities is to make sure that all logical
possibilities are considered.
• The multiplication rule states that if events
A1, A2, ….,Ak have n1, n2, …, nk possible
outcomes respectively, then the total
number of possible outcomes of the k
events is n1 x n2 x … x nk .
To put your footer here go to View > Header and Footer
14
The addition rule
If, on the other hand, events A1, A2, ….,Ak
are mutually exclusive, we have the addition
rule, i.e. that
A1 U A2 U …. U Ak has
n1 + n2 + … + nk possible outcomes.
Note: Independence and mutual exclusive
are not the same thing, e.g. if a die and a
coin are thrown simultaneously, the event of
a six on the die and the event “head” on the
coin, are independent, but are not mutually
exclusive.
To put your footer here go to View > Header and Footer
15
An Example:
Suppose companies X, Y, Z have tendered for a
low-cost housing project in a municipality.
There are concerns whether the project will be
completed in time and whether the cost will be as
budgeted or otherwise. The events are:
A – company X,Y or Z.
B – in time (T) or not in time (N).
C – below budget (U), as budgeted (B), over
budget (O).
These are independent events, so total number of
possible outcomes is 3x2x3 = 18.
We can represent the possible outcomes using a
tree diagram.
To put your footer here go to View > Header and Footer
16
A tree diagram for housing project
T
U
B
N
O U
Z
Y
X
T
B
O
U
B
T
N
O
U
B
O
U
B
To put your footer here go to View > Header and Footer
N
O
U
B
O
17
Prob. calculations from tree diagram
Suppose from previous experience you have the
following probabilities:
• 0.3 that company X will win the bid, 0.45 that Y
will win and 0.25 that Z will win.
• 0.9 that the project will finish in time if X does it,
0.8 it will finish in time if Y does it an 0.7 it will
finish in time if Z does it.
• 0.2 that the project will go over-budget if the
project finishes in time and 0.7 that it will go
over-budget if it does not finish in time.
Calculate the probability that the project will not
go over the budgeted cost.
To put your footer here go to View > Header and Footer
18
0.25
0.3
0.45
0.8
0.9
T
N
B
0.7
O U
0.7
T
0.2
U
Z
Y
X
B
O
0.3x0.9x0.2
T
N
0.2
U
B
0.7
O
U
B
O
0.45x0.8x0.2
0.3x0.1x0.7
N
0.7
0.2
U
B
O
U
B
O
0.25x0.7x0.2
0.45x0.2x0.7
To put your footer here go to View > Header and Footer
0.25x0.3x0.7
19
Answer to question (slide 18)
The required probability is 1-P(O), where
P(O) = (0.3*0.9*0.2) + (0.3*0.1*0.7) +
+ (0.45*0.8*0.2) + (0.45*0.2*0.7) +
+ (0.25*0.7*0.2) + (0.25*0.3*0.7)
= 0.2975.
Hence 1- P(O) = 0.7025.
To put your footer here go to View > Header and Footer
20
To put your footer here go to View > Header and Footer
21