Cardinality & Counting

Power sets, inclusion-exclusion, and comparing set sizes

Cardinality & Counting

How big is a set? For small sets you count, but a few clever ideas let you measure size without counting at all.

Power Set Explorer

Add or remove elements and watch the number of subsets double or halve. Turn on the Hasse diagram to see how the subsets nest.

Power Set Generator

Explore all subsets of a set, organized by size

S = {a, b, c}
|P(S)| = 2^|S| = 2^3 = 8 subsets
0 elements -- C(3,0) = 1 subset
{}
1 element -- C(3,1) = 3 subsets
{a}
{b}
{c}
2 elements -- C(3,2) = 3 subsets
{a, b}
{a, c}
{b, c}
3 elements -- C(3,3) = 1 subset
{a, b, c}
Go deeper:Cardinality & Counting

The cardinality of a set measures its size -- the number of elements it contains. For finite sets this is simply counting, but the concept extends far beyond: power sets grow exponentially, inclusion-exclusion handles overlaps, and bijections let us compare sizes without counting at all.

These counting principles are the bridge between set theory and combinatorics, and they lay the groundwork for understanding infinite cardinalities.

Key insight: The power set of an n-element set has exactly 2ⁿ elements. Each element is either in a subset or not, giving 2 choices per element. This exponential growth is why |P(S)| > |S| always -- even for infinite sets.

Inclusion-Exclusion Principle

Choose two or three sets, set the sizes with the sliders, then step through the count. Watch each subtraction undo a double count.

Inclusion-Exclusion Principle

Watch how alternating addition and subtraction gives the correct count

AB
Step 0/3
Start: 0

|A union B| = |A| + |B| - |A intersection B|

Go deeper:Inclusion-Exclusion Principle

Key insight: |A ∪ B| = |A| + |B| − |A ∩ B|. Without subtracting the intersection, elements in both sets get counted twice. For three or more sets, the pattern alternates: add singles, subtract pairs, add triples, and so on.

Cardinality Comparison

Pick a pair of sets, click an element on the left and then one on the right to pair them, then press Check Bijection. Can every element find exactly one partner?

Cardinality Comparison

Build a bijection between sets to compare their cardinalities

{1, 2, 3} and {a, b, c} -- different elements, same cardinality

Click an element in Set A, then click an element in Set B to create a mapping. Click a mapped element in A to remove its mapping.
Set A (|A| = 3)
Set B (|B| = 3)
Go deeper:Cardinality Comparison

Key insight: A bijection between two sets proves they have the same size, even when you cannot count the elements. This idea becomes essential for infinite sets, where "counting" breaks down entirely.

Key Takeaways

  • |P(S)| = 2ⁿ -- the power set always has exponentially more elements than the original set
  • Inclusion-exclusion -- the systematic way to count elements in unions of overlapping sets
  • Bijections prove equal cardinality -- a perfect pairing means two sets are the same size
  • From finite to infinite -- these principles generalize to measure the sizes of infinite sets

Spot a mistake or have an idea?

Search