Contents
Deep Breakdown
What it tells me (Situation Awareness): Two events are mutually exclusive if they cannot both occur at the same time: . When this holds, the union probability simplifies to the sum of individual probabilities. This is Kolmogorov's additivity axiom. In practice, it applies to exhaustive category memberships: a customer cannot be in both "churned" and "active" simultaneously.
Flowchart
Real-world use
Where it is used
Multi-class classification: classes are mutually exclusive (a data point belongs to exactly one class). Also: customer state transitions (active/churned/paused), product category assignment, or diagnostic test outcomes.
Problem it solves
When events are mutually exclusive, the union rule simplifies to addition — no intersection term needed.
How it solves the problem
Since , the inclusion-exclusion formula reduces to .
Example in a business
Multinomial classification with 3 sentiment classes: P(positive) = 0.55, P(neutral) = 0.30, P(negative) = 0.15. Classes are mutually exclusive, so .
The formula, piece by piece
- : A and B have no overlap.
- : the additive rule.
The formula in words
"If A and B cannot happen at the same time (mutually exclusive), the probability that A OR B occurs is simply the sum of their individual probabilities."
Critical Concepts
- Mutual exclusivity does NOT imply independence (and vice versa).
- In fact, if and and they're mutually exclusive, they CANNOT be independent.
- Exhaustive + mutually exclusive = a partition: .
- Categorical distribution uses this: one class per sample.
Step-by-step calculation (tiny example)
Step 1: Customer states A: churned (), B: paused (). States are mutually exclusive.
Step 2: P(churned OR paused)
Step 3: Verify no overlap No customer can be both churned and paused simultaneously. . Correct.
Code examples
Beginner example (Python)
# Multi-class classification: mutually exclusive classes
class_probs = {"positive": 0.55, "neutral": 0.30, "negative": 0.15} # P(positive or neutral)
p_pos_or_neu = class_probs["positive"] + class_probs["neutral"]
print(f"P(positive or neutral) = {p_pos_or_neu:.2f}") # 0.85Beginner example (R)
class_probs <- c(positive=0.55, neutral=0.30, negative=0.15)
p_pos_or_neu <- class_probs["positive"] + class_probs["neutral"]
cat("P(positive or neutral) =", p_pos_or_neu, "\n") # 0.85Professional example (Python)
import numpy as np
from typing import Sequence
def union_mutually_exclusive( probabilities: Sequence[float], event_names: Sequence[str] | None = None ) -> float:
"""Compute P(union) for mutually exclusive events via simple addition. Validates mutual exclusivity assumption (all probs fit within [0,1] and total does not exceed 1). Args: probabilities: Individual P(Ai) values. event_names: Optional names for reporting. Returns: P(A1 ∪ A2 ∪ ... ∪ Ak) = sum of P(Ai). """
prob_array = np.array(probabilities)
if np.any(prob_array < 0):
raise ValueError("Negative probability found")
total_union = float(np.sum(prob_array))
if total_union > 1.0 + 1e-8:
raise ValueError(f"Sum {total_union:.6f} > 1: not mutually exclusive or invalid probs")
return total_union # Sentiment class union analysis
sentiment_probs = [0.55, 0.30, 0.15]
event_names = ["positive", "neutral", "negative"]
for k in range(1, len(sentiment_probs) + 1):
p_union_k = union_mutually_exclusive(sentiment_probs[:k], event_names[:k])
names_str = " ∪ ".join(event_names[:k])
print(f"P({names_str}) = {p_union_k:.2f}")Source: AIO p. 84