StatisticsProbability Rules6 of 7
Probability Rules · 6

Tree Diagrams and Bayes' Theorem

When a process happens in stages and the probabilities in the second step depend on how the first step turned out, we need a way to map out the possibilities instead of keeping track of changing numbers in our head.

1

Mapping a Two-Stage Process

Suppose we want to find the overall chance that you arrive late to work tomorrow. In your town, it rains on 20%20\% of mornings (0.20.2) and is clear on the other 80%80\% (0.80.8). When it rains, traffic gets backed up and there is a 50%50\% chance (0.50.5) you are late; when the skies are clear, there is only a 10%10\% chance (0.10.1) you are late.

Mapping a Two-Stage Process with a Tree
P(Late)\displaystyle P(\text{Late}) =  ?\displaystyle = \;?
Rain  →  coin tossClear  →  almost never late\displaystyle \begin{aligned} \text{Rain} &\;\rightarrow\; \text{coin toss} \\ \text{Clear} &\;\rightarrow\; \text{almost never late} \end{aligned}

Once the stages are mapped out as branches from left to right, we need to turn the branch numbers into the probability of each full start-to-finish path and combine the paths where you arrive late.

Multiplying Along Paths and Adding Endpoints
P(Late)=  ?P(\text{Late}) = \;?
Rain\text{Rain}
0.20.2
Clear\text{Clear}
0.80.8
0.50.5
0.50.5
0.10.1
0.90.9
Late\text{Late}
On Time\text{On Time}
Late\text{Late}
On Time\text{On Time}
Rain\text{Rain}
Clear\text{Clear}
0.20.2
0.80.8
0.50.5
0.50.5
0.10.1
0.90.9
Late\text{Late}
0.10\share{0.10}
On Time\text{On Time}
0.10\share{0.10}
Late\text{Late}
0.08\share{0.08}
On Time\text{On Time}
0.72\share{0.72}
0.18\share{0.18}
Text solution
Check that each split adds to 11Every morning reaching a dot must follow one of the branches leaving that dot, so the branches at each fork add to 11.
0.2+0.8=10.5+0.5=10.1+0.9=1\displaystyle \begin{aligned} 0.2 + 0.8 &= 1 \\ 0.5 + 0.5 &= 1 \\ 0.1 + 0.9 &= 1 \end{aligned}
Multiply along each path to find the endpointsOnly a fraction of the mornings on a first-stage branch continue down a second-stage branch, so we multiply the branch probabilities along each path.
Rain, then Late=0.2×0.5=0.10Rain, then On Time=0.2×0.5=0.10Clear, then Late=0.8×0.1=0.08Clear, then On Time=0.8×0.9=0.72\displaystyle \begin{aligned} \text{Rain, then Late} &= 0.2 \times 0.5 \\ &= \share{0.10} \\[6pt] \text{Rain, then On Time} &= 0.2 \times 0.5 \\ &= \share{0.10} \\[6pt] \text{Clear, then Late} &= 0.8 \times 0.1 \\ &= \share{0.08} \\[6pt] \text{Clear, then On Time} &= 0.8 \times 0.9 \\ &= \share{0.72} \end{aligned}
Add the Late endpoints togetherRainy late mornings and clear late mornings are two separate groups of days that both end with you arriving late, so we add their endpoint probabilities.
Overall Late\displaystyle \text{Overall Late} =0.10+0.08\displaystyle = \share{0.10} + \share{0.08} =0.18\displaystyle = \share{0.18}

So you show up late on 18%\share{18\%} of all mornings: 10%\share{10\%} coming from rainy mornings and 8%\share{8\%} coming from clear mornings.

Because the second stage takes a fraction of a first-stage branch, changing a first-stage split rescales both of its endpoints, while all four endpoints still add up to all 100\share{100} mornings.

Each second-stage fork splits only the mornings that reach its branch, while all four endpoints together always add up to all 100 mornings.
2

Reversing the Condition

