Canadian flagMath101 · Independent Ontario learning libraryCreated and edited by Kamran
Discrete MathematicsUniversity3 min read

Set Operations

A precise guide to union, intersection, difference, complement, Cartesian product, and set identities.

Cheat sheet

Precise definition

For sets $A$ and $B$, the union $A\cup B$ contains elements in at least one set; the intersection $A\cap B$ contains elements in both; the difference $A\setminus B$ contains elements in $A$ but not $B$. Relative to a universe $U$, the complement is $A^c=U\setminus A$.

Notation and mathematical language

Membership notation $x\in A$ differs from subset notation $A\subseteq B$. The Cartesian product $A\times B=\{(a,b):a\in A,b\in B\}$ uses ordered pairs, so generally $A\times B\ne B\times A$. De Morgan's laws are $(A\cup B)^c=A^c\cap B^c$ and $(A\cap B)^c=A^c\cup B^c$.

Conceptual picture

Venn diagrams encode membership regions, but element-wise logic provides the proof. For example, $x\in A\cap(B\cup C)$ means $x\in A$ and ($x\in B$ or $x\in C$), which distributes to membership in $(A\cap B)\cup(A\cap C)$.

Conditions and key results

Complements require an explicit universe. Union is inclusive, and difference is not commutative. To prove two sets equal, establish both inclusions or show an arbitrary element belongs to the left exactly when it belongs to the right.

A reliable strategy

  1. State the universe and rewrite each operation as a membership condition.
  2. Evaluate parentheses from the inside outward, preserving ordered pairs in Cartesian products.
  3. For identities, use an arbitrary element and logical equivalences or prove two subset directions.
  4. Check with a small finite universe or shaded diagram without treating the picture as the proof.

Fully worked example

Interpretation and application

Set operations express database filters, probability events, solution sets, and access-control groups. 'Not in A or B' is ambiguous in ordinary language; symbolic parentheses distinguish outside the union from membership in a complement combined with another set.

Common mistakes

Verification and reasonableness

  • Check every listed element against the membership definition.
  • Use cardinality bounds: an intersection cannot be larger than either finite input set.
  • Verify identities both with element logic and one small finite example as an error check.

Practice

  1. If $A=\{1,2\}$ and $B=\{2,3\}$, find $A\cup B$.
  2. For the same sets, find $A\setminus B$.
  3. If $|A|=3$ and $|B|=4$, what is $|A\times B|$?
Answers and brief solutions
  1. $\{1,2,3\}$.
  2. $\{1\}$.
  3. $12$.

Further deduction

Set distributivity can be proved element-wise: $x\in A\cap(B\cup C)$ iff $x\in A$ and ($x\in B$ or $x\in C$). Propositional distributivity makes this equivalent to ($x\in A$ and $x\in B$) or ($x\in A$ and $x\in C$), exactly $x\in(A\cap B)\cup(A\cap C)$. Because the chain is biconditional for an arbitrary $x$, it proves both subset directions and therefore set equality. Symmetric difference, $A\triangle B=(A\setminus B)\cup(B\setminus A)$, records membership in exactly one of the sets. It is commutative and has cardinality $|A|+|B|-2|A\cap B|$ for finite sets, because intersection elements were counted twice and must be removed twice.

Check your understanding

Try it yourself

Hints are part of learning. Open one whenever it makes the next step feel possible.

1 practice question
Question 1Compute an intersection · Standard

How many elements are in {1,2,3,4} intersect {3,4,5}?

End of lesson

Nice work making it this far.

Understanding grows through return visits. Save this lesson, try the practice, or continue when you are ready.

Lesson complete

That one is yours now.

Set Operations is saved to My Learning. Take the win—you earned it.

1Your Math101 collectionlesson completed
Search 464 published lessons, 123 answer guides, courses, and learning tools.
Your experience

Settings

Ontario math tutoringWork with KamranBook ↗