Compound Probability Calculator (AND / OR)

Compute P(A and B), P(A or B), and P(A|B) for two events, whether they are independent or dependent.

Inputs

Probability of event A (0 to 1).

Probability of event B (0 to 1).

Independent events: P(A∩B) = P(A)·P(B). Otherwise enter the joint probability.

Joint probability, used only in dependent mode.

Result

P(A and B)
0.20000
P(A or B) 0.70000 · P(A|B) 0.50000
  • P(A)0.5
  • P(B)0.4
  • P(A and B) — intersection0.200000
  • P(A or B) — union0.700000
  • P(A | B)0.500000
  • P(B | A)0.400000
  • Independent?yes (assumed)
Note — For independent events, knowing B tells you nothing about A, so P(A|B)=P(A). For dependent events you must supply the joint probability P(A∩B), which cannot exceed the smaller of P(A) and P(B).

Step-by-step

  1. Independent → P(A∩B) = P(A)·P(B) = 0.5 × 0.4 = 0.200000.
  2. P(A∪B) = P(A) + P(B) − P(A∩B) = 0.5 + 0.4 − 0.200000 = 0.700000.
  3. P(A|B) = P(A∩B) ÷ P(B) = 0.200000 ÷ 0.4 = 0.500000.

How to use this calculator

  • Enter the individual probabilities P(A) and P(B), each between 0 and 1.
  • Choose whether the events are independent or dependent.
  • For dependent events, enter the joint probability P(A and B).
  • Read P(A and B), P(A or B), and the conditional probabilities.

About this calculator

Compound probability deals with how two events combine. The "AND" probability, P(A and B), is the chance both happen; for independent events — where one has no effect on the other, like two separate coin flips — it is simply the product P(A)·P(B). The "OR" probability, P(A or B), is the chance at least one happens, found by adding the individual probabilities and subtracting the overlap so it is not double-counted: P(A) + P(B) − P(A and B). The conditional probability P(A|B) is the chance of A given that B has occurred, equal to the joint probability divided by P(B). This calculator handles both independent events (where it computes the joint probability for you) and dependent events (where you supply the joint probability), and reports all the combinations along with a check of whether the events are actually independent.

How it works — the formula

Independent: P(A∩B) = P(A)·P(B) P(A∪B) = P(A) + P(B) − P(A∩B) P(A|B) = P(A∩B) ÷ P(B)

The union adds the two probabilities and removes the double-counted overlap; the conditional renormalizes the joint probability by the probability of the conditioning event.

Worked examples

Example 1
Independent: P(A)=0.5, P(B)=0.4
Inputs:
pa=0.5, pb=0.4, mode=independent
Output:
AND 0.2, OR 0.7, P(A|B) 0.5
Example 2
Two coin heads
Inputs:
pa=0.5, pb=0.5, mode=independent
Output:
AND 0.25, OR 0.75
Example 3
Dependent: P(A)=0.5, P(B)=0.4, P(A∩B)=0.3
Inputs:
pa=0.5, pb=0.4, mode=dependent, pand=0.3
Output:
OR 0.6, P(A|B) 0.75

Limitations

  • Dependent mode requires a valid joint probability you supply.
  • Assumes well-defined probabilities in [0, 1].
  • Does not handle more than two events at once.

Results follow from the probability axioms given consistent inputs.

Frequently asked

For independent events, multiply: P(A and B) = P(A) × P(B). For dependent events, P(A and B) = P(A) × P(B|A), so you need the conditional or the joint probability directly.

Related calculators

More tools you might like