,

Combinatorics studies discrete arrangements and how to count them. To count a collection, identify its objects, decide when two descriptions represent the same object, and organise the collection so each object is counted once.

The existing counting, permutation and combination lessons establish the basic formulas. This page develops the arguments behind more demanding counts: bijections, double counting, overlaps, pigeonholes, paths and distributions with restrictions.

On this page

Count the same objects through a bijection

A bijection pairs every object in one finite collection with exactly one object in another, with no omissions or repetitions. The two collections therefore have the same size.

Consider six-position binary strings with exactly two ones. Each string is determined by the two positions occupied by its ones. For example, 010010010010 corresponds to the subset {2,5}\{2,5\} of {1,2,3,4,5,6}\{1,2,3,4,5,6\}. Every two-position subset produces exactly one such string, so the count is

(62)=15\binom62=15

This argument is stronger than noting that two formulas happen to match. It explains why the objects themselves correspond. A coding rule that sent two different strings to the same subset would not be a bijection.

Double-count a marked selection

Choose a three-person committee from seven people and designate one member as chair. Count these marked committees in two ways.

First choose the chair, then select the other two members from the remaining six:

7(62)=7(15)=1057\binom62=7(15)=105

Alternatively, choose the committee first, then select its chair:

(73)⋅3=35(3)=105\binom73\cdot3=35(3)=105

Both procedures count each committee-with-chair exactly once. The same reasoning proves, for integers 1≤r≤n1\le r\le n,

n(n−1r−1)=r(nr)n\binom{n-1}{r-1}=r\binom nr

An unmarked committee is a different object. Forgetting the chair divides this count by three, not by seven.

Correct overlapping counts with inclusion-exclusion

How many integers from 1 through 30 are divisible by two or three? There are 15 multiples of two and ten multiples of three. Five numbers are multiples of both because they are multiples of six.

15+10−5=2015+10-5=20

Subtracting the overlap once corrects the fact that it was counted twice in the first two totals. Ten of the thirty integers belong to neither category.

For three sets, the corresponding rule is

|A∪B∪C|=|A|+|B|+|C|−|A∩B|−|A∩C|−|B∩C|+|A∩B∩C||A\cup B\cup C|=|A|+|B|+|C|-|A\cap B|-|A\cap C|-|B\cap C|+|A\cap B\cap C|

Each pairwise intersection here includes objects in all three sets. An object belonging to all three was counted three times, then subtracted three times, so it must be added back once. Venn Diagrams gives a region-by-region way to track the same calculation.

Guarantee a repetition with the pigeonhole principle

If more than k objects are placed into k categories, at least one category contains more than one object. More generally, placing n objects into k labelled categories, with k≥1k\ge1, guarantees that some category contains at least ⌈n/k⌉\lceil n/k\rceil objects. The categories themselves need not all receive an object.

With 23 objects and five boxes, some box must contain at least five. If every box contained at most four, the total could not exceed twenty. This proves the guarantee without specifying which box is crowded.

A less obvious application begins with six distinct integers chosen from 1 through 10. Group the ten available integers into five pairs:

{1,10},{2,9},{3,8},{4,7},{5,6}\{1,10\},\ \{2,9\},\ \{3,8\},\ \{4,7\},\ \{5,6\}

Selecting six numbers must completely select at least one pair. That pair sums to eleven. Five choices would not be enough to guarantee this: choosing 1,2,3,4,51,2,3,4,5 takes only one number from each pair.

Grouping ten integers into five pairs

Five sum-eleven pairs force a complete pair among six choicesThe numbers one through ten are paired to sum to eleven. An example selection of one through six chooses both members of the last pair.Six selected numbers, but only five pairsPair 1110Pair 229Pair 338Pair 447Pair 556Example selected set: {1, 2, 3, 4, 5, 6}Filled markers are selected; the paired sums are all 11.
This one selection illustrates the pairing. The proof applies to every six-element subset of {1,…,10}.
Diagram explanation and exact data

Six distinct selections occupy only five pair categories. If no pair were fully selected, at most five numbers could be chosen. At least one selected pair therefore sums to eleven.

Grouping ten integers into five pairs: exact reference data
Pair Members Sum
1 1, 10 11
2 2, 9 11
3 3, 8 11
4 4, 7 11
5 5, 6 11

Count paths by their steps

On an integer grid, travel from (0,0)(0,0) to (4,3)(4,3) using only unit steps east and north. Every route has seven steps: four east and three north. Choosing the three positions of the north steps determines the route.

