Loading…

Conditional Probability Calculator

Math Probability • Conditional Probability and Events

View all topics

Conditional Probability Calculator – P(A|B) from Joint & Marginal (Free)

Compute conditional probability using \(P(A\mid B)=\dfrac{P(A\cap B)}{P(B)}\). Optionally compare with \(P(A)\) to get an independence/dependence hint.

Tip: Press Play after calculating to animate shading: first \(B\), then the overlap \(A\cap B\), and finally the ratio \(P(A\mid B)\).

Inputs
If \(P(A\mid B)\neq P(A)\), then \(A\) and \(B\) are not independent (given these inputs).

Accepted expressions: 1e-3, pi, e, sqrt(2), sin(), cos(), tan(), ln(), log(), abs(). Use * for multiplication.

Output settings
Use tolerance to avoid false “not equal” due to rounding.
Visualization
Drag on the diagram to pan. Use mouse wheel / trackpad to zoom. The “given \(B\)” view focuses on the \(B\) region and highlights the overlap.
Ready
Interactive “given B” diagram

The conditional probability \(P(A\mid B)\) is the fraction of the \(B\) region that lies inside \(A\).

Rate this calculator

0.0 /5 (0 ratings)
Be the first to rate.
Your rating
You can update your rating any time.

Frequently Asked Questions

What does P(A|B) mean?

It is the probability of event A assuming event B has occurred; it measures A within the restricted sample space B.

Why must P(B)>0?

Because the formula P(A|B)=P(A∩B)/P(B) divides by P(B). If P(B)=0, conditioning on B is not defined by this ratio.

How can I tell if A and B are independent?

If P(A|B)=P(A) (within a tolerance), that is consistent with independence. Otherwise, the events are dependent given the provided values.

What if my inputs are inconsistent?

The calculator may warn you if P(A∩B) exceeds P(B) or P(A), or if the computed P(A|B) falls outside [0,1], indicating the numbers cannot represent a valid model.