Set Operations

Back

Loading concept...

🎯 Set Operations: The Magic of Combining Groups

The Story Begins…

Imagine you have a toy box full of different toys. Your best friend also has their own toy box. Now, what if you wanted to play with toys from both boxes together? Or find toys that you both have? Or see which toys only you have?

That’s exactly what set operations help us do—but with numbers, letters, or anything we can group together!


🧺 Our Universal Analogy: The Fruit Baskets

Throughout this journey, we’ll use fruit baskets as our main example.

  • Basket A = {🍎 Apple, 🍌 Banana, 🍊 Orange}
  • Basket B = {🍌 Banana, 🍊 Orange, 🍇 Grapes, 🍓 Strawberry}
  • Universal Basket U = {🍎 Apple, 🍌 Banana, 🍊 Orange, 🍇 Grapes, 🍓 Strawberry, 🍉 Watermelon}

Now let’s explore the magic!


1️⃣ Union of Sets (A ∪ B)

What Is It?

Union means combining everything from both sets into one big set.

Think of it like: “What fruits do we have if we pour BOTH baskets together?”

The Rule

A ∪ B = All elements in A OR B (or both!)

Example with Our Baskets

Basket A = {Apple, Banana, Orange}
Basket B = {Banana, Orange, Grapes, Strawberry}

A ∪ B = {Apple, Banana, Orange, Grapes, Strawberry}

Notice: Banana and Orange appear in BOTH baskets, but we only write them once in the union. No duplicates!

Real-Life Example

You have 3 friends who play soccer: {Tom, Sara, Max} You have 4 friends who play basketball: {Sara, Max, Lily, Jake}

Friends who play soccer OR basketball: {Tom, Sara, Max, Lily, Jake} ← This is the union!

graph TD A["Basket A"] --> U["Union A ∪ B"] B["Basket B"] --> U U --> R["All fruits from<br/>both baskets"]

2️⃣ Intersection of Sets (A ∩ B)

What Is It?

Intersection means finding what’s common in both sets.

Think of it like: “What fruits are in BOTH baskets?”

The Rule

A ∩ B = All elements in A AND B

Example with Our Baskets

Basket A = {Apple, Banana, Orange}
Basket B = {Banana, Orange, Grapes, Strawberry}

A ∩ B = {Banana, Orange}

Only Banana and Orange are in BOTH baskets!

Real-Life Example

Kids who like pizza: {Emma, Jack, Mia, Leo} Kids who like ice cream: {Mia, Leo, Sam, Zoe}

Kids who like BOTH pizza AND ice cream: {Mia, Leo} ← This is the intersection!

graph TD A["Things in A"] --> I{Both have it?} B["Things in B"] --> I I -->|Yes| R["A ∩ B"] I -->|No| X["Not included"]

3️⃣ Complement of a Set (A’)

What Is It?

Complement means everything NOT in your set.

Think of it like: “What fruits are NOT in my basket, but exist in the whole fruit world?”

The Rule

A’ = Everything in the Universal Set (U) that is NOT in A

Example with Our Baskets

Universal U = {Apple, Banana, Orange, Grapes, Strawberry, Watermelon}
Basket A = {Apple, Banana, Orange}

A' = {Grapes, Strawberry, Watermelon}

These are all the fruits that exist but aren’t in Basket A!

Real-Life Example

All students in class (U): {Ana, Ben, Cara, Dan, Eve} Students who passed the test (P): {Ana, Cara, Eve}

Students who did NOT pass (P’): {Ben, Dan} ← This is the complement!

graph TD U["Universal Set U"] --> Q{In Set A?} Q -->|Yes| A["Set A"] Q -->|No| AC["Complement A'"]

4️⃣ Difference of Sets (A - B)

What Is It?

Difference means what’s in the first set but NOT in the second.

Think of it like: “What fruits do I have that my friend doesn’t have?”

The Rule

A - B = Elements in A that are NOT in B

Example with Our Baskets

Basket A = {Apple, Banana, Orange}
Basket B = {Banana, Orange, Grapes, Strawberry}

A - B = {Apple}

Apple is in A but NOT in B!

Now the other way:

