AI Glossary / Data science and analytics / Advanced
Union Of Events
Definition
The union of events is the event that at least one of them occurs. For two events A and B, it is written A ∪ B and includes outcomes belonging to A, B or both. In probability, this is an inclusive or: outcomes satisfying both conditions remain included, but are counted only once.
What it means
Suppose a website classifies a visit by whether the visitor reads an article and whether they watch a video. The event reads an article or watches a video includes visits involving both activities. It excludes visits involving neither.
The union is a set of outcomes, while its probability is a number describing how likely that set is under a specified probability model. Confusing those two ideas can make notation harder than necessary.
In everyday reporting, the same logic helps combine overlapping groups. Before combining them, define the unit and period. Visitors, visits and individual activity events produce different totals, even when the activity names are the same.
How it works
For two events, the addition rule is P(A ∪ B) = P(A) + P(B) − P(A ∩ B). The intersection A ∩ B contains outcomes satisfying both conditions. Subtracting its probability once corrects the double-counting introduced by adding the two event probabilities.
If the events are mutually exclusive, their intersection is empty and simple addition suffices. Independence is a different property: independent events may occur together. Independence permits multiplication to find their intersection probability, but it is not required for the general union formula.
The union's complement means neither event occurs. Consequently, its probability can also be found as one minus the probability of neither. Choose the route that matches the available information, while keeping the same population and measurement unit throughout.
Three practical examples
- Learning analytics: Count visits that include an article, a video or both, giving each qualifying visit one place in the combined audience total.
- Content maintenance: Estimate how many pages need attention because they contain a broken link or a missing caption. Pages with both problems belong in the queue once, although they may require two kinds of repair.
- Personal planning: Identify calendar days with a class or a family commitment. A day containing both still occupies one day in the combined set of busy days.
Think of it this way
Think of two overlapping circles drawn around items on a board. One circle marks A and the other B. The union is everything inside either circle, including the overlap. The overlap does not create a second copy of an item. It simply shows that the item meets both descriptions.
Worked example
A website records 200 visits in a defined period. Of these, 90 include reading an article, 70 include watching a video and 30 include both activities.
The combined count is 90 + 70 − 30 = 130 visits. For a visit chosen uniformly from these 200 records, the probability of article-or-video activity is 130 / 200 = 65%.
The underlying groups are 60 article-only visits, 40 video-only visits, 30 visits with both and 70 with neither. Their counts sum to 200. The first three groups form the union and sum to 130.
Adding 90 and 70 without correction would report 160, because the 30 shared visits would each appear twice. By contrast, exactly one of the activities occurs on 60 + 40 = 100 visits, or 50%. That excludes the overlap and answers a different question.
The observed overlap rate is 15%. It is not the product 45% × 35% = 15.75%, so these exact empirical proportions do not satisfy independence. The union calculation remains valid regardless.
Illustrative case study
Fictional publisher Rowan Guides combines two maintenance reports. One lists pages with broken links, while the other lists pages lacking required captions. Managers initially add the list lengths to estimate how many pages editors must open.
An analyst matches the reports using a stable page identifier and discovers overlapping pages. The team creates one combined page queue, retaining separate issue indicators so neither repair is forgotten. It also distinguishes unique pages from total defects, since one page may contain several broken links.
Rowan uses the union for page-level workload and the detailed issue counts for repair planning. This fictional case illustrates why the correct combined total depends on the operational question, rather than suggesting that deduplicating pages removes the need to fix multiple problems.
Common misconceptions and mistakes
Or usually includes both in probability notation. If the intended meaning is exactly one, state that explicitly.
The intersection is not discarded from the union. It is subtracted once from the sum so it remains counted once overall.
Mutually exclusive does not mean independent. Two events with positive probabilities cannot be both mutually exclusive and independent.
Percentages from different populations cannot simply be placed in one union formula. Their denominators and event definitions must be compatible.
For three or more overlapping events, subtracting pairwise overlaps alone is generally insufficient. Higher-order overlaps must also be accounted for, or individual qualifying units can be counted directly.
Business use
Union logic supports deduplicated audience reach, review queues and estimates of exposure to at least one condition. It helps teams avoid overstating totals when categories overlap. Retain the underlying group indicators so combined counts can be reconciled and different questions answered later. A union describes membership or occurrence; it does not establish that one event causes another or explain why the overlap exists.
People also ask
Must events be independent to calculate a union?
No. The general two-event formula uses their actual intersection probability.
Can the union be smaller than either event?
No. It includes every outcome in each event.
Can its probability exceed one?
No. A result above one indicates incompatible inputs or an incorrect calculation.
Check your understanding
Why subtract 30 in the worked example?
Answer: Those visits were included in both original totals.
Does the union include the 30 visits with both activities?
Answer: Yes, once each.
How many visits have neither activity?
Answer: Seventy, the complement of the 130-visit union.
Related terms
- Intersection Of Events
- Sample space
- Mutually Exclusive Events
- Independence
- Probability
- complement
- inclusion–exclusion principle
- deduplication
Learn next
Draw a two-circle diagram for a small dataset. Fill in the four regions, then calculate at least one, both, exactly one and neither. Explain which question each result answers.
More in Data science and analytics
- Type-Casting - Type-casting is the conversion of a value from one data type to another according to a programming language or database system's rules.
- Undercoverage Bias - Undercoverage bias is systematic distortion in an estimate caused by failing to cover part of the intended population, when the omitted part differs in ways...
- Unicity (data analysis) - Unicity measures how often a limited set of observations singles out one individual's record or trace within a dataset.
- Univariate analysis - Univariate analysis examines one variable at a time to understand its values, distribution and other relevant properties.
- Unstructured data - Unstructured data is information whose substantive content is not organized into a predefined set of fields suitable for straightforward tabular analysis.
- Vector field histograms - Vector field histograms are directional representations used in a mobile-robot obstacle-avoidance method known as VFH.
Sources
University of California, Berkeley, Probability for Data Science, Union of Several Events: the two-event addition rule and the inclusion–exclusion extension. https://data140.org/sp17/textbook/ch5/UnionOfSeveralEvents.html The website counts, empirical probability calculations, practical examples and Rowan Guides case are original illustrations. They describe a fixed set of visits and do not by themselves estimate future website behaviour.
Previous: Unintended side-effects Next: Unique action axioms