The problem collection

Olympiad problems

A good problem takes time. Choose a topic, try a few approaches, and open the solution when you’re ready.

134 problems 6 topics Worked solutions throughout

All problems

Start anywhere, or narrow the collection to a technique you want to practise.

Showing 1–10 of 134 problems

Pigeonhole principle

Problem 01

From the integers {1,2,,2n}, any n+1 are chosen. Prove that at least one of the chosen integers divides another.

Worked solution Try it yourself first

Every positive integer has a unique representation 2am where a0 and m is a positive odd integer. Write each of the n+1 chosen integers as 2aimi with mi odd. Since each chosen integer is at most 2n and is odd after removing all factors of 2, each mi belongs to the set {1,3,5,,2n1}, which has exactly n elements. With n+1 odd parts among n possible values, the pigeonhole principle gives two chosen integers sharing the same odd part: x=2am and y=2bm for some odd m and distinct exponents a,b. If a<b then xy; if b<a then yx.

Pigeonhole principle

Problem 02

Let a1,a2,,amn+1 be a sequence of mn+1 distinct real numbers. Prove that the sequence contains either a strictly increasing subsequence of length m+1 or a strictly decreasing subsequence of length n+1.

Worked solution Try it yourself first

For each index k{1,,mn+1}, let k be the length of the longest strictly increasing subsequence of a1,,amn+1 that ends at ak.

If km+1 for any k, an increasing subsequence of length m+1 exists and we are done.

Otherwise k{1,2,,m} for all k. There are mn+1 indices and only m possible values, so by the pigeonhole principle some n+1 indices k1<k2<<kn+1 satisfy k1=k2==kn+1=.

We claim ak1>ak2>>akn+1. Suppose for a contradiction that aki<akj for some i<j. Then any strictly increasing subsequence of length ending at aki can be extended by akj (which appears later in the sequence and is larger), giving kjki+1=+1. This contradicts kj=. Since the terms are distinct, the subsequence ak1,,akn+1 is therefore strictly decreasing, with length n+1.

Pigeonhole principle

Problem 03

Five points lie inside or on an equilateral triangle of side 2. Prove that at least two of them are at distance at most 1 from each other.

Worked solution Try it yourself first

Connect the midpoints of each pair of sides of the triangle. This subdivides it into four congruent equilateral triangles, each of side 1. The five given points are distributed among these four smaller triangles (a point on a shared edge is assigned to either adjacent triangle). By the pigeonhole principle, at least one small triangle contains at least two of the five points.

It remains to note that the diameter of an equilateral triangle of side 1 — the greatest distance between any two points in it or on it — equals 1, since the three vertices are the farthest-apart pairs and each pair of vertices is distance 1 apart. Hence the two points in the same small triangle are at distance at most 1.

Pigeonhole principle

Problem 04

Prove that for any real number α and any positive integer N, there exist integers p and q with 1qN such that αpq<1qN.

Worked solution Try it yourself first

Consider the N+1 numbers {0α}=0,{α},{2α},,{Nα}, where {x}=xx denotes the fractional part of x. All N+1 values lie in [0,1). Partition [0,1) into the N subintervals [0,1N),  [1N,2N),  ,  [N1N,1). By the pigeonhole principle, two of the N+1 values fall in the same subinterval: say {rα} and {sα} with 0r<sN and {sα}{rα}<1/N.

Set q=sr and p=sαrα. Then 1qN and qαp=(sαsα)(rαrα)={sα}{rα}<1N. Dividing both sides by q gives αpq<1qN.

Pigeonhole principle

Problem 05

Given any 10 integers, prove that some non-empty subset of them has sum divisible by 10.

Worked solution Try it yourself first

Let the ten integers be a1,,a10 and form the eleven partial sums S0=0,Sk=a1+a2++ak(k=1,,10). Each Sk has a residue modulo 10 in {0,1,,9}.

