Cardinality

What is Cardinality?

Cardinality is just how many elements are in a set.

Notation: ∣A∣|A|

This reads: “the cardinality of A” or “the size of A”


Examples

SetCardinality
{1,2,3}\{1, 2, 3\}33
{a,b}\{a, b\}22
{apple}\{apple\}11
∅\emptyset00

The empty set has cardinality 0.


Cardinality of Union

∣A∪B∣=∣A∣+∣B∣−∣A∩B∣|A \cup B| = |A| + |B| - |A \cap B|

Why subtract the intersection? Elements in both sets get counted twice if you just add.

Example:

A={1,2,3},B={2,3,4}A = \{1, 2, 3\}, \quad B = \{2, 3, 4\}

  • ∣A∣=3|A| = 3
  • ∣B∣=3|B| = 3
  • A∩B={2,3}A \cap B = \{2, 3\}, so ∣A∩B∣=2|A \cap B| = 2

∣A∪B∣=3+3−2=4|A \cup B| = 3 + 3 - 2 = 4

Check: A∪B={1,2,3,4}A \cup B = \{1, 2, 3, 4\} — yes, 4 elements.


Disjoint Sets

If two sets have no overlap:

A∩B=∅A \cap B = \emptyset

Then:

∣A∪B∣=∣A∣+∣B∣|A \cup B| = |A| + |B|

No need to subtract — nothing is counted twice.


Cardinality of Cartesian Product

∣A×B∣=∣A∣×∣B∣|A \times B| = |A| \times |B|

Multiply the sizes.

Example:

A={1,2},B={a,b,c}A = \{1, 2\}, \quad B = \{a, b, c\}

∣A×B∣=2×3=6|A \times B| = 2 \times 3 = 6


Cardinality of Power Set

∣P(A)∣=2∣A∣|\mathcal{P}(A)| = 2^{|A|}

A set with nn elements has 2n2^n subsets.

Example:

A={1,2,3}A = \{1, 2, 3\}

∣P(A)∣=23=8|\mathcal{P}(A)| = 2^3 = 8


Summary

OperationCardinality
A∪BA \cup B∥A∥+∥B∥−∥A∩B∥\|A\| + \|B\| - \|A \cap B\|
A∪BA \cup B (disjoint)∥A∥+∥B∥\|A\| + \|B\|
A×BA \times B∥A∥×∥B∥\|A\| \times \|B\|
P(A)\mathcal{P}(A)2∥A∥2^{\|A\|}

Cardinality = counting elements.