Statistics & Probability Probability Fundamentals Kolmogorov probability axioms and the addition rule

Probability Calculator for One and Two Events

Give this calculator the probabilities of two events and how they relate, and it returns every derived probability at once: the complements, the intersection, the union, the chance that neither happens, the chance that exactly one happens, and both conditional probabilities. You can assume the events are independent, assume they cannot both occur, or supply the joint probability yourself when you know it. A two-by-two table shows the whole sample space split into its four pieces.

Calculator

This calculator runs in your browser. Enable JavaScript for live results — the inputs, formula and worked example below remain fully readable without it.

Inputs this calculator takes, with typical values
InputWhat to enterExample
P(A)Probability of event A as a decimal between 0 and 1, so 40% is entered as 0.4.0.5
P(B)Probability of event B as a decimal between 0 and 1.0.4
How the events relateIndependence is an assumption about the world, not a property you can read off P(A) and P(B).Independent - one does not affect the other
P(A and B)The probability that both events occur together; used only when you select the third option above.0.2

It returns

  • P(A or B) — The union: at least one of the two events occurs.
  • P(A and B)
  • P(not A)
  • P(neither A nor B)
  • P(exactly one of them)
  • P(A | B)
  • P(B | A)

The formula

P(AB)=P(A)+P(B)P(AB)
P(exactly one)=P(AB)P(AB)

In plain text: P(A or B) = P(A) + P(B) - P(A and B); P(A and B) = P(A) P(B) if independent; P(A|B) = P(A and B) / P(B)

  • P(A)Probability that event A occurs (probability)
  • P(B)Probability that event B occurs (probability)
  • P(A and B)Joint probability that both occur (probability)
  • P(A or B)Probability that at least one occurs (probability)

The addition rule subtracts the intersection because the two events' probabilities each already include the overlap, so adding them counts it twice.

Updated Category Probability Fundamentals Verified against published test cases Reading time 9 min

The four regions of a two-event problem

Any question about two events resolves into four mutually exclusive outcomes: both happen, only A happens, only B happens, or neither happens. Those four probabilities add to exactly 1, and every other quantity you might want is a sum of some of them.

P(A or B) is the first three added together. P(exactly one) is the middle two. P(neither) is the fourth. The complement of A is the last two. Once you know the four cells, nothing else requires thought - which is why the table on this page shows them, and why drawing a two-by-two grid is the fastest way to untangle a probability word problem.

What you cannot get from P(A) and P(B) alone is how big the overlap is. Two events each with probability 0.5 might never co-occur, might always co-occur when one does, or anything between. That missing information is exactly what the relation setting supplies, and it is a statement about the world rather than about arithmetic.

The addition rule, the product rule, and the bounds on the overlap

The addition rule is P(A or B) = P(A) + P(B) - P(A and B). The subtraction is there because P(A) already contains the region where both occur, and so does P(B); adding them counts that region twice, so it must come off once.

The product rule gives the overlap when the events are independent: P(A and B) = P(A) x P(B). Independence means that learning A occurred does not change the probability of B, which is the same thing as saying P(B | A) = P(B). It is an assumption about mechanism - separate coin flips, separate machines, unrelated customers - and it cannot be verified from P(A) and P(B).

Mutual exclusivity is a different statement entirely: the events cannot both occur, so P(A and B) = 0 and the addition rule collapses to a plain sum. These two ideas are constantly confused, and they are close to opposites. Mutually exclusive events with non-zero probabilities are strongly dependent, because knowing one occurred tells you the other did not.

When you supply the joint probability yourself, it must respect two bounds, called the Frechet bounds. It cannot exceed the smaller of P(A) and P(B), because the overlap sits inside both events. And it cannot be less than P(A) + P(B) - 1, because two events covering more than the whole sample space between them must intersect. With P(A) = 0.8 and P(B) = 0.7 the overlap is at least 0.5, so those two events cannot possibly be mutually exclusive. The calculator flags a value outside either bound and uses the nearest feasible one.

Conditional probability is defined as P(A | B) = P(A and B) / P(B), which is just the overlap re-expressed as a fraction of B rather than of the whole space. Rearranged, it gives the general multiplication rule P(A and B) = P(B) x P(A | B), and combined with its mirror image it produces Bayes' theorem.

