Course contentsShow
← Data Science
Lesson 80 of 2,1453. Probability FoundationsFree lesson

Set Operations: Union, Intersection, and Complement

Apply set operations to combine and manipulate events using union (OR), intersection (AND), and complement (NOT).

Set Operations: Union, Intersection, and Complement

You'll learn how to combine and manipulate probability events using three fundamental set operations: union (OR), intersection (AND), and complement (NOT).

The Core Idea

In probability, events are subsets of a sample space. Just like combining puzzle pieces, we can create new events by combining existing ones. Three operations let us do this:

Union (∪) — "A or B"
The union combines all outcomes from either event. If you roll a die and define:

  • Event A = {2, 4, 6} (rolling even)
  • Event B = {5, 6} (rolling 5 or 6)

Then A ∪ B = {2, 4, 5, 6} — any outcome that appears in A, B, or both.

Intersection (∩) — "A and B"
The intersection contains only outcomes in both events. Using the same events:

A ∩ B = {6} — only 6 appears in both sets.

If events share no outcomes (like "rolling even" and "rolling 1"), their intersection is the empty set ∅, and we call them mutually exclusive.

Complement (Aᶜ or A') — "not A"
The complement contains everything in the sample space except event A. For rolling a die where S = {1, 2, 3, 4, 5, 6}:

Aᶜ = {1, 3, 5} — all outcomes that are not even.

Why This Matters

These operations let you build complex probability questions from simple ones. "What's the probability of rolling even OR getting a 5?" uses union. "What's the probability of NOT rolling a 1?" uses complement. Understanding these operations is essential for calculating probabilities of compound events.

Key Takeaway: Union combines events with OR logic, intersection finds overlap with AND logic, and complement identifies everything NOT in an event — these three operations are the building blocks for working with probability events.