Skip to content

Introduction and Fundamental Principles of Counting

Long before combinatorics became a formal pillar of mathematics, it thrived as recreational mathematics—a playground of puzzles, games, and number patterns. Many enduring mathematical ideas began when curious minds tried to solve such puzzles purely for the pleasure of discovery.

Consider a magic square: a square grid of numbers in which every row, every column, and both main diagonals add up to the same constant, called the magic sum. In the classical \(3 \times 3\) magic square below, the integers \(1\) through \(9\) are arranged so that every row, column, and diagonal sums to \(15\):

Classical 3x3 Magic Square with Magic Sum 15

Mathematicians have constructed far more elaborate magic squares, including Srinivasa Ramanujan's famous \(4 \times 4\) birthday magic square—whose top row displays his birth date 22 12 18 87 (22 December 1887) while its rows, columns, diagonals, corner \(2 \times 2\) blocks, and central \(2 \times 2\) block all sum to \(139\). Filling a Sudoku grid, determining the number of valid \(10\)-digit mobile numbers, or counting the distinct ways to form a committee all belong to this same discipline.

In essence, combinatorics is the mathematical study of arranging and selecting discrete objects—such as numbers, letters, or people—according to specified rules.


Solution Sets and the Limits of Direct Enumeration

To see how a counting problem works beneath the surface, begin with a small example where every valid configuration can be written down explicitly.

Illustrative Problem 1: Arrange \(2\) girls and \(2\) boys in a queue so that no two girls stand adjacent and no two boys stand adjacent.

Let the two girls be \(G_1, G_2\) and the two boys be \(B_1, B_2\). Because only four people are involved, we can list every alternating queue directly. Notice that a valid queue must start with either a girl or a boy:

  • Starting with a girl: \(G_1 B_1 G_2 B_2\), \(G_2 B_1 G_1 B_2\), \(G_1 B_2 G_2 B_1\), \(G_2 B_2 G_1 B_1\).
  • Starting with a boy: \(B_1 G_1 B_2 G_2\), \(B_1 G_2 B_2 G_1\), \(B_2 G_1 B_1 G_2\), \(B_2 G_2 B_1 G_1\).

Each valid arrangement is a solution of the problem. Gathering all solutions into a single set \(S\) gives the solution set:

\[S = \{G_1 B_1 G_2 B_2,\; G_2 B_1 G_1 B_2,\; G_1 B_2 G_2 B_1,\; G_2 B_2 G_1 B_1,\; B_1 G_1 B_2 G_2,\; B_1 G_2 B_2 G_1,\; B_2 G_1 B_1 G_2,\; B_2 G_2 B_1 G_1\}\]

The count we seek is simply the cardinality of \(S\), namely \(|S| = 8\).

Direct enumeration works when \(S\) is tiny, but it collapses almost immediately as the number of objects grows. Even a supercomputer cannot list all possible orderings of a standard \(52\)-card deck. The central goal of combinatorics is therefore clear: develop logical methods to compute \(|S|\) exactly without writing out the individual elements of \(S\).


Divide and Rule: Discovering the Idea of Partitioning

Before stating any formal law of counting, observe how we naturally simplify a slightly larger problem by breaking it into clean, non-overlapping pieces.

Illustrative Problem 2: Two girls (Alexa and Siri) and three boys (\(B_1, B_2, B_3\)) are to be seated in a row of \(5\) chairs so that the two girls occupy the first two chairs. In how many ways can they be seated?

Let \(S\) be the solution set of all valid seatings. Rather than attempting to list all elements of \(S\) at once, fix the first two chairs first.

Suppose Alexa sits on Chair \(1\) and Siri sits on Chair \(2\). Now only the three boys remain for Chairs \(3, 4,\) and \(5\). To count their arrangements systematically, fix who sits on Chair \(3\):

  • If \(B_1\) sits on Chair \(3\), the remaining two boys arrange on Chairs \(4\) and \(5\) in \(2\) ways: \((B_2, B_3)\) or \((B_3, B_2)\).
  • If \(B_2\) sits on Chair \(3\), the remaining two boys arrange in \(2\) ways: \((B_1, B_3)\) or \((B_3, B_1)\).
  • If \(B_3\) sits on Chair \(3\), the remaining two boys arrange in \(2\) ways: \((B_1, B_2)\) or \((B_2, B_1)\).