Worked example: two independent events, then the same numbers with an overlap

A machine has a 50% chance of needing maintenance this month (event A) and the supplier has a 40% chance of a delivery delay (event B). Assume the two are unrelated.

  1. Intersection. Independence gives P(A and B) = 0.5 x 0.4 = 0.20.
  2. Union. P(A or B) = 0.5 + 0.4 - 0.2 = 0.70. There is a 70% chance of at least one problem.
  3. Neither. 1 - 0.70 = 0.30. Equivalently 0.5 x 0.6 = 0.30, which is the product of the two complements - a useful cross-check under independence.
  4. Exactly one. 0.70 - 0.20 = 0.50.
  5. Conditionals. P(A | B) = 0.20 / 0.40 = 0.50, unchanged from P(A) - which is what independence means.

Now suppose the two are not independent after all: both are driven by a shared cause, and the true joint probability is 0.35 rather than 0.20. Enter it directly.

  1. Union. 0.5 + 0.4 - 0.35 = 0.55, noticeably lower than before.
  2. Neither. 1 - 0.55 = 0.45.
  3. Exactly one. 0.55 - 0.35 = 0.20.
  4. Conditional. P(A | B) = 0.35 / 0.40 = 0.875, far above P(A) = 0.5.

The positive association makes the union smaller and the intersection larger. This is the direction people usually get wrong when they assume independence out of convenience: correlated failures cluster, so the chance of at least one problem falls while the chance of a simultaneous double problem rises sharply. If the two events are failures of redundant components, the independence assumption puts the chance of a simultaneous double problem at 0.20 where the truth is 0.35, understating it by 0.15 - that is 43% of the true value.

Reading the outputs, and checking they are consistent

Every output has an arithmetic check attached, and using them will catch most input errors.

The four cells of the table add to 1. P(A or B) plus P(neither) is 1. P(exactly one) plus P(A and B) is P(A or B). P(A | B) times P(B) returns P(A and B). If any of these fails, an input is wrong.

Compare the joint probability with the product P(A) x P(B) to judge the association. If the joint is larger, the events are positively associated - one occurring makes the other more likely than its unconditional probability. If it is smaller, they are negatively associated. If they are equal, the events are independent, whatever relation you selected. The calculator states which of these three holds rather than assuming a direction, because all three occur routinely.

The union has hard bounds worth knowing. It can never exceed 1, and it can never be smaller than the larger of P(A) and P(B), since A alone already guarantees the union. If a hand calculation gives a union above 1, you have almost certainly added two probabilities that share an overlap without subtracting it - the most common mistake in this whole area.

Finally, note that a conditional probability is undefined when its conditioning event has probability zero. P(A | B) divides by P(B), and if B never happens the question "given that B occurred" has no content. The calculator returns a dash rather than inventing a value.

The same two events under different relations

P(A) = 0.5 and P(B) = 0.4 throughout. Only the assumed relationship changes. Every row was produced by running this calculator's formulas at that joint probability.
RelationP(A and B)P(A or B)P(neither)P(exactly one)P(A | B)
Mutually exclusive0.000.900.100.900.000
Negatively associated0.100.800.200.700.250
Independent0.200.700.300.500.500
Positively associated0.300.600.400.300.750
Maximum overlap0.400.500.500.101.000

The joint probability can range from 0 to 0.40 here, since the Frechet bounds are max(0, 0.5 + 0.4 - 1) = 0 and min(0.5, 0.4) = 0.4. As the overlap grows the union shrinks by exactly the same amount.

The errors that recur

  • Treating mutually exclusive and independent as the same thing. They are close to opposites. Mutually exclusive means the overlap is zero; independent means the overlap is the product. Two events with non-zero probabilities cannot be both.
  • Adding probabilities without subtracting the overlap. P(A) + P(B) counts the intersection twice. If the sum exceeds 1, this is almost always the reason.
  • Assuming independence because it is convenient. Component failures, insurance claims, loan defaults and network outages are typically positively associated through a common cause. Assuming independence understates the probability that several occur together.
  • Reversing a conditional. P(A | B) and P(B | A) are different numbers unless P(A) = P(B). Converting between them requires Bayes' theorem, not a swap of the letters.
  • Supplying a joint probability outside the Frechet bounds. An overlap larger than either event, or smaller than P(A) + P(B) - 1, describes no possible situation. The calculator clamps to the nearest feasible value and says so.
  • Confusing P(exactly one) with P(at least one). The first excludes the case where both occur; the second includes it. They differ by exactly the joint probability.

