or P[ Since we have (Bayes` Theorem)

Conditional Probability
The probability of an event is often affected by the occurrence of other events and/or
the knowledge of information relevant to the event. Given two events, A and B, of an
experiment, P[ A| B] is called the conditional probability of A given that B has already
occurred.
It is defined by P[ A| B]=
P[ A ∩ B ]
P[ B ]
S
A
P[ A | B ] =
=
area of A in B
area of B
P[A ∩ B ]
P[ B ]
Since P[ A ∩ B ] = P[ B ∩ A ]
B
or P[ A ∩ B ] = P[ A | B ] P[ B ]
we have
P[ A | B ] P[ B ] = P[ B | A ] P[ A ] (Bayes’ Theorem)
Given the conditional probability P[ A| B]=
P[ A ∩ B]
P[ B]
Sometimes we know P[ A| B] and wish to compute P[ A ∩ B].
If the events A and B can both occur, then P[ A ∩ B ] = P[ A| B ]P[ B ]
Example: A site is composed of 60% sand and 40% silt in separate layers and pockets.
At this site, 10% of sand samples and 5% of silt samples are contaminated
with trace amounts of arsenic. If a soil sample is selected at random, what is the probability
that it is a contaminated sand sample?
Solution:
Let A be the event the sample is sand
Let B be the event the sample is silt
Let C be the event the sample is contaminated
Hence P[ A] = 0.6, P[ B ] = 0.4, P[C | A] = 0.1, P[C | B] = 0.05,
We want to find P[ A ∩ C ]
P[ A ∩ C ] = P[C | A]P[ A]
= 0.6 × 0.1 = 0.06
Two events A and B are independent if and only if P[ A ∩ B] = P[ A] P[ B].
This also implies that P[ A | B] = P[ A]
Independent events are not disjoint and disjoint events are not independent!
Example : Four retaining walls, A, B, C, and D, are constructed independently.
If their probabilities of sliding failure are estimated to be P[ A] = 0.01, P[ B] = 0.008,
P[C ] = 0.005, P[ D ] = 0.015 respectively, what is the probability that none of them will
slide by failing?
Solution : The four event are independent because they do not affect the probability
of the other occurring.
We want: P[ Ac ∩ B c ∩ C c ∩ D c ]
=P[ Ac ] P[ B c ] P[C c ] P[ D c ]
(since all event are independent)
=(1 − P[ A]) (1 − P[ B]) (1 − P[C ]) (1 − P[ D])
=(1 − 0.01) (1 − 0.008) (1 − 0.005) (1 − 0.015)
=0.9625
Total Probability Theorem
Sometimes we know the probability of an event in terms of the occurrence of
other events and want to compute the unconditional probability of the
event. For example, when we want to compute the total probability of
failure of a bridge, we can start by computing a series of simpler problems
such as
1.
2.
3.
4.
the probability of bridge failure given a maximum static load,
the probability of bridge failure given a maximum dynamic traffic load,
the probability of bridge failure given an earthquake,
the probability of bridge failure given a flood, etc.
The Total Probability Theorem can be used to combine the
above probabilities into the unconditional probability of bridge
failure. We need to know the above conditional probabilities along with the
probabilities that the “conditions” occur (e.g. the probability that the
maximum static load will occur during the design life, etc.).
P[F ] = P[F ∩ C1 ] + P[F ∩ C2 ] + P[F ∩ C3 ] + P[F ∩ C4 ] + P[F ∩ C5 ]
= P[ F | C1 ]P[C1 ] + P[ F | C2 ]P[C2 ] + P[ F | C3 ]P[C3 ] + P[ F | C4 ]P[C4 ] + P[ F | C5 ]P[C5 ]
C1 = event that no extreme effects occur
C2 = event of maximum static load
C3 = event of maximum dynamic load
C4 = event of an earthquake
C5 = event of a flood
…
Example : A company manufactures peizocones of which 50% are produced at plant A,
30% at plant B, and 20% at plant C. It is known that 1% of plant A's, 2% of plant B's,
and 3% of plant C's output are defective. What is the probability that a peizocone chosen
at random will be defective?
Solution :
Let A be the event that the peizocone was produced at plant A. P[ A] = 0.50
Let B be the event that the peizocone was produced at plant B. P[ B] = 0.30
Let C be the event that the peizocone was produced at plant C. P[C ] = 0.20
Let D be the event that the peizocone is defective. P[ D | A] = 0.01, P[ D | B ] = 0.02, P[ D | C ] = 0.03
One approach is to use a Venn Diagram :
A
B
C
S
D
P[ D ] = P[( D ∩ A)] ∪ P[( D ∩ B )] ∪ P[( D ∩ C )]
= P[( D ∩ A)] + P[( D ∩ B)] + P[( D ∩ C )] since D ∩ A, D ∩ B and D ∩ C are disjoint.
= P[ D | A] P[ A] + P[ D | B ] P[ B ] + P[ D | C ] P[C ]
= 0.01(0.5) + 0.02(0.3) + 0.03(0.2) = 0.017
Another approach is to use an Event Tree :
We will first demonstrate the Event Tree for this example and then explain some of
the rules governing it :
0.5
0.3
0.2
1.
2.
3.
4.
A
B
C
0.01
0.99
0.02
0.98
0.03
0.97
D
Dc
D
Dc
D
Dc
There is a starting node from which two or more branches leave.
At the end of each branch there is another node from which two or more branches may leave.
Repeat as needed from the new nodes until all possibilities have been covered.
A probability is associated with each branch, and for all branches except those leaving the first
node the probabilities are conditional probabilities.
5. Branches leaving any node must form a partition of the sample space, that is the sum of the
probabilities of all branches leaving a node must sum to unity.
0.5
0.3
0.2
A
B
C
0.01
0.99
0.02
0.98
0.03
0.97
D
Dc
D
Dc
D
Dc
Returning to the original question, we have
P[ D] = P[ D | A] P[ A] + P[ D | B ] P[ B ] + P[ D | C ] P[C ]
= 0.01(0.5) + 0.02(0.3) + 0.03(0.2) = 0.017
which, in terms of the event tree, is just the sum of all the paths that
lead to the outcome that you desire, D. Event trees make “total
probability” problems much simpler. They give a “picture” of what is
going on, and allow the computation of some of the desired probabilities
directly.
Another Total Probability Theorem example
Consider the stability of an embankment.
A earthquake of magnitude 7 or more will occur with
probability 0.1 during the design life.
A flood of more than 50 mm in 24 hours will occur with
probability 0.3 during the design life.
Assume that there is a negligible
probability of both occurring during the design life.
If the embankment has 0.3 probability of failing in the event
of an earthquake of magnitude 7 or more and a 0.2 probability
of failing in the event of a flood of more than 50 mm in 24
hours, then what is the probability of embankment failure
within its design life?
Let C1 be the event that an earthquake occurs
Let C2 be the event that a flood occurs
Let F be the event that the embankment fails
Then, we are given that
P[C1] = 0.1,
P[C2] = 0.3
c
c
P[C1∩C2] = 0.0, P[ C1 ∩C2 ] = 1 – (0.1+0.3) = 0.6
P[F | C1] = 0.3,
P[F | C2] = 0.2
c
C1 ∩C2
assume P[F | C1c∩C2c ] = 0.0
C1
0.1
F
0.6
F C2
0.3
c
S
Same example using an Event Tree
c
c
c
c
P[F] = P[F | C1]P[C1] + P[F | C2]P[C2] + P[F | C1 ∩C2 ]P[F | C1 ∩C2 ]
= (0.3)(0.1)
+
(0.2)(0.3) +
(0)(0.6)
= 0.09
0.1
0.3
0.6
C1
C2
c
0.3
F
0.7
0.2
Fc
F
0.8
c
C1 ∩C2
c
F
0 F
c
F
1
C1c∩C2c
C1
0.1
F
0.6
F C2
0.3
S
More on Bayes’ Theorem
posterior
P[ A | E ] =
prior
P[ E| A] P[ A]
P[E ]
Example: A contaminated soil has one of three possibilities:
1. only toxin 1 present (state A) Æ remediation scheme 1
2. only toxin 2 present (state B) Æ remediation scheme 2
3. both toxins present (state C) Æ remediation scheme 3
Assume that we have no prior bias about which state is true.
Thus, choose our “prior” to be P[A] =P[B] = P[C] = 1/3.
A sample is taken. It yields trace amounts of toxin 1.
Let E be the event that toxin 1 was found in a sample.
What is the updated probability of state A given E?
If A is true (only toxin 1), then the probability of observing trace
amounts of toxin 1 given A is 1.0 Æ P[E|A] = 1
If B is true (only toxin 2) then
Æ P[E|B] = 0
If C is true (both toxins) then
Æ P[E|C] = 1/2
(assume toxins occur in equal proportions if C is true)
P[E] = P[E|A]P[A] + P[E|B]P[B] + P[E|C]P[C]
= (1)(1/3) + (0)(1/3) + (1/2)(1/3) = 1/2
Updated probabilities, given that Toxin 1 has
been found in the first sample
P[ E| A] P[ A] (1)(1/ 3)
P[ A | E ] =
=
= 2/3
P[ E ]
(1/ 2)
P[ B | E ] =
P[ E|B] P[ B] (0)(1/ 3)
=
=0
P[ E ]
(1/ 2)
P[C | E ] =
P[ E|C ] P[C ] (1/ 2)(1/ 3)
=
= 1/3
P[ E ]
(1/ 2)
These will be the “prior” values for the next update.
Another sample is taken. It too yields trace amounts of toxin 1.
Let E be the event that toxin 1 was found in this sample.
What is the updated probability of state A given E?
As before,
if A is true (only toxin 1), then the probability of observing trace
amounts of toxin 1 given A is 1.0 Æ P[E|A] = 1
If B is true (only toxin 2) then
Æ P[E|B] = 0
If C is true (both toxins) then
Æ P[E|C] = 1/2
(assume toxins occur in equal proportions if C is true)
P[E] = P[E|A]P[A] + P[E|B]P[B] + P[E|C]P[C]
= (1)(2/3) + (0)(0) + (1/2)(1/3) = 5/6
Updated probabilities, given that Toxin 1 has
also been found in the second sample
P[ E| A] P[ A] (1.0)(2 / 3)
P[ A | E ] =
=
= 4/5
P[ E ]
(5 / 6)
P[ B | E ] =
P[ E|B] P[B] (0)(0)
=
=0
P[ E ]
(5/ 6)
P[C | E ] =
P[ E|C ] P[C ] (1/ 2)(1/ 3)
=
= 1/5
P[ E ]
(5 / 6)
These will be the “prior” values for any subsequent updating.
Decision Tree for Cost Assessment
• identify possible design alternatives and their costs
• for each design alternative, identify possible outcomes
(which are usually uncertain/random)
• assess probabilities of outcomes occurring
• assess costs (or cost distributions) associated with each
outcome
• for each design alternative, compute total expected cost (the
sum of the costs times their probability of occurrence)
• the optimum design alternative is the one with the lowest total
expected cost (this is one of the simplest and most popular
decision criterion, but there are others)
Decision Tree: Landslide Remediation Example
Alternative
(cost)
Outcome
(prob)
Failure
Cost
Total
Expected Cost
Landslide, L
Do Nothing
(0)
10
(0.3)
0 + 10(0.3) = 3.0
No Landslide, Lc
0
(0.7)
Landslide, L
Flatten Slope
(2)
10
(0.02)
2 + 10(0.02) = 2.2
c
No Landslide, L
0
(0.98)
Landslide, L
Effective, E
(0.8)
Install Drainage
(0.05)
No Landslide, Lc
10
0
(0.95)
Landslide, L
(1)
Ineffective, E c
(0.2)
(0.2)
10
No Landslide, Lc
(0.8)
0
1+10(0.05)(0.8)+10(0.2)(0.2)
= 1.8