List 6 — Conditional Probability
Two-way tables, independence, Bayes, total probability
University Homework & Passing
A survey of 100 students recorded whether each student (A) and whether they the course (B). The joint counts are: A∩B = 48, A∩Bᶜ = 12, Aᶜ∩B = 22, Aᶜ∩Bᶜ = 18. Find P(A), P(B), P(A∪B), P(A|B), and P(B|A). Are A and B mutually exclusive? Are they independent?
| Homework \ Result | Passed (B) | Failed (Bᶜ) | Total |
|---|---|---|---|
| Did homework (A) | 48 | 12 | 60 |
| No homework (Aᶜ) | 22 | 18 | 40 |
| Total | 70 | 30 | 100 |
A = student did homework, B = student passed. Grand total n = 100. Row totals: P(A) row = 48+12 = 60; Aᶜ row = 22+18 = 40. Column totals: B col = 48+22 = 70; Bᶜ col = 12+18 = 30.
Divide each marginal count by 100.
P(A∩B) = 48/100 = 0.48.
Given the student passed, what fraction did homework?
Given the student did homework, what fraction passed?
Mutually exclusive means A∩B = ∅, i.e. P(A∩B) = 0. Here P(A∩B) = 0.48 ≠ 0, so A and B are NOT mutually exclusive.
Independent iff P(A|B) = P(A). We found P(A|B) ≈ 0.686 but P(A) = 0.60. They differ, so A and B are NOT independent — doing homework is associated with a higher pass rate.
The four regions show joint counts out of 100: 48 students did homework AND passed (), 12 did homework but failed, 22 passed without doing homework, and 18 neither did homework nor passed.
Support Tickets — First-Contact Resolution
350 support tickets are classified by type: Technical (T) or Non-technical (Tᶜ), and by whether they were resolved on first contact (S). Counts: T∩S = 90, T∩Sᶜ = 60, Tᶜ∩S = 160, Tᶜ∩Sᶜ = 40. Find P(T∪S), P(S|T), P(S|Tᶜ), and interpret what the difference says about technical tickets.
| Ticket type \ Resolution | Resolved 1st contact (S) | Not resolved (Sᶜ) | Total |
|---|---|---|---|
| Technical (T) | 90 | 60 | 150 |
| Non-technical (Tᶜ) | 160 | 40 | 200 |
| Total | 250 | 100 | 350 |
Row totals: T = 90+60 = 150; Tᶜ = 160+40 = 200. Column totals: S = 90+160 = 250; Sᶜ = 60+40 = 100. Grand total = 350.
P(S|T) = 0.60 < P(S|Tᶜ) = 0.80, so being technical DECREASES the likelihood of first-contact resolution. T and S are not independent.
Counts out of 350: 90 tickets are both Technical and resolved on first contact (), 60 are Technical but not resolved, 160 are Non-technical and resolved, and 40 are Non-technical and not resolved.
Online Course — Videos vs. Quiz Pass
150 users are tracked: W = watched course videos, Q = passed the quiz. Counts: W∩Q = 72, W∩Qᶜ = 18, Wᶜ∩Q = 28, Wᶜ∩Qᶜ = 32. Compute P(Q|W), P(W|Q), P(Q|Wᶜ), and P(W|Qᶜ). Explain why P(Q|W) and P(W|Q) answer different questions.
| Watched videos \ Quiz result | Passed (Q) | Failed (Qᶜ) | Total |
|---|---|---|---|
| Watched (W) | 72 | 18 | 90 |
| Did not watch (Wᶜ) | 28 | 32 | 60 |
| Total | 100 | 50 | 150 |
W total = 72+18 = 90; Wᶜ total = 28+32 = 60. Q total = 72+28 = 100; Qᶜ total = 18+32 = 50. Grand total = 150.
P(Q|W) = 0.80 answers "does watching the videos help?" — 80% of watchers pass vs. ~47% of non-watchers. P(W|Q) = 0.72 describes the composition of passers — 72% of those who passed had watched. These are different conditional probabilities and must not be confused.
Counts out of 150: 72 users both watched videos and passed (), 18 watched but failed, 28 passed without watching, and 32 neither watched nor passed.
Workplace Tool Adoption
200 employees are surveyed on tool usage: A = uses Tool A, B = uses Tool B. P(A) = 130/200, P(B) = 90/200, and 60 use both. Find the counts for each cell, then compute P(A∪B), the probability of using only A, only B, neither, P(A|B), and P(B|A).
| Tool A \ Tool B | Uses B | Does not use B | Total |
|---|---|---|---|
| Uses A | 60 | 70 | 130 |
| Does not use A | 30 | 40 | 70 |
| Total | 90 | 110 | 200 |
A total = 130, B total = 90, A∩B = 60. Only A = 130−60 = 70. Only B = 90−60 = 30. Neither = 200−130−30 = 40.
Since P(A∩B) ≠ P(A)·P(B), the tools are not adopted independently.
Counts out of 200: 70 employees use only Tool A, 60 use both (), 30 use only Tool B, and 40 use neither tool.
Streaming App — Independence Check
200 subscribers: A = has the mobile app installed, M = watches movies regularly. P(A) = 0.60, P(M) = 0.70, A∩M = 84. Build the full table and determine whether A and M are independent.
| App installed \ Watches movies | Watches movies (M) | Does not watch (Mᶜ) | Total |
|---|---|---|---|
| Has app (A) | 84 | 36 | 120 |
| No app (Aᶜ) | 56 | 24 | 80 |
| Total | 140 | 60 | 200 |
A total = 0.60×200 = 120; M total = 0.70×200 = 140; A∩M = 84. A∩Mᶜ = 120−84 = 36. Aᶜ∩M = 140−84 = 56. Aᶜ∩Mᶜ = 200−120−56 = 24.
P(M|A) = P(M|Aᶜ) = P(M) = 0.70. Also verify multiplicatively:
Both conditions confirm independence: knowing whether a subscriber has the app gives no information about whether they watch movies regularly.
Counts out of 200: 84 subscribers both have the app and watch movies (), 36 have the app but do not watch, 56 watch movies without the app, and 24 have neither. Independence means — the circle overlap is exactly proportional.
Delivery Delays — International vs. Domestic
600 parcels: I = international shipment, D = delayed. P(I) = 200/600, P(D) = 60/600, I∩D = 36. Build the table, compute P(D|I), P(D|Iᶜ), test independence, and find P(I|D).
| Shipment type \ Delivery outcome | Delayed (D) | On time (Dᶜ) | Total |
|---|---|---|---|
| International (I) | 36 | 164 | 200 |
| Domestic (Iᶜ) | 24 | 376 | 400 |
| Total | 60 | 540 | 600 |
I total = 200; D total = 60; I∩D = 36. I∩Dᶜ = 200−36 = 164. Iᶜ∩D = 60−36 = 24. Iᶜ∩Dᶜ = 400−24 = 376.
Not independent — international shipments are 3× more likely to be delayed.
Given a parcel is delayed, what is the probability it was international?
Counts out of 600: 164 parcels are International but on time, 36 are International AND Delayed (), 24 are Domestic and Delayed, and 376 are Domestic and on time.
Subscription Tiers — Law of Total Probability & Bayes
400 customers are split into tiers: High (100), Medium (150), Low (150). Renewal counts: High renews 80, Medium 90, Low 30. Use the law of total probability to find P(Renewed), then apply Bayes' theorem to find the tier probabilities given renewal.
| Tier \ Renewal | Renewed | Not renewed | Total |
|---|---|---|---|
| High | 80 | 20 | 100 |
| Medium | 90 | 60 | 150 |
| Low | 30 | 120 | 150 |
| Total | 200 | 200 | 400 |
Each leaf shows the joint probability . The three Renew leaves sum to .
Fraud Detection — Base-Rate Paradox
10 000 transactions: 100 are fraudulent (F), 9 900 are legitimate (Fᶜ). A detection system flags suspicious transactions (S) with P(S|F) = 0.98 and P(S|Fᶜ) = 0.03. Build the table, compute P(S), and find P(F|S) — the probability a flagged transaction is actually fraud.
| Transaction \ Flagged? | Flagged (S) | Not flagged (Sᶜ) | Total |
|---|---|---|---|
| Fraud (F) | 98 | 2 | 100 |
| Legitimate (Fᶜ) | 297 | 9603 | 9900 |
| Total | 395 | 9605 | 10000 |
Fraud: 100 × 0.98 = 98 flagged, 2 not flagged. Legitimate: 9900 × 0.03 = 297 flagged, 9603 not flagged.
Even with a 98% true-positive rate, only about 24.8% of flagged transactions are genuinely fraudulent. The remaining ~75% are false positives from the large pool of legitimate transactions.
— most flagged transactions are false positives from the much larger pool of legitimate transactions.
Per 10 000 transactions: 2 are Fraud but not flagged, 98 are Fraud AND flagged (), 297 are Legit but flagged, and 9 603 are Legit and not flagged.
Order Cancellations by Channel
An e-commerce platform processes orders via three channels: Web (50% of orders, 4% cancel), App (35%, 6% cancel), Phone (15%, 10% cancel). Per 1 000 orders, build the table and find the overall cancellation probability P(C). Then use Bayes to find which channel is most responsible for cancellations.
| Channel \ Order outcome | Cancelled | Completed | Total |
|---|---|---|---|
| Web | 20 | 480 | 500 |
| App | 21 | 329 | 350 |
| Phone | 15 | 135 | 150 |
| Total | 56 | 944 | 1000 |
Web: 500 orders → 500×0.04 = 20 cancelled, 480 completed. App: 350 orders → 350×0.06 = 21 cancelled, 329 completed. Phone: 150 orders → 150×0.10 = 15 cancelled, 135 completed.
The App channel contributes the most cancellations (37.5%) despite Phone having the highest individual cancellation rate (10%), because App handles 35% of volume versus Phone's 15%.
Each leaf is the joint probability . The three Cancel leaves sum to .
Onboarding Tutorial — Comprehensive Analysis
500 users: T = completed the onboarding tutorial, C = completed the product setup. Counts: T∩C = 180, T∩Cᶜ = 70, Tᶜ∩C = 120, Tᶜ∩Cᶜ = 130. Compute all marginals, the union, four conditional probabilities, check independence, and quantify the effect of the tutorial.
| Tutorial \ Setup completion | Completed (C) | Not completed (Cᶜ) | Total |
|---|---|---|---|
| Did tutorial (T) | 180 | 70 | 250 |
| Skipped tutorial (Tᶜ) | 120 | 130 | 250 |
| Total | 300 | 200 | 500 |
T total = 180+70 = 250; Tᶜ total = 120+130 = 250. C total = 180+120 = 300; Cᶜ total = 70+130 = 200. Grand total = 500.
T and C are NOT independent. Tutorial completion raises the setup completion rate from 48% to 72% — a 24 percentage-point lift.
The tutorial is associated with a 24 pp increase in setup completion probability.
Counts out of 500: 70 users did the tutorial but did not complete setup, 180 did both (), 120 completed setup without the tutorial, and 130 did neither.