The chance that at least one happens

The union of two events is the set of outcomes in which A happens, B happens or both happen. The question comes up constantly: what is the chance a card is a heart or a face card, that a customer buys product A or B, or that at least one of two machines is down? This page takes the probability of A, the probability of B and the probability of both and returns the probability of the union. It does not assume independence. The overlap is supplied explicitly, which makes the page suitable for events that are related in any way.

Inclusion-exclusion

The formula is P(A or B) = P(A) + P(B) − P(A and B). Adding P(A) and P(B) counts every outcome in both events twice, once in each, so one copy of the overlap is subtracted. When the events cannot occur together, the overlap is 0 and the formula reduces to simple addition. When one event is contained in the other, the overlap equals the smaller probability and the union equals the larger. The overlap cannot exceed either P(A) or P(B), and the union cannot exceed 1. Inputs that violate these bounds are inconsistent.

Union of 0.3 and 0.4 with 0.1 overlap

The page starts with P(A) = 0.3, P(B) = 0.4 and P(both) = 0.1. The union is 0.3 + 0.4 − 0.1 = 0.6. Without the subtraction, the sum would be 0.7, which overstates the chance by the overlap. In a population of 100, 30 have A, 40 have B and 10 have both, so 20 have only A, 30 have only B and 10 have both, for 60 in total. Drawing a Venn diagram with these counts is the quickest way to see why subtraction is needed, and why the answer is smaller than the plain sum.

Cards

For a card drawn from a standard deck, let A be a heart, with probability 13/52 = 0.25, and B be a face card, with probability 12/52, about 0.2308. The overlap is the three face cards of hearts, 3/52, about 0.0577. The union is 0.25 + 0.2308 − 0.0577 = 0.4231, which is 22 of 52 cards. Entering 0.25, 0.2308 and 0.0577 returns 0.4231. The same method gives the chance of a king or a heart: 4/52 + 13/52 − 1/52 = 16/52, about 0.3077.

Independent and exclusive cases

For independent events, the overlap is the product P(A) × P(B). Two independent events with probabilities 0.5 each have an overlap of 0.25 and a union of 0.75. For mutually exclusive events, such as rolling a 1 or a 2 on a die, enter 0 for the overlap, giving 1/6 + 1/6 = 1/3. Two events with probabilities 0.6 and 0.5 and an overlap of 0.2 give a union of 0.9. Always determine the overlap from the structure of the problem, not by guessing independence. If the overlap is unknown, the union lies between max(P(A), P(B)) and min(1, P(A) + P(B)).

Reliability and risk examples

Suppose a router fails in 0.03 of months and a modem in 0.02, and both fail together in 0.005 of months, these figures being illustrative. The chance that at least one fails is 0.03 + 0.02 − 0.005 = 0.045. If failures were independent, the overlap would be 0.0006 and the union 0.0494, so the real data show the failures clustered, perhaps because of a shared power supply. Comparing the observed overlap with the product of the two probabilities is a quick check for dependence. An observed overlap well above the product points to a shared cause, and one well below suggests the events tend to exclude each other, as when two tasks compete for the same worker. In either case, the independence shortcut would give a union that is off, and supplying the measured overlap, as this page allows, avoids the error.

Extending beyond two events

For three events, inclusion-exclusion adds the three single probabilities, subtracts the three pairwise overlaps and adds back the triple overlap. The page covers two events only. For many independent events, the independent events calculator gives the chance of at least one using complements, which is simpler. For overlapping events with known joint probabilities, apply the rule step by step: compute the union of the first two, then treat that as one event and combine with the third using its own overlap.

Three ways to get the union wrong

Three mistakes are frequent. The first is adding probabilities without subtracting the overlap, which can produce values above 1. The second is subtracting the product P(A) × P(B) when the events are not independent. The third is mixing up "and" with "or": the overlap is the chance of both, the union is the chance of either. Inputs must be consistent as well: an overlap larger than P(A) or P(B) is impossible. If a result looks too high or too low, redraw the situation as a diagram of counts. Also watch the wording of survey results. If 60 percent of respondents like product A, 50 percent like product B and 20 percent like both, the share liking at least one is 90 percent, so 10 percent like neither. Reading the 60 and 50 as exclusive groups would give 110 percent, an impossible total that signals a missing overlap term. The union page handles the correction and the complement page gives the share who like neither. Marketing teams, epidemiologists and quality engineers all meet the same bookkeeping: overlapping categories must be counted once, and a quick sum of group sizes that exceeds the population is the usual sign that overlap was ignored.

Overlap must be supplied correctly

The page assumes you supply a correct overlap and does not assume independence. It does not check that your three inputs correspond to a real probability model, though an inconsistent set will give a union outside the possible range. It handles two events. The calculation is exact for the numbers you enter, and any error comes from the inputs. If you only know P(A) and P(B), the page cannot give a single answer, because the union depends on how much the events overlap. In that case compute the lower and upper bounds, and report the range instead of a single figure. The bounds are the larger of the two probabilities and the smaller of 1 and their sum, and they are reached when one event contains the other or the events are mutually exclusive.