01 / 20

Common Pitfalls in
Counting

Master the art of avoiding errors in combinatorics: miscounting, double counting, and invalid assumptions that derail even experienced problem-solvers.

Discrete Math

Why Counting Goes Wrong

Counting problems look deceptively simple: just add or multiply. But three recurring errors trip up students at every level. Understanding why these mistakes happen is the first step to eliminating them.

Miscounting
Arriving at the wrong total because a case is missed or an off-by-one error occurs.
Double Counting
Counting the same element or configuration more than once, inflating the result.
Invalid Assumptions
Applying a formula or principle where its preconditions are not actually met.

Pitfall 1: Miscounting

Miscounting occurs when you fail to enumerate all cases or make boundary errors. The classic example: "How many integers from \( 1 \) to \( n \)?" The answer is \( n \), but "from \( a \) to \( b \) inclusive" gives \( b - a + 1 \), not \( b - a \).

\( 3 \)
\( 4 \)
\( 5 \)
\( 6 \)
\( 7 \)
\( 8 \)
\( 9 \)
\( 9 - 3 + 1 = 7 \) integers
✕ Not \( 9 - 3 = 6 \)

Pitfall 2: Double Counting

Double counting happens when your counting scheme overlaps: the same outcome is reached by two or more branches of your enumeration. This is where the Inclusion-Exclusion Principle becomes essential.

A
B
Only A
\( A \cap B \)
Only B
\( |A \cup B| = |A| + |B| - |A \cap B| \)

Pitfall 3: Invalid Assumptions

An "invalid assumption" is applying a formula or rule outside its domain. Common examples include treating dependent choices as independent, assuming order matters when it does not (or vice versa), and confusing "with replacement" and "without replacement."

Independence
Multiplying probabilities or counts only works when choices do not affect each other.
Order
Using \( P(n,r) \) when order is irrelevant overcounts by \( r! \). Use \( C(n,r) \) instead.
Replacement
Drawing with replacement gives \( n^r \) outcomes; without replacement gives \( \frac{n!}{(n-r)!} \).

The Inclusion-Exclusion Principle

Inclusion-Exclusion is the primary tool for correcting double counts. For two sets, the formula is straightforward. For three sets, there is an extra correction layer.

Permutations vs Combinations

Confusing these two is the single most common invalid assumption in counting. The question to ask is: "Does the order of selection matter?"

Permutation \( P(n,r) \) Combination \( C(n,r) \)
Order matters? Yes No
Formula \( \frac{n!}{(n-r)!} \) \( \frac{n!}{r!(n-r)!} \)
Example Arranging 3 books on a shelf Choosing 3 books to read
Relationship \( P(n,r) = C(n,r) \times r! \)

A Checklist for Correct Counting

1
Identify the universe. What exactly is being counted? Define the set of outcomes clearly before computing anything.
2
Check for overlap. If you split into cases, ask: "Can an outcome belong to more than one case?" If yes, apply Inclusion-Exclusion.
3
Order or no order? Decide whether the arrangement matters. Use permutations for ordered selections, combinations for unordered.
4
Replacement or not? Determine whether items can be reused. This changes the count formula fundamentally.
5
Sanity-check with small cases. Verify your formula on \( n = 3 \) or \( n = 4 \) where you can list every outcome by hand.

Example 1: Fencepost Error

Problem: How many multiples of 3 are there from 12 to 99 inclusive?

1
The smallest multiple of 3 in the range is \( 12 \) and the largest is \( 99 \).
2
Rewrite as \( 3 \times 4, 3 \times 5, \ldots, 3 \times 33 \). So we need the count from 4 to 33 inclusive.
3
Apply the fencepost formula: \( 33 - 4 + 1 = \) \( 30 \).

Example 2: Double Counting with Sets

Problem: In a class of 40 students, 22 study French, 18 study Spanish, and 8 study both. How many study at least one language?

French
Spanish
14
8
10
\( 22 + 18 - 8 = 32 \) students

Example 3: Invalid Assumption

Problem: A committee of 3 is chosen from 10 people. How many committees are possible?

✕ Wrong approach
Using \( P(10,3) = 10 \times 9 \times 8 = 720 \). This counts every ordering of the same 3 people as a different committee.
✓ Correct approach
Using \( C(10,3) = \frac{720}{3!} = \frac{720}{6} = 120 \). Order does not matter for a committee.

Example 4: Three-Set Inclusion-Exclusion

Problem: How many integers from 1 to 100 are divisible by 2, 3, or 5?

1
Divisible by 2: \( \lfloor 100/2 \rfloor = 50 \). By 3: \( \lfloor 100/3 \rfloor = 33 \). By 5: \( \lfloor 100/5 \rfloor = 20 \).
2
By 6: \( 16 \). By 10: \( 10 \). By 15: \( 6 \). By 30: \( 3 \).
3
Apply the formula: \( 50 + 33 + 20 - 16 - 10 - 6 + 3 = \) \( 74 \).

Overcounting from Symmetry

When objects are identical or positions are indistinguishable, brute-force enumeration overcounts. Two common scenarios:

Identical Objects
Arranging the letters in "MISSISSIPPI" requires dividing by the factorials of repeated letters: \( \frac{11!}{4! \cdot 4! \cdot 2!} \).
Circular Arrangements
Seating \( n \) people around a round table: fix one person's seat, then arrange the remaining \( (n-1)! \) ways.

Independent vs Dependent Choices

The multiplication principle says: if choice A has \( m \) options and choice B has \( n \) options, the total is \( m \times n \). But this only works when B's options do not depend on A's selection.

Independent Dependent
Definition Choice B's count is the same regardless of A Choice B's count changes based on A
Formula \( m \times n \) Must sum over cases or use conditional counts
Example Pick a shirt (5) and pants (4): \( 5 \times 4 = 20 \) Pick 2 people from 10 without replacement: \( 10 \times 9 \)

Top Mistakes to Avoid

✕ Off-by-One
Forgetting the \( +1 \) in the fencepost formula. Integers from \( a \) to \( b \) inclusive: \( b - a + 1 \).
✕ Ignoring Overlap
Adding case counts without checking if cases share outcomes. Always ask: "Can an item be in more than one case?"
✕ Wrong Formula Choice
Using \( P(n,r) \) when \( C(n,r) \) is needed, or vice versa. Always determine whether order matters first.
✕ Assuming Independence
Multiplying counts as if each stage has the same number of options when earlier choices restrict later ones.

Summary of Pitfalls and Fixes

Pitfall What Goes Wrong Fix
Miscounting Off-by-one, missed cases Fencepost rule, list small cases
Double Counting Overlapping cases inflate totals Inclusion-Exclusion Principle
Wrong Order \( P \) vs \( C \) confusion Ask: "Does rearranging matter?"
False Independence Multiplying when stages are linked Track how counts change per stage
Symmetry Ignored Identical items treated as distinct Divide by the symmetry group size

Question 1 of 5

How many integers are there from 15 to 85 inclusive?

Question 2 of 5

In a group of 50 people, 30 like tea, 25 like coffee, and 10 like both. How many like neither?

Question 3 of 5

A student uses \( P(8,3) = 336 \) to count the number of 3-person study groups from 8 students. What went wrong?

Question 4 of 5

How many integers from 1 to 60 are divisible by either 4 or 6?

Question 5 of 5

A password consists of 4 digits chosen without replacement from \( \{0, 1, 2, \ldots, 9\} \). A student computes \( 10^4 = 10{,}000 \). What pitfall did they fall into?