How do you calculate the probability of the union of two events?

How to Calculate the Probability of the Union of Two Events

The calculation of the union of two events, denoted as P(A ∪ B), is one of the most fundamental operations in probability theory. This formula allows analysts and statisticians to determine the likelihood that at least one of two possible outcomes will occur. Mastering this concept is essential for anyone dealing with statistical modeling, risk assessment, or decision-making processes under uncertainty. The core principle dictates that we sum the individual probabilities of the events and then correct for any overlap, ensuring that common outcomes are not counted twice.

Formally, the equation used to determine P(A ∪ B) is known as the General Addition Rule. This rule provides a precise mechanism for combining separate probabilities. If we have two events, Event A and Event B, the probability of their union is defined as the probability of A plus the probability of B, minus the probability of their joint occurrence, or intersection. This subtraction step is crucial and represents the heart of understanding why the simple addition of P(A) and P(B) is insufficient when the events are not mutually exclusive.

In practice, understanding the union of events (Link 2/5) provides profound insight into scenarios where multiple success conditions exist. For instance, determining the probability of drawing an Ace or a Heart from a deck of cards requires this method, as the outcome “Ace of Hearts” belongs to both sets. Without carefully accounting for this overlap—the intersection (Link 2/5)—we would overestimate the true likelihood of the desired outcome. This robust mathematical structure ensures that our probabilistic models remain accurate and reflect the true nature of the sample space.

Understanding the Basics of Probability Theory

Before diving deep into the union calculation, it is paramount to establish a solid foundation in basic probability (Link 2/5) terminology and concepts. Probability fundamentally measures the likelihood of an event occurring, ranging from zero (impossibility) to one (certainty). Events are defined as specific outcomes or sets of outcomes within a defined experimental space. For example, in a standard six-sided die roll, the event “rolling an even number” comprises the outcomes {2, 4, 6}. The calculation of any probability relies heavily on the careful definition of the sample space, which is the complete set of all possible outcomes.

Central to probability theory is the concept of a probability measure, P(E), which quantifies the chance of event E occurring. Probabilities must adhere to specific axioms: the probability of any event must be non-negative, and the probability of the entire sample space must equal one. Furthermore, when dealing with multiple events, we often employ methods derived from set theory (Link 2/5) to manage and categorize outcomes. The use of Venn diagrams often serves as an invaluable visual aid, demonstrating how different events relate to each other within the bounded sample space, clearly illustrating areas of overlap or separation.

A strong comprehension of these fundamental building blocks—including the definitions of events, sample spaces, and basic probability assignments—is essential for accurately applying more complex rules, such as the Addition Rule for the union of events. Statistical errors often arise not from complex mathematical mistakes, but from misunderstandings regarding the definition of the events themselves or improper specification of the underlying distribution. Therefore, always begin by meticulously defining Event A, Event B, and the associated probabilities P(A) and P(B) relative to the experiment.

Defining the Union of Two Events (A ∪ B)

The mathematical notation A ∪ B represents the union of Event A and Event B. In plain language, the union describes the situation where Event A occurs, or Event B occurs, or both occur simultaneously. It is an inclusive ‘OR’ operation. If any outcome satisfies the criteria for A, or the criteria for B, or both, that outcome belongs to the union A ∪ B. This is distinct from the exclusive ‘OR’ (XOR), which specifies that one event occurs but not the other.

When working with probability, P(A ∪ B) translates to the probability that at least one of the two events takes place. Consider a marketing campaign targeting customers who either use Product X (Event A) or follow the company on social media (Event B). The union P(A ∪ B) calculates the overall reach of the campaign—the total proportion of customers who satisfy at least one of these criteria. This metric is extremely useful in fields like audience segmentation and demographic analysis where the goal is maximizing coverage.

Visualizing the union using a Venn diagram shows two overlapping circles labeled A and B. The union encompasses the entire area covered by both circles combined. The critical insight here is that the area where the circles overlap—the intersection (Link 3/5), A ∩ B—is inherently included in both P(A) and P(B). If we were simply to add P(A) + P(B), we would be counting this overlapping region twice, leading to an inflated and incorrect final probability. This geometric interpretation is the driving force behind the necessary subtraction step in the General Addition Rule.

