CombinatoricsIntermediate9 min read#combinatorics#bijection#double counting

Counting Without Listing: Bijections, Double Counting and Inclusion–Exclusion

Combinatorics is not enumeration. It is finding a structure that turns a messy count into a clean product, a symmetry, or two counts of the same thing.

Olympiad Desk · Core Learning

What you will take away

  • A bijection proves two sets are the same size without counting either one
  • Double counting: count the same collection two ways and equate the totals
  • Inclusion–exclusion handles "at least one" conditions
  • Complementary counting is usually shorter than direct counting

Bijections

If you can pair every object of a hard set with an object of an easy set, the hard set has the same size. Subsets of an n-element set pair with binary strings of length n; compositions pair with arrangements of sticks and stars; monotone lattice paths pair with strings of steps.

Double counting

Count incidences (edge–vertex pairs, person–handshake pairs, flag–flag pairs) twice: once by grouping on one side, once on the other. Equating the two expressions often yields the identity the problem is asking for, with no algebra required.

Worked problems

  1. 1

    How many subsets does a set with n elements have?

    Show hint

    Pair each subset with a string of n yes/no decisions.

    Show solution

    Each element is either in the subset or not: 2 independent choices per element, so there are 2ⁿ binary strings of length n, and pairing subset ↔ string is a bijection.

    Answer: 2ⁿ subsets.

  2. 2

    In a group of 40 people, prove that the number of people who know an odd number of other people in the group is even.

    Show hint

    Sum all degrees and count the edges twice.

    Show solution

    The sum of all degrees is 2 · #pairs, which is even. The sum of an even total of degrees splits into the odd-degree people and the even-degree people; the even-degree part contributes an even amount, so the odd-degree part must also sum to an even number — which means it contains an even number of people.

    Answer: There is an even number of people with an odd number of acquaintances.

Keep going

More guides on the same idea, or the next step up.

All guides
The Pigeonhole Principle: Your First Move on Most Olympiad Problems

The Pigeonhole Principle: Your First Move on Most Olympiad Problems

If n+1 pigeons sleep in n holes, one hole is crowded — and that single sentence wins a shocking number of olympiad problems. Here is how to spot the pigeons hidden inside a statement.

CombinatoricsFoundation7 min read
Invariants and Monovariants: Proving That Something Is Impossible

Invariants and Monovariants: Proving That Something Is Impossible

When a problem asks whether a configuration can ever be reached, stop simulating and start looking for a quantity that never changes — or always changes the same way.

CombinatoricsAdvanced10 min read
Modular Arithmetic in Ten Minutes: Remainders That Solve Equations

Modular Arithmetic in Ten Minutes: Remainders That Solve Equations

Last digits, divisibility, and equations that look impossible — almost all of them collapse once you stop tracking numbers and start tracking remainders.

Number TheoryFoundation8 min read
Angle Chasing: Geometry When You Cannot See the Picture

Angle Chasing: Geometry When You Cannot See the Picture

Most olympiad geometry starts with a fact you already know from school. The skill is knowing which fact to apply next — and how to keep the chain short.

GeometryIntermediate9 min read