Probability and Statistics 201-SN1-RE • CEGEP, Montreal
Corrected exercises: probability and conditional probability (201-SN1-RE)
Here are ten corrected exercises on probability and conditional probability for the Probability and Statistics course, 201-SN1-RE, in the Science program at CEGEP, preceded by a list of direct calculations.They cover the random experiment, the sample space and events, the axiomatic definition of probability and its properties, the complement, the union and the intersection, mutually exclusive events and independent events, conditional probability, the multiplication rule, the probability tree, the contingency table, the law of total probability and Bayes' theorem, proved in exercise 5, as well as the Monty Hall problem.
What the set covers, the traps it targets
They cover the random experiment, the sample space and events, the axiomatic definition of probability and its properties, the complement, the union and the intersection, mutually exclusive events and independent events, conditional probability, the multiplication rule, the probability tree, the contingency table, the law of total probability and Bayes' theorem, proved in exercise 5, as well as the Monty Hall problem.
By the end of the set, you can prove the rules of calculation from the three axioms (exercise 1), tell mutually exclusive from independent events by calculation and by proof (exercise 2), read a conditional probability in a table (exercise 3), reason on a pedigree (exercise 4), turn a condition around with Bayes' theorem (exercises 5, 7, 9 and 10) and compute the reliability of components in series and in parallel (exercise 6). The situations come from the natural sciences: bird songs picked up by a recorder, a muon telescope, environmental DNA of invasive species, the transmission of a recessive disease, contaminated wells, a hydrometric station, weather forecasting.
The traps covered in detail: adding the probabilities of overlapping events (exercise 1), confusing mutually exclusive with independent (exercises 2 and 8), answering 21 instead of 32 for the healthy sister of an affected child (exercise 4), treating two children of the same parents as independent (exercise 4), reading P(C∣S) as P(S∣C) (exercises 5 and 8), adding reliabilities in parallel (exercise 6), concluding “one chance in two” in front of two closed doors (exercise 7) and taking the sensitivity of a test for the probability of being contaminated (exercise 10). Exercises 9 and 10 are complete studies, from the data to the written decision rule.
The thread of the set: after the bar, the sample space changes. P(A∣B) counts A among only the cases where B occurs. Mutually exclusive, the condition wipes out A; independent, it changes nothing; and turning the bar around changes the denominator, and therefore the number. Do each exercise in full before opening the solution.
•AXIOMS: P(E)≥0; P(Ω)=1; if E∩F=∅, P(E∪F)=P(E)+P(F). Everything else is proved: P(E)=1−P(E), P(E∪F)=P(E)+P(F)−P(E∩F), P(∅)=0.
•CONDITIONAL PROBABILITY: if P(B)>0, P(A∣B)=P(B)P(A∩B). The condition B becomes the sample space: P(B) goes in the denominator. In general P(A∣B)=P(B∣A).
•MULTIPLICATION RULE: P(A∩B)=P(B)P(A∣B). On a probability tree, multiply along a path; the branches coming out of the same node add up to 1.
•INDEPENDENCE: A and B are independent if P(A∩B)=P(A)P(B), that is, when P(B)>0, P(A∣B)=P(A). MUTUALLY EXCLUSIVE: A∩B=∅. Two mutually exclusive events with nonzero probabilities are never independent.
•LAW OF TOTAL PROBABILITY: if B1, ..., Bn form a partition of Ω, P(A)=∑jP(Bj)P(A∣Bj).
•BAYES' THEOREM: P(Bi∣A)=∑jP(A∣Bj)P(Bj)P(A∣Bi)P(Bi). Numerator: one path of the tree; denominator: all the paths that lead to A.
•RELIABILITY, independent components: in series, p1p2; in parallel, 1−(1−p1)(1−p2).
Exercise 0.1: Computing with the rules of probability: twelve direct calculations
13 answers to check
In each line, A and B are two events of the same random experiment, and the data given are enough. Compute the probability asked for, as an exact decimal or to three decimal places, or answer the question.
One single move carries the whole list: before writing a number, say WHAT you are counting among. A plain probability counts in the whole sample space; a conditional probability P(A∣B)=P(B)P(A∩B) counts in B only, and it is P(B) that goes in the denominator.
a) P(A)=0.37: compute P(A).
b) P(A)=0.45, P(B)=0.32, P(A∩B)=0.12: compute P(A∪B).
c) Same data as in b): compute P(A∣B).
d) Same data as in b): compute P(B∣A), to three decimal places.
e) Same data as in b): compute P(A∩B).
f) Same data as in b): compute P(A∩B).
g) A and B are independent, P(A)=0.4 and P(B)=0.25: compute P(A∩B).
h) Same data as in g): compute P(A∪B).
i) A and B are mutually exclusive, P(A)=0.4 and P(B)=0.25: compute P(A∪B) and P(A∣B).
j) P(B)=0.3, P(A∣B)=0.8 and P(A∣B)=0.1: compute P(A).
k) Same data as in j): compute P(B∣A), to three decimal places.
l) P(A)=0.6, P(B)=0.5 and P(A∩B)=0.3: are A and B independent?
Show the solution
Answers
a)P(A)=0.63
b)P(A∪B)=0.65
c)P(A∣B)=0.375
d)P(B∣A)≈0.267
e)P(A∩B)=0.33
f)P(A∩B)=0.35
g)P(A∩B)=0.1
h)P(A∪B)=0.55
i)P(A∪B)=0.65 and P(A∣B)=0
j)P(A)=0.31
k)P(B∣A)≈0.774
l)Yes: P(A)P(B)=0.3=P(A∩B)
a)
The complement: P(A)=1−P(A)=1−0.37=0.63.
b)
Addition rule for a union:
P(A∪B)=0.45+0.32−0.12=0.65
The intersection is subtracted because it is counted once in P(A) and once in P(B).
c)
The condition B becomes the sample space, so P(B) goes in the denominator:
P(A∣B)=0.320.12=0.375
d)
Same intersection, different sample space:
P(B∣A)=0.450.12≈0.267
Pitfall: believing that P(B∣A)=P(A∣B). The numerator is the same, the denominator is not, and the two numbers differ as soon as P(A)=P(B).
e)
A splits into two disjoint pieces, A∩B and A∩B:
P(A∩B)=P(A)−P(A∩B)=0.45−0.12=0.33
f)
“Neither A nor B” is the complement of “A or B” (De Morgan's law, A∩B=A∪B):
P(A∩B)=1−0.65=0.35
g)
Independent: the probability of the intersection is the product.
P(A∩B)=0.4×0.25=0.1
h)
The addition rule always holds:
P(A∪B)=0.4+0.25−0.1=0.55
Pitfall: adding 0.4+0.25 as if A and B were mutually exclusive. Two independent events with nonzero probabilities have an intersection of nonzero probability.
i)
Mutually exclusive: A∩B=∅, so P(A∩B)=0 and the union is a plain sum, P(A∪B)=0.65.
And P(A∣B)=0.250=0: knowing that B occurred rules out A. Compare with g), where the same probabilities give an intersection of 0.1.
j)
B and B split the sample space. Law of total probability:
P(A)=P(B)P(A∣B)+P(B)P(A∣B)=0.3×0.8+0.7×0.1=0.31
k)
Turn the condition around, with the result of j) in the denominator:
P(B∣A)=P(A)P(A∩B)=0.310.24≈0.774
This is Bayes' theorem, on two branches.
l)
Compare the intersection with the product: P(A)P(B)=0.6×0.5=0.3=P(A∩B). The events are independent.
Check with the definition: P(A∣B)=0.50.3=0.6=P(A), knowing B changes nothing for A.
Points are earned before the solution; after it, you can keep practising.
For you:
Tick the exercises you have done or want to review: a free account, no password, keeps your ticks and your right answers from one visit to the next, tells you which chapter to tackle next and lets you ask for the exercise you are missing. Create your space, an email is enough.
Part A: the basics (/50)
Exercise 1: From the axioms to the rules of calculation: songs picked up by a recorder in the forest
8 answers to check
An automated acoustic recorder is attached to a tree in a mixed forest. Every morning in June, its software identifies the species that produced the first vocalization detected after dawn. Over one season, the observed frequencies give the model in the table, which we adopt: the random experiment is “record the species of the first vocalization on a morning chosen at random”, and only these seven species are detected at that hour. The probability of the Tree Swallow was erased from the report.
Let M be the event “the species is migratory” and N the event “the species nests in a cavity”. The diagram places each species, by its code, in M, in N, in both or in neither.
Recall the three axioms of a probability P on a sample space Ω: (A1) P(E)≥0 for every event E; (A2) P(Ω)=1; (A3) if E∩F=∅, then P(E∪F)=P(E)+P(F).
Code
Species
Migratory
Nest
Probability
T
Hermit Thrush
yes
on the ground
0.20
O
Ovenbird
yes
on the ground
0.16
W
White-throated Sparrow
yes
on the ground
0.24
S
Tree Swallow
yes
cavity
?
C
Black-capped Chickadee
no
cavity
0.14
H
Hairy Woodpecker
no
cavity
0.06
J
Canada Jay
no
branch
0.08
a) Describe the sample space Ω. Find the probability of the Tree Swallow, naming the axioms you use.
b) Using the diagram, compute P(M), P(N) and P(M∩N).
c) Compute P(M∪N) with the addition rule, then with the complementary event. Translate M∪N into a sentence.
d) Prove, from axioms (A1) to (A3) alone, that P(E)=1−P(E), then that P(E∪F)=P(E)+P(F)−P(E∩F) for any two events E and F.
e) A student notices that P(M)+P(N)>1 and concludes that the model is wrong, since a probability never exceeds 1. Is the model inconsistent? Justify.
f) Compute P(M∣N) and P(N∣M), to three decimal places. Explain in one sentence why these two numbers differ.
Show the solution
Answers
a)Ω={T,O,W,S,C,H,J}; P({S})=0.12
b)P(M)=0.72, P(N)=0.32, P(M∩N)=0.12
c)P(M∪N)=0.92; M∪N: “the species is a year-round resident and does not nest in a cavity”, that is {J}
d)Proofs with (A2) and (A3) on a partition into disjoint pieces
e)No: P(M)+P(N)=1.04 counts P(M∩N)=0.12 twice
f)P(M∣N)=0.375; P(N∣M)≈0.167: the denominators differ
a)
An outcome is a species: Ω={T,O,W,S,C,H,J}, seven outcomes that are NOT equally likely.
The seven elementary events are pairwise disjoint and their union is Ω. By (A3) applied step by step, then (A2):
The result is nonnegative, as (A1) requires: the completed model is a probability.
b)
Add the species of each region, which are pairwise disjoint, by (A3):
P(M)=P({T,O,W,S})=0.20+0.16+0.24+0.12=0.72
P(N)=P({S,C,H})=0.12+0.14+0.06=0.32
M∩N={S}, the only migratory species that nests in a cavity: P(M∩N)=0.12.
c)
With the addition rule:
P(M∪N)=0.72+0.32−0.12=0.92
With the complement: M∪N=M∩N, the species is not migratory AND does not nest in a cavity. That is the Canada Jay alone, hence P(M∪N)=1−0.08=0.92.
The two calculations agree: that is the check to make every time there are two routes.
d)
Complement. E and E are disjoint and E∪E=Ω. By (A3) then (A2):
P(E)+P(E)=P(Ω)=1, so P(E)=1−P(E).
Union. Cut into disjoint pieces: E∪F=E∪(F∩E) and F=(F∩E)∪(F∩E). By (A3), twice:
P(E∪F)=P(E)+P(F∩E) and P(F)=P(F∩E)+P(F∩E)
Take P(F∩E)=P(F)−P(E∩F) from the second equality and substitute it into the first:
P(E∪F)=P(E)+P(F)−P(E∩F)
The mutually exclusive case is only the special case P(E∩F)=0: the plain sum is axiom (A3), not a general rule.
e)
No. P(M)+P(N)=0.72+0.32=1.04 is not the probability of any event: S is counted once in M and once in N.
The axioms say nothing about the sum of the probabilities of two overlapping events. The probability of the union, on the other hand, is 0.92≤1.
Pitfall: adding the probabilities of two events without checking that they are disjoint. Going over 1 is the sign of a nonempty intersection here, not of an error in the model.
f)
Given N, the sample space becomes N={S,C,H}, with probability 0.32:
P(M∣N)=P(N)P(M∩N)=0.320.12=0.375
Given M, the sample space becomes M={T,O,W,S}, with probability 0.72:
P(N∣M)=0.720.12≈0.167
Same numerator, the Tree Swallow, but not the same sample space: among the cavity nesters it weighs a lot; among the migrants it is drowned out. That is the thread of the whole set.
Points are earned before the solution; after it, you can keep practising.
For you:
Exercise 2: Mutually exclusive or independent: the two plates of a muon telescope
8 answers to check
A laboratory muon telescope stacks two scintillator plates, S1 and S2, each connected to a photomultiplier tube. A coincidence unit counts a particle only if BOTH plates responded. For a muon that goes through both plates, let D1 be “S1 detects it” and D2 “S2 detects it”. The measured efficiencies are P(D1)=0.96 and P(D2)=0.93, and we assume that D1 and D2 are independent: the light produced in one plate has no influence on detection in the other.
We also model the nature of a charged particle that reaches the telescope: it is a muon (event U) with probability 0.75, an electron (event E) with probability 0.20, and some other particle otherwise.
a) Compute the probability that a muon going through the telescope is counted by the coincidence unit.
b) Compute P(D1∪D2) in two ways: with the addition rule, then with the complementary event.
c) Prove that if two events A and B are independent, then A and B are independent too. Deduce the probability that a muon is seen by S1 but missed by S2.
d) Are the events U and E mutually exclusive? Are they independent? Justify each answer with a calculation.
e) Prove that two mutually exclusive events with nonzero probabilities are never independent. Are the events D1 and D2 mutually exclusive?
f) Compute P(E∣U), then P(E∣U). Interpret these two values.
Show the solution
Answers
a)P(D1∩D2)=0.8928≈0.893
b)P(D1∪D2)=0.9972
c)P(D1∩D2)=0.96×0.07=0.0672
d)Mutually exclusive: yes; independent: no, 0=0.15
e)P(A∩B)=0<P(A)P(B); D1 and D2 are not mutually exclusive
f)P(E∣U)=0; P(E∣U)=0.8
a)
The muon is counted if S1 AND S2 detect it. The two events are independent, so:
P(D1∩D2)=P(D1)P(D2)=0.96×0.93=0.8928≈0.893
Nearly one muon in nine escapes the count, although each plate sees more than nine in ten: requiring a coincidence costs efficiency, and that is the price of a reduced background.
b)
With the union:
P(D1∪D2)=0.96+0.93−0.8928=0.9972
With the complement: “at least one plate” has complement “no plate”, and D1, D2 are independent (question c):
1−P(D1)P(D2)=1−0.04×0.07=1−0.0028=0.9972
c)
A splits into two disjoint pieces, A∩B and A∩B, so P(A∩B)=P(A)−P(A∩B). With the independence of A and B:
P(A∩B)=P(A)−P(A)P(B)=P(A)(1−P(B))=P(A)P(B)
This is exactly the definition of the independence of A and B.
Application: P(D1∩D2)=0.96×0.07=0.0672.
d)
A particle cannot be both a muon and an electron: U∩E=∅, the events are mutually exclusive.
Independence: P(U∩E)=0 whereas P(U)P(E)=0.75×0.20=0.15. The two numbers differ, so U and E are NOT independent.
Pitfall: saying “they have nothing to do with each other, so they are independent”. Knowing that the particle is a muon rules out the electron: that is the strongest dependence there is.
e)
If A∩B=∅ with P(A)>0 and P(B)>0, then P(A∩B)=0 while P(A)P(B)>0 as the product of two strictly positive numbers. The equality required for independence is impossible.
Conversely, D1 and D2 are independent and P(D1∩D2)=0.8928=0: they are not mutually exclusive, most muons are seen by both plates.
The two words even say almost the opposite: mutually exclusive, the occurrence of one tells you everything about the other; independent, it tells you nothing at all.
f)
Given U, the electron is ruled out: P(E∣U)=P(U)P(E∩U)=0.
Given U, the sample space shrinks to the particles that are not muons, with probability 0.25; the electron is one of them:
P(E∣U)=P(U)P(E∩U)=0.250.20=0.8
A condition changes the sample space in which you count: it can wipe out a probability or multiply it by four. Neither value equals P(E)=0.20, which confirms that U and E are dependent.
Points are earned before the solution; after it, you can keep practising.
For you:
Exercise 3: Reading a contingency table: environmental DNA of an invasive mussel by season
10 answers to check
A team looks for the DNA of the zebra mussel, an invasive species, in the water of lakes where its presence has already been confirmed by divers. Each one-litre sample is filtered, then the species' DNA is searched for by amplification. The table gives the result of 200 samples by season. A sample is drawn at random from the 200; let D be “the species' DNA is detected”, and Sp, Su and Fa the season of the sample (spring, summer, fall).
In addition, 120 of these samples were filtered on a type A membrane, and 36 of them gave a detection.
Spring
Summer
Fall
Total
Detected
15
36
9
60
Not detected
45
44
51
140
Total
60
80
60
200
a) Compute P(D), P(Su) and P(D∩Su).
b) Compute P(D∣Su) and P(Su∣D). Explain, using the table, why these two numbers differ.
c) Compute P(D∣Sp) and P(D∣Fa).
d) Is detection independent of the season of the sample? Justify with a comparison.
e) Find P(D) again from the conditional probabilities of b) and c) and the proportions of the three seasons only. Name the formula used.
f) Let A be “the sample was filtered on a type A membrane”. In these data, are D and A independent? Can we conclude that the type of membrane has no effect at all on detection?
Show the solution
Answers
a)P(D)=0.3, P(Su)=0.4, P(D∩Su)=0.18
b)P(D∣Su)=0.45; P(Su∣D)=0.6: denominators 80 and 60
c)P(D∣Sp)=0.25; P(D∣Fa)=0.15
d)No: P(D∣Su)=0.45=P(D)=0.3
e)Law of total probability: 0.3×0.25+0.4×0.45+0.3×0.15=0.3
f)Yes, P(D∣A)=0.3=P(D); but an equality in a sample does not prove the absence of an effect
a)
Read the totals and the relevant cell, out of the 200 samples:
Given summer, the sample space becomes the Summer column, 80 samples:
P(D∣Su)=8036=0.45
Given D, the sample space becomes the Detected row, 60 samples:
P(Su∣D)=6036=0.6
The cell 36 is the same; the condition chooses the total you divide by. With probabilities: 0.40.18 versus 0.30.18.
Pitfall: answering 0.18, the probability of the intersection, to a conditional question. “Among the summer samples” restricts the sample space; “detected and in summer” does not.
c)
Same move in the other two columns:
P(D∣Sp)=6015=0.25 and P(D∣Fa)=609=0.15
d)
If detection were independent of the season, we would have P(D∣Su)=P(D). But 0.45=0.3: detection depends on the season.
The product confirms it: P(D)P(Su)=0.12 whereas P(D∩Su)=0.18.
A plausible biological explanation, which the data alone do not prove: in warm water the mussel is more active and releases more DNA, especially during reproduction.
e)
The three seasons form a partition of the sample space. Law of total probability:
This is the direct reading of a) again. The figure in the solution shows it: each column has the probability of its season as its width, the blue part has the conditional probability as its height, and its area is the probability of the intersection.
f)
P(D∣A)=12036=0.3=P(D): in these 200 samples, D and A are independent.
That does not allow us to state that the membrane has no effect at all. An exact equality in a sample is fragile: a few more samples would shift it, and a real effect could be masked by the season if the membranes were not used in the same proportions in every season.
Deciding whether a difference observed in a contingency table reveals a real dependence is the purpose of the chi-square test of independence, seen later in the course.
Points are earned before the solution; after it, you can keep practising.
For you:
Exercise 4: Mendelian genetics: why the healthy sister is a carrier with probability 2/3
6 answers to check
A hereditary disease is caused by a recessive allele a of an autosomal gene; the normal allele A is dominant. Only aa individuals are affected; Aa individuals are called healthy carriers. In the family shown in the pedigree, Hugo is affected, while his two parents and his sister Leah are not. Leah has a partner, Mark, with no family history of the disease.
Model adopted: each parent passes on one of their two alleles with probability 21, independently of the other parent and from one child to the next; a person from the general population, healthy and with no family history, is a carrier with probability 301 (a value chosen for the exercise, of the same order as for several recessive diseases).
a) Justify that both of Hugo's parents are carriers, with genotype Aa.
b) For a child of these parents, compute the probabilities of the genotypes aa, Aa and AA using a tree of the two alleles passed on.
c) Leah is not affected. Show that the probability that she is a carrier is 32, and not 21.
d) Compute the probability that the first child of Leah and Mark is affected.
e) Leah and Mark are planning two children. Compute the probability that at least one of the two is affected, to five decimal places.
f) A student answers e) with 1−(1−1801)2. Explain why this calculation is wrong.
Show the solution
Answers
a)Hugo is aa: he received an a from each parent, who are healthy, hence Aa
b)P(aa)=41, P(Aa)=21, P(AA)=41
c)P(Aa∣healthy)=3/41/2=32
d)32×301×41=1801≈0.00556
e)32×301×167=7207≈0.00972
f)The status of the two children is not independent: both depend on the same parental genotypes
a)
Hugo is affected, so he is aa: he received one allele a from his father and one allele a from his mother.
Each parent therefore carries at least one a; neither is affected, so neither is aa. Both are Aa.
b)
A two-level tree: the father's allele (A or a, 21 each), then the mother's (21 each). The transmissions are independent, so multiply along a path:
P(aa)=21×21=41 and P(AA)=41
Aa gathers two disjoint paths, (A from the father, a from the mother) and (a from the father, A from the mother): P(Aa)=41+41=21.
Check: 41+21+41=1.
c)
We know that Leah is not aa. The event “healthy” is {AA,Aa}, with probability 43, and “carrier” is contained in “healthy”:
P(Aa∣healthy)=P(healthy)P(Aa)=3/41/2=32
Pitfall: answering 21, the probability of being a carrier BEFORE knowing that Leah is healthy. The information “healthy” removes the case aa from the sample space, and the two remaining cases AA and Aa do not weigh the same: Aa comes from two paths, AA from only one.
d)
The child can be affected only if Leah AND Mark are carriers, and the child then receives a from both. The genotypes of Leah and Mark are independent (Mark is not related to the family), so multiply along the path of the tree:
P(affected)=32×301×41=3602=1801≈0.00556
The other paths (Leah AA, or Mark AA) give a healthy child with certainty: they count for 0 in the law of total probability.
e)
First condition on the parents' genotypes. If both are carriers, each child is affected with probability 41, independently of the other:
P(at least one affected∣two carriers)=1−(43)2=167
Otherwise, no child is affected. By the law of total probability:
P=32×301×167=144014=7207≈0.00972
f)
The calculation 1−(1−1801)2≈0.01108 assumes that “the first child is affected” and “the second child is affected” are independent. They are not: both require Leah and Mark to be carriers.
Knowing that the first child is affected proves that both parents are carriers, and the probability that the second child is affected jumps from 1801 to 41.
Pitfall: confusing independence GIVEN the genotypes, which is true in this model, with plain independence, which is false. Here the error overestimates the risk by about 14%.
Points are earned before the solution; after it, you can keep practising.
For you:
Exercise 5: Bayes' theorem proved, then applied: three types of wells and a positive analysis
9 answers to check
In a rural region, private wells are classified into three types: deep drilled tubular wells (T), 60% of the wells; dug surface wells (S), 15%; driven filter points (F), the rest. A sampling campaign gave, for each type, the proportion of wells where coliform bacteria are present: 5% of the tubular wells, 16% of the surface wells and 8% of the filter points (data for the exercise).
A well is chosen at random; let C be “the water contains coliforms”. The laboratory analysis is considered error-free here; the imperfect test is the subject of exercise 10.
a) Complete the tree: give P(F) and the three probabilities P(C∣T), P(C∣S), P(C∣F).
b) Compute P(C), naming the formula used.
c) Prove Bayes' theorem: if B1, ..., Bn form a partition of Ω with P(Bj)>0 for every j, and if P(A)>0, then P(Bi∣A)=∑j=1nP(A∣Bj)P(Bj)P(A∣Bi)P(Bi).
d) The analysis of a well chosen at random reveals coliforms. Compute P(T∣C), P(S∣C) and P(F∣C), to three decimal places.
e) Which type of well is the most likely for a contaminated well? Compare with the type of well that is most often contaminated, and explain the difference.
Show the solution
Answers
a)P(F)=0.25; 0.95, 0.84 and 0.92
b)Law of total probability: P(C)=0.074
c)Definition of conditional probability in the numerator, law of total probability in the denominator
d)P(T∣C)≈0.405, P(S∣C)≈0.324, P(F∣C)≈0.270
e)Tubular (0.405), whereas the highest rate is that of the surface wells (0.16)
a)
The three types form a partition: P(F)=1−0.60−0.15=0.25.
Under each node, the two branches add up to 1: P(C∣T)=0.95, P(C∣S)=0.84, P(C∣F)=0.92.
b)
T, S, F form a partition of the sample space; law of total probability:
Order of magnitude check: 0.074 does lie between the smallest rate, 0.05, and the largest, 0.16, and close to the rate of the most common type.
c)
Step 1, the numerator. By definition, P(Bi∣A)=P(A)P(Bi∩A), and, again by definition, P(A∣Bi)=P(Bi)P(A∩Bi), hence P(Bi∩A)=P(A∣Bi)P(Bi).
Step 2, the denominator. The Bj are pairwise disjoint with union Ω, so the A∩Bj are pairwise disjoint with union A. By additivity:
P(A)=j=1∑nP(A∩Bj)=j=1∑nP(A∣Bj)P(Bj)
Step 3, substitute:
P(Bi∣A)=∑j=1nP(A∣Bj)P(Bj)P(A∣Bi)P(Bi)
The hypotheses are all used: P(Bj)>0 so that P(A∣Bj) makes sense, P(A)>0 to divide. The formula is therefore not one more theorem to memorize: it is the definition written twice.
d)
Numerators: the three paths that end in C. Denominator: their sum, P(C)=0.074.
P(T∣C)=0.0740.030≈0.405
P(S∣C)=0.0740.024≈0.324
P(F∣C)=0.0740.020≈0.270
Check: the three add up to 1, because given C the well is always of one of the three types.
e)
The most likely type for a contaminated well is the tubular well, with 0.405, even though it is the type LEAST often contaminated (5%).
The highest rate is that of the surface wells, P(C∣S)=0.16, but they make up only 15% of the wells: they contribute 0.024 of probability in total, against 0.030 for the tubular wells, which are four times as numerous.
Pitfall: reading P(C∣S), “among the surface wells, how many are contaminated”, as P(S∣C), “among the contaminated wells, how many are surface wells”. The first counts in branch S, the second in the set of all paths that end in C.
The two inform different decisions: P(C∣S) says which type to monitor first; P(T∣C) says where most of the contaminated wells will be found.
Points are earned before the solution; after it, you can keep practising.
For you:
Part B: problems and reasoning (/50)
Exercise 6: Reliability in series and in parallel: a remote hydrometric station through a whole winter
6 answers to check
A remote station measures the water level of a river and transmits its data. It works for a winter month if the level sensor L works, if at least one of the two power supplies works (solar panel with battery P1, backup battery pack P2), if the data logger E works, and if at least one of the two transmitters works (satellite S, cellular modem R). The diagram gives, under each component, its probability of working for the whole month.
In questions a) to e), the six components are assumed independent. A component and the event “it works for the whole month” are denoted by the same name.
a) Prove that two independent components connected in parallel, with reliabilities p and q, form a block with reliability 1−(1−p)(1−q).
b) Compute the reliability of the power supply block and that of the transmission block.
c) Compute the probability that the station works for the whole month, to four decimal places.
d) The budget allows ONE single component or block to be duplicated by an identical component connected in parallel. Which one should be duplicated to increase the reliability of the station the most? Justify with calculations.
e) The station broke down during the month. Compute the probability that the sensor L failed, to three decimal places.
f) In reality, an ice storm can knock out the panel and the backup battery together. A study then estimates P(P1∩P2)=0.06, the other assumptions being unchanged. Recompute the reliability of the station, to four decimal places, and comment.
Show the solution
Answers
a)P(A∪B)=1−P(A∩B)=1−(1−p)(1−q)
b)Power supply 0.985; transmission 0.99
c)0.98×0.985×0.99×0.99≈0.9461
d)The sensor L: the reliability rises to 0.9650, against at most 0.9603 for the other choices
e)P(L∣failure)=0.05390.02≈0.371
f)0.98×0.94×0.99×0.99≈0.9029: a common-cause failure ruins the redundancy
a)
The block works if A OR B works: that is the union. Its complement, by De Morgan, is A∩B: both have failed.
A and B are independent, so A and B are too (exercise 2, question c, applied twice):
P(A∪B)=1−P(A)P(B)=1−(1−p)(1−q)
In series, the block requires A AND B: that is the intersection, with probability pq by independence.
b)
Power supply: 1−0.10×0.15=1−0.015=0.985.
Transmission: 1−0.05×0.20=1−0.010=0.99.
Pitfall: adding, 0.90+0.85=1.75, which exceeds 1; or multiplying the reliabilities, 0.765, which is the formula for a SERIES connection and makes the block less reliable than each of its components.
c)
The four blocks L, power supply, E, transmission are in series and independent:
P(station)=0.98×0.985×0.99×0.99≈0.9461
A chain is less reliable than its weakest link: 0.9461<0.98.
d)
Recompute the reliability for each choice:
sensor duplicated: 1−0.022=0.9996, station ≈0.9650;
data logger duplicated: 1−0.012=0.9999, station ≈0.9556;
power supply block duplicated, that is, a second identical panel-and-battery set connected in parallel with the first: the block fails only if both sets fail, 1−0.0152=0.999775, station ≈0.9603;
transmission block duplicated in the same way: 1−0.0102=0.9999, station ≈0.9556.
Duplicate the sensor L: it is the least reliable link in the chain (0.98), and duplicating it raises the station from 0.9461 to 0.9650.
e)
The station fails as soon as one block fails: P(failure)=1−0.94609≈0.05391.
A sensor failure causes a station failure, so L∩failure=L:
P(L∣failure)=P(failure)P(L)=0.053910.02≈0.371
Before the failure, the sensor had a 2% chance of being faulty; once the failure is observed, it is the prime suspect, at 37%. The condition changed the sample space, and the technician who heads out by snowmobile knows where to start.
f)
With the common failure, the power supply block has reliability 1−0.06=0.94 instead of 0.985:
P(station)=0.98×0.94×0.99×0.99≈0.9029
The redundancy loses most of its effect: the duplicated block is now worth only 0.94, barely better than the panel alone (0.90) and far from the 0.985 of the independent model. The station drops from 0.9461 to 0.9029: the probability of failure nearly doubles, from 5.4% to 9.7%.
The parallel calculation is valid only if the failures are independent. Common-cause failures (cold, ice, lightning) are positively related, and the true reliability is then lower than the model's. Hence the practice of backing up a component with one of a DIFFERENT technology, exposed to other causes of failure.
Points are earned before the solution; after it, you can keep practising.
For you:
Exercise 7: The Monty Hall problem in the field: everything depends on what the person opening knows
10 answers to check
On an introductory outing, a naturalist guide shows an old trunk with three cavities numbered 1, 2 and 3. Only one holds a Pileated Woodpecker nest, and the guide knows which; for a participant, each holds it with probability 31. A participant points to cavity 1. The guide then inspects, with her endoscope camera, ANOTHER cavity that she knows is empty, and shows it empty; if both other cavities are empty, she chooses between them at random. She shows cavity 3 empty, then offers the participant the chance to switch to cavity 2.
Let Ni be “the nest is in cavity i” and O3 “the guide shows cavity 3”.
a) Give P(O3∣N1), P(O3∣N2) and P(O3∣N3), justifying each one with the guide's protocol.
b) Compute P(O3).
c) Compute P(N1∣O3) and P(N2∣O3). Should the participant switch?
d) A participant states: “There are two closed cavities left, so the nest is in one or the other with probability 21.” Explain the mistake.
e) On another day, a second guide does NOT know where the nest is. He inspects cavity 2 or cavity 3 at random, and cavity 3 happens to be empty. Compute the probability that the nest is in cavity 2 given this.
f) Back to the guide who knows. When she has a choice, she prefers cavity 3, which is easier to reach: she shows it with probability q, where 0≤q≤1. Show that P(N2∣O3)=1+q1, then compute this probability for q=0.8. Can switching be a disadvantage?
Show the solution
Answers
a)P(O3∣N1)=21, P(O3∣N2)=1, P(O3∣N3)=0
b)P(O3)=21
c)P(N1∣O3)=31, P(N2∣O3)=32: switch
d)Two remaining outcomes are not equally likely: the guide's move depends on where the nest is
e)21: switching no longer helps
f)1+q1≥21; for q=0.8, ≈0.556; switching is never a disadvantage
a)
If the nest is in 1, cavities 2 and 3 are empty and the guide picks one at random: P(O3∣N1)=21.
If the nest is in 2, she can show neither 1 (chosen) nor 2 (the nest): P(O3∣N2)=1.
If the nest is in 3, she never shows 3: P(O3∣N3)=0.
b)
The Ni form a partition; law of total probability:
P(O3)=31×21+31×1+31×0=21
c)
Bayes' theorem:
P(N1∣O3)=2131×21=31 and P(N2∣O3)=2131×1=32
And P(N3∣O3)=0: the sum is indeed 1. Switching doubles the chances of finding the nest.
The initial choice keeps its probability 31: the guide could always show an empty cavity other than 1, so her move teaches nothing about 1. It does, however, teach a lot about 2, which she avoided.
d)
“Two outcomes, so 21 each” assumes the outcomes are equally likely, which is neither given nor true. The guide's move is not independent of where the nest is: P(O3∣N2)=1 is twice as large as P(O3∣N1)=21.
Pitfall: counting the remaining outcomes instead of conditioning on the information received. A conditional probability is computed with the likelihood of the observation in each case, not by erasing the excluded cases.
e)
The guide who does not know inspects 2 or 3 with probability 21 each; we observe “he inspects 3 AND it is empty”. Likelihoods:
if N1: 21×1; if N2: 21×1; if N3: 21×0=0.
P(N2∣3 inspected and empty)=31×21+31×21+031×21=21
Same observation, different protocol, different answer: what matters is not what you see, but the probability of seeing it in each case. Here, chance could have revealed the nest, and the fact that it did not favours neither 2 nor 1.
f)
Only the likelihood P(O3∣N1) changes, and it equals q. By Bayes:
P(N2∣O3)=31q+31×1+031×1=1+q1
For q=0.8: P(N2∣O3)=1.81≈0.556.
Since 0≤q≤1, we have 1≤1+q≤2, so 1+q1≥21: switching is never a disadvantage. The case q=1 gives 21 (no difference), the case q=0 gives 1: if the guide shows 3 when she always avoids 3 whenever she can, the nest must be in 2.
Points are earned before the solution; after it, you can keep practising.
For you:
Exercise 8: Five statements to correct
5 answers to check
A weather station compares, over several years, its forecast from the day before with the observed weather. A day is chosen at random; let A be “rain was forecast the day before” and R “it rained”. The record gives, in the model adopted: P(R)=0.30, P(A)=0.32 and P(A∩R)=0.24.
Each of the following five statements is FALSE. For each one, compute the value asked for, then write the correct statement.
a) “When rain is forecast, it rains 75% of the time; so when it rains, rain had been forecast 75% of the time.” Compute P(A∣R).
b) “The forecast does not make the rain fall, so A and R are independent.” Compute P(R∣A) and compare it with P(R).
c) “P(R∣A)+P(R∣A)=1, since A and A are complementary.” Compute P(R∣A), to three decimal places.
d) “In this model, the days are independent. It has rained six days in a row; a run of seven is so rare that the seventh day will probably be dry, more than usual.” Compute the probability that it rains on the seventh day given that it rained on the previous six.
e) “The probability that it rains on Saturday or Sunday is 0.30+0.30=0.60.” Keeping the assumption that the days are independent, compute this probability.
Show the solution
Answers
a)P(A∣R)=0.8, not 0.75
b)P(R∣A)=0.75=P(R)=0.30: A and R are dependent
c)P(R∣A)≈0.088; it is P(R∣A)+P(R∣A) that equals 1
d)0.30 under the independence assumption
e)1−0.72=0.51
a)
The two percentages do not have the same denominator. First P(R∣A)=0.320.24=0.75, then:
P(A∣R)=P(R)P(A∩R)=0.300.24=0.8
Correct statement: “When rain is forecast, it rains 75% of the time; when it rains, rain had been forecast 80% of the time.”
Pitfall: turning the bar around without changing the denominator. The two numbers are equal only if P(A)=P(R).
b)
P(R∣A)=0.75 whereas P(R)=0.30: knowing that rain is forecast multiplies the probability of rain by 2.5. The events are dependent.
Check with the product: P(A)P(R)=0.096=0.24.
Correct statement: “The forecast does not cause the rain, but A and R are dependent, and that is a good thing: a forecast independent of the coming weather would be useless.”
Pitfall: confusing independence with the absence of a causal link. Independence is an equality between numbers, P(A∩R)=P(A)P(R); two effects of the same cause, here the state of the atmosphere the day before, are dependent without one causing the other.
c)
R∩A: it rains without a forecast, P(R∩A)=P(R)−P(R∩A)=0.30−0.24=0.06. And P(A)=1−0.32=0.68.
P(R∣A)=0.680.06≈0.088
The sum 0.75+0.088≈0.838 is not 1. The two probabilities are computed in two different sample spaces, A and A: nothing forces them to be complementary.
Correct statement: “In one and the same sample space A, P(R∣A)+P(R∣A)=1”; here P(R∣A)=0.25.
d)
If the days are independent, the rain of the previous six days changes nothing: the probability sought is P(R)=0.30.
The rarity of the full run, 0.37≈0.0002, is computed BEFORE the first six days. Once these six days have been observed, only one day is left to play out.
Correct statement: “Under the independence assumption, the seventh day is rainy with probability 0.30, like any other day.”
A nuance: real weather is not independent from one day to the next, since low-pressure systems last several days. Persistence, if it plays a role, makes rain MORE likely after a rainy run, never less: the statement is false in both models.
e)
The plain sum is allowed only for mutually exclusive events; but it can rain on both days. With the complement, and the independence of the two days:
P(Saturday or Sunday)=1−P(dry Saturday)P(dry Sunday)=1−0.7×0.7=0.51
Check with the union: 0.30+0.30−0.30×0.30=0.51.
Correct statement: “The probability that it rains on at least one of the two days is 0.51.” Without the independence assumption, we would need to know P(rain Saturday and Sunday).
Points are earned before the solution; after it, you can keep practising.
For you:
Exercise 9: Problem: environmental DNA, how many replicates to conclude that an invasive fish is absent?
5 answers to check
A team monitors the arrival of the tench, an invasive fish, in the lakes of a watershed. For a lake chosen at random in the area, regional data give, before any sampling, a probability ψ=0.40 that the species is present. In a lake, k water replicates are collected and analyzed separately.
Model adopted: if the species is present, each replicate detects its DNA with probability p=0.55; if it is absent, a replicate is falsely positive (laboratory contamination) with probability 0.02. Given presence or absence, the replicates are independent. Let L be “the species is present in the lake”.
a) The species is present. Compute the probability that at least one replicate out of k=3 is positive, to three decimal places.
b) In this question and the next, false positives are neglected. The three replicates from a lake are negative. Compute the probability that the species is present nonetheless, to three decimal places.
c) The protocol requires that a lake with no positive replicate be declared free of the species with a risk of error of at most 5%. Find the smallest number k of replicates that guarantees it.
d) False positives are now taken into account, with k=4. A lake gives exactly one positive replicate out of four. Compute P(L∣one positive out of four), to three decimal places. Do the same for exactly two positives out of four.
e) Write, in three or four sentences, the decision rule you would propose to the team, and name one assumption of the model that could make it too optimistic.
Show the solution
Answers
a)1−0.453≈0.909
b)P(L∣three negatives)≈0.057
c)k=4: 0.027≤0.05, whereas k=3 gives 0.057
d)One positive: ≈0.640; two positives: ≈0.991
e)Four replicates; no positive: free; two or more: present; only one: repeat. Risk: correlated replicates
a)
“At least one positive” has complement “three negatives”. Given presence, the replicates are independent:
P(at least one∣L)=1−(1−0.55)3=1−0.091125≈0.909
Pitfall:3×0.55=1.65, which is not a probability, or 0.553≈0.166, which is the probability that all three are positive.
b)
Turn the condition around with Bayes, on the partition {L,L}. Without false positives, a lake without the species gives three negatives with probability 1:
Three negative results bring the probability of presence down from 0.40 to 0.057: a sharp drop, but not a proof of absence. A negative does not say “absent”, it says “less likely to be present”.
c)
With k negative replicates, the same formula gives P(L∣kneg.)=0.4×0.45k+0.60.4×0.45k. We want it to be at most 0.05:
Taking the logarithm, which is negative for 0.45 and therefore reverses the inequality: k≥ln0.45ln(0.03/0.38)≈3.18.
The smallest integer is k=4. Check: k=3 gives 0.057>0.05 and k=4 gives ≈0.027≤0.05. The figure in the solution shows this decrease.
d)
There are 4 possible positions for the positive replicate, each with the same probability. Likelihoods:
if present: 4×0.55×0.453≈0.2005; if absent: 4×0.02×0.983≈0.0753.
P(L∣1pos.)=0.4×0.2005+0.6×0.07530.4×0.2005≈0.640
For two positives out of four (6 positions): present, 6×0.552×0.452≈0.3675; absent, 6×0.022×0.982≈0.0023.
P(L∣2pos.)=0.4×0.3675+0.6×0.00230.4×0.3675≈0.991
A single positive leaves more than one chance in three that it is contamination: an isolated positive is not a proof of presence, whereas two almost are.
e)
Proposed rule: collect four replicates per lake. No positive: declare the lake free of the species, with a risk of about 3% (0.029 when false positives are taken into account). Two or more positives: declare the species present, at more than 99%. Only one positive: do not conclude, and run a new sampling campaign.
These numbers depend on the model. The most fragile assumption is the independence of the replicates: collected on the same day at the same spot, they share the same conditions (cold water, current, dispersed DNA), so their failures are linked, and the true probability of presence after four negatives is larger than 0.029. The values of ψ and p are also estimates, to be updated with later campaigns.
Points are earned before the solution; after it, you can keep practising.
For you:
Exercise 10: Problem: a field test of drinking water, from the rate of positive results to the decision
6 answers to check
A rapid test kit detects the bacterium E. coli in the water of a well. The manufacturer states a sensitivity of 0.92 (the test is positive for 92% of contaminated wells) and a specificity of 0.96 (it is negative for 96% of uncontaminated wells). During a campaign in one region, 500 private wells are tested once: 64 results are positive.
Let C be “the well is contaminated”, T “the test is positive”, and π=P(C) the prevalence, that is, the proportion of contaminated wells in the region. The wells tested are considered to be chosen at random.
a) Compute the proportion of positive tests. Explain why it is not the proportion of contaminated wells.
b) Show that P(T)=0.04+0.88π, then estimate the prevalence π from the campaign.
c) With this prevalence, compute P(C∣T) and P(C∣T), to three decimal places.
d) Wells that test positive are tested a second time with another, identical kit; given the state of the well, the two results are assumed independent. Compute the probability that a well positive on both tests is contaminated, to three decimal places.
e) In another region, the prevalence is 2%. Compute P(C∣T) for the same kit, to three decimal places.
f) Write the recommendation to send to the well owners of the first region, in three or four sentences: what to do after a positive test, after a negative test, and what reservation to keep in mind.
Show the solution
Answers
a)50064=0.128: it includes false positives and misses false negatives
b)P(T)=0.92π+0.04(1−π); π=0.10
c)P(C∣T)≈0.719; P(C∣T)≈0.991
d)≈0.983
e)P(C∣T)≈0.319
f)Positive: do not drink the water without boiling it, confirm in a laboratory; negative: water very probably free of E. coli; reservation about the assumptions
a)
50064=0.128.
This is not the proportion of contaminated wells: the positives include uncontaminated wells wrongly declared positive, and some contaminated wells were declared negative. The rate of positives mixes the prevalence with the errors of the test.
b)
C and C form a partition; law of total probability:
Two positives out of three are then false positives. The value of a positive result depends on the prevalence, as the curve in the solution shows: when uncontaminated wells are the vast majority, even a small error rate on them produces more positives than the truly contaminated wells do.
f)
Recommendation for the first region. After a positive test, contamination is likely (about 72%): do not drink the water without boiling it first, and have it confirmed by a second test or, better, by an analysis in an accredited laboratory before disinfecting the well. After a negative test, the water is very probably free of E. coli (about 99%), which does not replace the regular testing recommended by the authorities.
Reservation: these numbers rest on the performance stated by the manufacturer and on the independence of the two tests. A substance in the water that skews both kits would make their errors linked, and the 98% of question d) would be too optimistic: that is why confirmation is preferably done with a different method.
Points are earned before the solution; after it, you can keep practising.
Something missing from this set?A type of exercise your teacher gives, a problem you are stuck on, a mistake you spotted: tell me, I read every request.
Sending goes through your free space: that is how I can answer you and tell you when the exercise is added. An email is enough, no password. Create your space.
Rather not create an account? Write to me directly.
This chapter comes back in
The chapters that build on it, later in the year or in the years that follow.
Looking for a probability and statistics tutor in Montreal?
Get in touch for a first session. Conditional probability comes down to a single question, “what am I counting among?”, and it is by asking it out loud, exercise after exercise, that it becomes a reflex on exam day.