Understanding Conditional Probability
Understanding Conditional Probability
5 PROBABILITY
CONDITIONAL
Those whose occurrence is conditional
1.5.1 on the occurrence of another event
In a large number of practical problems, the events of greatest interest are
PROBABILITY
Therefore, it is important to introduce the concept of conditional probability,
this is the conditional probability that has occurred or could occur CONDITIONAL
certain event.
Conditional Probability
1. No negativity: P A i | B 0
2. Normativity: P S | B 1
3. Additivity: P A B|C P A |C P B |C , A B
4. Probability of the complement:P A | B 1 P A | B
5. Probability of the impossible event: P B 0
6. Law of addition of probabilities:
P A B|C P A |C P B |C P A B|C
Marginal probability refers to the probability of any event,
to distinguish what is unconditional, that the occurrence of any does not matter
another event.
Conditional Probability
4 1
P T | P 1 P T | P 1 5 5
0.20
If the Papaloapan is observed and it is not polluted, it is very likely that the
Neither is he a fool.
P P T 0.35 7
P P |T 0.875
P T 0.40 8
7 1
P P |T 1 P P |T
8 8
0.125 1
If the Fool is observed first and turns out to be contaminated, it is very likely that
the Papaloapan is also it.
P P T P P T 0.20 0.20 1
P P |T 0.333
PT 1 P T 1 0.40 0.60 3
1 2
P P |T 1 P P |T
3 3
0.666 1
If the Fool is observed and is not contaminated, it is more likely that the Pope-
the swamp is polluted rather than not.
It could be concluded then that it would be more useful to observe the Papaloapan River;
however, the consequences of making a mistake are being overlooked
appreciation and it can be of two types: to suppose a contaminated river when
it is not, or to assume a river is unpolluted when it is.
146
Conditional Probability
It has been observed that the sections x and y become congested with probabilities
0.1y0.2, respectively, and that when the tramoyse congests, the tramox
se congestiona con probabilidad0.5. Considerando que los tres tramos tienen
the same capacity, with three lanes, at a permissible speed of 80 km/h
Let the events be: x ={tramoxsaturado} P x 0.1
y = {saturated tramoy} P y 0.2
P x | y 0.5
Conditional Probability
1 1 0
For i = 1: P AI P A i
Aj , P P A
A
1 1
i 1 i 1 j 1
For i = 2:
2 2 1
P Ai P A i
A,j P
A 1
A 2 A D 1 | A
D 2 1
i 1 i 1 j 1
k k i 1
For i = k: assuming true that: P Ai P A i Aj
i 1 i 1 j 1
For i = k + 1:
k 1 k k 0 k
P Ai P Ai A k 1 P AI Aj P A k 1 Ai
i 1 i 1 i 1 j 1 I 1
k
P Ai | A 1 A 2... A Pi 1 A | A
k 1 1 ...
A A
2 k
i 1
k 1 k 1 i 1
i
P A|A A1 ... 2 A Pi 1 A i Aj
i 1 i 1 j 1
Conditional Probability
P z | x y 1 P z | x y 1 1 0
1
P x y z 0 0
9
0.9
d) no section should be saturated:
P x y z P x P y | x P z | x y
4
P z | x
y 1 P z | x
y 1 0.2 0.8
5
8 4 16
P x y z 0.9 9 5 25
0.64
INDEPENDENCE IN PROBABILITY
P of
The occurrence of B affects the probability of the occurrence | B P A
A A:
and vice versa, the occurrence of A affects the probability of occurrence of B:
P B | A P B it is said then that events A and B are statistically
dependent.
On the other hand, the occurrence of Cno affects the probability of occurrence.
deA: üüüü , and vice versa, the occurrence of Ano affects the pro-
probability of occurrence of C: üüüü it is said then that the
events A and C are statistically independent.
It is worth noting that the statistical dependence between events always has
A physical explanation can always establish cause-and-effect relationships;
In the previous example, events A and B are physically dependent because
the occurrence of one of them makes the occurrence of the other easier. On the other hand,
Statistical independence does not always have a physical meaning.
Consider the following logical propositions:
Statistically dependent
Statistically independent
Physically dependent
physically independent
Statistical dependence implies physical dependence: p q in so far as
physical dependence does not imply statistical dependence:q p
Physical independence implies statistical independence. q :p , in so-
:p q
because statistical independence does not imply physical independence:
Conditional Probability
YesP A B P A P B | A and P B | A P B P A B P A P B
If P A B P B P A | B y P A | B P A P A B P B P A
These results corroborate the other way of formally defining independence.
Statistical dependence: Two events A and B are independent if, and only if, their...
The probability of joint occurrence is the product of the individual probabilities.
dualP(A) and P(B) of occurrence:
üüüü ____ (1.34)
This expression had already been obtained in section 1.4.3 to define pro-
joint probability of independent events.
The difficulty in applying the law of multiplication of probabilities
It is about knowing how to identify when two events are or are not statistically independent.
clearly, and then use rule 1.34 or rule 1.39, respectively.
Example 1.59 URN. Consider a urn that contains 6 red balls, 4 white...
blue balls, from which three balls are successively drawn from the urn,
replacement.
Sean los eventos: A ={sale bola azul} P A 5 / 15 1 / 3
B = {white ball sale} P B 4 / 15
R = {sale red ball} P R 6 / 15 2 / 5
Calculate the following probabilities:
a) That they come out in the order red, blue, white:
6 5 4 120 8
P R A B P R P A | R P B | R A
15 15 15 3375 225
After a red ball has been drawn, it is returned to the urn, so
There are still 15 balls, 5 of which are blue: P A | R 5 / 15 P A
After a blue ball has been drawn, it is returned to the urn, so if-
I have 15 balls, 4 of which are white. P B | R A 4 / 15 P B
b) They should come out in the order blue, red, blue:
5 6 5 150 2
P A R A P A P R | A P A | A R
15 15 15 3375 45
c) That three white balls come out:
4 4 4 64
P B B B P B P B | B P B | B B
15 15 15 3375
d) To get out one red, one blue, and one white, regardless of the order:
8 16
1 red, 1 blue, and 1 white 6 P R A B 6
225 75
that two blues and one red come out:
2 2
2 blue and 1 red 3
45 15
We see that when the extraction is done with replacement, the probabilities
the occurrence of successive events do not depend, are not conditioned to the
occurrence of previous events. The reason why the probabilities are
they have constants, from extraction to extraction, it is that physically the extractions
they are independent; in that case, the events are physically and statistically
independent.
1
Independence in Probability
Example 1.60 URN. Consider again the urn with 6 red balls, 4
white and blue, from which three balls are successively drawn, without replacement.
So. Calculate the same probabilities as those requested in example 1.59.
a) They should come out in the order red, blue, white:
6 5 4 120 4
P R A B P R P A | R P B | R A
15 14 13 2730 91
After the red ball has come out first, there are 14 left in the urn.
balls, 5 of which are blue: P A | R 5 / 14
After the red ball and blue ball have been drawn, there are 13 balls left in the urn.
4 of which are white:
üüüü
b) They should come out in the order blue, red, blue:
5 6 4 120 4
P A R A P A P R | A P A | A R
15 14 13 2730 91
c) That three white balls come out:
4 3 2 24 4
P B B B P B P B | B P B | B B
15 14 13 2730 455
d) That a red one, a blue one, and a white one come out, regardless of the order:
1 red, 1 blue and 1 white
P R A B R B A A B A
R B R B R A B A R
P R A B P R B A P A R B P A B R P B R A P B A R
4 24
6 P R A B 6
91 91
e) Let two blues and one red come out:
4 12
ones and one red one 3 P A R A 3
2 blue
91 91
Conditional Probability
Note the difference between the circuits in examples 1.53 and 1.61; in the
First, there are three switches in parallel and in this last one there are two switches.
res is a series with one in parallel. Both are analyzed similarly, as...
ensuring independence in the operation of the switches.
Example 1.62. FAMILIES WITH THREE CHILDREN. Consider only families with
three children and the experiment consisting of recording the sex of the children; ifH =
{hombre},M ={mujer}, con las probabilidades aceptadas:P(H)= 18/35y
P(M)= 17/35.
The sample space of the experiment is:
S
HHH , HHM
, HMH
, MHH
, HMM , MHM , MMH , MMM
The probabilities of the four different sample points are:
3
18
Three males: P HHH P H P H P H 0.136
35
2
18 17
Two males: P HHM P H P H P M 0.128
35 35
2
18 17
A male: P HMM P H P
M P M 0.121
35 35
1
INDEPENDENCE IN PROBABILITY
3
17
No male: P MMM P M
P M P M
0.115
35
Calculate the probabilities of the following events:
a)A ={familias con hijos de uno y otro sexo}
P A P
HHM HMH
HMM
MHH MHM MMH
3P HHM 3P HMM
3 0.128 3 0.121
0.749
b)B ={familias con un máximo de un hijo varón}
P B P
HMM MHM
MMM
MMH
3P HMM P MMM
3 0.121
0.115 0.479
c) The joint probability of A and B
P A B
P HMM MHM
MMH 3 0.121 0.364
d) Determine if the events A and B are statistically independent.
To determine if events A and B are statistically independent,
we multiply the individual probabilities and compare the result with
the joint probability: P A P B
0.749 0.479 0.359 0.364 P A B
Since there is no coincidence, we conclude that the events A and B
they are statistically dependent, which implies that there must be a depend
physical proximity between them. And indeed, the occurrence of one slightly favors
lie the occurrence of the other, and that happens because the probability of a male child
and the daughter is not symmetrical. If we had considered equiprobability
conP(H)= P(M)= 0.5, the results would be as follows:
P HHH P HHM
P HMM
P MMM
0.5 0.125
3
P A
6P HHM 6 0.125
0.75
P B
4P HMM 4 0.125
0.5
P A B
3P HMM 3 0.125
0.375
P A P B
0.75 0.5 0.375
And so, events A and B would be independent. Now we know that the
The lack of symmetry is what caused the dependency in this case.
Conditional Probability
INDEPENDENCE IN PROBABILITY
["NNNNN","NNNNF","NNNFN","NFNNN","FNNNN","NNNFF","NFNNF","NFNFN"]
FNNNF, FNNFN,
NFNNN, NFNFF, FNNFF, FFNNF, FFNFN, FFNFF
'
["NNFNN","NNFNF","NNFFN","NFFNN","FNFNN","NNFFF","NFFNF","NFFFN"]
["FNFNF","FNFFN","NFFNN","NFFFF","FNFFF","FFFNF","FFFFN","FFFFF"]
Let the event G = {There is current between A and B, with switch 5}
NNNNN NNNNF
NNNFN
NNFNN FNNNN
NFNNN
P G
NNNFF
NNFNF NFNFN
NNFFN FNNNF
FFNNN
FNFNN
NFFNN FFFNN
NNFFF
P NNNNN 5P NNNNF
8P NNNFF
2P NNFFF
1 p 51 5 p p 81 p 4 p2 21 p p3 3 2
1 5 p 10p2 10p3 5 p 4 p5 5 p 20p2 30p3 20p4 5 p 5
8 p 2 24p3 24p4 8p 5 2p 3 4p 4 2p 5
1 2 p 2 2 p 3 5 p 4 2 p 5
It must be fulfilled that: 1 2 p p2 1 24 p 2 p 5 p 2 2 p 3 4 5
1 2 p 2 p4 1 2 p 2 2 p 3 5 p 4 2 p 5 0, 2p3 4 p 4 2 p 5 0
2p 31 2p p 2 0, p31 p 0, p 0, p3 0, 1 p 0, 1 p 0 2
2
1 2 p 2 2 p 3 5 p 4 2 p 5 1 4 p 2 4 p 3 p4 0, 2p2 6 p 3 6 p 4 2 p 5 0
2p 21 3p 3p 2 p 3 0, p21 p 0, p 0, p2 3
3
0, 1 p 0, 1 p 0
P C D P NFNF FNFN
2P NNFF 2 1 p p2 2
P C D P NFNF
FNFN 2P NNFF 2 1 p p2 2
Conditional Probability
Conditionality in Images
Finally, the third difficulty arises from the variety of the information.
information available to address conditional probability problems
It is in accordance with it that we must proceed. It is not about this-
to develop an algorithm for each case that leads to the search for the formula
correct, but rather to know the range of possibilities and recognize the different
ways to solve them, without overlooking relevant information.
Considering only two events A and B corresponding to a certain
probability space, when taking into account complementary events Acy
BcEight conditional probability relationships can be established, consider
removing all denominators different from zero.
P A B P B A
P A | B ; P B | A
P B P A
P Ac B c
PB A
P Ac B ; P BcA
P B P A
P A B c
P B Ac
P A | B c
; P B | A c
PB c
P A c
P Ac B c c
PB Ac
P Ac |Bc ; P BcAc
c
PB P Ac
All possible knowledge involved in those relationships is summarized
16 elements: 8 conditional probabilities, 4 joint probabilities
marginal probabilities, and it means that a probability problem
The conditional has been completely resolved only when the...
16 elements.
To fully solve a problem of conditional probability, one only needs to
they require three non-complementary elements, the possibilities being
following:
marginal and joint
marginal and conditional
joint and marginal
joint and conditional
1 marginal, 1 joint and 1 conditional
marginals and joint
•2marginales and 1conditional
2 joint and 1 conditional
•3 conditionals
Hasta aquí, los problemas de probabilidad condicional los hemos resuelto
in the usual way, using algebra to consider simultaneously
three basic rules: the probability of the complement and the laws of addition and
multiplication of probabilities. There are other visual resources that are worth it.
pity to explore; they are the double-entry tables, the probability trees
conditional and unit square diagrams, all of them easy to handle,
very useful for clearly understanding the concepts and for visualizing all the
results simultaneously, although none of them is self-sufficient for
face any type of conditional probability problem.
158
Conditional Probability
Cross-tabulation tables
Initially, we consider conditional probability problems.
that involve only two events and their respective complements; for
they, the base element is a double entry table or 2x2 matrix, which
it contains or must contain the information of the 4 joint probabilities:
Conditionality in Images
b)P(T|Pc)=
c
1/4,P(T|P)= 7/15, P(P|T)= 2/3 c
Conditional Probability
e) The marginal probabilities are noted on the right margin of the diagram.
del otro evento básico y su complemento:P(B) yP(Bc), adding the proba-
joint associated probabilities; the sum of these two marginals must equal 1 and
it is the way to verify arithmetic operations.
The tree corresponding to event B is constructed in the same way, inter-
changing A for B and A for B.
Example 1.66. CONNECTION. With reference to example 1.56, the data of the
problema son:P(x)= 0.1, P(y)= 0.2,P x | y 0.5
CONDITIONALITY IN IMAGES
In fact, the two diagrams at the ends represent the two extreme cases.
mite of the general case, symbolized by the second diagram: when there is no
joint occurrence and when there is implied occurrence, in those two cases, the
the dependency between the events is total.
In the first diagram, where A and B are mutually exclusive events,
if A occurs, then the probability of B is null; and if A occurs, then the
probability of no probability; that is why they are dependent.
In the third diagram, where the occurrence of A implies the occurrence of B,
if it happens, then the probability of A is the joint probability of A and B;
And if it happens, then the probability of it being one; that's why they are dependent.
So, when there is incompatibility or abstinence, it can be assured.
that the events are not independent. In fact, it is the same type of
relationship between events, as can be seen in the following diagrams:
The general case is where it is difficult to clarify whether the events are independent.
teeth or not, and a Venn diagram does not help at all. To visualize probability-
conditional probabilities, we propose the use of unit square diagrams,
que son aplicables en todos los casos y se construyen como sigue:
a) The unit horizontal segment is divided into two subintervals that
they represent the two events that may be considered occurred, assigning to each
length of subinterval, the probability of the corresponding event: P(B)
P(Bc).
b) About each of the two defined subintervals there is a rectangle of
unit height, which is divided into two regions; the lower one with a height
equals the conditional probability P(A|•) and whose area corresponds to the pro-
joint probability P(A ), and the upper one with height equal to the probability
conditionalP(A |•), automatically delimited by the value one and whose area
c
Conditional Probability
c) P A B 0.1
P A P B
0.4 0.5 0.2 0.1 dependent events
P A B 0.1 P A Bc 0.3
P A | B 0.2, P Ac | B 0.8, P A | Bc 0.6
P B 0.5
PB c
0.5
1
CONDITIONALITY IN IMAGES
0.1
P Ac|Bc P B | A
0.4, 0.25, P BcA 0.75
0.4
P B Ac 0.4
P B | A c
0.666, P Bc Ac 0.333
P A c
0.6
B 0.2
d)P A
P A P B
0.4 0.5 0.2 P A B
independent events
P A B 0.2 P A Bc 0.2
P A | B 0.4, P AcB P A | Bc
0.6, 0.4
P B 0.5
PB c
0.5
0.2
P Ac|Bc P B | A
0.6, 0.5, P Bc A 0.5
0.4
P B Ac 0.3
P B | Ac 0.5, P BcAc
0.5
P A c
0.6
B 0.3
e)P A
P A P B
0.4 0.5 0.2 0.3 dependent events
P A B 0.3 P A Bc 0.1
P A | B 0.6, P Ac| B 0.4, P A | Bc 0.2
P B 0.5
PB c
0.5
0.3
P Ac |Bc P B | A
0.8, 0.75, P BcA 0.25
0.4
P B Ac 0.2
P B | A c
0.333, P Bc Ac 0.666
P A c
0.6
164
Conditional Probability
In general: 0 P A B P A ; 0 P A B P B
If P A B 0 A B
IfP A B P A A B, P B | A 1
If P A B P B B A P A | B 1
YesP A B P A P B A B
YesP A B P A P B there is a positive correlation between A and B
TOTAL PROBABILITY
This result is known as the theorem of total probability and represents the
expansion of the probability of an event in terms of its probabilities
conditionals, conditioned on a set of mutually exclusive events
inclusive and collectively exhaustive.
Indeed:
n
P A P A B 1A B ... 2 A B P n A B I
i 1
But Bi Bj , i j therefore: A B i A B j , i j
n
So: P A P A B i
i 1
Conditional Probability
Although it did not seem so, that which we call the probability theorem
total in chapter 1.2 and that for more than two hundred years was considered
one of the three fundamental theorems of probability is exactly
the same as the one dealt with in this section, only it was presented differently
way; with the adjustment made, it could be clearly seen that it is about the
same concept.
Example 1.68. URNS. There are three urns that contain 24 balls each.
Urn 1 has 16 red balls and 8 white balls, urn 2 has 20 red balls and 4
white, and the urn has 6 red balls and 18 white balls. A ball has been extracted from
In some of the urns, what is the probability that the ball is white?
It is reasonable to assume four solutions: If the ball came out of urn 1, the probability-
The probability of it being white is 1/3, because there are 8 out of 24 balls that are white. If the
The ball came out of urn 2, the probability that it is white is 1/6, because there are 4.
de24balls, which are white. And if the ball came out of urn3, the probability of
that it is white is 3/4, because there are 18 out of 24 balls, which are white. Finally-
you, if we do not know from which of the three urns it came, then the probability of
that it is white is 5/12, because, in total, there are 30 out of 72 balls, which are white.
1
TOTAL PROBABILITY
Could it be possible that all four answers are correct? Well, if it supposes-
More than the ball came out of urn 1, the correct answer is the first; it is a
conditional probability, conditioned on the chosen urn being urn 1.
One can say exactly the same, if we assume the extraction from the urn.
8 1
2, or of the 3:P B |1 , P B | 2 4 1, P B | 3 18 3
24 3 24 6 24 4
The fourth answer corresponds to an unconditional probability, as
there is no need to assume anything here; considering that the chosen urn could
be any of the three, with an equal probability of 1/3, the total probability
that the ball is white is: P B P B | 1 P 1 P B | 2 P 2 P B | 3 P 3
1 1 1 1 3 1 1 1 1 4 2 9 15 5
3 3 6 3 4 3 9 18 4 36 36 12
When total probability is obtained, the unit square diagram is
you can simplify by omitting the corresponding probabilities of the comple-
metos, leaving only a probability distribution:
Conditional Probability
TOTAL PROBABILITY
P z P z | x y P x | y P y P z | x y P x | y P y
P z | x y P x | y P y P z | x y P x | y P y
The data is:
P x 0.1, P y 0.2, P x | y 0.5, P z | x y
0.2
Tnheday:irhoadbtl Px y 0.1, P x y 0.8
P z | x y P z | x y
P z | x y 1, P x 0.9, P and
0.8
Px y 0.8
P x | y 1 P x | y 1 0.5 0.5; P x | y 1
P y 0.8
P x | y 1 P x | y 1 1 0
0.2 1 0 0.8 1 0.5 0.2 0.2 1 0.8
P z 1 0.5
0.1 0 0.1 0.16 0.36
In a deeper analysis, I would be interested in knowing the capacity that should be
to have section z so that the failure is less probable, taking into account the
social cost and the cost of the work.
P NNNF P NNFN
P NFNN
P FNNN
p 1 p 3
P NNFF P NFFN
P FFNN
P FNNF P NFNF
P FNFN
p 21 p 2
P NFFF P FNFF
P FFNF
P FFFN
p31 p
P FFFF p 4
Conditional Probability
1.5.5
THEOREM
Thus, by the definition of conditional probability, the probability
to the same assumptions established for the probability theorem
of occurrence P Aj B
THE BAYES the probability of event B, given the occurrence of event Ajes: P B
j | A
P A j
When we say: 'given the occurrence of event B', this should not be inter-
pretend as if you are the result of a deterministic experiment, assuming
that if it has occurred, then P(B)=1. The richness of Spanish makes it easier to express
the idea of a better way, with the phrase: 'if the event happens.'
While Bayes' rule seems a complicated expression, it is still in
essence the same quotient that defines conditional probability, except that the
denominator, which corresponds to a marginal probability, is now expanded
doing according to the total probability theorem. In essence, the theorem invokes
only two laws: addition and multiplication of probabilities.
17
BAYES' THEOREM
Conditional Probability
The name of the theorem honors the memory of Thomas Bayes; however,
Now it is known that he only participated marginally in its expression, for there is
evidence that it was never in a position to make formulations from
total probabilities. The first to state it was Abraham De Moivre,
but who really developed it was Laplace, who in 1812 expressed: “Let A
an event that occurs in conjunction with one and only one of the events dis-
togetherB1, B2…, BnIf event A is known to have occurred, what is the proof?
probability of the eventBjtoo? The probability of existence of one of
those causes are equal to a fraction with a numerator equal to the probability
of the event that follows from this case and a denominator that is the sum of the
similar probabilities related to all possible causes.
BAYES' THEOREM
Example 1.74. INTERCHANGE. For the case of the Viaduct - Periphery interchange
Nice, we will calculate some conditional probabilities.
P x
They already had: 0.1, P and 0.2, P x | y 0.5, P z | x y
0.2
Px y 0.1, P x y
0.8, P z | x y P z | x y
P z | x y 1
P x
0.9, P y 0.8, P x | y 0.5, P x | y 1, P x | y 0, P z 0.36
Assuming that segment z is saturated:
a) Probability that the sections x and y also become saturated:
P z | x and
P x y P z | x y P x | y P 1 y 0.5 0.2 5
Px y|z
P z P z 0.36 18
b) Probability that the tramox will saturate, but not the tramoy:
1 0 0.8
P z | x y P x | y P y
P x y|z
P z
0.36
0
Conditional Probability
P
NNNN|C
P NNNF|C P
NNFN|C P
NFNN|C
P NNFF|C
P NFNF|C P NFFN|C P NFFF|C
P NNNN|C P NNNN P NNNF|C P NNNF
P C P C
P NNFN|C P NNFN P NFNN|C P NFNN
P C P C
P NNFF|C P NNFF P NFNF|C P NFNF
P C P C
P NFFN|C
P NFFN P NFFF|C P NFFF
P C P C
1 1 p 3 4 1
p1 p 2 1 p 21 p 0
3
2
1 4p 4p p
2 3 4
1 4p 6p 4p p 3p 9p 2 9p 3 p 4 2p 2 4p 3 p 4
2 3 4
1 4 p 2 4 p 3 p4
1 p p2 p3
1 4 p 2 4 p 3 p 4
b) That switches 1 and 4 are closed:
P N 1 N|C
4 P NNNN
NNFN NFNN NFFN|C
P NNNN|C
P NNFN|C P NFNN|C
P NFFN|C
P NNNN|C P NNNN P NNFN|C P NNFN
P C P C
P NFNN|C P NFNN P NFFN|C P NFFN
P C P C
1 1 p 2 4 1 p1 p 1 p 21 p
3
2
1 4 p 2 4 p 3 p4
1 4p 6p 2 4p 3 p4 2p 6p 2 6p 3 2p 4 p 2 2p 3 p 4
1 4 p 2 4 p 3 p4
1 2 p p2
1 4 p 2 4 p 3 p4
c) That switches 1 and 4 are open:
P F 1 F|C
4
P FFFF FNFF
FFNF FNNF|C
P FFFF|C
P FFNF|C
P FNFF|C FNNF|C
P
P FFFF|C
P FFFF P FFNF|C
P FFNF
P C P C
P FNFF|C
P FNFF P FNNF|C
P FNNF
P C P C
p4 2 0 p31 p 1 p2 1 p 2
0 p 2 2 p 3 p 4
1 4 p 2 4 p 3 p 4 1 4 p 2 4 p 3 p 4
17
BAYES' THEOREM
Conditional Probability
BAYES' THEOREM
Matrix arrangements
1. The two equations that relate the probabilities of complementary events
comments: P A P Ac 1, P B P B c 1 can be expressed by
the product of the individual probability matrix by a unit vector and
P A P Ac 1 1
results in a unit vector:
P B P B c
1 1
2. The equations that relate joint probabilities with pro-
Marginal abilities correspond to the total probability theorem:
P A B P A Bc P A , P Ac B P Ac B c P Ac
P B A P B Ac P B, P B c A P Bc Ac P Bc
and can be expressed through the product of a probability matrix
jointly by a unit vector and results in a probability vector
complementary margins:
P A B P A B c 1 P A
P Ac B P A c
Bc 1 P A c
P B A P B Ac 1 P B
P Bc A P B c
Ac 1 P B c
P B | A P B | Ac P A P B
P B c | A P B c Ac P Ac P Bc
178
Conditional Probability
Note that the first system of equations is associated with the probability tree.
a priori abilities and the second system of equations is associated with the tree of
posterior probabilities.
A posteriori tree:
And matrix-wise:
0.5
0.04 0.02 0.03 0.032
0.3
0.96 0.96 0.97 0.968
0.2
0.6250 0.4959 0.5
0.032
0.1875 0.3037 0.3
0.968
0.1875 0.2004 0.2
17
BAYES' THEOREM
Example 1.77. INTERCHANGE. At the interchange of Viaducto and Periférico there has been
It has been observed that the segments x and y congest with probabilities 0.1 and 0.2.
respectively, when the tramoyse gets congested, the tramoxse conges-
tiona with a probability of 0.5, and that when the sections xe and y work below
its capabilities, the probability that the tramozse saturates is 0.2. Constru-
probability trees a priori and a posteriori, to visualize the application
from the theorems of total probability and Bayes, when solving this problem.
All the required information has already been calculated and summarized.
in example 1.74, which is now being emptied into the probability trees.
A priori tree:
Posterior tree:
180
Conditional Probability
Conditional independence
If A, ByCson three events that can occur together, then it
it says that events A and B are conditionally independent given the occurrence
the occurrence of event C, with P(C) > 0, if C occurs, the occurrence or non-occurrence
year-end company provides no information about the probability of occurrence of
The occurrence or non-occurrence of B does not provide any information about the
probability of occurrence of A:
P A | B C P A
|C , P B C 0
P B | A C P B
|C , P A C 0
BAYES' THEOREM
Conditional Probability
BAYES' THEOREM
P C | D The 0.0448
For this example in which the symptoms are two: pain and cavity, it was necessary to
calculate 8 conditional probabilities; if instead of two there had been five
symptoms, the probabilities that would need to be evaluated would be 64.
Now let's assume that these two symptoms are statistically independent.
teeth; for this we require two tables with four data each:
Pain and cavity are events that depend on whether the patient has cavities.
or some other ailment. However, once we know that the patient
has cavities, we can assume that cavity and pain are independent events
tes; es decir, si la caries es causa tanto del dolor como de la oquedad, podemos
assume that feeling pain does not affect the likelihood of having a cavity and vice versa
versus, which means considering that hollowness and pain are conditional events.
finally independent: P O D|C P O |C
P D |C
184
Conditional Probability
P C D O P D O|C P C
P D |C P O |C P C
P C | D The
P D O P D O P D O
P C | D O ,P C | D O P D |C P O |C P C,P D
|C P O |C P C
0.8 0.8 0.2,0.2 0.5294 0.8 0.128,0.0847 0.6018,0.3982
P C | D O
0.60, P C | D
The 0.40, P D The 0.2127
P D The C P D O|C P C P D
|C P O |C P C 0.8 0.8 0.2 0.128
The joint probability P O D , although it is now unknown and does not re-
wants to be evaluated, it must function as a constant that normalizes the
1
conditional occurrence probabilities:
P O D
P C | D O, P C | D The P D | C P O | C P C,
P D | C P O | C P C
0.8 0.8 0.2,0.2 0.5294 0.8 0.128, 0.0847 0.6018,0.3982
P C | D
The
0.60, P C | D
The 0.40
Weseethattheseresultsarebasedonthehypothesisofconditionalindependence.
National differences are much different from those previously calculated based on probabilities.
joint elementals. And it's either this, or the assignment of the latter leaves
a lot to wish for, or the consideration of conditionally independent events
teeth is simply not valid.
The hypothesis of conditional independence between events facilitates the assignment
of the 8 elementary joint probabilities, with which the
probabilistic behavior of cavities and their symptoms:
P C D The P D O|C P C P D
|C P O |C P C 0.8
0.8 0.2 0.128
Instead of having a table with 8 independent numbers, we only require
4 independent numbers, located in two tables.
CLASSIC PROBLEMS
P M M M M P M P M P M
P M
P M P M
M M P M M P M M P M
M P M M
M
P M M P M M M P M M M P M M M
P M
M M M
P M M M M 4P M 6 PM
M 4P M M
M P M
M M M
2 3 4
1 1 1 1
4 6 4
4 4 4 4
1 0.375 0.0625 0.00390625 0.6836
Approximately 7 out of 10 times it will spawn at least one mule and you can
bet that this will happen.
Conditional Probability
CLASSIC PROBLEMS
Conditional Probability
The response with Bayes' rule yields the same result: P(Rc|S)= 3/4
Breast cancer
Doctors do not know for sure if a mammogram is useful for
detect breast cancer; the problem seems to be in the interpretation ra-
dialogical, because much of what can be seen in it is a grayish area, which
for some it is something ambiguous, considered normal and for others that ambiguity
is suspicious. The truth is that mammograms are not as useful as one might think.
to suppose, although for economic interests it is claimed otherwise.
It is believed that around 1% of women over 40
Years suffer from breast cancer: P(C) = 0.01. An exploratory test is available.
what is mammography, which provides new information: 80% of the
Women with breast cancer will have positive mammograms: P(+|C) = 0.80,
while only 9.6% of women without cancer will have mammograms
positive:P(+|CcIn summary, we have 80% true positives and 20%
of false positives; and we have 9.6% of false negatives and 90.4% of negatives
true. What is the probability that a woman whose mammogram returned
positive, does he really have cancer?
Bayes' rule immediately answers the question, but before applying it
let's solve the exercise based on reasoning. Considering a group of
10,000 women; if P(C)= 0.01, there is a group of 100 women with cancer
mom and another group of 9,900 women without breast cancer. After the examination
Radiologically, four groups are formed; group A consists of 80 women.
with breast cancer and positive mammography, group B formed by 20 women-
breast cancer patients with negative mammography, group C formed by 950
women without breast cancer and positive mammography and the group formed by
8,950 women without breast cancer and negative mammography.
The exploratory method is fallible: it points out 20 out of 100 sick women.
of cancer as healthy, and of the 9,900 healthy women, as sick.
If we divide the number of women in group A by the total number of women that
tested positive in the test, it results in 7.8%, which means that 92.2% of
women who test positive on the test do not have cancer. While
if we divide the number of women in group D among the total number of women that
they tested negative in the test, the result is 99.8%, which means that the
Mammography is quite reliable when its result is negative.
1
CLASSIC PROBLEMS
Bayes' theorem shows that it would be much more effective to conduct the test.
only to the group of women at high risk, due to family history and habits
of hygiene, and not to all women over 40 years old, without exception. The most-
tography is not a treatment, but a method of medical exploration aimed at
exclude healthy people to dedicate themselves to the sick; but if he/she explores
if it does not contribute, then it stops being useful.
Now let's answer this second question: what is the probability of having
Cancer, if after two consecutive mammograms, both diagnose cancer?
SiM1= {1a. positive mammogram}, M2= {2a. positive mammography}.
Obviously, we cannot assume unconditional independence between M.1y
M2but it is valid to assume conditional independence of M1yM2given that
there is cancer.
Therefore: P C | M1 M 2 P C M M 1 M|C P 1M |C
2P P C2 ,
where it is a proportionality constant that is determined automatically
mind.
1 P M |C2 P C,P
P M|C M|C
P M
1
|C P C2
0.8 0.8 0.01
, 0.096 0.096 0.99
0.0064,0.00912384
0.0064 0.00912384 0.0155238 64.3942131952507 64.42
P C | M1 M 2 64.42 0.0064
0.4122
Then approximately 41% of women with dual diagnoses
positively with mammography will actually have breast cancer.