On this concept: Formula

Not sure which lesson to do first? Find your level and get a plan →

Math · Sets & Logic · Grade 9-12

Cardinality

Cardinality is the number of distinct elements in a finite set, written ∣A∣.

∣A∪B∣=∣A∣+∣B∣−∣A∩B∣ (inclusion-exclusion principle)

Quick Answer

Cardinality is the number of distinct elements in a finite set, written ∣A∣. Use it whenever a question asks 'how many' about a collection: how many different letters a word uses, how many students take art or music, how many outcomes an experiment has. Count each different member once, so ∣{a,a,b}∣=2. For overlapping sets, the inclusion-exclusion principle ∣A∪B∣=∣A∣+∣B∣−∣A∩B∣ removes the double count.

Why This Matters

Cardinality is the bridge from sets to counting and probability: a probability such as 38 is the size of an event set divided by the size of the sample space. Inclusion-exclusion lets you count a union from overlapping data, as in surveys. Without care about distinct members and overlaps, counts come out too high, and probabilities built on them can even exceed 1.

Intuitive Explanation

The cardinality of a set is its size: the number of different members. ∣{red,green,blue}∣=3 and ∣∅∣=0. Because a set ignores repeats, the word MISSISSIPPI has 11 letters but its set of letters {M,I,S,P} has cardinality 4. A member that is itself a set counts as one: ∣{{1,2},3}∣=2.

Cardinality gets interesting when sets overlap. If 18 students take art, 15 take music and 6 take both, the sum 18+15=33 counts those 6 twice, once in each group. Subtracting them once gives ∣A∪M∣=18+15−6=27. That is the inclusion-exclusion principle: include both sets, then exclude the overlap. For three sets the pattern continues: add the three sizes, subtract the three pairwise overlaps, then add back the part in all three.

Don't confuse the size of a set with the number of its subsets. The set {a,b,c} has cardinality 3, but it has 23=8 subsets, because each member is either in or out of a subset: 2×2×2 choices. Adding one member adds 1 to the cardinality but doubles the number of subsets.

Think of it like this. Cardinality is the head count at a party, not the number of times the door opened: a guest who stepped out and came back is still one person. Inclusion-exclusion is how you merge two guest lists that overlap: add both lists, then subtract everyone who appears on both.

Core idea. Cardinality is the count of distinct elements in a set, written ∣A∣.


When to Use

Use cardinality when the question asks how many distinct members a set has: 'different', 'unique', 'how many students take at least one'. With overlapping groups and an 'or' question, use inclusion-exclusion. If repeats count, as in total coins or total votes, you are counting a list, not a set. If the question asks how many groups or selections can be formed, count subsets (2n) or combinations, not members.

Tip. Ask: Am I counting how many distinct elements a set has, each once?

How to Recognize It

Before you count, settle which objects count as the same, which groups overlap, and whether the question wants members or ways of choosing them.

  1. Could the same object appear more than once in the data, like a repeated letter or a voter who signed two petitions?

    If yes, and the question wants different objects, count each once: MISSISSIPPI uses only 4 letters. If it wants the total number of signatures, every copy counts, and you are counting a list, not a set.

  2. Are you combining two groups that might share members?

    If yes, use inclusion-exclusion, ∣A∪B∣=∣A∣+∣B∣−∣A∩B∣. If no, the groups are disjoint and the sum ∣A∣+∣B∣ is exact, the one case where simply adding the sizes is safe.

  3. Is the question really about how many groups, teams or selections can be formed?

    If yes, you are counting subsets, 2n of them, or combinations such as (52)=10 pairs, not members. If no, and it asks for the size of one set, count its elements.

  4. Is the set described by a rule over a range, such as the multiples of 7 up to 100?

    If yes, count without listing: the members run from 7×1 to 7×14=98, so there are 14. If no, and the members are listed, count each distinct one once.

Cardinality compared with Sum of two cardinalities, Number of subsets (power set size), and Element

Cardinality, adding two sizes, counting subsets and naming an element all answer questions about the same set, so they blur in counting problems. Ask what one unit of your count is: a distinct member, a member of possibly overlapping groups, a subset, or one particular item.

Cardinality