The General Addition Rule for Probability

The definitive formula for calculating the probability of the union of any two events A and B is articulated by the General Addition Rule. This rule is necessary when the events are not disjoint, meaning they share outcomes. The formula is written as: P(A ∪ B) = P(A) + P(B) − P(A ∩ B). This elegant formula ensures that the calculation adheres to the fundamental axioms of probability, particularly that the probability of the union cannot exceed the probability of the entire sample space (which is 1).

Let’s break down the components of the formula. P(A) is the marginal probability of Event A occurring, and P(B) is the marginal probability of Event B occurring. The sum P(A) + P(B) represents the initial aggregation of the likelihoods. However, this sum includes the probability of the joint occurrence, P(A ∩ B), counted twice: once within P(A) and once within P(B). Therefore, the final term, P(A ∩ B), must be subtracted once to correct for this double counting error, resulting in the mathematically accurate probability of the union.

This rule is universally applicable regardless of the dependency between the events. Whether A and B are independent (where the occurrence of one does not affect the probability of the other) or dependent, the General Addition Rule remains the correct method for calculating P(A ∪ B). However, the way P(A ∩ B) is calculated might change depending on dependency. If the events are independent, the intersection is simply the product of the individual probabilities: P(A ∩ B) = P(A) * P(B). If they are dependent, conditional probability rules must be used: P(A ∩ B) = P(A) * P(B | A).

Why We Subtract the Intersection (P(A ∩ B))

The subtraction of the intersection (Link 4/5), P(A ∩ B), is arguably the most crucial and differentiating feature of the General Addition Rule. If we were dealing with simple counting principles, and we counted the number of outcomes in A and the number of outcomes in B, any outcome belonging to both sets would appear twice in our total count. Since probability (Link 3/5) is derived from the ratio of favorable outcomes to total outcomes, this double counting directly translates into an overestimation of the probability of the union.

This concept is formalized by the Principle of Inclusion-Exclusion, a fundamental counting technique derived from set theory (Link 3/5). For two sets, the principle states that the size of their union is the sum of their individual sizes minus the size of their intersection. When applied to probability, where the sizes are replaced by probabilities, the principle holds true. By subtracting P(A ∩ B), we are effectively excluding the region that was included twice, ensuring that every unique outcome in the union is accounted for exactly once.

Consider a quality control scenario where a manufactured part might fail Test A (8% probability) or fail Test B (5% probability). If 2% of parts fail both tests, the simple addition (8% + 5% = 13%) suggests 13% of parts fail. However, those 2% parts that failed both were counted in both 8% and 5%. The correct total probability of failure (P(A ∪ B)) is 8% + 5% – 2% = 11%. This demonstrates the practical importance of the subtraction: it moves the calculation from a gross estimate to a precise statistical measurement of failure risk.

Special Case: Mutually Exclusive Events

A significant simplification occurs when the events A and B are mutually exclusive (or disjoint). Two events are mutually exclusive if they cannot occur at the same time; that is, they share no common outcomes. If A occurs, B cannot, and vice versa. Examples include flipping a coin and getting ‘Heads’ (Event A) versus getting ‘Tails’ (Event B), or rolling a die and getting an even number versus getting a one.

When events are mutually exclusive events (Link 2/5), their intersection (Link 5/5) is empty. Mathematically, this means that the probability of their joint occurrence is zero: P(A ∩ B) = 0. In this special case, the General Addition Rule simplifies dramatically to the Special Addition Rule: P(A ∪ B) = P(A) + P(B). Because there is no overlap, there is nothing to subtract, and the simple addition of the marginal probabilities yields the correct union probability.

It is crucial to correctly identify whether events are mutually exclusive before applying the simplified rule. Misidentifying overlapping events as mutually exclusive is a common statistical error that leads to an artificially low P(A ∩ B) value (mistakenly assuming it is zero) and consequently an inflated P(A ∪ B). Always verify the sample space and ensure that no outcome satisfies both events simultaneously. If in doubt, default to the General Addition Rule, P(A ∪ B) = P(A) + P(B) − P(A ∩ B), as it is mathematically robust for all cases.

