Conditional Probability Calculator
Works out P(A|B) by dividing the joint probability P(A∩B) by P(B), the rule behind Bayes theorem and behind any update made after new evidence arrives.
P(A|B)
—
Conditional probability
Conditional probability tells you how likely event A is once you already know B happened: P(A|B) = P(A∩B) / P(B), which only makes sense when P(B) > 0. When P(A|B) = P(A), the two events are independent and learning about B tells you nothing new about A. Watch out for the inverse conditional fallacy, the habit of treating P(A|B) and P(B|A) as if they were interchangeable. Forensics has a famous version of this: "probability of innocence given a DNA match" is not the same thing as "probability of a match given innocence". To see it concretely, take a deck of 52 cards. P(king|face card) = P(king ∩ face) / P(face) = (4/52)/(12/52) = 1/3.
Applications
It turns up everywhere you reason from partial information. Medicine reads it as the sensitivity and specificity of a diagnostic test. Bayes' theorem uses it to update priors. Machine learning relies on it for Naive Bayes classifiers and for conditional independence in graphical models. Forensics needs it to interpret DNA matches without falling into the prosecutor's fallacy, and insurers use it to price risk. Weather forecasting leans on it too.
FAQ
Why is P(A|B) different from P(B|A)? The denominators differ, P(B) for one and P(A) for the other, so the two only line up when P(A) = P(B). Mixing them up is exactly what the prosecutor's fallacy does.
What if P(B) = 0? Then the conditional probability has no value at all. There is nothing to condition on if B never happens.
How does it relate to independence? A and B are independent precisely when P(A|B) = P(A), which is the same as saying P(A∩B) = P(A)·P(B).
Related Tools
Poisson Distribution
Compute P(X = k) and P(X ≤ k) in Poisson(λ).
Poisson Probability Calculator
Computes probability of k occurrences in a Poisson distribution with mean lambda using the classic exponential factorial formula.
Dice Sum Probability Calculator
Enter how many six-sided dice and a target total to get P(sum = s) by convolution, plus the raw count over 6^n. Two dice landing on 7 give 6/36.
Probability of a Run of Heads
Work out the chance of getting at least k heads in a row in n coin tosses, counted exactly by dynamic programming rather than simulated.
Probable Stops
Calculate the probable number of stops of an elevator, S = N × (1 − (1 − 1/N)^P), from the number of served floors N and the number of passengers P in the car. The result is how many floors, on average, the elevator actually stops at during a trip (probabilistically, two passengers may go to the same floor). It is an essential parameter of the round trip time calculation: more stops raise the RTT. The formula assumes passengers choose destination floors randomly and uniformly. With a full car, S approaches N (stops at almost all). Enter the number of floors and passengers.
Exact Binomial Test
Computes the exact binomial test, which checks whether the observed proportion of successes is compatible with a hypothesized probability, without resorting to the normal approximation. For small samples, where the z-test fails, this is the correct test: it sums the exact probabilities, given by the binomial distribution, of all outcomes as likely or less likely than the observed one. For example: are 8 heads in 10 tosses compatible with a fair coin? Enter the successes, the total and the hypothesized probability.
The results provided by this tool are for general informational and educational purposes only and do not constitute professional, financial, medical, legal, tax or accounting advice. Always confirm important decisions with a qualified professional and official sources.