Beyond two events

The addition rule extends to three or more events through inclusion-exclusion: add the individual probabilities, subtract every pairwise intersection, add back every triple intersection, and so on. The number of terms doubles with each extra event, so for anything past three it is usually easier to compute P(none of them) and subtract from 1 - which under independence is just the product of the complements.

When the same experiment is repeated many times with a fixed success probability, you do not need this page at all: the binomial distribution calculator handles "exactly k successes in n trials" and its cumulative forms directly. When outcomes are equally likely and you need to count the ways an event can happen, the underlying counts come from combinations and permutations.

To update a probability in the light of evidence rather than combine two of them, use the Bayes' theorem calculator, which is built from the conditional probability definition on this page. For a continuous quantity rather than discrete events, probabilities come from areas under a density curve - see the normal distribution calculator.

One habit is worth carrying away from this page. Whenever a two-event question confuses you, draw the two-by-two table, fill in the intersection first, and derive everything else from the four cells. Almost every classic probability paradox dissolves once the four regions are written down explicitly, because the confusion nearly always comes from a conditional being read as an unconditional.

Frequently asked questions

What is the difference between mutually exclusive and independent?

Mutually exclusive means the two events cannot both happen, so P(A and B) = 0. Independent means knowing one occurred does not change the probability of the other, so P(A and B) = P(A) x P(B). Events with non-zero probabilities cannot be both, because exclusivity implies that A occurring guarantees B did not - which is the strongest possible dependence.

Why does the addition rule subtract P(A and B)?

Because P(A) and P(B) each already include the region where both occur, so adding them counts that region twice. Subtracting the intersection once restores it to a single count. When the events are mutually exclusive there is no overlap, and the rule reduces to a simple sum.

How do I know whether two events are independent?

Not from P(A) and P(B) - independence is a statement about mechanism, or something you verify from data by checking whether P(A and B) equals P(A) x P(B). Separate physical processes with no shared cause are usually a safe assumption; anything driven by weather, an economic cycle, a shared supplier or a common component usually is not.

Can P(A and B) be larger than P(A)?

No. The event "both occur" is contained inside the event "A occurs", so its probability can never exceed P(A) or P(B). That is the upper Frechet bound. If a calculation produces a larger value, the joint probability has been misread, often by confusing it with a conditional.

What is P(at least one) and how does it differ from P(exactly one)?

P(at least one) is the union: it includes the case where both occur. P(exactly one) excludes that case, so it is the union minus the intersection. With P(A) = 0.5, P(B) = 0.4 and independence, at least one is 0.70 while exactly one is 0.50 - a difference of exactly the 0.20 joint probability.

How do I enter percentages?

Convert to decimals first: 40% is 0.4 and 7.5% is 0.075. Probabilities in this calculator run from 0 to 1, which is the convention in probability theory and keeps the multiplication rule readable - multiplying two percentages directly gives an answer a hundred times too large.

What happens if P(B) is zero?

P(A | B) becomes undefined, because it divides by P(B) and conditioning on an impossible event has no meaning. The calculator shows a dash rather than a number. Every unconditional output is still perfectly well defined.

Can I use this for more than two events?

Not directly, but you can chain it. Treat "A or B" as a single event, compute its probability here, then combine that with C. For independent events the shortcut is usually easier: the probability that none of them occurs is the product of the complements, and one minus that is the probability that at least one does.

References

  • Foundations of the Theory of Probability, 2nd English ed. — Chelsea Publishing (A. N. Kolmogorov, 1956)
  • An Introduction to Probability Theory and Its Applications, Vol. 1, 3rd ed. — Wiley (William Feller)
  • Introduction to Probability, 2nd revised ed. — American Mathematical Society (Grinstead & Snell)