Chapter

Counting in Two Ways

The module introduces double counting as a method: pairs, incidences, degree sums, average arguments, subset identities, and first bounds.
Log in to track solved progress and bookmarks.

Theory

Key Idea

Double counting means counting the same set of objects in two different ways. The result may be an equality, an identity, an average, or a proof that an object with a desired property must exist.

Most often, we count pairs: \((student,club)\), \((vertex,edge)\), \((subset,element)\), \((point,line)\). If the right pairs are chosen, the problem often becomes short.

Basic Facts

  • If the same finite set is counted in two ways, the answers are equal.
  • The sum of degrees of a graph equals \(2E\), because every edge has two ends.
  • If \(T\) objects are distributed among \(m\) boxes, some box contains at least the average \(T/m\).
  • The number of pairs \((S,x)\), where \(x\) belongs to subset \(S\), can be counted by \(S\) or by \(x\).
  • Double counting often turns “prove existence” into a statement about an average.

When to Use This Method

  • The problem contains relations between objects: a student attends a club, a point lies on a line, a vertex is incident to an edge.
  • You need to prove a combinatorial identity.
  • There is a table, rows and columns, and entries can be counted in two ways.
  • You need to prove existence of an object with high or low load.

How to Recognise the Method

Look for phrases such as “each object is connected to”, “in every group”, “each pair”, “total number of memberships”, or “average number”. They almost always suggest a set of pairs or incidences.

If you see a sum like \(0C(n,0)+1C(n,1)+\cdots+nC(n,n)\), try counting pairs “chosen subset and marked element inside it”.

Typical Mistakes

  • Counting two different sets of objects instead of one set in two ways.
  • Forgetting that each graph edge has two ends.
  • Using an average but not stating the conclusion “there exists at least the average”.
  • Confusing ordered pairs and unordered pairs.
  • In identity problems, not explaining what is being counted.

Mini-Checklist

  • What set of objects are we counting?
  • Can each object be described as a pair \((a,b)\)?
  • What happens if we count by the first component?
  • What happens if we count by the second component?
  • Do we need equality or only an estimate?
  • How does the average imply existence?

Examples

Example 1. Handshakes

Each handshake can be counted by its two participants.

Problem. In a room of \(10\) people, everyone shook hands with everyone else. How many handshakes occurred?

Solution.

Count pairs of people: choose \(2\) people from \(10\), giving \(45\). Equivalently, each person gives \(9\) handshake-ends, \(90\) ends in total, and each handshake has two ends, so \(90/2=45\).

Comment. This is the first version of sum of degrees.

Example 2. Club Memberships

Count pairs “student — club”.

Problem. In a school, \(30\) students each attend exactly \(2\) clubs. How many student-club memberships are there?

Solution.

Each student gives \(2\) pairs \((student,club)\). Total: \(30\cdot2=60\) memberships.

Comment. If club sizes are known, their sum must also be \(60\).

Example 3. Average Gives Existence

If the average is large, someone is at least average.

Problem. There are \(60\) memberships across \(8\) clubs. Prove that some club has at least \(8\) students.

Solution.

If every club had at most \(7\) students, the total would be at most \(8\cdot7=56\) memberships. But there are \(60\). Hence some club has at least \(8\) students.

Comment. This is the average argument in contradiction form.

Example 4. Sum of Degrees

Every edge has two ends.

Problem. Prove that in every graph, the sum of all vertex degrees equals twice the number of edges.

Solution.

Count pairs \((v,e)\), where vertex \(v\) is an endpoint of edge \(e\). Counting by vertices gives the sum of degrees. Counting by edges gives \(2\) pairs per edge. Thus the sum of degrees is \(2E\).

Comment. This is the main graph-counting lemma.

Example 5. Identity with Subsets

Count a subset and a marked element.

Problem. Prove that \(\sum_{k=0}^n kC(n,k)=n2^{n-1}\).

Solution.

Count pairs \((S,x)\), where \(S\) is a subset of an \(n\)-element set and \(x\in S\). By size \(S=k\), we get the left side. By the element \(x\), choose \(x\) in \(n\) ways and choose the remaining elements of \(S\) freely from \(n-1\), giving \(n2^{n-1}\).

Comment. The identity became a problem about pairs.

Example 6. Pairs of Subsets

Each element may be outside both sets, only in the larger set, or in both.

Problem. How many pairs \((A,B)\) of subsets of an \(n\)-element set satisfy \(A\subset B\)?

Solution.

For each element there are three possibilities: outside \(B\), in \(B\) but not in \(A\), or in both \(A\) and \(B\). Hence there are \(3^n\) pairs.

Comment. This is also a double viewpoint: by elements instead of by sets.

Example 7. Point-Line Incidences

The same table “point lies on line” is counted by rows or columns.