So far we have moved forward in time from the weather to your arrival at work, where the branch number 0.50.5 tells us the chance you are late if it is raining. Now suppose a coworker in a windowless office sees you walk in late and wants to know the reverse: given that you are late, what is the probability that it is raining outside?

Reversing the Condition
P(Rain∣Late)=  ?P(\event{\text{Rain}} \mid \observed{\text{Late}}) = \;?
Rain\event{\text{Rain}}
0.20.2
Clear\text{Clear}
0.80.8
0.50.5
0.50.5
0.10.1
0.90.9
Late\observed{\text{Late}}
0.10\share{0.10}
On Time\text{On Time}
0.10\share{0.10}
Late\observed{\text{Late}}
0.08\share{0.08}
On Time\text{On Time}
0.72\share{0.72}
Rain\event{\text{Rain}}
Clear\text{Clear}
0.20.2
0.80.8
0.50.5
0.5\htmlClass{lc-mute}{0.5}
0.10.1
0.9\htmlClass{lc-mute}{0.9}
Late\observed{\text{Late}}
0.10\share{0.10}
On Time\htmlClass{lc-mute}{\text{\sout{On Time}}}
0.10\htmlClass{lc-mute}{\text{\sout{0.10}}}
Late\observed{\text{Late}}
0.08\share{0.08}
On Time\htmlClass{lc-mute}{\text{\sout{On Time}}}
0.72\htmlClass{lc-mute}{\text{\sout{0.72}}}
0.18\observed{0.18}
Text solution
Cross out the endpoints that did not happenSince your coworker sees that you are late, neither On Time path happened today, narrowing the remaining possibilities down to just the two Late endpoints.
All Late mornings\displaystyle \text{All } \observed{\text{Late}} \text{ mornings} =0.10+0.08\displaystyle = \share{0.10} + \share{0.08} =0.18\displaystyle = \observed{0.18}
Divide the rainy-late endpoint by all late endpointsAmong just the late mornings, we find the share that came from the Rain path (where the vertical bar ∣\mid is read "given that": the outcome after the bar is what we already observed, not division).
P(Rain∣Late)=0.100.10+0.08=0.100.18=1018≈0.556\displaystyle \begin{aligned} P(\event{\text{Rain}} \mid \observed{\text{Late}}) &= \frac{\event{0.10}}{\observed{0.10 + 0.08}} \\ &= \frac{\event{0.10}}{\observed{0.18}} \\ &= \frac{\event{10}}{\observed{18}} \approx \share{0.556} \end{aligned}

So seeing you walk in late raises the probability of rain from 20%20\% on a normal morning to 55.6%\share{55.6\%}, because slightly more of your late mornings come from rain (0.10\event{0.10}) than from clear skies (0.08\share{0.08}).

3

Drawing Without Replacement

In the commute problem, the second-stage probabilities were already given to us. When you draw items one after another without putting the first one back, you have to build the second-stage fractions yourself because the first grab changes what is left for the second grab.

Suppose a kitchen drawer holds 1010 loose batteries (7\event{7} Charged and 3\other{3} Dead) and you grab two batteries one after the other without replacement. We want to find the probability that both batteries are charged, the probability that exactly one is charged, and the reversed probability that the first battery is charged given that the second battery tests dead.