Hence there are \(2 + 2 + 2 = 6\) ways to seat the three boys.

Next, swap the two girls so that Siri sits on Chair \(1\) and Alexa sits on Chair \(2\). By the exact same reasoning, the three boys again arrange themselves on Chairs \(3, 4,\) and \(5\) in \(6\) ways.

Tree Diagram Showing the Partition of the Seating Solution Set

Adding the two cases yields \(6 + 6 = 12\) valid seatings.

Expressing this divide-and-rule strategy in set notation reveals why the count is exact. We split \(S\) into two subsets:

  • \(S_1\): all arrangements with Alexa on Chair \(1\) and Siri on Chair \(2\) (\(|S_1| = 6\)).
  • \(S_2\): all arrangements with Siri on Chair \(1\) and Alexa on Chair \(2\) (\(|S_2| = 6\)).

Two essential conditions hold:

  1. \(S_1 \cap S_2 = \emptyset\): No seating belongs to both \(S_1\) and \(S_2\).
  2. \(S_1 \cup S_2 = S\): Together, \(S_1\) and \(S_2\) account for every valid seating.

Because both conditions are satisfied, \(|S| = |S_1| + |S_2| = 6 + 6 = 12\).

Overcounting and Undercounting

In larger problems we do not list the elements of \(S\); we split \(S\) logically according to some chosen criterion. Whenever a logical split violates either of the two conditions above, the final count fails:

  • Overcounting occurs when parts overlap (\(S_i \cap S_j \neq \emptyset\)). Any arrangement lying in more than one part is counted two or more times.
  • Undercounting occurs when the parts fail to cover all of \(S\) (\(\bigcup S_i \subsetneq S\)). Valid arrangements are silently omitted.

Nearly every error in combinatorics traces back to faulty case-splitting that causes either overcounting or undercounting.

Scaling Up Without Enumeration

We now know that \(3\) boys can sit on \(3\) chairs in \(6\) ways. Use that single fact to solve the next case without listing a single arrangement.

Illustrative Problem 3: In how many ways can \(4\) boys (\(B_1, B_2, B_3, B_4\)) sit in a row of \(4\) chairs?

Let \(S\) be the solution set. Split \(S\) logically into four subsets \(S_1, S_2, S_3, S_4\), where \(S_k\) consists of all seatings with boy \(B_k\) on Chair \(1\).

1. No overlap: Because Chair \(1\) holds only one boy at a time, all six pairwise intersections are empty:

\[S_1 \cap S_2 = \emptyset, \quad S_1 \cap S_3 = \emptyset, \quad S_1 \cap S_4 = \emptyset, \quad S_2 \cap S_3 = \emptyset, \quad S_2 \cap S_4 = \emptyset, \quad S_3 \cap S_4 = \emptyset\]

2. No omissions: Every seating places one of the four boys on Chair \(1\), so:

\[S_1 \cup S_2 \cup S_3 \cup S_4 = S\]

In each subset \(S_k\), one boy is fixed on Chair \(1\) and the remaining \(3\) boys arrange themselves on the remaining \(3\) chairs in \(6\) ways. Thus \(|S_1| = |S_2| = |S_3| = |S_4| = 6\), giving:

\[|S| = |S_1| + |S_2| + |S_3| + |S_4| = 6 + 6 + 6 + 6 = 24\]

Partitioning and the Addition Principle

The logical splitting we just practiced has a precise name in set theory.

Definition (Partition of a Set): A collection of subsets \(S_1, S_2, \dots, S_k\) forms a partition of a set \(S\) if:

  1. Pairwise Disjoint (Mutually Exclusive): \(S_i \cap S_j = \emptyset\) for all \(i \neq j\) (\(1 \le i, j \le k\)).
  2. Exhaustive: \(S_1 \cup S_2 \cup \dots \cup S_k = S\).

Each subset \(S_i\) is called a part (or block) of the partition.

Partition of a Solution Set into Pairwise Disjoint Exhaustive Subsets

Core Strategy of Combinatorics:
To count a complicated solution set \(S\), construct a mutually exclusive and exhaustive partition of \(S\) into simpler parts whose sizes can be counted cleanly.

Theorem (Addition Principle): If a finite solution set \(S\) is partitioned into \(k\) pairwise disjoint, exhaustive parts \(S_1, S_2, \dots, S_k\), then:

\[|S| = |S_1| + |S_2| + \dots + |S_k| = \sum_{i=1}^{k} |S_i|\]

In concise operational form: if a choice can be made from one group in \(m\) ways or from another completely disjoint group in \(n\) ways, then there are \(m + n\) ways to make the choice.

Example 1: Class A has \(20\) students, \(A = \{a_1, a_2, \dots, a_{20}\}\), and Class B has \(30\) students, \(B = \{b_1, b_2, \dots, b_{30}\}\), with no student enrolled in both classes. In how many ways can a single representative be selected from either Class A or Class B?

Solution: The solution set \(S = A \cup B\) partitions cleanly into the two disjoint sets \(S_1 = A\) (\(|S_1| = 20\)) and \(S_2 = B\) (\(|S_2| = 30\)). By the Addition Principle:

\[|S| = |S_1| + |S_2| = 20 + 30 = 50\]

Example 2 (Non-Disjoint Groups — Avoiding Overcounting): A student may choose one elective from a list of \(12\) Science courses or \(10\) Mathematics courses. If \(3\) interdisciplinary courses appear on both lists, how many distinct electives are available?

Solution: Adding \(12 + 10 = 22\) overcounts because the two lists overlap in \(3\) courses. To build a valid disjoint partition, split the courses into three mutually exclusive parts: Science only (\(12 - 3 = 9\)), Mathematics only (\(10 - 3 = 7\)), and both lists (\(3\)). By the Addition Principle, the number of distinct electives is \(9 + 7 + 3 = 19\) (equivalently \(12 + 10 - 3\)). In Section 08, we generalize this overlap correction into the Principle of Inclusion–Exclusion.


The Multiplication Principle

Although often taught as an independent rule, the Multiplication Principle is a direct special case of the Addition Principle—the case in which every part of a partition has the exact same size.

To see this clearly, modify Example 1: suppose two students must be selected—the first from Class A (\(20\) students, \(\{a_1, \dots, a_{20}\}\)) and the second from Class B (\(30\) students, \(\{b_1, \dots, b_{30}\}\)).

  • If the first student is \(a_1\), the second can be chosen in \(30\) ways.
  • If the first student is \(a_2\), the second can again be chosen in \(30\) ways.
  • For every choice of \(a_i \in A\) (\(1 \le i \le 20\)), there are always \(30\) choices for the second student from \(B\).

Writing out the entire solution set \(S\) displays a \(20 \times 30\) rectangular array of ordered pairs:

\[S = \left\{ \begin{matrix} (a_1, b_1) & (a_1, b_2) & (a_1, b_3) & \cdots & (a_1, b_{29}) & (a_1, b_{30}) \\ (a_2, b_1) & (a_2, b_2) & (a_2, b_3) & \cdots & (a_2, b_{29}) & (a_2, b_{30}) \\ (a_3, b_1) & (a_3, b_2) & (a_3, b_3) & \cdots & (a_3, b_{29}) & (a_3, b_{30}) \\ \vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\ (a_{19}, b_1) & (a_{19}, b_2) & (a_{19}, b_3) & \cdots & (a_{19}, b_{29}) & (a_{19}, b_{30}) \\ (a_{20}, b_1) & (a_{20}, b_2) & (a_{20}, b_3) & \cdots & (a_{20}, b_{29}) & (a_{20}, b_{30}) \end{matrix} \right\}\]

Each row \(S_i\) contains all pairs whose first entry is \(a_i\). These \(20\) rows form a pairwise disjoint, exhaustive partition of \(S\) in which every part has equal size \(|S_i| = 30\). Applying the Addition Principle:

\[|S| = |S_1| + |S_2| + \dots + |S_{20}| = \underbrace{30 + 30 + \dots + 30}_{20 \text{ times}} = 20 \times 30 = 600\]

Theorem (Multiplication Principle):

  1. Ordered-Pair Form: If a finite set \(A\) has \(m\) elements and a finite set \(B\) has \(n\) elements, the number of ordered pairs \((a, b)\) with \(a \in A\) and \(b \in B\) is \(m \times n\).
  2. Partition Form: If a finite solution set \(S\) is partitioned into \(m\) pairwise disjoint, exhaustive parts of equal size \(n\), then \(|S| = m \times n\).

Generalization to \(k\) Steps: Given \(k\) finite sets \(A_1, A_2, \dots, A_k\) containing \(n_1, n_2, \dots, n_k\) elements respectively, choosing one element independently from each set produces \(n_1 \times n_2 \times \dots \times n_k\) ordered \(k\)-tuples.

