Enter the probability of each. You get both happening, either happening, exactly one, neither, and P(A given B).
With P(A) = 0.5 and P(B) = 0.4, this page reports six figures at once, not just AND and OR: P(not A) = 0.5, P(A and B) = 0.2, P(A or B) = 0.7, P(neither) = 0.3, and P(A given B) = 0.5. Every one of them falls out of the same two starting numbers under independence — nothing else is assumed.
P(neither) is (1 − 0.5) × (1 − 0.4) = 0.3 — both events failing to happen, the direct complement of "at least one." P(A XOR B), exactly one of the two but not both, is P(A) + P(B) − 2×P(A and B) = 0.5 + 0.4 − 0.4 = 0.5 here — the ordinary OR figure with the overlap subtracted twice instead of once, since XOR excludes the overlap entirely rather than counting it once. Add AND, XOR, and neither together — 0.2 + 0.5 + 0.3 — and the total is exactly 1: every outcome falls into exactly one of "both," "exactly one," or "neither," with nothing left over and nothing double-counted.
Probability answers "how likely," while a closely related question is "how many ways" — dealing a hand, arranging a lineup, choosing a committee. The Permutation and Combination Calculator handles that counting side directly, and the two combine naturally: many classic probability problems are really a favorable-outcomes count divided by a total-outcomes count from exactly that kind of calculation. For summarizing real, messy data rather than clean theoretical probabilities, see the Statistics Calculator. Every figure here is also just a percentage wearing a 0-to-1 disguise — the Percentage Calculator works in the more familiar 0-to-100 notation for the identical arithmetic.
This calculator treats A and B as independent — one happening tells you nothing about the other. Coin flips and dice rolls qualify. A great many real situations do not.
Rain today and rain tomorrow are not independent. Two loans defaulting in the same recession are not independent. Underestimating exactly this correlation is a large part of what made the 2008 mortgage crisis worse than the models predicted: individually unlikely defaults were treated as unrelated when they shared a common cause.
If your events are dependent, P(A and B) is P(A) × P(B given A), and you need the conditional probability rather than the raw one.
With P(A) = 0.5 and P(B) = 0.4, adding gives 0.9. But that counts the 0.2 where both occur twice — once inside A, once inside B. Subtracting the overlap gives the correct 0.7.
The trap sharpens with larger probabilities: two events at 0.7 each would sum to 1.4, which is impossible. Any probability above 1 means the overlap was not removed.
That one event happening does not change the odds of the other. Coin flips are independent; weather on consecutive days is not. The formulas here assume independence, and give wrong answers if the events are actually linked.
Because outcomes where both happen sit inside A and inside B, so adding the two probabilities counts them twice. Subtracting the overlap once corrects it. Without the subtraction you can get a probability above 1, which is impossible.
Take 1 minus the probability of none. For two events that is 1 − (1−P(A))(1−P(B)). It is almost always easier than adding up every way at least one could happen, and the advantage grows with more events.
The probability of A given that B has already happened: P(A and B) ÷ P(B). For independent events it simply equals P(A), since B tells you nothing. When it differs from P(A), the events are dependent by definition.
For counting the arrangements behind a probability, use the Permutation and Combination Calculator. Descriptive statistics on a dataset are handled by the Statistics Calculator and Standard Deviation Calculator, and for sampling see the Sample Size Calculator.