Drawing Without Replacement
1010
7 Charged\event{7\ \text{Charged}}
3 Dead\other{3\ \text{Dead}}
Charged\event{\text{Charged}}
6+3=9\event{6} + \other{3} = 9
7+2=9\event{7} + \other{2} = 9
Dead\other{\text{Dead}}
710\dfrac{\event{7}}{10}
310\dfrac{\other{3}}{10}
69\dfrac{\event{6}}{9}
39\dfrac{\other{3}}{9}
79\dfrac{\event{7}}{9}
29\dfrac{\other{2}}{9}
Charged\event{\text{Charged}}
4290\share{\dfrac{42}{90}}
Dead\other{\text{Dead}}
2190\share{\dfrac{21}{90}}
Charged\event{\text{Charged}}
2190\share{\dfrac{21}{90}}
Dead\other{\text{Dead}}
690\share{\dfrac{6}{90}}
Text solution
Update the drawer counts for the second grabPulling one battery out of the 1010-battery drawer leaves 99 batteries behind and drops the count of whichever type was pulled on the first grab by 11.
After 1st Charged(710):2nd Charged=69,2nd Dead=39After 1st Dead(310):2nd Charged=79,2nd Dead=29\displaystyle \begin{aligned} &\text{After 1st } \event{\text{Charged}} \left(\frac{\event{7}}{10}\right): \\ &\quad \begin{aligned} \text{2nd } \event{\text{Charged}} &= \frac{\event{6}}{9}, \\ \text{2nd } \other{\text{Dead}} &= \frac{\other{3}}{9} \end{aligned} \\[8pt] &\text{After 1st } \other{\text{Dead}} \left(\frac{\other{3}}{10}\right): \\ &\quad \begin{aligned} \text{2nd } \event{\text{Charged}} &= \frac{\event{7}}{9}, \\ \text{2nd } \other{\text{Dead}} &= \frac{\other{2}}{9} \end{aligned} \end{aligned}
Multiply along each path and keep the common denominatorLeaving all four endpoints over 10×9=9010 \times 9 = 90 instead of simplifying early makes it easy to add and compare them in the next steps.
Charged, then Charged=710×69=4290Charged, then Dead=710×39=2190Dead, then Charged=310×79=2190Dead, then Dead=310×29=690\displaystyle \begin{aligned} \event{\text{Charged}}\text{, then }\event{\text{Charged}} &= \frac{\event{7}}{10} \times \frac{\event{6}}{9} \\ &= \share{\frac{42}{90}} \\[6pt] \event{\text{Charged}}\text{, then }\other{\text{Dead}} &= \frac{\event{7}}{10} \times \frac{\other{3}}{9} \\ &= \share{\frac{21}{90}} \\[6pt] \other{\text{Dead}}\text{, then }\event{\text{Charged}} &= \frac{\other{3}}{10} \times \frac{\event{7}}{9} \\ &= \share{\frac{21}{90}} \\[6pt] \other{\text{Dead}}\text{, then }\other{\text{Dead}} &= \frac{\other{3}}{10} \times \frac{\other{2}}{9} \\ &= \share{\frac{6}{90}} \end{aligned}
Read the single endpoint where both are chargedOnly the top path gives two charged batteries, which we simplify at the end.
Both Charged\displaystyle \text{Both } \event{\text{Charged}} =4290\displaystyle = \share{\frac{42}{90}} =715≈0.467\displaystyle = \share{\frac{7}{15}} \approx \share{0.467}
Add both orders for exactly one charged batteryGetting one charged and one dead battery happens in two ways, Charged then Dead (7×3\event{7} \times \other{3}) and Dead then Charged (3×7\other{3} \times \event{7}), so we add both mixed endpoints together.
Exactly one Charged=2190+2190=4290=715≈0.467\displaystyle \begin{aligned} &\text{Exactly one } \event{\text{Charged}} \\ &\quad = \share{\frac{21}{90}} + \share{\frac{21}{90}} \\ &\quad = \share{\frac{42}{90}} = \share{\frac{7}{15}} \approx \share{0.467} \end{aligned}
Cross out the second-charged endpoints to reverse the conditionWhen the second battery tests dead, only the two endpoints ending in Dead (2190\share{\tfrac{21}{90}} and 690\share{\tfrac{6}{90}}) remain, and because both are already over 9090, we can compare their numerators directly.
P(1st Charged∣2nd Dead)=21902190+690=2121+6=2127=79\displaystyle \begin{aligned} &P(\event{\text{1st Charged}} \mid \observed{\text{2nd Dead}}) \\ &\quad = \frac{\event{\tfrac{21}{90}}}{\observed{\tfrac{21}{90} + \tfrac{6}{90}}} \\ &\quad = \frac{\event{21}}{\observed{21 + 6}} = \frac{\event{21}}{\observed{27}} = \share{\frac{7}{9}} \end{aligned}