Meaning
Use this when you need the size — the number of distinct members — of a set.
Key test
Am I counting how many distinct elements a set has, each once?
Formula
∣A∪B∣=∣A∣+∣B∣−∣A∩B∣ (inclusion-exclusion principle)
Example
In a class, 18 students take art and 15 take music; 6 take both. How many take art or music?

Sum of two cardinalities

Meaning
Adds counts and double-counts shared elements.
Key test
Use only for disjoint sets; otherwise apply inclusion-exclusion.
Formula
∣A∪B∣=∣A∣+∣B∣−∣A∩B∣
Example
∣A∣+∣B∣ overcounts when A∩B≠∅

Number of subsets (power set size)

Meaning
Counts subsets, which grows as 2∣A∣, not the elements.
Key test
Use when asked how many subsets a set has.
Formula
2∣A∣
Example
A 3-element set has 23=8 subsets

Element

Meaning
Names one member rather than counting them.
Key test
Use when you mean a specific item, not the total size.
Formula
x∈A
Example
∣A∣=3 but 2 is one element

Formula & Notation

∣A∪B∣=∣A∣+∣B∣−∣A∩B∣ (inclusion-exclusion principle)
∣A∪B∣=∣A∣+∣B∣−∣A∩B∣ (inclusion-exclusion); ∣A∣=n⇔∃ a bijection f:A→{1,2,…,n}

How to read it: ∣A∣ or n(A)

Worked Examples

Example 1 — Count with overlap

Easy

In a class, 18 students take art and 15 take music; 6 take both. How many take art or music?
Show the steps and the answer
  1. Name the sets: A = art students and M = music students, with ∣A∣=18, ∣M∣=15, ∣A∩M∣=6.

    'Art or music' asks for the size of the union A∪M.

  2. Add the two sizes: 18+15=33.

    This counts each of the 6 students who take both classes twice, once in A and once in M.

  3. Subtract the overlap once: 33−6=27.

    Inclusion-exclusion, ∣A∪M∣=∣A∣+∣M∣−∣A∩M∣, leaves every student counted exactly once.

  4. Check by regions: art only 18−6=12, music only 15−6=9, both 6; 12+9+6=27.

    Three non-overlapping regions can be added directly, and they give the same 27.

Answer: 27 students

Takeaway: For an 'or' count with overlap, add the sizes and subtract the overlap once.

Example 2 — Counting subsets

Standard

How many subsets does a 3-element set {a,b,c} have?
Show the steps and the answer
  1. Note that the set has 3 members, so its cardinality is 3.

    The question asks about subsets, which is a different count from the number of members.

  2. For each member decide in or out: a (2 ways), b (2 ways), c (2 ways).

    A subset is fixed exactly by those three yes-or-no choices.

  3. Multiply: 2×2×2=23=8.

    Each combination of choices gives a different subset.

  4. List them to confirm: ∅, {a}, {b}, {c}, {a,b}, {a,c}, {b,c}, {a,b,c}.

    The list includes the empty set and the whole set, and it has 8 entries.

Answer: 23=8 subsets

Takeaway: A set with n members has 2n subsets: each new member adds 1 to the cardinality but doubles the subset count.

Example 3 — Find the mistake: counting rolls instead of faces

Application

A die is rolled 10 times, giving 3, 5, 3, 1, 6, 5, 3, 2, 6, 1. Kai is asked how many different faces appeared and writes: "Let F={3,5,3,1,6,5,3,2,6,1}, so ∣F∣=10." Find the mistake and correct it.
Show the steps and the answer
  1. Tally the repeats in Kai's braces: 3 appears 3 times; 5, 1 and 6 appear twice each; 2 appears once.

    Those tallies add to 3+2+2+2+1=10, the number of rolls, but a set lists each member once.

  2. Write the set without repeats: F={1,2,3,5,6}.

    These are the faces that appeared at least once.

  3. Count: ∣F∣=5.

    Kai's 10 is the length of the list of rolls, not the size of the set of faces.

  4. Check: a die has 6 faces and only 4 never appeared, so ∣F∣=6−1=5.

    A set of faces can never have more than 6 members, so 10 was impossible.

Answer: ∣F∣=5: the faces 1, 2, 3, 5 and 6 appeared.

Takeaway: Cardinality counts different members; the number of entries in a list with repeats is a different number.

