Understanding Conditional Probability
Definition:
P(A|B) = P(A ∩ B) / P(B)
Bayes' theorem form (used by this calculator):
P(A|B) = P(B|A)·P(A) / [ P(B|A)·P(A) + P(B|¬A)·(1 − P(A)) ]
The probability of A given that B has occurred, for P(B) > 0
Conditional probability answers the question: given that event B has happened, how likely is event A? It is defined as the joint probability of both events, P(A ∩ B), divided by the probability of the conditioning event, P(B). This is only defined when P(B) is greater than zero — you cannot condition on something that never occurs.
In many real problems you do not directly know the joint probability P(A ∩ B) or the marginal P(B). Instead you know three quantities: the prior P(A) (how common A is before you see any evidence), the sensitivity P(B|A) (how often the evidence B shows up when A is true), and the false-positive rate P(B|¬A) (how often B shows up when A is false). Bayes' theorem stitches these together. The denominator is the law of total probability: P(B) = P(B|A)·P(A) + P(B|¬A)·(1 − P(A)), splitting every occurrence of B into the "A was true" branch and the "A was false" branch. This calculator implements exactly that expression.
How the calculator works
Enter each value as a decimal between 0 and 1. With the default medical-screening example — prior P(A) = 0.01, sensitivity P(B|A) = 0.99, false-positive rate P(B|¬A) = 0.05 — the joint probability is 0.99 × 0.01 = 0.0099, the total probability of a positive is 0.0099 + 0.05 × 0.99 = 0.0594, and the posterior is 0.0099 / 0.0594 ≈ 0.1667, or about 16.7%. A "99% accurate" test on a 1-in-100 condition still leaves you more likely to be healthy than sick after a positive result.
Related probability rules
- Multiplication rule: P(A ∩ B) = P(A) × P(B|A). Rearranging this definition is where the P(A ∩ B) / P(B) formula comes from.
- Law of total probability: P(B) = P(B|A)·P(A) + P(B|¬A)·P(¬A). This is the denominator in Bayes' theorem.
- Complement: P(¬A|B) = 1 − P(A|B). The calculator reports this as the fourth output.
- Independence: if A and B are independent, P(A|B) = P(A) — knowing B tells you nothing about A. You can check this by setting sensitivity equal to the false-positive rate; the posterior then collapses back to the prior.
Common intuition traps
- Base-rate neglect: people fixate on the test's accuracy and ignore how rare A is. When the prior is tiny, even an excellent test produces mostly false positives, so P(A|B) stays low.
- Confusing P(A|B) with P(B|A): "the probability of a positive test given the disease" (sensitivity) is not "the probability of the disease given a positive test" (the posterior). Swapping these is the prosecutor's fallacy.
- Assuming symmetry: P(A|B) and P(B|A) are only equal when P(A) = P(B). In general they can differ enormously.
Frequently Asked Questions
What is the formula for conditional probability?
Why is P(A|B) so low even when the test is 99% accurate?
What is the difference between P(A|B) and P(B|A)?
Can conditional probability be greater than the prior?
Common Tip Percentages
| Service | Typical Tip Range | Notes |
|---|---|---|
| Restaurant (sit-down) | 15–20% | 20%+ for exceptional service |
| Food delivery | 10–20% | Consider extra for long distances |
| Taxi / rideshare | 10–20% | More for assistance with luggage |
| Hotel housekeeping | $2–5/night | Leave daily, not just at checkout |
| Barber / hair salon | 15–20% | On pre-discount total |
| Pizza delivery | 10–15% or $3–5 minimum | Higher in bad weather |
General Household Budget Ratios (50/30/20 Rule)
| Category | % of Net Income | Examples |
|---|---|---|
| Needs | 50% | Rent, groceries, utilities, insurance |
| Wants | 30% | Dining out, entertainment, hobbies |
| Savings / Debt | 20% | Emergency fund, retirement, extra payments |
Common Measurement Conversions for Everyday Use
| Quantity | US / Imperial | Metric Equivalent |
|---|---|---|
| 1 cup | 8 fl oz | 237 mL |
| 1 pint | 16 fl oz | 473 mL |
| 1 quart | 32 fl oz | 946 mL |
| 1 gallon | 128 fl oz | 3.785 L |
| 1 lb | 16 oz | 453.6 g |
| 1 ft | 12 in | 30.48 cm |