The Concept of Set Intersection (A ∩ B)

The intersection (Link 5/5) of two events, denoted A ∩ B, represents the set of outcomes where both Event A AND Event B occur. This concept is foundational not only to calculating the union but also to understanding conditional probability and independence. P(A ∩ B) is the joint probability, and its accurate determination is often the most challenging step in applying the Addition Rule, especially when dealing with dependent variables.

How P(A ∩ B) is calculated depends entirely on the relationship between A and B. As mentioned previously, if the events are independent (e.g., flipping a coin twice), P(A ∩ B) = P(A) * P(B). Independence implies that the outcome of A does not influence the outcome of B. However, if the events are dependent (e.g., drawing two cards without replacement), the calculation requires conditional probability: P(A ∩ B) = P(A) * P(B | A), where P(B | A) is the probability of B occurring given that A has already occurred.

Understanding the intersection is vital for risk modeling. For example, calculating the probability of a system failing due to both a hardware fault (A) and a software bug (B) requires knowing P(A ∩ B). If these events are highly dependent (e.g., the software bug is only triggered by the specific hardware fault), the joint probability P(A ∩ B) will be higher than if they were independent. Therefore, accurately modeling dependency structure is key to obtaining a precise value for the intersection, which subsequently guarantees the accuracy of the union calculation P(A ∪ B).

Practical Application and Examples

The probability of the union of two events finds widespread application across diverse fields. In finance, it might be used to calculate the probability that a stock portfolio yields positive returns in sector A or sector B. In public health, it helps determine the likelihood that an individual exhibits symptom X or symptom Y. Furthermore, in computer science, specifically in areas like machine learning classification, P(A ∪ B) helps evaluate the performance of models by calculating the probability of a positive outcome in at least one of two parallel classifiers.

Consider a simple survey example: 60% of students like Math (P(M)=0.6), 40% like Science (P(S)=0.4), and 25% like both Math and Science (P(M ∩ S)=0.25). We want to find the probability that a randomly chosen student likes Math or Science. Using the General Addition Rule: P(M ∪ S) = P(M) + P(S) − P(M ∩ S). P(M ∪ S) = 0.60 + 0.40 − 0.25 = 0.75. This shows that 75% of students like at least one of the subjects. The 0.25 represents the students who were counted in both 0.60 and 0.40, and subtracting it corrects the total.

The utility of P(A ∪ B) extends into complex reliability engineering. If a crucial component relies on two redundant backup systems, A and B, knowing the probability of system failure (P(A ∪ B)) is critical for safety assessment. Here, P(A ∪ B) represents the probability that at least one system fails. If the systems are independent and P(A)=0.01 and P(B)=0.01, P(A ∩ B) = 0.01 * 0.01 = 0.0001. Thus, P(A ∪ B) = 0.01 + 0.01 – 0.0001 = 0.0199. This demonstrates that redundancy significantly lowers the overall probability of system failure compared to a single point of failure, a cornerstone of reliable design based on the properties of union (Link 4/5) calculations.

Using the Provided Probability Calculator

To facilitate the calculation and visualization of these concepts, a calculator tool is often utilized. The following section contains the necessary code and output fields for an interactive probability calculator. This tool helps users input the marginal probabilities of Event A and Event B and immediately see the computed values for the complement of A (P(A’)), the complement of B (P(B’)), the union of events (Link 3/5) (P(A ∪ B)), the intersection (P(A ∩ B)), and the probability of only one event occurring.

Note that the specific logic implemented in the accompanying JavaScript assumes that Event A and Event B are independent when calculating the intersection. In independence, P(A ∩ B) is simply P(A) multiplied by P(B). This simplifies the computation for demonstrative purposes. The tool then uses this calculated intersection value to determine the union probability, P(A ∪ B) = P(A) + P(B) − P(A ∩ B), adhering strictly to the General Addition Rule.