Example 3: A room contains \(10\) men, \(8\) women, \(6\) boys, and \(4\) girls. In how many ways can a group consisting of one man, one woman, one boy, and one girl be selected?

Solution: The four selections have \(10\), \(8\), \(6\), and \(4\) choices respectively, and each count is completely independent of the others regardless of selection order. By the Multiplication Principle:

\[\text{Total ways} = 10 \times 8 \times 6 \times 4 = 1920\]

Example 4 (Combining Addition and Multiplication): Three cities \(X\), \(Y\), and \(Z\) are connected by roads: there are \(3\) roads from \(X\) to \(Y\), \(4\) roads from \(Y\) to \(Z\), and \(2\) direct highways from \(X\) to \(Z\) that bypass \(Y\). How many distinct routes lead from \(X\) to \(Z\)?

Solution: Partition all routes from \(X\) to \(Z\) into two mutually exclusive cases:

  • Case 1 (Passing through \(Y\)): Choose a road \(X \to Y\) (\(3\) ways) and a road \(Y \to Z\) (\(4\) ways). By the Multiplication Principle, this gives \(3 \times 4 = 12\) routes.
  • Case 2 (Direct from \(X\) to \(Z\)): \(2\) routes.

By the Addition Principle, there are \(12 + 2 = 14\) distinct routes in total.


Independence and the Order of Choices

Essential Condition:
The Multiplication Principle requires that the number of choices at each step remain constant regardless of the outcomes of previous steps. Whenever the size of the partition parts varies from one choice to another, direct multiplication is invalid.

Two contrasting examples make this requirement crystal clear.

Case 1: Dependent Choices Create Uneven Partitions

Example 5: From \(10\) boys and \(8\) girls, one head boy and one head girl are to be chosen. However, a girl named Amaara refuses to serve as head girl if a boy named Max is chosen as head boy. Find the number of valid selections.

Why Direct Multiplication Fails: Consider choosing the head girl first, then the head boy:

  • If Amaara is chosen as head girl, Max is excluded, leaving \(9\) choices for head boy.
  • If any of the other \(7\) girls is chosen as head girl, all \(10\) boys remain eligible.

The number of head-boy choices depends on which girl is picked. In the rectangular grid of pairs, Amaara's row contains only \(9\) pairs whereas the other \(7\) rows each contain \(10\) pairs.

Comparison of Uniform Partition (Independent Choices) vs Uneven Partition (Dependent Choices)

Method 1 (Partitioning into Uniform Blocks): Split the solution set \(S\) into two disjoint, exhaustive parts based on the exceptional girl:

  • \(S_1\): valid pairs in which Amaara is head girl. Excluding Max leaves \(9\) boys:
\[S_1 = \{(\text{Amaara}, \text{Boy } 1),\; (\text{Amaara}, \text{Boy } 2),\; \dots,\; (\text{Amaara}, \text{Boy } 9)\} \implies |S_1| = 9\]
  • \(S_2\): valid pairs in which Amaara is not head girl. Each of the remaining \(7\) girls can pair with all \(10\) boys, forming a uniform \(7 \times 10\) block:
\[S_2 = \left\{ \begin{matrix} (\text{Girl } 1, \text{Boy } 1) & (\text{Girl } 1, \text{Boy } 2) & \cdots & (\text{Girl } 1, \text{Boy } 10) \\ (\text{Girl } 2, \text{Boy } 1) & (\text{Girl } 2, \text{Boy } 2) & \cdots & (\text{Girl } 2, \text{Boy } 10) \\ \vdots & \vdots & \ddots & \vdots \\ (\text{Girl } 7, \text{Boy } 1) & (\text{Girl } 7, \text{Boy } 2) & \cdots & (\text{Girl } 7, \text{Boy } 10) \end{matrix} \right\} \implies |S_2| = 7 \times 10 = 70\]

By the Addition Principle, \(|S| = |S_1| + |S_2| = 9 + 70 = 79\).

Method 2 (Complementary Shortcut): Ignoring the restriction gives a complete \(8 \times 10 = 80\) grid of pairs. Removing the single forbidden pair \((\text{Amaara}, \text{Max})\) leaves \(80 - 1 = 79\) valid pairs.

