Conditional Probability Calculator
Find the probability of one event given that another has occurred, using P(A|B) = P(A ∩ B) / P(B), with a labeled Venn diagram and step-by-step solution.
Enter each probability as a decimal between 0 and 1 (e.g. 0.5 for 50%). The calculator finds P(A|B) — the probability of A given that B has occurred.
Venn Diagram
Conditioning on B shrinks the sample space down to the red circle — P(A|B) is the share of that circle covered by the purple overlap.
P(A|B) = P(A ∩ B) / P(B) = 0.2 / 0.5 = 0.4
Step-by-Step Solution
Here's exactly how this answer was calculated, one step at a time.
- 1
Write down the given probabilities
P(A) = 0.4, P(B) = 0.5, P(A ∩ B) = 0.2
P(A ∩ B) is the probability that both A and B happen together.
- 2
Apply the conditional probability formula
P(A | B) = P(A ∩ B) / P(B)
Conditioning on B means we shrink the sample space down to just the outcomes where B happens.
- 3
Substitute the known values
P(A | B) = 0.2 / 0.5 = 0.4
This means there is a 40% chance of A occurring, given that B has already occurred.
- 4
(Bonus) Find the reverse conditional, P(B | A)
P(B | A) = P(A ∩ B) / P(A) = 0.2 / 0.4 = 0.5
P(A|B) and P(B|A) are usually different values — conditioning is not symmetric.
- 5
Check whether A and B are independent
P(A) × P(B) = 0.4 × 0.5 = 0.2 vs. P(A ∩ B) = 0.2
These are equal, so A and B are independent — knowing B occurred doesn't change the probability of A.
✓ Final Answer: P(A|B) = 0.4 (40%)
Free Online Conditional Probability Calculator
This conditional probability calculator finds the probability of one event occurring given that another event has already happened, using the formula P(A|B) = P(A ∩ B) / P(B). Enter the probability of each event and the probability that both occur together, and the calculator instantly returns P(A|B), the reverse conditional P(B|A), and whether the two events are independent — complete with a labeled Venn diagram and a full step-by-step solution.
Whether you're a student solving conditional probability problems for a statistics or probability course, a teacher preparing worked examples, or a data analyst reasoning about dependent events, this P(A given B) calculator handles the entire calculation instantly and shows exactly how the answer was derived.
The Conditional Probability Formula
Conditional probability measures how likely an event is once we already know that another event has occurred. The core formula is:
- P(A | B) = P(A ∩ B) / P(B) — the probability of A, given that B has occurred
- P(B | A) = P(A ∩ B) / P(A) — the reverse conditional, the probability of B given A
- P(A ∩ B) is the joint (intersection) probability — the chance both A and B happen together
- Independence check: if P(A ∩ B) = P(A) × P(B), then A and B are independent events
How to Use This Conditional Probability Calculator
Using the calculator takes just three steps. First, enter P(A), the probability of event A. Second, enter P(B), the probability of event B. Third, enter P(A ∩ B), the probability that both events happen together. The calculator instantly displays P(A|B), P(B|A), and tells you whether A and B are independent, along with a Venn diagram showing the relationship between the two events.
In the diagram, circle B is drawn with a bolder outline to represent the idea behind conditioning: once you know B has occurred, your entire 'world' shrinks down to just the red circle. P(A|B) then asks what fraction of that reduced world (circle B) is also covered by event A — which is exactly the purple overlap region divided by the full red circle.
Worked Example
Suppose in a deck-drawing experiment, P(A) = 0.4 (the probability of drawing a face card), P(B) = 0.5 (the probability of drawing a red card), and P(A ∩ B) = 0.2 (the probability of drawing a card that's both a red face card). Then P(A|B) = P(A ∩ B) / P(B) = 0.2 / 0.5 = 0.4, meaning that among all red cards, 40% are face cards.
Checking for independence: P(A) × P(B) = 0.4 × 0.5 = 0.2, which exactly matches P(A ∩ B) = 0.2 — so in this example, drawing a face card and drawing a red card are independent events, since knowing the card is red doesn't change the chance it's also a face card.
Conditional Probability vs. Independence
Two events are called independent when the occurrence of one has no effect on the probability of the other — mathematically, P(A|B) = P(A), which happens exactly when P(A ∩ B) = P(A) × P(B). When events are dependent, P(A|B) will differ from the plain, unconditional P(A), sometimes dramatically. This calculator automatically checks and reports whether your two events are independent based on the values you enter.
Conditional Probability and Bayes' Theorem
Conditional probability is the foundation that Bayes' theorem is built on. While this calculator finds P(A|B) directly from P(A ∩ B) and P(B), Bayes' theorem lets you find P(A|B) using P(B|A), P(A), and P(B) instead — useful when the joint probability isn't given directly but the reverse conditional is. If your problem gives you P(B|A) rather than P(A ∩ B), our Bayes' Theorem Calculator is the better tool for the job.
Where Conditional Probability Is Used
Conditional probability is one of the most widely applied concepts in probability and statistics, showing up constantly across many fields:
- Students and teachers use it throughout probability, statistics, and discrete math coursework.
- Medical diagnostics use conditional probability to interpret test results — e.g. the chance of having a disease given a positive test result.
- Machine learning and data science use conditional probability extensively, especially in classification algorithms like Naive Bayes.
- Insurance and risk analysis use conditional probability to price policies based on known risk factors.
- Marketing and A/B testing use it to understand how one behavior (like clicking an ad) relates to another (like making a purchase).
Frequently Asked Questions
What is the formula for conditional probability?
Conditional probability is calculated as P(A|B) = P(A ∩ B) / P(B), where P(A ∩ B) is the probability that both events A and B occur, and P(B) is the probability of event B.
What does P(A|B) actually mean?
P(A|B) reads as 'the probability of A given B' — it's the likelihood that event A occurs, assuming we already know that event B has occurred.
Is P(A|B) the same as P(B|A)?
No, they're generally different. P(A|B) = P(A ∩ B) / P(B), while P(B|A) = P(A ∩ B) / P(A). Confusing the two is a very common mistake — always check which event is the 'given' condition.
How do I know if two events are independent?
Two events A and B are independent if P(A ∩ B) = P(A) × P(B), which is equivalent to saying P(A|B) = P(A) — knowing B occurred doesn't change the probability of A.
What's the difference between conditional probability and Bayes' theorem?
Conditional probability, P(A|B) = P(A ∩ B) / P(B), is the basic definition. Bayes' theorem rearranges this to let you calculate P(A|B) from P(B|A), P(A), and P(B) instead, which is useful when the joint probability isn't directly known.