Where You'll See It

  • Survey of streaming services

    A survey of 200 households finds 120 use Service A, 90 use Service B and 50 use both. Households using at least one: 120+90−50=160, so 200−160=40 use neither. Reporting the plain sum, 210, would claim more households than were surveyed.

  • Unique visitors to a website

    A website counts page views and unique visitors separately. If 3 people view 4, 2 and 6 pages, there are 12 page views, but the set of visitors has cardinality 3. Advertisers care about the unique count, because it measures how many different people saw an ad.

  • Light-switch patterns

    A room with 4 independent light switches has 24=16 on/off patterns, because each pattern is a subset of switches that are on. The set of switches has cardinality 4, but the set of patterns has cardinality 16, including all-off and all-on.

Common Mistakes

  1. The slip: Counting a repeated listing twice, like ∣{a,a,b}∣=3

    Instead: distinct elements only, so it is 2.

  2. The slip: Using ∣A∣+∣B∣ for the union when sets overlap

    Instead: subtract ∣A∩B∣ via inclusion-exclusion.

  3. The slip: Confusing cardinality with the number of subsets

    Instead: elements count linearly, subsets count as 2∣A∣.


Mini Practice

Try these on your own. Tap Reveal when you want to check.

  1. Find the cardinality of the set of letters in the word COMMITTEE.

    Hint: List each distinct letter once before you count.

  2. In a group of 50 students, 32 play a sport, 21 play an instrument, and 9 do both. How many do neither?

    Hint: Find how many do at least one activity first.

  3. ∣A∣=15, ∣B∣=11 and ∣A∪B∣=20. Find ∣A∩B∣.

    Hint: Use ∣A∪B∣=∣A∣+∣B∣−∣A∩B∣ and solve for the overlap.

  4. How many whole numbers from 1 to 200 are multiples of 7 or multiples of 11?

    Hint: Count each set, then remove the numbers counted twice: the multiples of 77.

  5. A set A has 5 elements. One person asks how big A is; another asks how many subsets A has. Which question is about the cardinality of A, and what are both answers?

    Hint: Are you counting elements or counting collections of elements?

  6. Club A has 14 members and club B has 10. Three students are in both. Rita says, "∣A∪B∣=24." Correct Rita.

    Hint: Were the 3 shared students counted once or twice?

Want the full set?

50 practice questions for this concept — free to try, every one with a complete worked solution showing the why, not just the answer.

Frequently Asked Questions

Can two infinite sets have different sizes?

Yes. Georg Cantor defined two sets to have the same cardinality when their members can be paired off one to one. The even numbers pair with all the whole numbers (n↔2nn \leftrightarrow 2n), so those two infinite sets are the same size, even though one sits inside the other. But in 1874 Cantor proved that the real numbers cannot be paired off with the whole numbers: there are strictly more of them.

Why is cardinality written with the same bars as absolute value?

The bars measure size in both cases. ∣−5∣=5|-5| = 5 is the size of a number, its distance from 0, and ∣A∣|A| is the size of a set, its number of members. The context tells you which is meant: a number or expression inside the bars means absolute value, and a set means cardinality. Some books write n(A)n(A) or #A\#A for cardinality to avoid the clash.

How can I count the members of a set without listing them?

Match each member to a number you can count. The multiples of 6 from 1 to 200 are 6×16 \times 1 up to 6×336 \times 33, since 6×33=1986 \times 33 = 198 and 6×34=2046 \times 34 = 204, so there are 33 of them. The whole numbers from 15 to 40, inclusive, number 40−15+1=2640 - 15 + 1 = 26; forgetting the +1+1 is a classic error, often called the fencepost error.

How do websites count unique visitors?

A page-view counter counts a list: every visit adds 1, even a repeat visit from the same person. A unique-visitor count is a cardinality: each device or account counts once, however often it returns. If 40 people visit a page 100 times in total, the list has 100 entries but the set of visitors has cardinality 40. Advertisers usually care most about the second number.

Learning Path

← Before

SetElement
Cardinality

You are here

Next →

Nothing after this yet
You need Set and Element: what counts as a member and why repeats collapse. Cardinality attaches a number to each set and gives inclusion-exclusion for unions. It leads to counting principles and combinations, to probability as (size of the event)/(size of the sample space), and to comparing infinite sets, where the whole numbers and the even numbers turn out to have the same cardinality.

See Also