While Method 2 is shorter here (and anticipates the Subtraction Principle below), Method 1 shows why dependence breaks multiplication and how isolating the restricted case restores uniform blocks.

Case 2: How Choice Order Preserves or Breaks Independence

Notice that independence does not require the exact same set of items to remain available at Step \(2\)—only the same count.

Example 6 (Unrestricted Roles): From a class of \(60\) students, two different students are chosen: one as class captain and one as class monitor. In how many ways can this be done?

Solution: Choose the captain in \(60\) ways. Although the identity of the remaining \(59\) students depends on who became captain, the number of remaining choices for monitor is always \(59\). Every part of the partition has equal size \(59\), so the Multiplication Principle gives \(60 \times 59 = 3540\). Reversing the order (monitor first, captain second) gives the same uniform count.

Now introduce a single restriction and compare both orders of selection.

Example 7 (Restricted Role — Choice Order Matters): A class of \(60\) students has \(40\) girls and \(20\) boys. Two different students must be chosen as class captain and class monitor, subject to the rule that only a girl may become monitor, while the captain may be either a boy or a girl. Find the number of valid selections.

Method 1 (Monitor First — Uniform Partition):

  1. Choose the monitor from the \(40\) girls: \(40\) ways.
  2. Choose the captain from the remaining \(39\) girls and \(20\) boys: \(39 + 20 = 59\) ways—always \(59\), regardless of which girl was chosen as monitor.

By the Multiplication Principle:

\[\text{Total ways} = 40 \times 59 = 2360\]

Method 2 (Captain First — Uneven Partition): If we instead choose the captain first (\(60\) ways), the number of choices left for the monitor is no longer constant:

  • If a boy becomes captain (\(20\) ways), all \(40\) girls remain eligible for monitor.
  • If a girl becomes captain (\(40\) ways), only \(39\) girls remain eligible for monitor.

Because \(20\) parts have size \(40\) while \(40\) parts have size \(39\), direct multiplication fails. We must partition \(S\) into two disjoint cases:

  • Case 1 (Boy is captain): \(20 \times 40 = 800\).
  • Case 2 (Girl is captain): \(40 \times 39 = 1560\).

By the Addition Principle, \(|S| = 800 + 1560 = 2360\).

Rule of Constraint Priority:
Whenever restrictions apply to particular roles or positions, always make the most restricted choices first. Doing so often keeps subsequent choice counts constant, allowing a single application of the Multiplication Principle instead of tedious casework.


The Subtraction Principle

Method 2 of Example 5 illustrated an idea that is often far more efficient than direct counting. In many combinatorial problems, counting the configurations that satisfy a given condition directly forces us into a maze of messy cases, whereas counting the configurations that satisfy the opposite condition—along with the unrestricted total—is effortless. In such situations, we count everything without restriction and subtract the unwanted cases.