Problem. There are \(9\) lines, each containing \(5\) marked points. Each marked point lies on exactly \(3\) lines. How many marked points are there?

Solution.

Count incidences \((point,line)\). By lines there are \(9\cdot5=45\). By points there are \(3N\), where \(N\) is the number of points. Thus \(3N=45\), so \(N=15\).

Comment. Classic incidence-counting problem.

Example 8. Bounding by Pairs

If each triple contains \(3\) pairs, we can bound the number of triples.

Problem. There are three-element subsets of a \(10\)-element set, and no pair of elements occurs in two different subsets. Prove that there are at most \(15\) such subsets.

Solution.

Each three-element subset contains \(3\) pairs of elements. There are \(45\) pairs total in a \(10\)-element set. Since pairs do not repeat, \(3m\le45\), where \(m\) is the number of subsets. Hence \(m\le15\).

Comment. This is already an olympiad-style double-counting bound.

Problems

Problems

#4.1
#4.1

Handshakes

Double counting Grade 7 Grade 8 ★☆☆☆☆

In a room of \(10\) people, everyone shook hands with everyone else. How many handshakes occurred?

Details
Problem: COM-B1-M04-P001
Difficulty: Level 1 of 5
Tag: Double counting
Grade: Grade 7, Grade 8
#4.2
#4.2

Student and Club

Incidence Grade 7 Grade 8 ★☆☆☆☆

In a class of \(20\) students, each attends exactly \(2\) clubs. How many pairs \((student,club)\) are there?

Details
Problem: COM-B1-M04-P002
Difficulty: Level 1 of 5
Tag: Incidence
Grade: Grade 7, Grade 8
#4.3
#4.3

Rows and Columns

Double counting Grade 7 Grade 8 ★☆☆☆☆

A table contains numbers. Explain why the sum of row sums equals the sum of column sums.

Details
Problem: COM-B1-M04-P003
Difficulty: Level 1 of 5
Tag: Double counting
Grade: Grade 7, Grade 8
#4.4
#4.4

Letter in a Word

Strings Grade 7 Grade 8 ★☆☆☆☆

There are \(12\) words of length \(5\). How many pairs \((word,position)\) are there?

Details
Problem: COM-B1-M04-P004
Difficulty: Level 1 of 5
Tag: Strings
Grade: Grade 7, Grade 8
#4.5
#4.5

Edges of a Complete Graph

Graphs Grade 7 Grade 8 ★☆☆☆☆

How many edges are in a graph with \(6\) vertices where every pair of vertices is connected by an edge?

Details
Problem: COM-B1-M04-P005
Difficulty: Level 1 of 5
Tag: Graphs
Grade: Grade 7, Grade 8
#4.6
#4.6

Odd Degrees

Graphs Grade 8 Grade 9 ★★☆☆☆

Prove that in every graph, the number of vertices of odd degree is even.

Details
Problem: COM-B1-M04-P006
Difficulty: Level 2 of 5
Tag: Graphs
Grade: Grade 8, Grade 9
#4.7
#4.7

A Club with Many Students

Pigeonhole principle Grade 8 Grade 9 ★★☆☆☆

Across \(8\) clubs there are \(60\) memberships. Prove that some club has at least \(8\) students.

Details
Problem: COM-B1-M04-P007
Difficulty: Level 2 of 5
Tag: Pigeonhole principle
Grade: Grade 8, Grade 9
#4.8
#4.8

Sum of Subset Sizes

Identity Grade 8 Grade 9 ★★☆☆☆

For a set of \(5\) elements, find the sum of the sizes of all its subsets.

Details
Problem: COM-B1-M04-P008
Difficulty: Level 2 of 5
Tag: Identity
Grade: Grade 8, Grade 9
#4.9
#4.9

Subset and Element

Identity Grade 8 Grade 9 ★★☆☆☆

How many pairs \((S,x)\), where \(S\subset\{1,\ldots,6\}\) and \(x\in S\), are there?

Details
Problem: COM-B1-M04-P009
Difficulty: Level 2 of 5
Tag: Identity
Grade: Grade 8, Grade 9
#4.10
#4.10

Paths of Length Two

Counting Grade 8 Grade 9 ★★☆☆☆

In the complete graph on \(6\) vertices, how many ordered paths \(A-B-C\) with distinct \(A,B,C\) are there?

Details
Problem: COM-B1-M04-P010
Difficulty: Level 2 of 5
Tag: Counting
Grade: Grade 8, Grade 9
#4.11
#4.11

Endpoints of Diagonals

Incidence Grade 8 Grade 9 ★★☆☆☆

Derive the formula for the number of diagonals of an \(n\)-gon by counting diagonal endpoints.

Details
Problem: COM-B1-M04-P011
Difficulty: Level 2 of 5
Tag: Incidence
Grade: Grade 8, Grade 9
#4.12
#4.12