By experimenting with different input probabilities, users can quickly observe how changes in P(A) or P(B) affect the resulting union and intersection values. Furthermore, setting P(A) and P(B) such that P(A) + P(B) is less than or equal to 1, and observing the results, reinforces the principle that the union must be less than or equal to 1. Using P(A) = 0.5 and P(B) = 0.5, for independent events, the intersection P(A ∩ B) = 0.25, and the union P(A ∪ B) = 0.75, which is a classic demonstration of the inclusion-exclusion principle in action. Finally, the calculation of the probability that either A or B occurs, but not both, utilizes the formula P(A ∪ B) − P(A ∩ B), highlighting the utility of both the union and intersection figures.

@import url('https://fonts.googleapis.com/css?family=Droid+Serif|Raleway');


.axis--y .domain {
  display: none;
}

h1 {
text-align: center;
font-size: 50px;
margin-bottom: 0px;
font-family: 'Raleway', serif;
}

p {
color: black;
text-align: center;
margin-bottom: 15px;
margin-top: 15px;
font-family: 'Raleway', sans-serif;
}

#words {
color: black;
font-family: Raleway;
max-width: 550px;
margin: 25px auto;
line-height: 1.75;
padding-left: 100px;
}

#calcTitle {
text-align: center;
font-size: 20px;
margin-bottom: 0px;
font-family: 'Raleway', serif;
}

#hr_top {
width: 30%;
margin-bottom: 0px;
border: none;
height: 2px;
color: black;
background-color: black;
}

#hr_bottom {
width: 30%;
margin-top: 15px;
border: none;
height: 2px;
color: black;
background-color: black;
}

#words label, input {
    display: inline-block;
    vertical-align: baseline;
    width: 350px;
}

    #button {
      border: 1px solid;
      border-radius: 10px;
      margin-top: 20px;
      padding: 10px 10px;
      cursor: pointer;
      outline: none;
      background-color: white;
      color: black;
      font-family: 'Work Sans', sans-serif;
      border: 1px solid grey;
      /* Green */
    }
    
    #button:hover {
      background-color: #f6f6f6;
      border: 1px solid black;
    }

Probability that event A does not occur: P(A’): 0.7

Probability that event B does not occur: P(B’): 0.5

Probability that event A and/or event B occurs P(A∪B): 0.65

Probability that event A and event B both occur P(A∩B): 0.15

Probability that either event A or event B occurs, but not both: 0.5

function probCalc() {
	
//get input values
var probA = document.getElementById('probA').value;
var probB = document.getElementById('probB').value;

//assign probabilities to variable names
var complementA = 1 - probA;
var complementB = 1 - probB;
var intersection = probA * probB;
var union = probA - (-1*probB) - intersection;
var singleOccur = probA - (-1*probB) - (2*intersection);

//output probabilities
document.getElementById('complementA').innerHTML = complementA.toPrecision();
document.getElementById('complementB').innerHTML = complementB.toPrecision();
document.getElementById('union').innerHTML = union.toPrecision();
document.getElementById('intersection').innerHTML = intersection.toPrecision();
document.getElementById('singleOccur').innerHTML = singleOccur.toPrecision();
}

Cite this article

stats writer (2026). How to Calculate the Probability of the Union of Two Events. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-do-you-calculate-the-probability-of-the-union-of-two-events/

stats writer. "How to Calculate the Probability of the Union of Two Events." PSYCHOLOGICAL SCALES, 1 Jan. 2026, https://scales.arabpsychology.com/stats/how-do-you-calculate-the-probability-of-the-union-of-two-events/.

stats writer. "How to Calculate the Probability of the Union of Two Events." PSYCHOLOGICAL SCALES, 2026. https://scales.arabpsychology.com/stats/how-do-you-calculate-the-probability-of-the-union-of-two-events/.

stats writer (2026) 'How to Calculate the Probability of the Union of Two Events', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-do-you-calculate-the-probability-of-the-union-of-two-events/.

[1] stats writer, "How to Calculate the Probability of the Union of Two Events," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, January, 2026.

stats writer. How to Calculate the Probability of the Union of Two Events. PSYCHOLOGICAL SCALES. 2026;vol(issue):pages.

Download Post (.PDF)
Slide Up
x
PDF
Scroll to Top