So there is a 715\share{\tfrac{7}{15}} (46.7%\share{46.7\%}) chance of grabbing two charged batteries, the same 715\share{\tfrac{7}{15}} (46.7%\share{46.7\%}) chance of grabbing one of each, and if the second battery tests dead, a 79\share{\tfrac{7}{9}} (77.8%\share{77.8\%}) chance that the first battery sitting on the counter is charged, matching the 7\event{7} charged batteries among the other 99 original batteries.

Whatever the starting mix of batteries, pulling one on the first grab lowers that type's fraction on the second grab, yet the two mixed endpoints (Charged then Dead, and Dead then Charged) always have the exact same probability out of 9090.

When you grab two batteries without putting the first one back, the first grab changes what is left for the second grab, yet both ways to get a mixed pair always have the same chance.
4

Rare Events and False Alarms

Reversing a tree is especially useful when a condition is rare and a test's high accuracy rate tempts us to guess a number that is way too high.

At a computer chip factory, only 1%1\% (0.010.01) of all chips are Defective while 99%99\% (0.990.99) are Fine. An automated scanner catches 90%90\% (0.900.90) of Defective chips by ringing an alarm, and falsely rings an alarm on 10%10\% (0.100.10) of Fine chips. If the alarm rings on a chip, what is the probability that the chip is actually defective?

Rare Events and False Alarms
P(Defective∣Alarm)=  ?P(\event{\text{Defective}} \mid \observed{\text{Alarm}}) = \;?
Defective:  1%\event{\text{Defective}}\text{:}\; 1\%
=0.01{}= 0.01
Fine:  99%\text{Fine:}\; 99\%
=0.99{}= 0.99
P(Alarm∣Defective)P(\observed{\text{Alarm}} \mid \event{\text{Defective}})
=90%{}= 90\%
P(Alarm∣Fine)P(\observed{\text{Alarm}} \mid \text{Fine})
=10%{}= 10\%
Defective\event{\text{Defective}}
0.010.01
Fine\text{Fine}
0.990.99
0.900.90
0.100.10
0.100.10
0.900.90
Alarm\observed{\text{Alarm}}
No Alarm\text{No Alarm}
Alarm\observed{\text{Alarm}}
No Alarm\text{No Alarm}
0.009\event{0.009}
0.099\share{0.099}
Text solution
Multiply along the two paths that trigger the alarmSince the alarm just rang, we only need the two endpoints that end in Alarm: one coming from the tiny Defective branch and one coming from the huge Fine branch.
Defective, then Alarm=0.01×0.90=0.009Fine, then Alarm=0.99×0.10=0.099\displaystyle \begin{aligned} &\event{\text{Defective}}\text{, then }\observed{\text{Alarm}} \\ &\quad = 0.01 \times 0.90 = \share{0.009} \\[6pt] &\text{Fine, then }\observed{\text{Alarm}} \\ &\quad = 0.99 \times 0.10 = \share{0.099} \end{aligned}
Divide the true-alarm endpoint by all alarms combinedWe compare the true-alarm endpoint against the total of both alarm endpoints.
P(Defective∣Alarm)=0.0090.009+0.099=0.0090.108=112≈0.083\displaystyle \begin{aligned} &P(\event{\text{Defective}} \mid \observed{\text{Alarm}}) \\ &\quad = \frac{\event{0.009}}{\observed{0.009 + 0.099}} = \frac{\event{0.009}}{\observed{0.108}} \\ &\quad = \share{\frac{1}{12}} \approx \share{0.083} \end{aligned}

So when the alarm goes off, there is only a 112\share{\tfrac{1}{12}} (8.3%\share{8.3\%}) chance the chip is actually defective, because a 10%10\% false-alarm rate on the massive 99%99\% Fine group produces eleven times as many alarms (0.099\share{0.099}) as a 90%90\% catch rate on the tiny 1%1\% Defective group (0.009\event{0.009}).

Even with the scanner's 90%90\% catch rate and 10%10\% false-alarm rate held fixed, false alarms outnumber true alarms whenever defective chips are rare, and true alarms only pull ahead once the incoming Defective branch is wide enough.