Who Solved Many Problems

Existence Grade 8 Grade 9 ★★☆☆☆

\(25\) students solved \(100\) problems in total. Prove that some student solved at least \(4\) problems.

Details
Problem: COM-B1-M04-P012
Difficulty: Level 2 of 5
Tag: Existence
Grade: Grade 8, Grade 9
#4.13
#4.13

General Identity on Subset Sizes

Identity Grade 8 Grade 9 ★★★☆☆

Prove combinatorially that \(\sum_{k=0}^n kC(n,k)=n2^{n-1}\).

Details
Problem: COM-B1-M04-P013
Difficulty: Level 3 of 5
Tag: Identity
Grade: Grade 8, Grade 9
#4.14
#4.14

Sum of Pairs in Initial Segments

Identity Grade 8 Grade 9 ★★★☆☆

Prove that \(C(2,2)+C(3,2)+\cdots+C(n,2)=C(n+1,3)\).

Details
Problem: COM-B1-M04-P014
Difficulty: Level 3 of 5
Tag: Identity
Grade: Grade 8, Grade 9
#4.15
#4.15

Shared Memberships

Sets Grade 8 Grade 9 ★★★☆☆

A school has \(40\) students and \(5\) clubs. Each student attends exactly \(2\) clubs. Prove that some club has at least \(16\) students.

Details
Problem: COM-B1-M04-P015
Difficulty: Level 3 of 5
Tag: Sets
Grade: Grade 8, Grade 9
#4.16
#4.16

Nested Pairs of Subsets

Double counting Grade 8 Grade 9 ★★★☆☆

How many pairs \((A,B)\) of subsets of an \(n\)-element set satisfy \(A\subset B\)?

Details
Problem: COM-B1-M04-P016
Difficulty: Level 3 of 5
Tag: Double counting
Grade: Grade 8, Grade 9
#4.17
#4.17

Segments Between Points

Pairs Grade 8 Grade 9 ★★★☆☆

There are \(12\) marked points in the plane, no three collinear. How many segments with endpoints among the marked points can be drawn?

Details
Problem: COM-B1-M04-P017
Difficulty: Level 3 of 5
Tag: Pairs
Grade: Grade 8, Grade 9
#4.18
#4.18

Player with at Least Average Wins

Average Grade 8 Grade 9 ★★★☆☆

In a tournament, each of \(n\) players played each other exactly once, with no draws. Prove that some player won at least \((n-1)/2\) games.

Details
Problem: COM-B1-M04-P018
Difficulty: Level 3 of 5
Tag: Average
Grade: Grade 8, Grade 9
#4.19
#4.19

Rectangles by Pairs of Lines

Double counting Grade 8 Grade 9 ★★★☆☆

How many rectangles are in a \(5\) by \(6\) grid of cells?

Details
Problem: COM-B1-M04-P019
Difficulty: Level 3 of 5
Tag: Double counting
Grade: Grade 8, Grade 9
#4.20
#4.20

Committees and Members

Average Grade 8 Grade 9 ★★★☆☆

There are \(12\) committees, each with \(5\) people, and \(20\) people total participate. Prove that some person belongs to at least \(3\) committees.

Details
Problem: COM-B1-M04-P020
Difficulty: Level 3 of 5
Tag: Average
Grade: Grade 8, Grade 9
#4.21
#4.21

Many Acquaintances

Average Grade 9 ★★★★☆

In a group of \(15\) people, each person knows at least \(7\) others. Prove that there are at least \(53\) acquainted pairs.

Details
Problem: COM-B1-M04-P021
Difficulty: Level 4 of 5
Tag: Average
Grade: Grade 9
#4.22
#4.22

Square of Subset Size

Identity Grade 9 ★★★★☆

Prove combinatorially that \(\sum_{k=0}^n k^2C(n,k)=n(n+1)2^{n-2}\).

Details
Problem: COM-B1-M04-P022
Difficulty: Level 4 of 5
Tag: Identity
Grade: Grade 9
#4.23
#4.23

Points and Lines

Incidence Grade 9 ★★★★☆

There are \(9\) lines, each with \(5\) marked points. Each marked point lies on exactly \(3\) lines. Find the number of marked points.

Details
Problem: COM-B1-M04-P023
Difficulty: Level 4 of 5
Tag: Incidence
Grade: Grade 9
#4.24
#4.24

Seventeen Triples

Double counting Grade 9 ★★★★★

From a \(10\)-element set, \(17\) three-element subsets are chosen. Prove that two chosen subsets have at least two common elements.

Details
Problem: COM-B1-M04-P024
Difficulty: Level 5 of 5
Tag: Double counting
Grade: Grade 9

Ladders

No published ladders were found.
Previous Chapter
Next Chapter