2.4 C
London
Friday, December 20, 2024
HomeStatistics TutorialTutorialsSet Operations: Union, Intersection, Complement, and Difference

Set Operations: Union, Intersection, Complement, and Difference

Related stories

Learn About Opening an Automobile Repair Shop in India

Starting a car repair shop is quite a good...

Unlocking the Power: Embracing the Benefits of Tax-Free Investing

  Unlocking the Power: Embracing the Benefits of Tax-Free Investing For...

Income Splitting in Canada for 2023

  Income Splitting in Canada for 2023 The federal government’s expanded...

Can I Deduct Home Office Expenses on my Tax Return 2023?

Can I Deduct Home Office Expenses on my Tax...

Canadian Tax – Personal Tax Deadline 2022

  Canadian Tax – Personal Tax Deadline 2022 Resources and Tools...

set is a collection of items.

We denote a set using a capital letter and we define the items within the set using curly brackets. For example, suppose we have some set called “A” with elements 1, 2, 3. We would write this as:

A = {1, 2, 3}

This tutorial explains the most common set operations used in probability and statistics.

Union

Union set operation

Definition: The union of sets A and B is the set of items that are in either A or B.

Notation: A ∪ B

Examples:

  • {1, 2, 3} ∪ {4, 5, 6} = {1, 2, 3, 4, 5, 6}
  • {1, 2} ∪ {1, 2} = {1, 2}
  • {1, 2, 3} ∪ {3, 4} = {1, 2, 3, 4}

Intersection

Intersection set operation

Definition: The intersection of sets A and B is the set of items that are in both A and B.

Notation: A ∩ B

Examples:

  • {1, 2, 3} ∩ {4, 5, 6} = {∅}
  • {1, 2} ∩ {1, 2} = {1, 2}
  • {1, 2, 3} ∩ {3, 4} = {3}

Complement

Complement set operation

Definition: The complement of set A is the set of items that are in the universal set U but are not in A.

Notation: A’  or  Ac

Examples:

  • If U = {1, 2, 3, 4, 5, 6} and A = {1, 2}, then Ac = {3, 4, 5, 6}
  • If U = {1, 2, 3} and A = {1, 2}, then Ac = {3}

Difference

Difference set operation

Definition: The difference of sets A and B is the set of items that are in A but not B.

Notation: A – B

Examples:

  • {1, 2, 3} – {2, 3, 4} = {1}
  • {1, 2} – {1, 2} = {∅}
  • {1, 2, 3} – {4, 5} = {1, 2, 3}

Symmetric Difference

Symmetric difference between two sets

Definition: The symmetric difference of sets A and B is the set of items that are in either A or B, but not in both.

Notation: A Δ B

Examples:

  • {1, 2, 3} Δ {2, 3, 4} = {1, 4}
  • {1, 2} Δ {1, 2} = {∅}
  • {1, 2, 3} Δ {4, 5} = {1, 2, 3, 4, 5}

Cartesian Product

Cartesian product of two sets

Definition: The cartesian product of sets A and B is the set of ordered pairs from A and B.

Notation: A x B

Examples:

  • If A = {H, T} and B = {1, 2, 3}, then A x B = {(H, 1), (H, 2), (H, 3), (T, 1), (T, 2), (T, 3)}
  • If A = {T, H} and B = {1, 2, 3}, then A x B = {(T, 1), (T, 2), (T, 3), (H, 1), (H, 2), (H, 3)}

Subscribe

- Never miss a story with notifications

- Gain full access to our premium content

- Browse free from up to 5 devices at once

Latest stories