Number of routes=(73)=35\text{Number of routes}=\binom73=35

Now require the route to pass through (2,1)(2,1). The first segment needs two east and one north step, giving (31)=3\binom31=3 choices. The remaining segment needs two east and two north steps, giving (42)=6\binom42=6 choices.

Routes through (2,1)=3⋅6=18\text{Routes through }(2,1)=3\cdot6=18

Every allowed route reaches that point at most once, so this split counts each qualifying route once. The number avoiding it is 35−18=1735-18=17.

Split a constrained route at its required point

Monotone grid routes can be counted at every vertexRoutes use east and north unit steps. Counts at vertices form Pascal sums, with thirty-five routes to four comma three and eighteen through two comma one.1111123413610141020151535012340123Counts from (0,0), using only east and north(2,1)One route is drawn; vertex labels count all allowed routes.
Numbers beside vertices are route counts, not edge lengths. The outlined route is one example.
Diagram explanation and exact data

There are 35 routes to (4,3). Three reach (2,1), and six continue from there to (4,3), giving 18 through-routes and 17 avoiding routes.

Split a constrained route at its required point: exact reference data
Vertex (x,y) Routes from origin
(0,0) 1
(1,0) 1
(2,0) 1
(3,0) 1
(4,0) 1
(0,1) 1
(1,1) 2
(2,1) 3
(3,1) 4
(4,1) 5
(0,2) 1
(1,2) 3
(2,2) 6
(3,2) 10
(4,2) 15
(0,3) 1
(1,3) 4
(2,3) 10
(3,3) 20
(4,3) 35

Allowing west steps, diagonal steps or revisits would change the problem. The binomial count is tied to the stated move restrictions, not merely the endpoint coordinates.

Distribute identical objects into labelled groups

Suppose seven identical counters are distributed among three labelled boxes, with empty boxes allowed. Let the box counts be x1,x2,x3x_1,x_2,x_3. We seek non-negative integer solutions of

x1+x2+x3=7x_1+x_2+x_3=7

Represent the seven counters by stars and separate the three groups with two bars. For example, **|***|** represents (2,3,2)(2,3,2). The nine-symbol string is determined by the two bar positions:

(92)=36\binom92=36

Adjacent bars represent an empty middle box; a bar at an end represents an empty first or last box. The boxes are labelled, so (2,3,2)(2,3,2) and (3,2,2)(3,2,2) are different allocations.

If each box must contain at least one counter, place one in each first. Distributing the remaining four gives (62)=15\binom62=15 allocations.

Add an upper bound

Keep empty boxes allowed, but require x1≤3x_1\le3. Start with the unrestricted 36 and subtract allocations with x1≥4x_1\ge4. Set y1=x1−4y_1=x_1-4. Then

y1+x2+x3=3,y1,x2,x3≥0y_1+x_2+x_3=3,\qquad y_1,x_2,x_3\ge0

There are (52)=10\binom52=10 excluded allocations. Therefore 36−10=2636-10=26 satisfy the upper bound. The shift is a bijection: each excluded allocation corresponds to exactly one solution of the smaller sum.

Check the counting object before accepting the answer

A valid count must include every permitted object once. Check order, repeated objects, labels, empty choices and overlapping categories. These questions decide whether a product, quotient, complement or case split is valid.

For example, the stars-and-bars calculation does not assign probabilities to the allocations. A physical experiment that throws seven distinguishable counters into boxes generally gives different probabilities to different box-count triples. A count becomes a probability only after a selection model specifies the weights.

Practice questions

  1. How many eight-position binary strings have exactly three ones?
  2. How many east/north routes go from (0,0)(0,0) to (3,2)(3,2), and how many of them pass through (1,1)(1,1)?
  3. How many non-negative integer triples satisfy x1+x2+x3=5x_1+x_2+x_3=5?
Check your answers
  1. Choose the three one-positions: (83)=56\binom83=56.
  2. The total is (52)=10\binom52=10. Through (1,1)(1,1) there are (21)(31)=2(3)=6\binom21\binom31=2(3)=6 routes. Each segment’s step choices determine a unique complete route.
  3. Five stars and two bars give (72)=21\binom72=21 triples. Empty labelled boxes are included.

Related topics

Counting Principle, Permutations and Combinations provide focused technique references. Recurrence Relations counts arrangements through smaller cases, while Graph Theory: Introduction changes the emphasis from counting selections to describing connections.

Sources and further reading