Case 1. Sk0(mod10) for some k1. Then the non-empty subset {a1,,ak} has sum divisible by 10.

Case 2. Sk≢0(mod10) for all k1. Then S1,,S10 take values in {1,2,,9}, a set of only 9 residues. Since there are 10 sums, the pigeonhole principle gives 1i<j10 with SiSj(mod10). Then ai+1+ai+2++aj=SjSi0(mod10), so the non-empty subset {ai+1,,aj} has sum divisible by 10.

In both cases a non-empty subset with the required property exists.

Pigeonhole principle

Problem 06

In any group of 6 people, where any two are either acquainted or unacquainted, prove that there exist 3 people who are mutually acquainted, or 3 people who are mutually unacquainted.

Worked solution Try it yourself first

Fix any person A. Each of the other 5 people is either acquainted with A or not. By the pigeonhole principle, at least 5/2=3 of them fall in the same category.

Case 1: A is acquainted with B1,B2,B3. If any two of B1,B2,B3 are acquainted — say B1 and B2 — then A,B1,B2 are three mutually acquainted people. Otherwise B1,B2,B3 are pairwise unacquainted, giving three mutually unacquainted people.

Case 2: A is unacquainted with B1,B2,B3. If any two of B1,B2,B3 are unacquainted — say B1 and B2 — then A,B1,B2 are three mutually unacquainted people. Otherwise B1,B2,B3 are pairwise acquainted, giving three mutually acquainted people.

In every case the required triple exists.

Pigeonhole principle

Problem 07

Given any n integers, prove that some non-empty subset of them has sum divisible by n.

Worked solution Try it yourself first

Let the n integers be a1,,an and form the n+1 partial sums S0=0,Sk=a1++ak(k=1,,n). These n+1 values have residues in {0,1,,n1}, a set of n elements.

If Sk0(modn) for some k1, the subset {a1,,ak} has sum divisible by n. Otherwise S1,,Sn all have non-zero residues; together with S0=0 that is n+1 values in n residue classes, so by the pigeonhole principle SiSj(modn) for some 0i<jn. Since i1 is not guaranteed here, note that if i=0 then Sj0, handled above; otherwise 1i<jn and ai+1++aj=SjSi0(modn), giving the required subset.

Pigeonhole principle

Problem 08

In any simple graph on n2 vertices, prove that some two vertices have the same degree.

Worked solution Try it yourself first

Each vertex of a simple graph on n vertices has degree in {0,1,,n1}. These are n possible values for n vertices, so if all degrees were distinct they would be exactly {0,1,2,,n1}. But this is impossible: a vertex of degree n1 is adjacent to every other vertex, which prevents any vertex from having degree 0. Hence the n degrees cannot all be distinct, and by the pigeonhole principle two vertices share a degree.

Pigeonhole principle

Problem 09

From the integers {1,2,,2n}, any n+1 are chosen. Prove that some two of them sum to 2n+1.

Worked solution Try it yourself first

Partition {1,2,,2n} into the n complementary pairs {1,2n},  {2,2n1},  ,  {n,n+1}, each of which sums to 2n+1. The n+1 chosen integers are distributed among these n pairs. By the pigeonhole principle two chosen integers belong to the same pair and therefore sum to 2n+1.

Pigeonhole principle

Problem 10

Among any 5 points in the plane with integer coordinates, prove that the midpoint of some pair of them also has integer coordinates.

Worked solution Try it yourself first

Each lattice point (x,y) belongs to exactly one of the four parity classes determined by the residues of x and y modulo 2: (0,0),(0,1),(1,0),(1,1). With 5 points and only 4 classes, the pigeonhole principle gives two points (x1,y1) and (x2,y2) in the same class: x1x2 and y1y2(mod2). Their midpoint is (x1+x22,y1+y22), and both coordinates are integers because x1+x2 and y1+y2 are each divisible by 2.

Take your time. A small example, a useful substitution or a different viewpoint can be the start of a proof.