Theorem (Subtraction Principle): Let \(U\) be the finite universal set of all configurations obtained when a restriction is relaxed, let \(A \subseteq U\) be the subset of configurations satisfying the given restriction, and let \(A' = U \setminus A\) be its complement (the configurations satisfying the opposite restriction). Then:

\[|A| = |U| - |A'|\]

Visual Comparison of the Subtraction Principle and the Division Principle

Example 8 (Repeated Letters in a Password): How many \(7\)-letter passwords can be formed using the \(26\) letters of the English alphabet such that at least one letter is repeated?

Solution: Counting \(A\) directly would require listing dozens of distinct repetition patterns (one letter repeated twice, two letters repeated twice, one repeated thrice, all seven identical, and so on). Instead, apply the Subtraction Principle:

  • \(U\) (Unrestricted universe): All \(7\)-letter passwords. Each of the \(7\) positions has \(26\) independent choices, so \(|U| = 26^7\).
  • \(A\) (Target restriction): Passwords with at least one repeated letter.
  • \(A'\) (Opposite restriction): Passwords with no repeated letter (all \(7\) letters distinct). Filling the positions from left to right gives \(26\), then \(25\), then \(24\), ..., down to \(20\) choices:
\[|A'| = 26 \times 25 \times 24 \times 23 \times 22 \times 21 \times 20\]

Therefore, the number of passwords with at least one repeated letter is:

\[|A| = |U| - |A'| = 26^7 - (26 \times 25 \times 24 \times 23 \times 22 \times 21 \times 20)\]

The Essence of the Subtraction Principle:
Notice how counting \(A\) directly in Example 8 was nearly impossible, while computing both the unrestricted total \(|U|\) and the opposite case \(|A'|\) took just one line each. Whenever a condition (especially one phrased with "at least one") breaks into too many cases, pause and check whether counting without the restriction and with the opposite restriction is simpler—then subtract.

Example 9 (At Least One Six on Three Dice): Three distinguishable dice (red, blue, and green) are rolled simultaneously. How many outcomes show the number \(6\) on at least one die?

Solution: Without restriction, each die has \(6\) outcomes, so \(|U| = 6^3 = 216\). For the opposite restriction \(A'\) (no die shows a \(6\)), each die has \(5\) outcomes (\(1, 2, 3, 4,\) or \(5\)), giving \(|A'| = 5^3 = 125\). By the Subtraction Principle:

\[|A| = 216 - 125 = 91\]

The Division Principle

Consider a simple farm calculation: if \(100{,}000\) tomatoes are harvested from a field in which every single plant bears exactly \(100\) tomatoes, then the number of plants in the field is immediately:

\[\frac{100{,}000}{100} = 1000\]

This observation generalizes into one of the most useful tools in combinatorics.

Theorem (Division Principle): If a finite set \(S\) is partitioned into \(m\) pairwise disjoint, exhaustive parts \(S_1, S_2, \dots, S_m\) of equal size \(d\), then:

\[m = \frac{|S|}{d}\]

Proof: By the Multiplication Principle, \(|S| = m \cdot d\). Dividing both sides by \(d\) yields \(m = |S| / d\). \(\blacksquare\)

The Division Principle turns uniform overcounting into a deliberate problem-solving technique: if it is easy to count an auxiliary set \(S\) in which every distinct target object appears the exact same number of times \(d\), we simply compute \(|S|\) and divide by \(d\). We will use this exact technique to derive combinations, circular permutations, multiset permutations, and distributions into identical boxes.

Example 10 (Handshakes in a Room): Ten people meet in a room, and every pair of people shakes hands exactly once. How many handshakes take place?

Solution: First count all ordered pairs \((P, Q)\) of distinct people: \(10\) choices for \(P\) and \(9\) choices for \(Q\) give \(|S| = 10 \times 9 = 90\). Because the handshake between \(A\) and \(B\) is identical to the handshake between \(B\) and \(A\), the set \(S\) partitions into equivalence classes \(\{(A, B), (B, A)\}\) of equal size \(d = 2\). By the Division Principle, the number of distinct handshakes is:

\[\frac{90}{2} = 45\]

Example 11 (Diagonals of a Convex Polygon): How many diagonals does a convex \(n\)-sided polygon (\(n \ge 3\)) have?

Solution: Choose any of the \(n\) vertices as a starting point. It cannot connect by a diagonal to itself or to its \(2\) adjacent vertices, leaving \(n - 3\) valid endpoints. This gives \(n(n - 3)\) directed diagonals \(\overrightarrow{PQ}\). Because every geometric diagonal \(PQ\) is counted twice—once as \(\overrightarrow{PQ}\) and once as \(\overrightarrow{QP}\)—the Division Principle gives:

\[\text{Number of diagonals} = \frac{n(n - 3)}{2}\]

(Checking small cases: for a triangle \(n = 3\), \(\frac{3 \times 0}{2} = 0\); for a quadrilateral \(n = 4\), \(\frac{4 \times 1}{2} = 2\); for a pentagon \(n = 5\), \(\frac{5 \times 2}{2} = 5\).)


The Bijection Principle

Sometimes we want to count the elements of a set \(A\), yet counting \(A\) directly feels awkward. In such cases, we can often pair each element of \(A\) with an element of a completely different—and much simpler—set \(B\).

Think about selecting a starting lineup from a squad of \(5\) players, \(\{P_1, P_2, P_3, P_4, P_5\}\). Suppose the coach wants to know how many ways there are to choose \(3\) players to play (call this set of choices \(A\)), and also how many ways there are to choose \(2\) players to sit on the bench (call this set \(B\)).

Notice that every choice of \(3\) players to play automatically decides the exact \(2\) players who sit on the bench:

  • Choosing \(\{P_1, P_2, P_3\}\) to play pairs uniquely with \(\{P_4, P_5\}\) on the bench.
  • Choosing \(\{P_1, P_2, P_4\}\) to play pairs uniquely with \(\{P_3, P_5\}\) on the bench.
  • Choosing \(\{P_1, P_3, P_5\}\) to play pairs uniquely with \(\{P_2, P_4\}\) on the bench, and so on.

Check the two properties of this pairing:

  1. One-to-one (Injective): Two different starting teams of \(3\) players can never leave the exact same \(2\) players on the bench.
  2. Onto (Surjective): Every possible pair of \(2\) players on the bench corresponds to a valid starting team (the remaining \(3\) players)—no pair in \(B\) is left unpaired.

Bijection Pairing Between 3-Player Teams and 2-Player Benches

Because every element of \(A\) is matched with a unique partner in \(B\) and nothing is left over on either side, the two sets must have the exact same number of elements: \(|A| = |B|\)—without even needing to compute either count.

A pairing that is both one-to-one and onto is called a bijection.

Theorem (Bijection Principle): If there exists a bijection \(f : A \to B\) between two finite sets \(A\) and \(B\), then:

\[|A| = |B|\]

The power of the Bijection Principle lies in translation: whenever a set \(A\) is difficult to count directly, design a clean one-to-one and onto rule matching \(A\) with a simpler set \(B\), and count \(B\) instead.

Example 12 (Counting All Subsets via Binary Strings): Prove that a finite set \(X = \{x_1, x_2, \dots, x_n\}\) of \(n\) elements has exactly \(2^n\) subsets.

Solution: Associate every subset \(T \subseteq X\) with an \(n\)-bit binary string \((b_1, b_2, \dots, b_n)\) where \(b_i = 1\) if \(x_i \in T\) and \(b_i = 0\) if \(x_i \notin T\). For \(n = 3\) with \(X = \{x_1, x_2, x_3\}\), the bijection pairs all \(8\) subsets cleanly:

Subset \(T \subseteq \{x_1, x_2, x_3\}\) Binary String \((b_1, b_2, b_3)\)
\(\emptyset\) 000
\(\{x_3\}\) 001
\(\{x_2\}\) 010
\(\{x_2, x_3\}\) 011
\(\{x_1\}\) 100
\(\{x_1, x_3\}\) 101
\(\{x_1, x_2\}\) 110
\(\{x_1, x_2, x_3\}\) 111

In general, every subset corresponds to a unique \(n\)-bit string and every \(n\)-bit string corresponds to a unique subset. By the Multiplication Principle, there are \(2^n\) binary strings of length \(n\); by the Bijection Principle, \(X\) has exactly \(2^n\) subsets. \(\blacksquare\)

Example 13 (Knockout Tournament): A single-elimination tennis tournament begins with \(100\) players. In each match, the winner advances and the loser is eliminated (with byes granted whenever an odd number of players remain in a round). How many matches are played to determine the champion?

Solution: Tracking rounds and byes is unnecessary. Every match eliminates exactly one player, and every eliminated player loses exactly one match—a bijection between the set of matches played and the set of eliminated players. To leave \(1\) champion out of \(100\) players, exactly \(99\) players must be eliminated; hence exactly \(99\) matches must be played, regardless of how the bracket is structured.


The Pigeonhole Principle

Unlike the previous principles, which compute exact counts, the Pigeonhole Principle (also called Dirichlet's Box Principle) guarantees the existence of an overlap or shared property.

If \(5\) letters are placed into \(4\) mailboxes, it is impossible for every mailbox to receive at most \(1\) letter (that would account for at most \(4\) letters). Hence at least one mailbox must contain at least \(2\) letters.

Pigeonhole Principle with n+1 Pigeons and n Pigeonholes

Theorem (Simple Pigeonhole Principle): If \(n + 1\) or more objects (pigeons) are placed into \(n\) boxes (pigeonholes), then at least one box contains at least \(2\) objects.

Proof (By Contradiction): Suppose every one of the \(n\) boxes contains at most \(1\) object. Then the total number of objects is at most \(n \cdot 1 = n\), contradicting the hypothesis that there are at least \(n + 1\) objects. \(\blacksquare\)

Theorem (Generalized Pigeonhole Principle): If \(N\) objects are placed into \(k\) boxes, then at least one box contains at least \(\lceil N / k \rceil\) objects, where \(\lceil x \rceil\) denotes the smallest integer greater than or equal to \(x\).

Proof (By Contradiction): Suppose every box contained at most \(\lceil N / k \rceil - 1\) objects. Since \(\lceil N / k \rceil - 1 < N / k\), the total number of objects across all \(k\) boxes would be at most:

\[k \left(\left\lceil \frac{N}{k} \right\rceil - 1\right) < k \cdot \frac{N}{k} = N\]

which contradicts the total count \(N\). \(\blacksquare\)

The art of applying the Pigeonhole Principle lies in choosing the pigeonholes cleverly so that two objects landing in the same box automatically satisfy the property you wish to prove.

Example 14 (Minimum Crowd for Shared Birth Months): What is the minimum number of students needed in an auditorium to guarantee that at least \(4\) students share the same birth month?

Solution: Take the \(k = 12\) calendar months as pigeonholes and the students as pigeons. In the worst case, each of the \(12\) months could contain \(3\) students (\(12 \times 3 = 36\) students) without any month reaching \(4\). Adding one more student forces at least one month to hold \(4\) students. Thus the minimum number is \(36 + 1 = 37\) (confirming \(\lceil 37 / 12 \rceil = 4\)).

Example 15 (Guaranteed Consecutive Integers): From \(\{1, 2, 3, \dots, 2n\}\), any \(n + 1\) distinct integers are chosen. Prove that at least two of the chosen integers are consecutive.

Solution: Partition \(\{1, 2, \dots, 2n\}\) into \(n\) disjoint consecutive pairs to serve as pigeonholes:

\[H_1 = \{1, 2\}, \quad H_2 = \{3, 4\}, \quad H_3 = \{5, 6\}, \quad \dots, \quad H_n = \{2n - 1, 2n\}\]

Assign each of the \(n + 1\) chosen integers to the pair containing it. By the Pigeonhole Principle, at least one pair \(H_j = \{2j - 1, 2j\}\) receives both of its elements, producing two consecutive integers. \(\blacksquare\)

Example 16 (Guaranteed Divisibility): From \(\{1, 2, 3, \dots, 2n\}\), any \(n + 1\) distinct integers are chosen. Prove that at least one of the chosen integers divides another.

Solution: Every positive integer \(m\) can be written uniquely as a power of \(2\) times an odd integer, called its odd part:

\[m = 2^a \cdot q \qquad (a \ge 0,\; q \text{ odd})\]

Since every chosen integer lies in \(\{1, 2, \dots, 2n\}\), its odd part \(q\) belongs to the set \(\{1, 3, 5, \dots, 2n - 1\}\), which contains exactly \(n\) odd numbers. Label \(n\) pigeonholes by these \(n\) odd numbers, and place each of the \(n + 1\) chosen integers into the box matching its odd part.

By the Pigeonhole Principle, two distinct chosen integers \(x\) and \(y\) must share the same odd part \(q\):

\[x = 2^a \cdot q \qquad \text{and} \qquad y = 2^b \cdot q \qquad (a \neq b)\]

Without loss of generality, let \(a < b\). Then \(y = 2^{b - a} \cdot x\), so \(x\) divides \(y\). \(\blacksquare\)


Summary of Fundamental Counting Principles

Principle Mathematical Statement Core Intuition & Application
Addition Principle \(\lvert S \rvert = \sum_{i=1}^k \lvert S_i \rvert\) for pairwise disjoint, exhaustive \(S_i\) Split \(S\) into non-overlapping, exhaustive cases (OR); prevents overcounting and undercounting
Multiplication Principle \(\lvert S \rvert = n_1 \cdot n_2 \cdots n_k\) Special case of Addition with equal-sized parts (AND); requires independent counts (satisfy strictest constraints first)
Subtraction Principle \(\lvert A \rvert = \lvert U \rvert - \lvert A' \rvert\) Count the unrestricted universe \(U\) and subtract the opposite condition \(A'\) (ideal for "at least one")
Division Principle \(m = \lvert S \rvert / d\) When every target object is overcounted by the exact same factor \(d\), divide \(\lvert S \rvert\) by \(d\)
Bijection Principle \(\lvert A \rvert = \lvert B \rvert\) if \(f: A \to B\) is bijective Pair an unfamiliar set one-to-one with a simpler set of the same size
Pigeonhole Principle \(N\) objects in \(k\) boxes \(\implies\) some box has \(\ge \lceil N/k \rceil\) Prove existence of overlaps or structural patterns by designing clever pigeonholes