B - A = {Grapes, Strawberry}

Grapes and Strawberry are in B but NOT in A!

Important!

A - B ≠ B - A (Order matters!)

Real-Life Example

Your toys: {car, doll, puzzle, blocks} Friend’s toys: {doll, blocks, train}

Toys only YOU have (Your toys - Friend’s toys): {car, puzzle}

Toys only FRIEND has (Friend’s toys - Your toys): {train}


5️⃣ Set Laws and Properties

These are the “Rules of the Game”

Just like math has rules (2+3 = 3+2), sets have rules too!


🔄 Commutative Laws

Order doesn’t matter for Union and Intersection!

A ∪ B = B ∪ A
A ∩ B = B ∩ A

Example: {1, 2} ∪ {3} = {3} ∪ {1, 2} = {1, 2, 3} ✓


📦 Associative Laws

Grouping doesn’t matter!

(A ∪ B) ∪ C = A ∪ (B ∪ C)
(A ∩ B) ∩ C = A ∩ (B ∩ C)

Example: ({1} ∪ {2}) ∪ {3} = {1} ∪ ({2} ∪ {3}) Both give us {1, 2, 3} ✓


🔀 Distributive Laws

Spreading operations across sets!

A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C)
A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)

Example: Let A = {1, 2}, B = {2, 3}, C = {3, 4}

A ∪ (B ∩ C) = {1, 2} ∪ {3} = {1, 2, 3} (A ∪ B) ∩ (A ∪ C) = {1, 2, 3} ∩ {1, 2, 3, 4} = {1, 2, 3} ✓


🪞 Identity Laws

Empty set and Universal set are special!

A ∪ ∅ = A       (Union with empty = same set)
A ∩ U = A       (Intersection with universal = same set)
A ∩ ∅ = ∅       (Intersection with empty = empty)
A ∪ U = U       (Union with universal = universal)

Example: {1, 2, 3} ∪ {} = {1, 2, 3} ✓ Makes sense—adding nothing changes nothing!


🔃 Complement Laws

A ∪ A' = U      (Set + its complement = everything)
A ∩ A' = ∅      (Set and its complement share nothing)
(A')' = A       (Complement of complement = original)

Example: If U = {1, 2, 3, 4, 5} and A = {1, 2} Then A’ = {3, 4, 5}

A ∪ A’ = {1, 2} ∪ {3, 4, 5} = {1, 2, 3, 4, 5} = U ✓


🧙‍♂️ De Morgan’s Laws

The magical flip rules!

(A ∪ B)' = A' ∩ B'
(A ∩ B)' = A' ∪ B'

Think of it like:

  • “NOT (this OR that)” = “NOT this AND NOT that”
  • “NOT (this AND that)” = “NOT this OR NOT that”

Example: U = {1, 2, 3, 4, 5}, A = {1, 2}, B = {2, 3}

(A ∪ B)’ = {1, 2, 3}’ = {4, 5} A’ ∩ B’ = {3, 4, 5} ∩ {1, 4, 5} = {4, 5} ✓


🎉 Quick Summary

Operation Symbol Meaning Example
Union A ∪ B Everything from both {1,2} ∪ {2,3} = {1,2,3}
Intersection A ∩ B Common to both {1,2} ∩ {2,3} = {2}
Complement A’ Not in A If U={1,2,3}, A={1}, then A’={2,3}
Difference A - B In A but not B {1,2} - {2,3} = {1}

💪 You Did It!

Now you can:

  • ✅ Combine sets with Union
  • ✅ Find common elements with Intersection
  • ✅ Find what’s missing with Complement
  • ✅ Find unique elements with Difference
  • ✅ Use Set Laws to simplify problems

Remember: Sets are just groups of things, and set operations are ways to compare and combine those groups. Just like organizing your toys, your apps, or your friends list!

Go forth and set-operate with confidence! 🚀

Loading story...

Story - Premium Content

Please sign in to view this story and start learning.

Upgrade to Premium to unlock full access to all stories.

Stay Tuned!

Story is coming soon.

Story Preview

Story - Premium Content

Please sign in to view this concept and start learning.

Upgrade to Premium to unlock full access to all content.