Sets and Set Operations

20 min
0/4 practice checks

A set is a collection of distinct objects called elements. We write xAx \in A for 'xx is in AA'. Key operations:

  • Union ABA \cup B: everything in AA or BB.
  • Intersection ABA \cap B: everything in both.
  • Complement AA': everything (in the universal set) not in AA.

The number of elements in AA is its cardinality A|A|.

For overlapping sets, simply adding sizes double-counts the shared part. The inclusion–exclusion principle fixes this:

AB=A+BAB|A \cup B| = |A| + |B| - |A \cap B|

Worked example. If A=10|A|=10, B=8|B|=8 and AB=3|A\cap B|=3, then AB=10+83=15|A\cup B| = 10 + 8 - 3 = 15 — we subtract the 3 counted twice.

A set with nn elements has 2n2^n subsets: each element is either in or out.

If A={1,2,3,4}A=\{1,2,3,4\} and B={3,4,5}B=\{3,4,5\}, what is ABA \cap B?

If A=10|A|=10, B=8|B|=8 and AB=3|A\cap B|=3, find AB|A\cup B|.

How many subsets does a set with 4 elements have?

In a class of 30 learners, 18 take Mathematics and 15 take Physical Sciences; 7 take both. How many take at least one of the two subjects?