With a fixed 90% catch rate and 10% false-alarm rate, true alarms only outnumber false alarms once the incoming Defective branch is wide enough.
5

Choosing the First Stage and Bayes' Theorem

When you read a word problem from scratch, you have to decide which event belongs on the first stage of your tree and which belongs on the second stage before you can calculate anything.

Choosing the First Stage and Bayes' Theorem
1st stage\text{1st stage}
2nd stage\text{2nd stage}
Charged\event{\text{Charged}}
710\dfrac{\event{7}}{10}
Dead\other{\text{Dead}}
310\dfrac{\other{3}}{10}
69\dfrac{\event{6}}{9}
39\dfrac{\other{3}}{9}
79\dfrac{\event{7}}{9}
29\dfrac{\other{2}}{9}
Charged\event{\text{Charged}}
Dead\other{\text{Dead}}
Charged\event{\text{Charged}}
Dead\other{\text{Dead}}

Whenever you reverse a condition on a tree, the fraction you build from the endpoints is called Bayes' Theorem:

Reversed Probability=The one path you’re testingAll the paths that endthe way you observed\displaystyle \begin{aligned} &\share{\text{Reversed Probability}} \\ &\quad = \frac{\event{\text{The one path you're testing}}}{\observed{\begin{gathered}\text{All the paths that end} \\ \text{the way you observed}\end{gathered}}} \end{aligned}

Key concepts

Picking the first stage

Follow the time order when actions happen one after another (1st1\text{st} battery grab on the first stage, 2nd2\text{nd} grab on the second stage). When time order isn't given, look for which numbers have an "if" attached: put the unconditional probabilities with no "if" attached on the first stage (0.20.2 Rain, 0.80.8 Clear) and the conditional "if" probabilities on the second stage (0.50.5 Late if Rain). At every fork, the branches leaving a dot must add to 11.

Multiplying vs. adding

Multiply along a single path because you are taking a fraction of a fraction (Rain, then Late=0.2×0.5=0.10\text{Rain, then Late} = 0.2 \times 0.5 = \share{0.10}). If a problem asks for one specific two-stage path ("both batteries are charged" or "a domestic flight that departs late"), stop right after multiplying that path; do not add other paths or divide. Add endpoints only when multiple separate paths produce the outcome ("overall chance of arriving late" combines 0.10+0.08=0.18\share{0.10} + \share{0.08} = \share{0.18}; "exactly one battery is charged" combines both orders, 2190+2190=4290\share{\tfrac{21}{90}} + \share{\tfrac{21}{90}} = \share{\tfrac{42}{90}}).

Drawing without replacement

Removing an item on the first grab drops the total and that item's count by 11 on the second stage (after pulling 11 of 7\event{7} Charged batteries from 1010, the next Charged branch is 69\tfrac{\event{6}}{9}). Keep all endpoints over their unsimplified common denominator (10×9=9010 \times 9 = 90) until the very last step.

When to reverse the condition (and when not to)

If the known condition is already on the first stage ("if it rains, what is the chance you are late?"), just read the second-stage branch (0.50.5) directly. Only reverse the condition when you are told how the second stage ended ("given that you arrived late, what is the chance it rained?"). Cross out the endpoints that didn't happen and take your target path's share of the remaining endpoints:

Reversed Probability=The one path you’re testingAll the paths that endthe way you observed(P(Rain∣Late)=0.100.10+0.08=1018)\displaystyle \begin{aligned} &\share{\text{Reversed Probability}} \\ &\quad = \frac{\event{\text{The one path you're testing}}}{\observed{\begin{gathered}\text{All the paths that end} \\ \text{the way you observed}\end{gathered}}} \\[10pt] &\Biggl(P(\event{\text{Rain}} \mid \observed{\text{Late}}) \\ &\quad = \frac{\event{0.10}}{\observed{0.10 + 0.08}} = \frac{\event{10}}{\observed{18}}\Biggr) \end{aligned}

6

Practice

1

At an airport, 30%30\% of flights are international and the rest are domestic. Among domestic flights, 85%85\% depart on time and the rest depart late. What is the probability that a randomly selected flight is a domestic flight that departs late?

Each split leaving a dot must add up to 11: what fraction of all flights are domestic, and within that branch, what fraction depart late?

Find the missing branch at each splitSubtract from 11 at each fork rather than multiplying the given 0.300.30 and 0.850.85 directly (which would give 0.2550.255) or keeping 0.850.85 for on-time domestic flights (which would give 0.70×0.85=0.5950.70 \times 0.85 = 0.595).
Domestic=1−0.30=0.70Late given Domestic=1−0.85=0.15\displaystyle \begin{aligned} \text{Domestic} &= 1 - 0.30 \\ &= 0.70 \\[6pt] \text{Late given Domestic} &= 1 - 0.85 \\ &= 0.15 \end{aligned}
Multiply along the single pathSince we want a single two-stage path (Domestic, then Late), multiply along that path (do not add the branches to get 0.850.85).
Domestic, then Late\displaystyle \text{Domestic, then Late} =0.70×0.15\displaystyle = 0.70 \times 0.15 =0.105 (or 10.5%)\displaystyle = \share{0.105} \text{ (or } \share{10.5\%})
2

If a student studies in the library, there is an 80%80\% chance they finish their assignment. If they study in their dorm room, there is a 40%40\% chance they finish. Suppose 25%25\% of students study in the library and the rest study in their dorm room. What is the overall probability that a randomly chosen student finishes their assignment?

Even though the finishing rates are mentioned first in the problem, which probabilities have no "if" attached and belong on the first stage of the tree?

Put the unconditional study location on the first stageLibrary is 0.250.25 and Dorm is 1−0.25=0.751 - 0.25 = 0.75. Multiply each location branch by its finishing rate rather than averaging 0.800.80 and 0.400.40 to get 0.600.60.
Library, then Finish=0.25×0.80=0.20Dorm, then Finish=0.75×0.40=0.30\displaystyle \begin{aligned} \text{Library, then Finish} &= 0.25 \times 0.80 \\ &= \share{0.20} \\[6pt] \text{Dorm, then Finish} &= 0.75 \times 0.40 \\ &= \share{0.30} \end{aligned}
Add both Finish endpointsDon't stop at the Library endpoint (0.20\share{0.20}) alone; combine both groups of students who finish their assignment.
Overall Finish\displaystyle \text{Overall Finish} =0.20+0.30\displaystyle = \share{0.20} + \share{0.30} =0.50 (or 50%)\displaystyle = \share{0.50} \text{ (or } \share{50\%})
3

A box contains 88 markers: 5\event{5} working and 3\other{3} dried out. You grab two markers one after the other without putting the first one back. What is the probability that exactly one of the two markers you grab is working?

How many markers are left in the box on the second grab, and how many different paths end with one working marker and one dried-out marker?

Multiply along each mixed path with the updated denominatorBecause the first marker is not replaced, only 77 markers remain for the second grab (leaving the denominator at 88 would give 3064=1532\tfrac{30}{64} = \tfrac{15}{32}).
Working, then Dried out=58×37=1556Dried out, then Working=38×57=1556\displaystyle \begin{aligned} \event{\text{Working}}\text{, then }\other{\text{Dried out}} &= \frac{\event{5}}{8} \times \frac{\other{3}}{7} \\ &= \share{\frac{15}{56}} \\[6pt] \other{\text{Dried out}}\text{, then }\event{\text{Working}} &= \frac{\other{3}}{8} \times \frac{\event{5}}{7} \\ &= \share{\frac{15}{56}} \end{aligned}
Add both orders togetherCounting only the first order leaves you with half the answer (1556\share{\tfrac{15}{56}}); add both paths that result in one of each.
Exactly one Working=1556+1556=3056=1528 (or about 53.6%)\displaystyle \begin{aligned} &\text{Exactly one } \event{\text{Working}} \\ &\quad = \share{\frac{15}{56}} + \share{\frac{15}{56}} = \share{\frac{30}{56}} \\ &\quad = \share{\frac{15}{28}} \text{ (or about } \share{53.6\%}) \end{aligned}
4

Only 2%2\% of packages passing through a warehouse contain fragile glass. An automated scanner flags 95%95\% of packages that contain glass, and falsely flags 5%5\% of packages that do not contain glass. If the scanner flags a package, what is the probability that the package actually contains fragile glass?

Find both endpoints where the scanner flags a package: how large is the 5%5\% false-alarm share of the 98%98\% No Glass branch compared to the 95%95\% share of the 2%2\% Glass branch?

Multiply along both paths that end in a flagged packageMultiply each flagging rate by the fraction of packages that enter that branch; skipping the first stage and comparing 0.950.95 to 0.95+0.050.95 + 0.05 would just give back 0.950.95.
Glass, then Flagged=0.02×0.95=0.019No Glass, then Flagged=0.98×0.05=0.049\displaystyle \begin{aligned} &\event{\text{Glass}}\text{, then }\observed{\text{Flagged}} \\ &\quad = 0.02 \times 0.95 = \share{0.019} \\[6pt] &\text{No Glass, then }\observed{\text{Flagged}} \\ &\quad = 0.98 \times 0.05 = \share{0.049} \end{aligned}
Divide the true-glass endpoint by all flagged endpointsDon't stop at the single path 0.019\event{0.019}; divide by the total of both flagged endpoints.
P(Glass∣Flagged)=0.0190.019+0.049=0.0190.068=1968 (or about 27.9%)\displaystyle \begin{aligned} &P(\event{\text{Glass}} \mid \observed{\text{Flagged}}) \\ &\quad = \frac{\event{0.019}}{\observed{0.019 + 0.049}} = \frac{\event{0.019}}{\observed{0.068}} \\ &\quad = \share{\frac{19}{68}} \text{ (or about } \share{27.9\%}) \end{aligned}
5

A bag holds 1212 keys: 4\event{4} open a storage room and 8\other{8} do not. A janitor pulls one key out of the bag and puts it in their pocket without trying it, then pulls a second key out of the bag and tries it in the lock. Given that the second key opens the storage room, what is the probability that the first key in the janitor's pocket also opens the storage room?

Keep the endpoint fractions over the common denominator 12×11=13212 \times 11 = 132, and cross out the two endpoints where the second key does not open the room.

Find the two endpoints where the second key opens the roomOn the top path, pulling one working key first leaves only 3\event{3} working keys among the remaining 1111 (using 411\tfrac{4}{11} again gives 16132\tfrac{16}{132} and leads to the wrong answer 13\tfrac{1}{3}). On the bottom path, pulling a non-working key first leaves all 4\event{4} working keys among the remaining 1111.
Open, then Open=412×311=12132Not Open, then Open=812×411=32132\displaystyle \begin{aligned} \event{\text{Open}}\text{, then }\event{\text{Open}} &= \frac{\event{4}}{12} \times \frac{\event{3}}{11} \\ &= \share{\frac{12}{132}} \\[6pt] \other{\text{Not Open}}\text{, then }\event{\text{Open}} &= \frac{\other{8}}{12} \times \frac{\event{4}}{11} \\ &= \share{\frac{32}{132}} \end{aligned}
Divide the both-open endpoint by all second-open endpointsDon't stop at the single path 12132=111\event{\tfrac{12}{132}} = \event{\tfrac{1}{11}}; compare the numerators across both remaining endpoints over 132132.
P(1st Open∣2nd Open)=1213212132+32132=1244=311 (or about 27.3%)\displaystyle \begin{aligned} &P(\event{\text{1st Open}} \mid \observed{\text{2nd Open}}) \\ &\quad = \frac{\event{\tfrac{12}{132}}}{\observed{\tfrac{12}{132} + \tfrac{32}{132}}} = \frac{\event{12}}{\observed{44}} \\ &\quad = \share{\frac{3}{11}} \text{ (or about } \share{27.3\%}) \end{aligned}