Example Data Table
| Example |
P(A) |
P(B) |
P(A ∩ B) |
Formula |
P(A|B) |
| Passed exam given completed homework |
0.70 |
0.60 |
0.48 |
0.48 / 0.60 |
0.8000 |
| Buyer returns given coupon used |
0.30 |
0.40 |
0.18 |
0.18 / 0.40 |
0.4500 |
| Rain given cloudy morning |
0.25 |
0.50 |
0.20 |
0.20 / 0.50 |
0.4000 |
Formula Used
Direct conditional probability:
P(A|B) = P(A ∩ B) / P(B)
Bayes theorem:
P(A|B) = [P(B|A) × P(A)] / P(B)
Count method:
P(A|B) = Count(A ∩ B) / Count(B)
Complement method:
P(A|B) = 1 - P(not A|B)
The denominator must not be zero. The overlap cannot be greater than either single event probability.
How to Use This Calculator
- Choose the method that matches your available data.
- Select decimal or percent input scale.
- Enter the event labels for better reports.
- Enter P(B) and P(A ∩ B) for the direct method.
- Use P(B|A), P(A), and P(B) for Bayes theorem.
- Use count fields when you have observed records.
- Press Calculate to show the result below the header.
- Download CSV or PDF for reporting.
Understanding Conditional Probability
Conditional probability helps you measure an event after another event is known. It answers a focused question. How likely is A when B has already happened? This calculator turns that question into a clear number. It also shows the complement, odds, lift, and chart values.
Why P(A|B) Matters
Many decisions depend on filtered evidence. A teacher may ask how likely a student passes, given that homework was completed. A marketer may ask how likely a buyer returns, given that a coupon was used. A medical analyst may compare a positive test with a known risk group. In each case, the condition changes the population. You are not measuring everyone. You are measuring only the cases inside B.
Using Direct and Bayes Inputs
The direct method uses P(A and B) divided by P(B). This works when you already know the overlap between both events. The Bayes method is useful when you know P(B|A), P(A), and P(B). It reverses the condition in a controlled way. Count mode helps when you have raw observations instead of percentages. Complement mode is helpful when the chance of not A inside B is easier to collect.
Reading the Result
A high P(A|B) means A is common within B. A low value means A is rare within B. The lift value compares the conditional probability with the base probability of A. A lift above one suggests B increases the chance of A. A lift below one suggests B lowers it. Conditional odds show the balance between A and not A after B is known.
Best Practice
Always check that probabilities use the same scale. Do not mix percentages and decimals unless the fields request them. Make sure P(B) is greater than zero. Review the overlap carefully, because it cannot exceed either event. Use the chart and export buttons for reporting. Treat the result as a model of the data, not a guarantee. Better input data gives better probability decisions. Keep labels simple. Name event A and event B before entering values. This avoids confusion later. Save the CSV for audits. Save the PDF for summaries. Recalculate after each data update and stakeholder review regularly.
FAQs
1. What does P(A|B) mean?
P(A|B) means the probability of Event A happening when Event B is already known to have happened. It narrows the sample space to cases where B is true.
2. What is the main formula?
The main formula is P(A|B) = P(A ∩ B) / P(B). It divides the shared probability by the probability of the condition event.
3. When should I use Bayes theorem?
Use Bayes theorem when you know P(B|A), P(A), and P(B). It helps reverse the condition and estimate P(A|B).
4. Can P(B) be zero?
No. P(B) is the denominator. If P(B) is zero, the conditional probability is undefined because the condition never occurs.
5. What does lift mean?
Lift compares P(A|B) with P(A). A value above one means B raises the chance of A. A value below one means B lowers it.
6. Can I use percentages?
Yes. Select the percent scale and enter values like 25 instead of 0.25. Keep all probability fields on the same scale.
7. What is the count method?
The count method uses observed records. Divide the number of cases inside both A and B by the number of cases inside B.
8. Why is my result above one?
A result above one means the inputs are inconsistent. Check the overlap, base rates, and denominator. Probabilities must stay between zero and one.