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

AB=A+BAB|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
  • AB={2,3}A \cap B = \{2, 3\}, so AB=2|A \cap B| = 2

AB=3+32=4|A \cup B| = 3 + 3 - 2 = 4

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


Disjoint Sets

If two sets have no overlap:

AB=A \cap B = \emptyset

Then:

AB=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)=2A|\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
ABA \cup BA+BAB\|A\| + \|B\| - \|A \cap B\|
ABA \cup B (disjoint)A+B\|A\| + \|B\|
A×BA \times BA×B\|A\| \times \|B\|
P(A)\mathcal{P}(A)2A2^{\|A\|}

Cardinality = counting elements.