Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving...

124
Problem Solving in Math (Math 43900) Fall 2015 Instructor: David Galvin Abstract This document comprises an introduction to the Putnam competition, and a collec- tion of themed solving strategies, problems and solutions presented during the semester in preparation for the 2015 Putnam competition. Contents 1 Introduction 4 1.1 The Putnam Competition ............................ 4 1.2 The Problem Solving in Math seminar ..................... 4 2 Week one (August 25) — A grab-bag 6 2.1 Week one problems ................................ 8 2.2 Week one solutions ................................ 9 3 Week two (September 1) — Induction 14 3.1 Week two problems ................................ 18 3.2 Week two solutions ................................ 19 4 Week three (September 8) — Pigeon-hole principle 24 4.1 Week three problems ............................... 26 4.2 Week three solutions ............................... 27 5 Week four (September 15) — Binomial coecients 31 5.1 Week four problems ................................ 38 5.2 Week four solutions ................................ 39 6 Week five (September 22) — Modular arithmetic and the greatest common divisor 45 6.1 Week five problems ................................ 49 6.2 Week five solutions ................................ 50 7 Week six (September 29) — Inequalities 56 7.1 Week six problems ................................ 64 7.2 Week six solutions ................................ 65 1

Transcript of Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving...

Page 1: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

Problem Solving in Math (Math 43900)

Fall 2015

Instructor: David Galvin

Abstract

This document comprises an introduction to the Putnam competition, and a collec-

tion of themed solving strategies, problems and solutions presented during the semester

in preparation for the 2015 Putnam competition.

Contents

1 Introduction 41.1 The Putnam Competition . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.2 The Problem Solving in Math seminar . . . . . . . . . . . . . . . . . . . . . 4

2 Week one (August 25) — A grab-bag 62.1 Week one problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82.2 Week one solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

3 Week two (September 1) — Induction 143.1 Week two problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183.2 Week two solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

4 Week three (September 8) — Pigeon-hole principle 244.1 Week three problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264.2 Week three solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

5 Week four (September 15) — Binomial coe�cients 315.1 Week four problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385.2 Week four solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

6 Week five (September 22) — Modular arithmetic and the greatest commondivisor 456.1 Week five problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496.2 Week five solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

7 Week six (September 29) — Inequalities 567.1 Week six problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647.2 Week six solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65

1

Page 2: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

8 Week seven (October 6) — Polynomials 688.1 Week seven problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 708.2 Week seven solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

9 Week eight (October 13) — A grab-bag 749.1 Week eight problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 779.2 Week eight solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78

10 Week nine (October 27) — Recurrences 8310.1 Week nine problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8910.2 Week nine solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90

11 Week ten (November 3) — Graphs 9411.1 Week ten problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9811.2 Week ten solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99

12 Week eleven (November 10) — Probability 10312.1 Week eleven problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10812.2 Week eleven solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109

13 Week twelve (November 17) — Games 11313.1 Week twelve problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11413.2 Week twelve solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115

14 Week thirteen (November 24) — Preparing for the Putnam Competition11814.1 Week 13 problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12314.2 Week 13 Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124

2

Page 3: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

.

3

Page 4: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

1 Introduction

1.1 The Putnam Competition

The seventy-sixth annual William Lowell Putnam Mathematical Competition will take placeon Saturday, December 5, 2015. Every year, around 4000 US & Canadian undergraduatesparticipate in the competition.

The competition consists of two three-hour sessions (morning and afternoon), with eachsession having six problems. The problems are hard, not because they are made up of lotsof parts, or involve extensive computation, or require very advanced mathematics to solve.They are hard because they each require a moment of cleverness, intuition and ingenuity toreach a solution. Typically, the median score out of 120 (10 possible points per question) is 1!The Putnam Competition may be the most challenging and rewarding tests of mathematicalskill that you will ever encounter.

1.2 The Problem Solving in Math seminar

To help prepare for the Putnam Competition, the math department runs the 1 credit courseMath 43900. If you are signed up for Math 43900, then you are also signed up to participatein the Putnam competition on December 5. This year, the details of the course are as follows:

• Instructor: David Galvin, 248 Hayes-Healy, [email protected].

• Meetings: Tuesdays, 3.30pm-4.20pm, De Bartolo 201, starting August 25 (just a shortorganizational meeting), ending December 1 (the last Tuesday before the competition).

• O�ce hours: Email me for an appointment.

• Text: There is no required text. The following books (one available online throughthe library, the others on reserve at the Math library) are worth looking at. First, twoclassics that deal with the art of problem-solving:

– Problem-solving through problems by Larson (QA 43 .L37 1983)

– How to solve it by Polya (QA 11 .P6 2004).

Next, a doorstop filled with problems and strategies for the Putnam itself:

– Putnam and beyond by Gelca and Andreescu (online).

Finally, three books that exhaustively catalog all Putnam Competitions up to 2000:

– The William Lowell Putnam Mathematical Competition 1985-2000: problems, so-lutions, and commentary by Kedlaya, Poonen and Vakil (QA 43 .W5425 2002)

– The William Lowell Putnam Mathematical Competition problems and solutions:1938-1964 by Gleason, Greenwood and Kelly (QA 43 .W54)

– The William Lowell Putnam Mathematical Competition problems and solutions:1965-1984 by Alexanderson, Klosinski and Larson (QA 43 .W542 1985).

4

Page 5: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

• Course website: http://www3.nd.edu/~

dgalvin1/43900/43900_F15/index.html.This is where announcements, problem sets, etc., will be posted. Also, I’ve put herethe problems & solutions for the Putnam Competitions from 2001 on. (NB — whenfollowing this link straight from a pdf file of the course notes, the tilde in front ofdgalvin1 sometimes causes a problem; if so just enter it by hand.)

• Course organization: Each meeting will (usually) be built around a specific theme(pigeon-hole principle, induction & recursion, inequalities, probability, etc.). We’ll talkabout the general theme, then spend time trying to solve some relevant problems. Atthe end of each meeting I’ll hand out a set of problems on that theme, that you cancut your teeth on. Usually we’ll begin the next session with presentations of solutionsto some of those problems. On occasional meetings, I might give out a problem set atthe beginning, and have everyone pick a problem or two to work on individually forthe meeting period (a sort of “mock Putnam”).

• Grading and homework: The grade for the class will be determined solely by activeparticipation in class (participating in class discussions, occasionally presenting prob-lem solutions on the board) and by participation in the 2014 Putnam Competition.I’ll give out a problem set at the end of each meeting, usually with many problems;I don’t expect anyone to work on all the problems, but I do expect everyone to workon at least some of the problems each week, and to be prepared to talk about theirprogress at the beginning of the next meeting.

• Honor code: It’s perfectly fine to collaborate with your colleagues on problems (al-though I do encourage you to try many problems on your own, since the PutnamCompetition itself is an individual competition). You have all taken the Honor Codepledge, to not participate in or tolerate academic dishonesty. For this course, thatmeans that if you use a source to help you solve a problem (such as discussion witha colleague, or consulting a book or online resource), you should acknowledge that inyour write-up or oral presentation.

5

Page 6: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

2 Week one (August 25) — A grab-bag

Most weeks’ handouts will be a themed collection of problems — all involving inequalities ofone form or another, for example, or all involving linear algebra. The Putnam Competitionitself has no such theme, and so every so often we’ll have a handout that includes the realisticchallenge of figuring out what (possibly di↵erent) approach (or approaches) to take for eachproblem. This introductory problem set is one such.

Look over the problems, pick out some that you feel good about, and tackle them! You’lldo best if you engage your conscious brain fully on a single problem, rather than hoppingback-and-forth between problems every few minutes (but it’s also a good idea to read all theproblems before tackling one, to allow your subconscious brain to mull over the whole set).

Remember that problem solving is a full-contact sport: throw everything you know at theproblem you are tackling! Sometimes, the solution can come from an unexpected quarter.

The point of Math 43900 is to introduce you to (or reacquaint you with) a variety oftricks and tools that tend to be frequently useful in the solving of competition puzzles; buteven before that process starts, there are lots of common-sense things that you can do tomake problem-solving fun, productive and rewarding. Whole books are devoted to thesestrategies (such as Larson’s Problem solving through problems and Polya’s How to solve it).

Without writing a book on the subject, here (adapted from a list by Ravi Vakil) are someslogans to keep in mind when solving problems:

• Try small cases!

• Plug in small numbers!

• Do examples!

• Look for patterns!

• Draw pictures!

• Write lots!

• Talk it out!

• Choose good notation!

• Look for symmetry!

• Break into cases!

• Work backwards!

• Argue by contradiction!

• Consider extreme cases!

• Modify the problem!

• Make a generalization!

6

Page 7: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

• Don’t give up after five minutes!

• Don’t be afraid of a little algebra!

• Take a break!

• Sleep on it!

• Ask questions!

And above all:

• Enjoy!

7

Page 8: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

2.1 Week one problems

1. Let

f(n) =nX

k=1

1pk +

pk + 1

.

Evaluate f(9999).

2. Which number is bigger: e

⇡ or ⇡

e? (Note: of course, a calculator will reveal theanswer in an instant! The challenge really is to make the determination without anynumerical calculations.)

3. Take a walk on the number line, starting at 0, by on the first step taking a step oflength one, either right or left, on the second step taking a step of length two, eitherright or left, and in general on the kth step taking a step of length k, either right orleft.

(a) Prove that for each integer m, there is a walk that visits (has a step ending at)m.

(b) Let f(m) denote the least number of steps needed to reach m. Show that

limm!1

f(m)pm

exists, and find the value of the limit.

4. Prove that every nonzero coe�cient of the Taylor series of

(1� x+ x

2)ex

about x = 0 is a rational number whose numerator (in lowest terms) is either 1 or aprime number.

5. Let f be a non-constant polynomial with positive integer coe�cients. Prove that if nis a positive integer, then f(n) divides f(f(n) + 1) if and only if n = 1.

6. Let a0

< a

1

< a

2

. . . be an infinite sequence of positive integers. Prove that there existsa unique integer n � 1 such that

a

n

<

a

0

+ a

1

+ a

2

+ . . .+ a

n

n

a

n+1

.

8

Page 9: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

2.2 Week one solutions

1. Let

f(n) =nX

k=1

1pk +

pk + 1

.

Evaluate f(9999).

Solution: Rationalize!

f(n) =nX

k=1

1pk +

pk + 1

=nX

k=1

pk �

pk + 1

(pk +

pk + 1)(

pk �

pk + 1)

=nX

k=1

(pk + 1�

pk)

=pn+ 1� 1,

the last line by a telescoping sum. So f(9999) =p10000� 1 = 99.

Source: 2014 U. Illinois Urbana-Champaign mock Putnam

2. Which number is bigger: e

⇡ or ⇡

e? (Note: of course, a calculator will reveal theanswer in an instant! The challenge really is to make the determination without anynumerical calculations.)

Solution: Consider the function f(x) = x

1/x, which is continuous and di↵erentiableon (0,1). We have

f

0(x) =x

1/x

x

2

(1� ln x) .

For 0 < x < e, f 0(x) > 0 and for e < x < 1, f 0(x) < 0, so f(x) has a unique maximumvalue at x = e. It follows that for any x 6= e (in the range (0,1)),

e

1e

> x

1x

ore

x

> x

e

.

Since ⇡ 6= e, it follows thate

> ⇡

e

.

Notice that we didn’t need to know which of e, ⇡ is bigger here, just that they are notequal!

Source: This is a standard (hard-ish) calculus problem; I was reminded of it when itappeared on the U. Illinois Urbana-Champaign 2005 mock Putnam.

9

Page 10: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

3. Take a walk on the number line, starting at 0, by on the first step taking a step oflength one, either right or left, on the second step taking a step of length two, eitherright or left, and in general on the kth step taking a step of length k, either right orleft.

(a) Prove that for each integer m, there is a walk that visits (has a step ending at)m.

(b) Let f(m) denote the least number of steps needed to reach m. Show that

limm!1

f(m)pm

exists, and find the value of the limit.

Solution:

(a) We can easily get to the number m = n(n + 1)/2, for any integer n: just do1 + 2 + 3 + . . . + n. What about a number of the form n(n + 1)/2 � k, where1 k n� 1? For k even we can get to this by flipping the + to a � in front ofk/2. For k odd we can get to this by first adding n+1 to the end, then subtractingn� 2 (net e↵ect: �1), then flipping the + to a � in front of (k � 1)/2.

Thus we can reach every number in the interval [n(n+1)/2� (n�1), n(n+1)/2].Using 1+2+3+ . . .+n = n(n+1)/2 we can easily check that the union of thesedisjoint intervals, as n increases from 1, covers the positive integers. To get to anegative integer m, just reverse the signs on any scheme that gets to �m.

Another way to get to n > 0: do n = (�1+2)+(�3+4)+ . . .+(�(2n�1)+2n).

(b) Our second solution to part 1 shows f(n) 2n, but to solve part 2 we needto do better. Our first solution to part 1 shows that if m 2 [n(n + 1)/2 �(n � 1), n(n + 1)/2] then f(m) n + 2. But it is also easy to see that in thatinterval, f(m) � n, since the largest number that can be reached in n� 1 step is1 + 2 + . . .+ (n� 1) = n(n+ 1)/2� n.

For m 2 [n(n+1)/2� (n�1), n(n+1)/2], we have (n�1)/p2pm (n+1)/

p2,

and so p2

n

n+ 1 f(m)p

m

p2n+ 2

n� 1.

Notice that n here is a function of m, and that as m ! 1 we have n ! 1 also.So the sequence f(m)/

pm is sandwiched between two positive sequences both of

which go top2 as m ! 1. By the squeeze theorem,

limm!1

f(m)pm

exists and equalsp2.

Source: From A Mathematical Orchard, Problems and Solutions by Krusemeyer,Gilbert and Larson

10

Page 11: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

4. Prove that every nonzero coe�cient of the Taylor series of

(1� x+ x

2)ex

about x = 0 is a rational number whose numerator (in lowest terms) is either 1 or aprime number.

Solution: Using e

x =P

k�0

x

k

/k! we can multiply out directly to get that the Taylorseries of (1� x+ x

2)ex about x = 0 is

(1� x+ x

2)ex = 1 +X

k�2

x

k

✓1

k!� 1

(k � 1)!+

1

(k � 2)!

◆= 1 +

X

k�2

x

k

✓k � 1

k(k � 2)!

◆.

[Notice that after we have dealt with the constant and linear terms of the product,all remaining terms may homogeneously be written as a sum of three terms]. Amongthe constant and linear terms, only the constant term is non-zero, and it is a rationalnumber whose numerator (in lowest terms) is 1. So it remains to show that for allk � 2, (k � 1)/(k(k � 2)!) (which is non-zero always, and a rational number always)has, in lowest terms, a numerator that is either prime or 1.

If k = 2 then (k�1)/(k(k�2)!) = 1/2, so the numerator of the Taylor series coe�cientis 1.

For k � 3, so k� 1 � 2, if k� 1 is a prime number, then (k� 1)/(k(k� 2)!) is alreadyin lowest terms: k cannot have k � 1 as a factor ((k/(k � 1) = 1 + 1/(k � 1), whichis not an integer for any k � 1 � 2), and it cannot have any of the multiplicands of(k� 2)! (k� 2, k� 3, . . . , 3, 2) as a factor, as all of these are smaller than k� 1. In thiscase the numerator of the Taylor series coe�cient in lowest terms is indeed a prime.

If k � 1 is the square of a prime, say k � 1 = p

2, then, since p k � 2 and so is one ofthe multiplicands of (k � 2)!, the Taylor series coe�cient in lowest terms has either por 1 as numerator.

If k � 1 is a higher power of a prime, or has more than one prime factor, then k � 1can be written as the product of distinct integers both of which appear among themultiplicands of (k � 2)! (either as p` = p ⇥ p

`�1 or pqX = p ⇥ qX, where ` � 3 andX 2 N), and so the Taylor series coe�cient in lowest terms has 1 as numerator.

Source: 2014 Putnam competition, question A1.

5. Let f be a non-constant polynomial with positive integer coe�cients. Prove that if nis a positive integer, then f(n) divides f(f(n) + 1) if and only if n = 1.

Solution: Write f(x) as a0

+ a

1

x + . . . + a

k

x

k with each a

i

> 0 and with k � 1. Wehave

f(f(n) + 1) = a

0

+ a

1

(f(n) + 1) + . . .+ a

k

(f(n) + 1)k

= a

0

+ a

1

+ . . .+ a

n

+Kf(n)

= f(1) +Kf(n)

11

Page 12: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

where K is an integer. Here we are using the fact that for each i � 1,

(f(n) + 1)i = 1 +

✓i

1

◆f(n) + . . .+

✓i

i

◆f(n)i

= 1 + f(n)

✓✓i

1

◆+ . . .+

✓i

i

◆f(n)i�1

◆.

We conclude that f(n) divides f(f(n) + 1) if and only if f(n) divides f(1) +Kf(n),which happens if and only if f(n) divides f(1). This certainly happens when n = 1; butfor n > 1, we have f(n) > f(1) > 0 (here we use both the fact that f is non-constantand that it has positive integer coe�cients), and so we cannot have f(n) dividing f(1).So it only happens at n = 1.

Source: Putnam competition 2007, question B1. The problem as it originally appearedon the Putnam was in error, leaving out the word “non-constant” (notice that for anynon-zero constant polynomial, f(n) divides f(f(n) + 1) for all n).

6. Let a0

< a

1

< a

2

. . . be an infinite sequence of positive integers. Prove that there existsa unique integer n � 1 such that

a

n

<

a

0

+ a

1

+ a

2

+ . . .+ a

n

n

a

n+1

.

Solution: We begin by showing that there must be at least one n � 1 such that

a

n

<

a

0

+ a

1

+ a

2

+ . . .+ a

n

n

a

n+1

holds. Indeed, suppose not; then for each n � 1, we have either

f(n) a

n

ora

n+1

< f(n)

(both note not both, since a

n

< a

n+1

), where for convenience of typography we haveset

f(n) =a

0

+ a

1

+ a

2

+ . . .+ a

n

n

.

We prove, by induction on n, that it’s the second of these that must occur, i.e., that

a

n+1

< f(n).

The base case n = 1 is clear: we cannot have f(1) a

1

, since this is the same asa

0

+ a

1

a

1

, and we known that a0

> 0; so we must have a

2

< f(1). [Recall that wehave made the assumption that there is no n � 1 for which a

n

< f(n) a

n+1

.] Forn > 1, the inductive hypothesis tells us that

a

n

< f(n� 1).

12

Page 13: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

Recalling the definition of f(n � 1), multiplying across by n � 1, adding a

n

to bothsides, and dividing by n, this is the same as

a

n

< f(n);

so we can’t have f(n) a

n

, and so must have a

n+1

< f(n). This completes theinduction.

Summary so far: under the assumption that there is no n � 1 for which a

n

< f(n) a

n+1

, we have concluded that an+1

f(n) for all n � 1.

We now claim that it follows from this (“this” being a

n+1

f(n) for all n � 1) that

a

n+1

< a

0

+ a

1

for all n � 1. Again, we proceed by (this time strong) induction on n, with n = 1immediate from a

2

< f(1). For n > 1 we have

a

n+1

< f(n)

=a

0

+ a

1

+ a

2

+ . . .+ a

n

n

<

a

0

+ a

1

+ (a0

+ a

1

) + . . .+ (a0

+ a

1

)

n

=n(a

0

+ a

1

)

n

= a

0

+ a

1

,

where in the second inequality we have used the induction hypothesis to bound a

k

<

a

0

+ a

1

for each of k = 2, . . . , n� 1. This completes the induction.

Summary so far: under the assumption that there is no n � 1 for which a

n

< f(n) a

n+1

, we have concluded that an+1

a

0

+ a

1

for all n � 1. But this is a contradiction:since the a

i

’s are integers and increasing, there must be some n � 1 for which a

n+1

>

a

0

+ a

1

.

Interim conclusion: there is at least one n � 1 for which a

n

< f(n) a

n+1

.

Now we need to show that there is a unique such n. To do this, suppose that n issuch that a

n

< f(n) a

n+1

, and that m > n. We will prove (by induction on m)that f(m) a

m

. If we can do this, we will have shown that there can be at most onen such that a

n

< f(n) a

n+1

, and combined with our interim conclusion, we wouldhave a unique such n.

The base case for the induction is m = n + 1; f(n + 1) a

n+1

is just a simplerearrangement of f(n) a

n+1

. We now move onto the induction step. For m > n+ 1,we get to assume f(m�1) a

m�1

. Combining this with a

m�1

< a

m

, we get f(m�1) a

m

, and a simple rearrangement of this leads to f(m) a

m

, completing the induction.

Source: International Mathematical Olympiad 2014, question 1; for an extensive dis-cussion of this problem, with lots of di↵erent solutions, see the weblog of Fields medalistTim Gowers, http://gowers.wordpress.com/2014/07/19/mini-monomath/

13

Page 14: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

3 Week two (September 1) — Induction

Suppose that P (n) is an assertion about the natural number n. Induction is essentially thefollowing: if there is some a for which P (a) is true, and if for all n � a we have that the truthof P (n) implies the truth of P (n+ 1), then we can conclude that P (n) is true for all n � a.This should be fairly obvious: knowing P (a) and the implication “P (n) =) P (n + 1)”at n = a, we immediately deduce P (a + 1). But now knowing P (a + 1), the implication“P (n) =) P (n+1)” at n = a+1 allows us to deduce P (a+2); and so on. Induction is themathematical tool that makes the “and so on” above rigourous. Induction works becauseof the fundamental fact that a non-empty subset of the natural numbers must have a leastelement. To see why this allows induction work, suppose that we know that P (a) is truefor some a, and that we can argue that for all n � a, the truth of P (n) implies the truthof P (n + 1). Suppose now (for a contradiction) that there are some n � a for which P (n)is not true. Let F = {n|n � a, P (n) not true}. By assumption F is non-empty, so has aleast element, n

0

say. We know n

0

6= a, since P (a) is true; so n

0

� a+ 1. That means thatn

0

� 1 � a, and since n

0

� 1 62 F (if it was, n0

would not be the least element) we knowP (n

0

�1) is true. But then, by assumption, P ((n0

�1)+1) = P (n0

) is true, a contradiction!

Example: Prove that a set of size n � 1 has 2n subsets (including the empty set and theset itself).

Solution: Let P (n) be the statement “a set of size n has 2n subsets”. We prove that P (n)is true for all n � 1 by induction. We first establish a base case. When n = 1, the genericset under consideration is {x}, which has 2 = 21 subsets ({x} and ;); so P (1) is true.

Next we establish the inductive step. Suppose that for some n � 1, P (n) is true. ConsiderP (n + 1). The generic set under consideration now is {x

1

, . . . , x

n

, x

n+1

}. We can constructa subset of {x

1

, . . . , x

n

, x

n+1

} by first forming a subset of {x1

, . . . , x

n

}, and then eitheradding the element x

n+1

to this subset, or not. This tells us that the number of subsets of{x

1

, . . . , x

n

, x

n+1

} is 2 times the number of subsets of {x1

, . . . , x

n

, }. Since P (n) is assumedtrue, we know that {x

1

, . . . , x

n

, } has 2n subsets (this step is usually referred to as applyingthe inductive hypothesis); so {x

1

, . . . , x

n

, x

n+1

} has 2 ⇥ 2n = 2n+1 subsets. This shows thatthe truth of P (n) implies that of P (n+ 1), and the proof by induction is complete.

Strong Induction

Induction is a great tool because it gives you somewhere to start from in an argument. Andsometimes, the more you start with, the further you’ll go. That’s why the principle of StrongInduction is worth keeping in mind: if there is some a for which P (a) is true, and if for eachn > a we have that the truth of P (m) for all m, a m < n, implies the truth of P (n), thenwe can conclude that P (n) is true for all n � a.

The proof that this works is almost the same as the proof that induction works. What’sgood about strong induction is that when you are at the part of the argument where youhave to show that the truth of P (n+1) from some assumptions about earlier assertions, younow have a lot more to work with: each of P (a), P (a + 1), . . . , P (n � 1), rather than justP (n) alone. Sometimes this is helpful, and sometimes it’s absolutely necessary.

14

Page 15: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

Example: Prove that every integer n � 2 can be written as n = p

1

. . . p

`

where the p

i

’s are(not necessarily distinct) prime numbers.

Solution: Let P (n) be the statement: “n can be written as n = p

1

. . . p

`

where the p

i

’s are(not necessarily distinct) prime numbers”. We’ll prove that P (n) is true for all n � 2 bystrong induction.

P (2) is true, since 2 = 2 works.Now consider P (n) for some n > 2. We want to show how the (simultaneous) truth of

P (2), . . . , P (n� 1) implies the truth of P (n). If n is prime, then n = n works to show thatP (n) holds. If n is not a prime, then its composite, so n = ab for some numbers a, b with2 a < n and 2 b < n. We’re allowed to assume that P (a) and P (b) are true, thatis, that a = p

1

. . . p

`

where the p

i

’s are (not necessarily distinct) prime numbers, and thata = q

1

. . . q

m

where the q

i

’s are (not necessarily distinct) prime numbers. It follows that

n = ab = p

1

. . . p

`

q

1

. . . q

m

.

This is a product of (not necessarily distinct) prime numbers, and so P (n) is true.So, by strong induction, we conclude that P (n) is true for all n � 2.

Notice that we would have gotten exactly nowhere with this argument if, in trying toprove P (n), all we had been allowed to assume was P (n� 1).

Recurrences

Sometimes we are either given a sequence of numbers via a recurrence relation, or we canargue that there is such relation that governs the evolution of the sequence. A sequence(b

n

)n�a

is defined via a recurrence relation if some initial values, b

a

, b

a+1

, . . . , b

k

say, aregiven, and then a rule is given that allows, for each n > k, b

n

to be computed as long as weknow the values b

a

, b

a+1

, . . . , b

n�1

.Sequences defined by a recurrence relation, and proofs by induction, go hand-in-glove.

We may have more to say about recurrence relations later in the semester, but for now, we’llconfine ourselves to an illustrative example.

Example: Let a

n

be the number of di↵erent ways of covering a 1 by n strip with 1 by 1and 1 by 3 tiles. Prove that a

n

< (1.5)n.

Solution: We start by figuring out how to calculate an

via a recurrence. Some initial valuesof a

n

are easy to compute: for example, a1

= 1, a2

= 1 and a

3

= 2. For n � 4, we cantile the 1 by n strip EITHER by first tiling the initial 1 by 1 strip with a 1 by 1 tile, andthen finishing by tiling the remaining 1 by n � 1 strip in any of the a

n�1

admissible ways;OR by first tiling the initial 1 by 3 strip with a 1 by 3 tile, and then finishing by tiling theremaining 1 by n� 3 strip in any of the a

n�3

admissible ways. It follows that for n � 4 wehave a

n

= a

n�1

+ a

n�3

. So a

n

(for n � 1) is determined by the recurrence

a

n

=

8>><

>>:

1 if n = 1,1 if n = 2,2 if n = 3, and

a

n�1

+ a

n�3

if n � 4.

15

Page 16: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

Notice that this gives us enough information to calculate a

n

for all n � 1: for example,a

4

= a

3

+ a

1

= 3, a5

= a

4

+ a

2

= 4, and a

6

= a

5

+ a

3

= 6.Now we prove, by strong induction, that a

n

< 1.5n. That a1

= 1 < 1.51, a2

= 1 < (1.5)2

and a

3

= 2 < (1.5)3 is obvious. For n � 4, we have

a

n

= a

n�1

+ a

n�3

< (1.5)n�1 + (1.5)n�3

= (1.5)n 2

3+

✓2

3

◆3

!

= (1.5)n✓26

27

< (1.5)n,

(the second line using the inductive hypothesis) and we are done by induction.

Notice that we really needed strong induction here, and we really needed all three of thebase cases n = 1, 2, 3 (think about what would happen if we tried to use regular induction,or what would happen if we only verified n = 1 as a base case); notice also that an inductionargument can be written quite concisely, while still being fully correct, without fussing toomuch about “P (n)”.

Induction beyond NInduction can work to prove families of statements indexed other than N. Rather than givinga general statement, we present an illustrative example. Suppose we have a doubly-infinitesequence (a

n,k

)1n,k=0

that is defined by the rules

• a

0,0

= 1;

• a

n,0

= 1 for all n > 0;

• a

0,k

= 0 for all k > 0; and

• a

n,k

= a

n�1,k

+ a

n�1,k�1

for n, k > 0.

(Convince yourself that this does uniquely define an,k

for any n, k � 0). Checking numeroussmall values suggests that for all n, k � 0,

a

n,k

=

⇢n!

k!(n�k)!

if n � k,

0 if k > n,

where n! is defined to be n ⇥ (n � 1) ⇥ . . . ⇥ ⇥1 if n � 1, with 0! = 1 (this is the factorialfunction, about which we will have a lot to say later).

We can prove this by induction; but it can’t be quite the same induction as before, sincethe family of statements about a

n,k

is indexed not by N but by N⇥N. One way to deal withthis is to introduce a new parameter ` = n + k, and give a proof by induction on ` of thestatement that the above formula for a

n,k

is correct whenever n+ k = `. Another approach

16

Page 17: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

is to proof the statement by an outer induction on n, and then an inner induction on k;essential this means that we deduce the truth of the statement about a

n,k

from the truth ofthe statements about a

n,k

0 for all 0 k

0< k (if any) and about a

n

0,k

0 for all 0 n

0< n and

all 0 k

0 (again, if any). We leave the details of these approaches to the reader!

17

Page 18: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

3.1 Week two problems

1. Let f(n) be the number of regions which are formed by n lines in the plane, whereno two lines are parallel and no three meet in a point (so f(1) = 2, f(2) = 4 andf(3) = 7). Find a formula for f(n), and prove that it is correct.

2. Let r be a real number such that r + 1/r is an integer. Prove that for every positiveinteger n, the real number

r

n +1

r

n

is an integer.

3. Define a sequence (an

)n�1

by

a

1

= 1, a

2n

= a

n

, and a

2n+1

= a

n

+ 1.

Prove that an

counts the number of 1’s in the binary representation of n.

4. At time 0, a particle resides at the point 0 on the real line. Just before 1 second passes,it divides into 2 particles that fly in opposite directions and stop at distance 1 fromthe original particle. Just before 2 seconds pass, each of these particles again dividesinto 2 particles flying in opposite directions and stopping at distance 1 from the pointof division, and so on, every second. Whenever two particles meet they annihilate eachother (leaving nothing behind). How many particles will there be at time 211 + 1?

5. The numbers 1 through 2n are partitioned into two sets A and B of size n, in anarbitrary manner. The elements a

1

, . . . , a

n

of A are sorted in increasing order, that is,a

1

< a

2

< . . . < a

n

, while the elements b1

, . . . , b

n

of B are sorted in decreasing order,that is, b

1

> b

2

> . . . > b

n

. Find (with proof!) the value of the sum

nX

i=1

|ai

� b

i

|.

6. On an infinite sheet of white graph paper (a paper with a square grid), n squaresare colored black. At moments t = 1, 2, . . ., squares are recolored according to thefollowing rule: each square gets the color occurring at least twice in the triple formedby this square, its top neighbor, and its right neighbor. Prove that after the momentt = n, all squares are white.

18

Page 19: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

3.2 Week two solutions

1. Let f(n) be the number of regions which are formed by n lines in the plane, whereno two lines are parallel and no three meet in a point (so f(1) = 2, f(2) = 4 andf(3) = 7). Find a formula for f(n), and prove that it is correct.

Solution: Suppose you have n lines down already, so f(n) regions. The (n+1)st line,not being parallel to any other will, will meet all n, and all at di↵erent places (sinceno three lines meet in a point). Without loss of generality we can assume that the(n + 1)st line is the x-axis, and along the line we can mark, in order, the n meetingpoints with other lines, �1 < x

1

< x

2

< . . . < x

n

< 1. The segment on the (n+1)stline from �1 to x

1

form the boundary of two regions (above and below it) that werepreviously one region; so this segment adds one region to the total. Similarly all theother segments add one region. There are n+ 1 segments in all, so we get the relation

f(n+ 1) = f(n) + n+ 1 ((for n � 1)), f(1) = 2.

Computing the first few values, it seems clear that f(n) grows quadratically, and that infact f(n) = (n2 +n+2)/2. We prove this by induction on n, with P (n) the statement“f(n) = (n2 + n + 2)/2”. P (1) asserts “f(1) = (12 + 1 + 2)/2 = 2, which is true.Suppose P (n) is true for some n � 1. Let’s look at P (n + 1), which is the assertion“f(n+1) = ((n+1)2+(n+1)+2)/2 = (n2+3n+4)/2”. Since P (n) is assumed true,we know

f(n) =n

2 + n+ 2

2.

We also know f(n+ 1) = f(n) + n+ 1, so

f(n+ 1) =n

2 + n+ 2

2+ n+ 1 =

n

2 + 3n+ 4

2,

and so indeed P (n + 1) is true. That P (n) is true for all n � 1, i.e., that f(n) =(n2 + n+ 2)/2 for all n � 1, has now been proved by induction.

Source: This is a classic.

2. Let r be a real number such that r + 1/r is an integer. Prove that for every positiveinteger n, the real number

r

n +1

r

n

is an integer.

Solution: Note that r 6= 0. Try induction on n; base case n = 1 is given. For n > 1,

r

n +1

r

n

=

✓r +

1

r

◆✓r

n�1 +1

r

n�1

◆�✓r

n�2 +1

r

n�2

◆.

By (strong) induction, all three terms in parentheses on the right-hand side are integers(not quite: when n = 2, one of the terms is r0 + 1/r0, which is an integer but not byinduction), so the right-hand side is an integer.

Source: Told to me by Jay, a student in 43900 in 2013.

19

Page 20: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

3. Define a sequence (an

)n�1

by

a

1

= 1, a

2n

= a

n

, and a

2n+1

= a

n

+ 1.

Prove that an

counts the number of 1’s in the binary representation of n.

Solution: Let f(n) count the number of 1’s in the binary representation of n. We firstshow that

f(1) = 1, f(2n) = f(n), and f(2n+ 1) = f(n) + 1.

This is easy: Clearly f(1) = 1; if the binary representation of n is a1

a

2

. . . a

k

, then thebinary representation of 2n is a

1

a

2

. . . a

k

0, so f(2n) = f(n); if the binary representationof n is a

1

a

2

. . . a

k

, then the binary representation of 2n+1 is a1

a

2

. . . a

k

1, so f(2n+1) =f(n) + 1.

Since f(n) satisfies the same initial conditions as an

, and the same recurrence, it seemsclear that f(n) = a

n

. Formally, we prove the statement “f(n) = a

n

” for all n � 1 byby strong induction. For n = 1 it’s clear. For n > 1, if n = 2m is even then we have

f(n) = f(m) = a

m

= a

n

,

the first equality by what we’ve proved about f , the second by (strong) induction, andthe third by hypothesis on a. Similarly if n = 2m+ 1 is odd then we have

f(n) = f(m) + 1 = a

m

+ 1 = a

n

,

and we are done.

Remark: The above induction prove works (suitably modified) to establish rigorouslythe evident but important fact that if two sequences are defined recursively, with thesame initial conditions and same recurrence relations, then they are in fact the samesequence.

Source: I found this on Stanford’s Putnam prep site, where it is sourced to the book“The Art and Craft of Problem Solving” by P. Zeitz.

4. At time 0, a particle resides at the point 0 on the real line. Just before 1 second passes,it divides into 2 particles that fly in opposite directions and stop at distance 1 fromthe original particle. Just before 2 seconds pass, each of these particles again dividesinto 2 particles flying in opposite directions and stopping at distance 1 from the pointof division, and so on, every second. Whenever two particles meet they annihilate eachother (leaving nothing behind). How many particles will there be at time 211 + 1?

Solution: We prove the following by induction on m � 1: at time 2m � 1 (at themoment when 2m � 1 seconds have passed), there is a single particle at every oddnumber from �2m + 1 to 2m + 1; AND, at no earlier time has there a particle as faraway from 0 as ±(2m � 1).

20

Page 21: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

Once we have this, we easily see that at time 2m there is a single particle at each of±2m (all other newly created particles have annihilated each other), so that at time2m+1 there are four particles, at �2m� 1, �2m+1, 2m� 1 and 2m+1. In particular,at time 211 + 1 there are four particles.

The base case for the induction is clear. For the induction step, assume that for somem � 1, at time 2m � 1 there is a single particle at every odd number from �2m + 1 to2m + 1, and at no earlier time has there a particle as far away from 0 as ±(2m � 1). Itfollows that at time 2m, there will be particles at ±2m, and no others (all other newlycreated particles have annihilated each other).

Consider the evolution of the particles at ±2m. Scaling the whole system to recenterat 2m, after a further 2m� 1 seconds the particle at 2m will have given rise to particlesat every odd number from (�2m + 1) + 2m to (2m � 1) + 2m, and this particle will nothave created any particle that goes beyond 1 (to the left) or 2m+1 � 1 (to the right).[This is the induction hypothesis]. Similarly, the particle at �2m will have given rise toparticles at every odd number from (�2m +1)� 2m to (2m � 1)� 2m, and this particlewill not have created any particle that goes beyond �1 (to the right) or �2m+1+1 (tothe left).

These two applications of the induction hypothesis proceeded independently of eachother; but in fact since the evolution of the particle at 2m stays to the right of 0 and theevolution of the particle at �2m stays to the left of 0, the two can be run simultaneouslywithout interacting.

It follows that at time 2m+1 � 1 there is a single particle at every odd number from�2m+1 + 1 to 2m+1 + 1, and at no earlier time has there a particle as far away from 0as ±(2m+1 � 1). This completes the induction.

Source: From Matousek and Nesetril, Invitation to Discrete Mathematics, Section 1.3exercise 9 (of 2nd edition).

5. The numbers 1 through 2n are partitioned into two sets A and B of size n, in anarbitrary manner. The elements a

1

, . . . , a

n

of A are sorted in increasing order, that is,a

1

< a

2

< . . . < a

n

, while the elements b1

, . . . , b

n

of B are sorted in decreasing order,that is, b

1

> b

2

> . . . > b

n

. Find (with proof!) the value of the sum

nX

i=1

|ai

� b

i

|.

Solution: The wording of the question strongly suggests that the answer is indepen-dent of the choice of A and B, so we should start with a particularly nice choice of Aand B, see what answer we get, conjecture that this is always the answer, and thentry to prove the conjecture.

Letting A = {1, 2, 3, . . . , n} and B = {2n, 2n� 1, . . . , n+ 1}, we find that

nX

i=1

|ai

� b

i

| = (2n� 1) + (2n� 3) + . . .+ 1 = n

2

21

Page 22: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

(it is an easy induction that the sum of the first n odd positive integers is n2).

So, we try to prove by induction thatP

n

i=1

|ai

� b

i

| = n

2. The base case n = 1 istrivial.

For n � 2, we can consider two cases. Case 1 is when 1 and 2n end up in di↵erentpartition classes. Let’s start by considering 1 2 A, 2n 2 B. In this case, |a

1

� b

1

| willcontribute 2n� 1 to the sum. What about the remaining terms? Notice that A \ {1}and B \ {2n} form a partition {a

2

, . . . , a

n

} [ {b2

, . . . , b

n

} of {2, . . . , 2n � 1}, with thea’s increasing and the b’s decreasing. Setting a

01

= a

2

� 1, a02

= a

3

� 1, etc., up toa

0n�1

= a

n

� 1, and also setting b

01

= b

2

� 1, b02

= b

3

� 1, etc., up to b

0n�1

= b

n

� 1, weget that A0 and B

0 form a partition {a01

, . . . , a

0n�1

} [ {b01

, . . . , b

0n�1

} of {1, . . . , 2n� 2},with the a

0’s increasing and the b

0’s decreasing. By induction,

n�1X

i=1

|a0i

� b

0i

| = (n� 1)2,

and so, since |a0i

� b

0i

| = |ai+1

� b

i+1

| for each i,

nX

i=1

|ai

�b

i

| = (2n�1)+nX

i=2

|ai+1

�b

i+1

| = (2n�1)+n�1X

i=1

|a0i

�b

0i

| = (2n�1)+(n�1)2 = n

2

.

If 2n 2 A, 1 2 B, an almost identical argument gives the same result.

Case 2 is where 1 and 2n end up in the same partition class. We start with the casewhere 1, 2n 2 A. Let x be such that 1, 2, . . . , x 2 A, but x+ 1 2 B. Then

nX

i=1

|ai

� b

i

| =xX

i=1

(bi

� i) +n�1X

i=x+1

|ai

� b

i

|+ (2n� (x+ 1)).

(Note that this is valid even if x = n � 1, the largest it can possibly be; the secondsum in this case is empty and so 0). If we modify A and B to form A

0 = {a01

, . . . , a

0n

},B

0 = {b01

, . . . , b

0n

} by swapping 1 and x+ 1, then

nX

i=1

|a0i

� b

0i

| =xX

i=1

(bi

� (i+ 1)) +n�1X

i=x+1

|ai

� b

i

|+ (2n� 1)

=xX

i=1

(bi

� i) +n�1X

i=x+1

|ai

� b

i

|+ (2n� (x+ 1))

=nX

i=1

|ai

� b

i

|.

But now (with A

0 and B

0) we are back in case 1, sonX

i=1

|ai

� b

i

| =nX

i=1

|a0i

� b

0i

| = n

2

.

A very similar reduction works if 1, 2n 2 B.

Source: From the UMass Putnam preparation class.

22

Page 23: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

6. On an infinite sheet of white graph paper (a paper with a square grid), n squaresare colored black. At moments t = 1, 2, . . ., squares are recolored according to thefollowing rule: each square gets the color occurring at least twice in the triple formedby this square, its top neighbor, and its right neighbor. Prove that after the momentt = n, all squares are white.

Solution: (Sketch) Strong induction on n. Let R be the lowest row initially containinga black square, and let C be the leftmost such column. By the inductive hypothesis,after moment n� 1 all squares above R are white, and also all squares to the right ofC. The only possible remaining black square at the intersection of R and C disappearsat the moment n.

Source: From Matousek and Nesetril, Invitation to Discrete Mathematics, Section 1.3exercise 8 (of 2nd edition).

23

Page 24: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

4 Week three (September 8) — Pigeon-hole principle

“If n+1 pigeons settle themselves into a roost that has only n pigeonholes, then there mustbe at least one pigeonhole that has at least two pigeons.”

This very simple principle, sometimes called the box principle, and sometimes Dirichlet’sbox principle, can be very powerful.

The proof is trivial: number the pigeonholes 1 through n, and consider the case where ai

pigeons land in hole i. If each a

i

1, thenP

n

i=1

a

i

n, contradicting the fact that (sincethere are n+ 1 pigeons in all)

Pn

i=1

a

i

= n+ 1.Since it’s a simple principle, to get some power out of it it has to be applied cleverly (in the

examples, there will be at least one such clever application). Applying the principle requiresidentifying what the pigeons should be, and what the pigeonholes should be; sometimes thisis far from obvious.

The pigeonhole principle has many obvious generalizations. I’ll just state one of them:“if more than mn pigeons settle themselves into a roost that has no more than n pigeonholes,then there must be at least one pigeonhole that has at least m+ 1 pigeons”.

Example: 10 points are placed randomly in a 1 by 1 square. Show that there must be somepair of points that are within distance

p2/3 of each other.

Solution: Divide the square into 9 smaller squares, each of dimension 1/3 by 1/3. Theseare the pigeonholes. The ten randomly chosen points are the pigeons. By the pigeonholeprinciple, at least one of the 1/3 by 1/3 squares must have at least two of the ten points in it.The maximum distance between two points in a 1/3 by 1/3 square is the distance betweentwo opposite corners. By Pythagoras this is

p(1/3)2 + (1/3)2 =

p2/3, and we are done.

Example: Show that there are two people in New York City who have the exactly samenumber of hairs on their head.

Solution: Trivial, because surely there are at least two baldies in NYC! But even if weweren’t sure of that: a quick websearch shows that a typical human head has around 150,000hairs, and it is then certainly reasonable to assume that no one has more than 5,000,000hairs on their head. Set up 5,000,001 pigeonholes, numbered 0 through 5,000,000, and place aresident of NYC (a “pigeon”) into bin i if (s)he has i hairs on her head. Another websearchshows that the population of NYC is around 8,300,000, so there are more pigeons thanpigeonholes, and some pigeonhole must have multiple pigeons in it.

Example: Show that every sequence of nm + 1 real numbers must contain EITHER adecreasing subsequence of length n+1 OR an increasing subsequence of length m+1. (In asequence a

1

, a

2

, . . ., an increasing subsequence is a subsequence ai1 , ai2 , . . . [with i

1

< i

2

< . . .]satisfying a

i1 a

i2 . . ., and a decreasing subsequence is defined analogously).

Solution: Let the sequence be a

1

, . . . , a

nm+1

. For each k, 1 k nm + 1, let f(k) be thelength of the longest decreasing subsequence that starts with a

k

, and let g(k) be the lengthof the longest increasing subsequence that starts with a

k

. Notice that f(k), g(k) � 1 always.If there is a k with either f(k) � n+1 or g(k) � m+1, we are done. If not, then for every

k we have 1 f(k) n and 1 g(k) m. Set up nm pigeonholes, with each pigeonholelabeled by a di↵erent pair (i, j), 1 i n, 1 j m (there are exactly nm such pairs).

24

Page 25: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

For each k, 1 k nm+ 1, put ak

in pigeonhole (i, j) i↵ f(k) = i and g(k) = j. There arenm+ 1 pigeonholes, so one pigeonhole, say hole (r, s), has at least two pigeons in it.

In other words, there are two terms of the sequence, say a

p

and a

q

(where without lossof generality p < q), with f(p) = f(q) = r and g(p) = g(q) = s.

Suppose a

p

� a

q

. Then we can find a decreasing subsequence of length r + 1 startingfrom a

p

, by starting a

p

, a

q

, and then proceeding with any decreasing subsequence of lengthr that starts with a

q

(one such exists, since f(q) = r). But that says that f(p) � r + 1,contradicting f(p) = r.

On the other hand, suppose a

p

a

q

. Then we can find an increasing subsequence oflength s + 1 starting from a

p

, by starting a

p

, a

q

, and then proceeding with any increasingsubsequence of length s that starts with a

q

(one such exists, since g(q) = s). But that saysthat g(p) � s+ 1, contradicting g(p) = s.

So, whether ap

� a

q

or ap

a

q

, we get a contradiction, and we CANNOT ever be in thecase where there is NO k with either f(k) � n + 1 or g(k) � m + 1. This completes theproof.

Remark: This beautiful result was discovered by P. Erdos and G. Szekeres in 1935; theincredibly clever application of pigeonholes was given by A. Seidenberg in 1959.

25

Page 26: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

4.1 Week three problems

1. Given a sequence a

1

, . . . , a

m

of length m, show that there is a consecutive subse-quence whose sum is divisible by m. (A consecutive subsequence means a subsequencea

i

, a

i+1

, a

i+2

, . . . a

i+j�1

of length j, where j could be as small as one.)

2. (a) 51 di↵erent integers are chosen between 1 and 100, inclusive. Show that some twoof them are coprime (have no prime factor in common).

(b) 51 di↵erent integers are chosen between 1 and 100, inclusive. Show that there aresome two of them such that one divides the other.

3. A partition of a set X is a collection of disjoint non-empty subsets (the parts) whoseunion is X. For a partition ⇡ of X, and an element x 2 X, let ⇡(x) denote the numberof elements in the part containing x.

Let ⇡, ⇡

0 be any two partitions of {1, 2, . . . , 9}. Show that there are two distinctnumbers x and y in {1, 2, . . . , 9} such that ⇡(x) = ⇡(y) and ⇡

0(x) = ⇡

0(y).

4. Recall that a regular icosahedron is a convex polyhedron having 12 vertices and 20 faces;the faces are congruent equilateral triangles. On each face of a regular icosahedron iswritten a nonnegative integer such that the sum of all 20 integers is 39. Show thatthere are two faces that share a vertex and have the same integer written on them.

5. Show that among any 4n�1 people, there are either some n of them who mutually knoweach other, or some n who mutually don’t know each other. (The relation “knowing”is assumed to be symmetric — if I know you, you know me, and vice-versa.)

6. The Fibonacci numbers are defined by the recurrence f

0

= 0, f1

= 1 and f

n

= f

n�1

+f

n�2

for n � 2. Show that the Fibonacci sequence is periodic modulo any positiveinteger. (I.e, show that for each k � 1, the sequence whose nth term is the remainderof f

n

on division by k is a periodic sequence).

26

Page 27: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

4.2 Week three solutions

1. Given a sequence a

1

, . . . , a

m

of length m, show that there is a consecutive subse-quence whose sum is divisible by m. (A consecutive subsequence means a subsequencea

i

, a

i+1

, a

i+2

, . . . a

i+j�1

of length j, where j could be as small as one.)

Solution: Let at the m numbers a

1

, a1

+ a

2

, etc., up to a

1

+ . . . + a

m

. If any oneof these is divisible by m, we are done. If not, then these m numbers have betweenthem at most m� 1 remainders on division by m (1 through m� 1), so by pigeon-holeprinciple, some two of them must have the same remainder on division by m.

Say those two are a

1

+ . . . + a

k

and a

1

+ . . . + a

k

+ . . . + a

`

for some ` > k. Then thedi↵erence of these two, a

k+1

+ . . .+ a

`

, is divisible by m.

Source: This is a classic.

2. (a) 51 di↵erent integers are chosen between 1 and 100, inclusive. Show that some twoof them are coprime (have no prime factor in common).

Solution: Among 51 numbers chosen from between 1 and 100, two must be con-secutive, and so coprime (use pigeon-hole principle with 50 pigeon-holes labelled“1, 2”, “3, 4”, etc., up to “99, 100”).

(b) 51 di↵erent integers are chosen between 1 and 100, inclusive. Show that there aresome two of them such that one divides the other.

Solution: Every positive whole number can be expressed uniquely as n = m2k

where m is odd and k is a non-negative whole number. Create 50 pigeon-holeslabelled “1”, “3”, etc., up to “99”. Place number n in pigeon-hole labelled “m”if n = m2k for some non-negative whole number k. By the pigeon-hole principle,there is some odd m such that there are two distinct numbers n

1

, n

2

among the51 with n

1

= m2k1 and n

2

= m2k2 . The smaller of these divides the larger.

Source: These problems were favorites of Paul Erdos. The first is often called “Posa’ssoup problem”; see http://www.math.uwaterloo.ca/navigation/ideas/articles/honsberger/index.shtml for an explanation.

3. A partition of a set X is a collection of disjoint non-empty subsets (the parts) whoseunion is X. For a partition ⇡ of X, and an element x 2 X, let ⇡(x) denote the numberof elements in the part containing x.

Let ⇡, ⇡

0 be any two partitions of {1, 2, . . . , 9}. Show that there are two distinctnumbers x and y in {1, 2, . . . , 9} such that ⇡(x) = ⇡(y) and ⇡

0(x) = ⇡

0(y).

Solution: We want to show that at least 4 elements x must have the same valueof ⇡(x). Why is this helpful? Because these 4 elements can’t possible have distinctvalues of ⇡0(x); the smallest possible 4 distinct values are 1, 2, 3 and 4, accountingfor 10 elements of a 9-element set. So there are two among the 4, say x, y, with⇡

0(x) = ⇡

0(y), and of course ⇡(x) = ⇡(y), so we are done.

27

Page 28: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

Suppose ⇡ has a part of size 4 or more. Then definitely at least 4 elements x musthave the same value of ⇡(x). So assume that every part in ⇡ has size 3 or less. Thepossibilities for the part sizes are:

3, 3, 3 ! has 9 elements with same value of ⇡(x)

3, 3, 2, 1 ! has 6 elements with same value of ⇡(x)

3, 3, 1, 1, 1 ! has 6 elements with same value of ⇡(x)

3, 2, 2, 2 ! has 6 elements with same value of ⇡(x)

3, 2, 2, 1, 1 ! has 4 elements with same value of ⇡(x)

3, 2, 1, 1, 1, 1 ! has 4 elements with same value of ⇡(x)

3, 1, 1, 1, 1, 1, 1 ! has 6 elements with same value of ⇡(x)

2, 2, 2, 2, 1 ! has 8 elements with same value of ⇡(x)

2, 2, 2, 1, 1, 1 ! has 6 elements with same value of ⇡(x)

2, 2, 1, 1, 1, 1, 1 ! has 5 elements with same value of ⇡(x)

2, 1, 1, 1, 1, 1, 1, 1 ! has 7 elements with same value of ⇡(x)

1, 1, 1, 1, 1, 1, 1, 1, 1 ! has 9 elements with same value of ⇡(x).

(Of course this could have been done more e�ciently!) In all cases, there are at least4 elements x with the same value of ⇡(x).

Source: Putnam competition 1995, B1

4. Recall that a regular icosahedron is a convex polyhedron having 12 vertices and 20 faces;the faces are congruent equilateral triangles. On each face of a regular icosahedron iswritten a nonnegative integer such that the sum of all 20 integers is 39. Show thatthere are two faces that share a vertex and have the same integer written on them.

Solution: A key thing to know about the icosahedron is how many faces meet at eachvertex. Suppose it is x. The the number of pairs (v, F ) where v is a vertex and F isa face that has v as a vertex is 12x (each of 12 vertices contributes x to the number);but it is also 3⇥ 20 (each of 20 faces contributes 3 to the number). So x = 5.

Suppose that there are no two faces that share a vertex and have the same integerwritten on them. Then, for each vertex, the smallest possible sum of the five numberson the faces meeting that vertex is 0 + 1 + 2 + 3 + 4 = 10. Consider the double sum

X

vertices x

X

faces F touching x

number on F .

We have just argued that for each x, the inner sum is at least 10, so the double sum isat least 120. But because each face is a triangle, the double sum counts each numberexactly three times, and hence the sum is 3⇥ 39 = 117. This is a contradiction; hence,there are no two faces that share a vertex and have the same integer written on them.

Source: Putnam competition 2013, A1.

28

Page 29: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

5. Show that among any 4n�1 people, there are either some n of them who mutually knoweach other, or some n who mutually don’t know each other. (The relation “knowing”is assumed to be symmetric — if I know you, you know me, and vice-versa.)

Solution: Note that 4n�1 = 22n�2. Pick a person a

1

arbitrarily. Of the remaining22n�2 � 1 people, it must be the case that either a

1

knows at least 22n�3 of them, ordoesn’t know at least 22n�3 of them (this is pigeon-hole principle, essentially; if sheknows fewer than 22n�3, and doesn’t know fewer than 22n�3, this accounts for fewerthan 22n�2 � 1 people).

If a1

knows at least 22n�3 people, then label a1

with a “K”, and select arbitrarily asubset of the people she knows of size 22n�3. Remove all other people from considera-tion. If she doesn’t know at least 22n�3 people, then label her with a “D”, and selectarbitrarily a subset of the people she doesn’t know of size 22n�3. Remove all otherpeople from consideration.

Repeat: select an arbitrary person a

2

from among the 22n�3 people left under consid-eration after a

1

has been dealt with; among the 22n�3 � 1 people that a2

may know ornot know (not counting a

1

), she either knows at least 22n�4 of them, or doesn’t knowthis many; in the former case, label a

2

“K” and select a subset of size 22n�4 of people(other than a

1

) that she knows, removing all others from consideration; in the lattercase, label a

2

“D” and select a subset of size 22n�4 of people (other than a

1

) that shedoesn’t know, removing all others from consideration.

Iterate this process until we have selected a

1

, a

2

, . . . , a

2n2 . Notice that when we considera

2n�2

, there is one person left unconsidered (if a2n�2

knows this person, she gets label“K”; if not, label “D”). Call this last person a

2n�1

.

Two labels have been used to label a1

through a

2n�2

, so, by pigeon-hole, one of thelabels must be used at least n� 1 times [note that we could have said the same thingif we had only up to a

2n�3

; so the “4n�1” at the beginning of the problem could bereplaced by “4n�1

/2”]. Say that that label is “K”. Then any collection of n� 1 of thea

i

’s with label “K”, together with a

2n�1

, form a collection of n people who mutuallyknow each other (that a

i

knows a

j

for i < j follows from the fact that a

i

has label“K”). On the other hand, if that label is “D” then any collection of n � 1 of the a

i

’swith label “D”, together with a

2n�1

, form a collection of n people who mutually don’tknow each other.

Source: This is (a version of) Ramsey’s theorem, a central theorem in combinatorics.

6. The Fibonacci numbers are defined by the recurrence f

0

= 0, f1

= 1 and f

n

= f

n�1

+f

n�2

for n � 2. Show that the Fibonacci sequence is periodic modulo any positiveinteger. (I.e, show that for each k � 1, the sequence whose nth term is the remainderof f

n

on division by k is a periodic sequence).

Solution: Consider the sequence obtained from the Fibonacci sequence by taking theremainder of each term on division by k (so the result is a sequence, all terms in{0, . . . , k � 1}). Suppose that there are two consecutive terms in this sequence, saythe mth and (m + 1)st, taking values a, b, and two other consecutive terms , say the

29

Page 30: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

nth and n + 1st, taking the same values a, b (with m < n). Then the (m + 2)nd and(n+ 2)nd terms of the reduced sequence agree.

[WHY? Because the (m+2)nd term is the remainder of Fm+2

on division by k, which isthe remainder of F

m

+F

m+1

on division by k, which is the remainder of Fm

on divisionby k PLUS the remainder of F

m+1

on division by k, which is the remainder of a ondivision by k PLUS the remainder of b on division by k, which is the remainder of F

n

on division by k PLUS the remainder of Fn+1

on division by k, which is the remainderof F

n

+ F

n+1

on division by k, which is the remainder of Fn+2

on division by k.]

The same argument shows that the reduced sequence is periodic beyond themth terms,with period (at most) n�m.

So all we need to do to find periodicity is to find two consecutive terms in the sequence,that agree with two other consecutive terms. There are only k

2 possibilities for a pairof consecutive values in the sequence, and infinitely many consecutive values, so byPHP there has to be a coincidence of the required kind.

Source: Northwestern Putnam prep class.

30

Page 31: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

5 Week four (September 15) — Binomial coe�cients

Binomial coe�cients crop up quite a lot in Putnam problems. This handout presents someways of thinking about them.

Introduction

The binomial coe�cient�n

k

�, with n 2 N and k 2 Z, can be defined many ways; possi-

bly the most helpful definition from the point of view of problem-solving is the followingcombinatorial one:

✓n

k

◆is the number of subsets of size k of a set of size n.

In particular, this definition immediately tells us that for all n � 0 we have�n

k

�= 0 if k > n

or if k < 0, and that�n

0

�=�n

n

�= 1 (and so in particular

�0

0

�= 1).

The binomial coe�cients can also be defined by a recurrence relation: for n � 1, and allk 2 Z, we have the recurrence

✓n

k

◆=

✓n� 1

k

◆+

✓n� 1

k � 1

◆, (Pascal’s identity)

with initial conditions�0

k

�= 0 if k 6= 0, and

�0

0

�= 1. To see that this recurrence does indeed

generate the binomial coe�cients, think about the combinatorial interpretation: the subsetsof {1, . . . , n} of size k (

�n

k

�of them) partition into those that don’t include element n (

�n�1

k

of them) and those that do include element n (�n�1

k�1

�of them). The recurrence allows us

to quickly compute small binomial coe�cients via Pascal’s triangle: the zeroth row of thetriangle has length one, and consists just of the number 1. Below that, the first row has two1’s, one below and to the left of the 1 in the zeroth row, and one below and to the right ofthe 1 in the zeroth row. The second row has three entries, a 1 below and to the left of theleftmost 1 in the first row, a 1 below and to the right of the rightmost 1 in the first row,and in the center a 2. Each subsequent row contains one more entry than the previous row,starting with a 1 below and to the left of the leftmost 1 in the previous row, ending with a1 below and to the right of the rightmost 1 in the previous row, and with all other entriesbeing the sum of the two entries in the previous row above to the left and to the right of theentry being considered (see the picture below).

31

Page 32: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

1

1 1

1 2 1

1 3 3 1

1 4 6 4 1

1 5 10 10 5 1

1 6 15 20 15 6 1

etc.

Pascal’s triangle in numbers

The kth entry in row k (counting from 0 rather than 1 both down and across) is then�n

k

�(this is just a restatement of Pascal’s identity) (see the picture below).

�0

0

�1

0

� �1

1

�2

0

� �2

1

� �2

2

�3

0

� �3

1

� �3

2

� �3

3

�4

0

� �4

1

� �4

2

� �4

3

� �4

4

�5

0

� �5

1

� �5

2

� �5

3

� �5

4

� �5

5

�6

0

� �6

1

� �6

2

� �6

3

� �6

4

� �6

5

� �6

6

etc.

Pascal’s triangle symbolically

Finally, there is a algebraic expression for�n

k

�, that makes sense for all n, k � 0, using

the factorial function (defined combinatorially as the number of ways of arranging n distinctobjects in order, and algebraically by n! = n(n � 1)(n � 2) . . . (3)(2)(1) for n � 1, with0! = 1): ✓

n

k

◆=

n(n� 1) . . . (n� (k � 1))

k!=

n!

k!(n� k)!.

To see this, note that n(n� 1) . . . (n� (k� 1)) is fairly evidently the number of ordered listsof k distinct elements from {1, . . . , n} (often referred to in textbooks as “permutations of n

32

Page 33: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

items taken k at a time” — ugh). When the ordered lists are turned into (unordered) subsets,each subset appears k! times (once for each of the k! ways of putting k distinct objects intoan ordered list), so we need to divide the ordered count by k! to get the unordered count.

When dealing with binomial coe�cients, it is very helpful to bear all three definitions inmind, but in particular the first two.

Identities

The binomial coe�cients satisfy a staggering number of identities. The simplest of theseare easily understood using either the combinatorial or algebraic definitions; for the moreinvolved ones, that include sums, the algebraic definition is usually next to useless, andoften the easiest way to prove the identity is combinatorially, by showing that both sides ofthe identity count the same thing in di↵erent ways (illustration below), though it is oftenpossible also to prove these identities by induction, using the recurrence relation. Anotherapproach that is helpful is that of generating functions.

Here are some of the basic binomial coe�cient identities:

1. (Symmetry) ✓n

k

◆=

✓n

n� k

(Proof: trivial from the algebraic definition; combinatorially, left-hand side countsselection of subsets of size k from a set of size n, by naming the selected elements;right-hand side also counts selection of subsets of size k from a set of size n, this timeby naming the unselected elements).

2. (Lower summation)nX

k=0

✓n

k

◆= 2n

(Proof: close to impossible using the algebraic definition; combinatorially, very straight-forward: left-hand side counts the number of subsets of a set of size n, by first decidingthe size of the subset, and then choosing the subset itself; right-hand side also countsthe number of subsets of a set of size n, by going through the n elements one-by-oneand deciding whether they are in the subset or not).

3. (Upper summation)nX

m=k

✓m

k

◆=

✓n+ 1

k + 1

◆.

4. (Parallel summation)nX

k=0

✓m+ k

k

◆=

✓n+m+ 1

n

◆.

5. (Square summation)nX

k=0

✓n

k

◆2

=

✓2n

n

◆.

33

Page 34: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

6. (Vandermonde identity, or Vandermonde convolution)

rX

k=0

✓m

k

◆✓n

r � k

◆=

✓n+m

r

◆.

The binomial theorem

This is the most important identity involving binomial coe�cients: for all real x and y, andn � 0,

(x+ y)n =nX

k=0

✓n

k

◆x

n�k

y

k

.

This can be proved by induction using Pascal’s identity, but the proof is quite awkward.Here’s a nice combinatorial proof. First, note that the identity is trivial if either x = 0 ory = 0, so we may assume x, y 6= 0. Dividing through by x

n, the identity is the same as

(1 + z)n =nX

k=0

✓n

k

◆z

k

.

We will prove this combinatorially when z is a positive integer. The left-hand side countsthe number of words of length n from alphabet {0, 1, 2, . . . , z}, by deciding on the lettersone after the other. The right-hand side also counts the number of words of length n fromalphabet {0, 1, 2, . . . , z}, as follows: first decide how many of the letters of the word are from{1, . . . , z} (this is the k of the summation). Next, decide the location of these k letters (thisis the

�n

k

�). Finally, decide what specific letters go into those spots, one after another (this

is the z

k) (note that the remaining n� k letters must all be 0’s).This only shows the identity for positive integer z. But now we use the fact that both

the right-hand and left-hand sides are polynomials of degree n, so if they agree at n + 1di↵erent values of z, they must agree at all values of z (otherwise, their di↵erence is a not-identically-zero polynomial of degree at most n with n+ 1 distinct roots, an impossibility).And indeed, the two sides agree not just at n+1 di↵erent values of z, but at infinitely many(all positive integers z). So from the combinatorial argument that shows that the two sidesare equal for positive integers z, we infer that they are equal for all real z. This argument isoften called the polynomial principle.

There is a version of the binomial theorem also for non-positive-integral exponents: forall real ↵,

(1 + z)↵ =X

k�0

✓↵

k

◆z

k

where�↵

k

�is defined in the obvious way:

✓↵

k

◆=

↵(↵� 1) . . . (↵� k + 1)

k!(for k � 1;

�↵

0

�= 1),

and the equality is valid for all real |z| < 1. (Check: when ↵ is a positive integer, this reducesto the standard binomial theorem).

34

Page 35: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

For example, if ` > 0 is a positive integer, then✓�`

k

◆=

(�`)(�`� 1) . . . (�`� k + 1)

k!= (�1)k

✓`+ k � 1

k

◆,

and so1

(1� z)`=X

k�0

✓`+ k � 1

k

◆z

k

.

This generalizes the familiar identity

1

1� z

= 1 + z + z

2 + . . . .

Modulo the convergence analysis, the proof of the binomial theorem for general exponentsis fair easy: the coe�cient of xk in the Taylor series Taylor series of (1 + z)↵ is

1

k!

d

k

dx

k

(1 + z)↵|z=0

=

✓↵

k

◆.

Compositions and weak compositions

A composition of a positive integer n into k parts is a vector (x1

, x

2

, . . . , x

k

), with each entrya strictly positive integer, and with

Pk

i=1

x

i

= n. For example, (2, 1, 1, 3) is a compositionof 7, as is (1, 3, 1, 2); and, because a composition is a vector (ordered list), these two areconsidered di↵erent compositions.

A weak composition of a positive integer n into k parts is a vector (x1

, x

2

, . . . , x

k

), witheach entry a non-negative (possibly 0) integer, and with

Pk

i=1

x

i

= n. For example, (2, 0, 1, 3)is a weak composition of 6, but not a composition.

How many weak compositions of n are there, into k parts? Put down n+ k � 1 stars ina row. Choose k� 1 of them to turn into bars. The resulting arrangement of stars-and-barsencodes a weak composition of n into k parts — the number of stars before the first bar isx

1

, the number of stars between the first and second bar is x2

, and so on, up to the numberof stars after the last bar, which is x

k

(notice that only k � 1 bars are needed to determinek intervals of stars). Conversely, every weak composition of n into k parts is encoded byone such selection of k � 1 bars from the initial list of n + k � 1 stars. For example, theconfiguration ? ? || ? | ? ?? encodes the weak composition (2, 0, 1, 3) of 6 into 4 parts. So, thenumber of weak compositions of n into k parts is a binomial coe�cient,

�n+k�1

k�1

�.

How many compositions of n are there, into k parts? Each such composition (x1

, x

2

, . . . , x

k

)gives rise to a weak composition (x

1

� 1, x2

� 1, . . . , xk

� 1) of n � k into k parts, and allweak composition of n � k into k parts are achieved by this process. So, the number ofcompositions of n into k parts is the same as the number of weak compositions of n� k intok parts, which is

�(n�k)+k�1

k�1

�=�n�1

k�1

�.

For example: I like plain cake, chocolate cake, blueberry cake and pumpkin cake donutsfrom Dunkin’ Donuts. In how many di↵erent ways can I buy a dozen donuts that I like? Imust buy x

1

plain, x2

chocolate, x3

blueberry and x

4

pumpkin, with x

1

+ x

2

+ x

3

+ x

4

= 12,and with each x

i

a non-negative integer (possibly 0). So the number of di↵erent purchasesI can make is the number of weak compositions of 12 into 4 parts, so

�15

4

�= 1365.

35

Page 36: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

Warm-up problems

1. Give a combinatorial proof of the upper summation identity.

Solution: RHS is number of subsets of {1, . . . , n + 1} of size k + 1, counted directly.LHS counts same, by first specifying largest element in subset (if largest element isk+1, remaining k must be chosen from {1, . . . , k},

�k

k

�ways; if largest element is k+2,

remaining k must be chosen from {1, . . . , k + 1},�k+1

k

�ways; etc.).

2. Give a combinatorial proof of the parallel summation identity.

Solution: RHS is number of subsets of {1, . . . , n+m+ 1} of size n, counted directly.LHS counts same, by first specifying the smallest element not in subset (if smallestmissed element is 1, all n elements must be chosen from {2, . . . , n + m + 1},

�m+n

n

ways, the k = n term; if smallest missed element is 2, then 1 is in subset and remainingn� 1 elements must be chosen from {3, . . . , n+m+ 1},

�m+n�1

n�1

�ways, the k = n� 1

term; etc., down to: if smallest missed element is n + 1, then {1, . . . , n} is in subsetand remaining 0 elements must be chosen from {n + 2, . . . , k + 1},

�m+0

0

�ways, the

k = 0 term).

3. Give a combinatorial proof of the square summation identity.

Solution: RHS is number of subsets of {±1, . . . ,±n} of size n, counted directly.LHS counts same, by first specifying k, the number of positive elements chosen, thenselecting k positive elements (

�n

k

�ways), then selecting the k negative elements that

are not chosen (so the n� k that are, for n in total) (�n

k

�ways).

4. Give a combinatorial proof of the Vandermonde identity.

Solution: Let A = {x1

, . . . , x

m

} and B = {y1

, . . . , y

n

} be disjoint sets. RHS is numberof subsets of A[B of size r, counted directly. LHS counts same, by first specifying k,the number of elements chosen from A, then selecting r elements from A (

�m

k

�ways),

then selecting the remaining r � k elements from B (�

n

r�k

�ways).

5. EvaluatenX

k=0

(�1)k✓n

k

for n � 1.

Solution: Applying the binomial theorem with x = 1, y = 1 get

0 = (1� 1)n =nX

k=0

✓n

k

◆1n�k(�1)k =

nX

k=0

(�1)k✓n

k

so the sum is 0.

36

Page 37: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

6. (a) Let an

be the number of 0-1 strings of length n that do not have two consecutive1’s. Find a recurrence relation for a

n

(starting with initial conditions a

0

= 1,a

1

= 2).

Solution: By considering whether the last term is a 0 or a 1, get the Fibonaccirecurrence: a

n

= a

n�1

+ a

n�2

.

(b) Let an,k

be the number of 0-1 strings of length n that have exactly k 1’s and thatdo not have two consecutive 1’s. Express a

n,k

as a (single) binomial coe�cient.

Solution: Add a 0 to the beginning and end of such a string. By reading o↵a

1

, the number of 0’s before the first 1, then a

2

, the number of 0’s between thefirst 1 and the second, and so on up to a

k+1

, the number of 0’s after the last 1,we get a composition (a

1

, . . . , a

k+1

) of n + 2 � k into k + 1 parts; and each suchcomposition can be encoded (uniquely) by such a string. So a

n,k

is the number ofcompositions of n+ 2� k into k + 1 parts, and so equals

�n+1�k

k

�.

(c) Use the results of the previous two parts to give a combinatorial proof (showingthat both sides count the same thing) of the identity

F

n

=X

k�0

✓n� k � 1

k

where F

n

is the nth Fibonacci number (F1

= 1, F2

= 1, Fn

= F

n�1

+ F

n�2

forn � 3).

Solution: From the recurrence in the first part, we get an

= F

n+2

, so F

n

countsthe number of 0-1 strings of length n � 2 with no two consecutive 1’s. We cancount such strings by first deciding on k, the number of 1’s, and by the secondpart, the number of such strings is

�n�1�k

k

�. Summing over k we get the result.

37

Page 38: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

5.1 Week four problems

1. Show that the coe�cient of xk in (1 + x+ x

2 + x

3)n is

kX

j=0

✓n

j

◆✓n

k � 2j

◆.

2. n points are arranged on a circle. All possible diagonals are drawn. Assuming that nothree of the diagonals meet at a single point, how many intersections of diagonals arethere inside the circle?

3. (a) The kth falling power of x is xk = x(x� 1)(x� 2) . . . (x� (k� 1)). Prove that forall real x, y, and all n � 1,

(x+ y)n =nX

k=0

✓n

k

◆x

n�k

y

k

.

(b) The kth rising power of x is xk = x(x+ 1)(x+ 2) . . . (x+ (k� 1)). Prove that forall real x, y, and all n � 1,

(x+ y)n =nX

k=0

✓n

k

◆x

n�k

y

k

.

4. EvaluatenX

k=0

F

k+1

✓n

k

for n � 0, where F

1

, F

2

, F

3

, F

4

, F

5

, . . . are the Fibonacci numbers 1, 1, 2, 3, 5, . . ..

5. Evaluate2nX

k=0

(�1)kkn

✓2n

k

for n � 1.

6. Show that for all k � 0,

Z⇡/2

0

(2 sin x)2k dx =⇡

2

✓2k

k

◆.

38

Page 39: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

5.2 Week four solutions

1. Show that the coe�cient of xk in (1 + x+ x

2 + x

3)n is

kX

j=0

✓n

j

◆✓n

k � 2j

◆.

Solution: We have

(1 + x+ x

2 + x

3)n = (1 + x)n(1 + x

2)n

=

X

i�0

✓n

i

◆x

i

! X

i

0�0

✓n

2i0

◆x

2i

0

!.

We get an x

k term in the product by pairing each�n

i

�x

i from the first sum with�n

k�2i

�x

k�2i from the second; so the coe�cient of xk in the product is

kX

i=0

✓n

i

◆✓n

k � 2i

◆,

as claimed.

Source: 1992 Putnam competition, problem B2.

2. n points are arranged on a circle. All possible diagonals are drawn. Assuming that nothree of the diagonals meet at a single point, how many intersections of diagonals arethere inside the circle?

Solution: Each intersection inside the circle determines a unique collection of four ofthe points on the circle, by: two lines meet at each intersection, and each of the twolines has two endpoints. Conversely, each set of four points on the circle determines aunique point of intersection, by: if the four points are, in clockwise order, a, b, c, d,then the associated point of intersection is the intersection of the lines ac and bd.

It follows that there are exactly as many intersections of diagonals inside the circle, asthere are sets of points on the circle; and there are

�n

4

�such sets of points.

Source: This is a classic problem.

3. (a) The kth falling power of x is xk = x(x� 1)(x� 2) . . . (x� (k� 1)). Prove that forall real x, y, and all n � 1,

(x+ y)n =nX

k=0

✓n

k

◆x

n�k

y

k

.

39

Page 40: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

(b) The kth rising power of x is xk = x(x+ 1)(x+ 2) . . . (x+ (k� 1)). Prove that forall real x, y, and all n � 1,

(x+ y)n =nX

k=0

✓n

k

◆x

n�k

y

k

.

Solution:

(a)

(b) Here’s a combinatorial proof. Let x and y be positive integers. The number ofwords in alphabet {1, . . . , x} [ {x

1

, . . . , x+ y} of length n with no two repeatingletters, counted by selecting letter-by-letter, is (x + y)n. If instead we count byfirst selecting k, the number of letters from {x + 1, . . . , x + y} used, then locatethe k positions in which those letters appear, then selecting the n�k letters from{1, . . . , x} letter-by-letter in the order that they appear in the word, and finallyselecting the k letters from {x + 1, . . . , x + y} letter-by-letter in the order thatthey appear in the word, we get a count of

Pn

k=0

�n

k

�x

n�k

y

k. So the identity istrue for positive integers x, y.

The LHS and RHS are polynomials in x and y of degree n, so the di↵erence is apolynomial in x and y of degree at most n, which we want to show is identically0. Write the di↵erence as P (x, y) = p

0

(x) + p

1

(x)y + . . . + p

n

(x)yn where eachp

i

(x) is a polynomial in x of degree at most n. Setting x = 1 we get a polynomialP (1, y) in y of degree at most n. This is 0 for all integers y > 0 (by our combina-torial argument), so by the polynomial principle it is identically 0. So each p

i

(x)evaluates to 0 at x = 1. But the same argument shows that each p

i

(x) evaluatesto 0 at any positive integer x. So again by the polynomial principle, each p

i

(x) isidentically 0 and so P (x, y) is. This proves the identity for all real x, y.

(c) Set x0 = �x and y

0 = �y; we have

(x+ y)n = (�x

0 � y

0)n = (�1)n(x0 + y

0)n

and

nX

k=0

✓n

k

◆x

n�k

y

k =nX

k=0

✓n

k

◆(�x

0)n�k(�y

0)k

=nX

k=0

✓n

k

◆(�1)n�k(x0)n�k(�1)k(y0)k

= (�1)nnX

k=0

✓n

k

◆(x0)n�k(y0)k,

so the identity follows from the falling power binomial theorem (the previouspart).

40

Page 41: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

Source: These are standard identities that appear as exercises in many combinatoricstextbooks.

4. EvaluatenX

k=0

F

k+1

✓n

k

for n � 0, where F

1

, F

2

, F

3

, F

4

, F

5

, . . . are the Fibonacci numbers 1, 1, 2, 3, 5, . . ..

Solution: When n = 0 we get a sum of 1; when n = 1 we get a sum of 2; when n = 2we get a sum of 5; when n = 3 we get a sum of 13; when n = 4 we get a sum of 34;this suggests strongly

nX

k=0

F

k+1

✓n

k

◆= F

2n+1

.

One way to prove this is to iterative apply the Fibonacci recurrence to F

2n+1

: on thezeroth iteration,

F

2n+1

=

✓0

0

◆F

2n+1

.

The first iteration leads to

F

2n+1

= F

2n

+ F

2n�1

=

✓1

0

◆F

2n

+

✓1

0

◆F

2n�1

.

The second leads to

F

2n+1

= F

2n

+ F

2n�1

= (F2n�1

+ F

2n�2

) + (F2n�2

+ F

2n�3

)

=

✓2

0

◆F

2n�1

+

✓2

1

◆F

2n�2

+

✓2

2

◆F

2n�3

.

This suggest that we prove to more general statement, that for each 0 s n,

F

2n+1

=sX

j=0

✓s

j

◆F

2n+1�s�j

. (?)

The case s = n yields

F

2n+1

=nX

j=0

✓n

j

◆F

n+1�j

,

which is the same as what we have to prove (by the symmetry relation�n

j

�=�

n

n�j

�).

We can prove (?) by induction on s (for each fixed n), with the case s = 0 trivial. Forlarger s, we begin with the s�1 case of the induction hypothesis, then use the Fibonaccirecurrence to break each Fibonacci number into the sum of two earlier ones, thenuse Pascals identity to gather together terms involving the same Fibonacci number.(Details omitted.)

Source: This is a well-known binomial coe�cient identity.

41

Page 42: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

5. Evaluate2nX

k=0

(�1)kkn

✓2n

k

for n � 1.

Solution: It’s not easy to deal with this sum in isolation. But, we can generalize:define, for each n, r � 1, a

r,n

=P

2n

k=0

(�1)kkr

�2n

k

�. We claim that a

r,n

= 0 (and so inparticular a

n,n

, our sum of interest, is 0.

We prove the claim for each n by induction on r. It will be helpful to define

f

n

(x) =2nX

k=0

x

k

✓2n

k

◆= (1 + x)2n.

Di↵erentiating,

f

0n

(x) =2nX

k=0

kx

k�1

✓2n

k

◆= 2n(1 + x)2n�1

.

Evaluating at x = �1 we get

2nX

k=0

(�1)k�1

k

1

✓2n

k

◆= 0,

and multiplying by �1 gives a1,n

= 0. This is the base case of the induction.

For the induction step, assume that aj,n

= 0 for all 1 j < r (with r � 2). The rthderivative of f

n

(x) is

f

(r)

n

(x) =2nX

k=0

k(k�1) . . . (k�(r�1))xk�r

✓2n

k

◆= 2n(2n�1) . . . (2n�(r�1))(1+x)2n�r

.

Now k(k�1) . . . (k� (r�1)) is a polynomial in k, of degree r, whose leading coe�cientis 1, and for which all other terms are polynomials in r; in other words,

k(k � 1) . . . (k � (r � 1)) = k

r + c

1

(r)kr�1 + . . .+ c

r

(r),

and so

f

(r)

n

(x) =2nX

k=0

x

k�r

k

r

✓2n

k

◆+

rX

j=1

c

j

(r)2nX

k=0

x

k�r

k

r�j

✓2n

k

◆.

Evaluating at x = �1, and recalling that f (r)

n

(x) = 2n(2n�1) . . . (2n�(r�1))(1+x)2n�r,we get

2nX

k=0

(�1)k�r

k

r

✓2n

k

◆+

rX

j=1

c

j

(r)2nX

k=0

(�1)k�r

k

r�j

✓2n

k

◆= 0.

42

Page 43: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

The sum corresponding to j = r is

c

j

(r)2nX

k=0

(�1)k�r

✓2n

k

◆= (�1)�r

c

j

(r)2nX

k=0

(�1)k✓2n

k

◆= (�1)�r

c

j

(r)(1� 1)2n = 0.

The sum corresponding to each j, 1 j < r is c

j

(r)(�1)�r

a

r,n

, so is 0 by induction.So we conclude

2nX

k=0

(�1)k�r

k

r

✓2n

k

◆= 0,

which give a

r,n

= 0 on multiplying by (�1)r.

Source: I’m not sure where I first saw this.

6. Show that for all k � 0,

Z⇡/2

0

(2 sin x)2k dx =⇡

2

✓2k

k

◆.

Solution: Using integration by parts (u = (sin x)n�1, dv = sin x dx, so that du =(n� 1)(sin x)n�2 cos x dx and v = � cos x dx) we get that for n � 2,

Z(sin x)n dx = �(sin x)n�1 cos x+ (n� 1)

Z(sin x)n�2(cos x)2 dx

= �(sin x)n�1 cos x+ (n� 1)

Z(sin x)n�2(1� (sin x)2) dx

= �(sin x)n�1 cos x� (n� 1)

Z(sin x)n dx+ (n� 1)

Z(sin x)n�2

dx.

Rearranging yields the “reduction formula”Z

(sin x)n dx = � 1

n

(sin x)n�1 cos x+n� 1

n

Z(sin x)n�2

dx.

Applying this to the definite integral, we obtain

Z⇡/2

0

(sin x)n dx =n� 1

n

Z⇡/2

0

(sin x)n�2

dx. (1)

Noting that Z⇡/2

0

(sin x)0 dx =⇡

2,

we iteratively apply (1) to obtain

Z⇡/2

0

(sin x)2k dx =2k � 1

2k· 2k � 3

2k � 2· . . . 3

4· 12· ⇡2,

43

Page 44: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

and so Z⇡/2

0

(2 sin x)2k dx = 22k2k � 1

2k· 2k � 3

2k � 2· . . . 3

4· 12· ⇡2.

Now

22k2k � 1

2k· 2k � 3

2k � 2· . . . 3

4· 12· ⇡2

= 2k(2k � 1)(2k � 3) . . . (3)(1)

k!

2

= 2k(2k � 1)(2k � 3) . . . (3)(1)k!

k!k!

2

= 2k[k](2k � 1)[k � 1](2k � 3)[k � 2] . . . [2](3)[1](1)

k!k!

2

=[2k](2k � 1)[2k � 2](2k � 3)[2k � 4] . . . [4](3)[2](1)

k!k!

2

=(2k)!

k!k!

2

=⇡

2

✓2k

k

◆,

as required.

Source: This is a classic calculus exercise that appears in most calculus textbooks. Isaw it on the UMass Putnam preparation website.

44

Page 45: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

6 Week five (September 22) — Modular arithmeticand the greatest common divisor

Modular arithmetic is something that everyone (not just mathematicians), are familiar withfrom a very early age, though maybe not in a formal way. For example, whenever youobserve something like “it is 11 o’clock now, so in three hours time it will two o’clock”, youare performing addition modulo 12, saying “11 + 3 = 2”. In this section we will formalizemodular arithmetic, and present numerous properties and applications that highlight itsusefulness.

Modular arithmetic

For integers a and b, and positive integer k, say that a is congruent to b (modulo k), written“a ⌘ b (mod k)”, if a and b leave the same remainder on division by k, or equivalently ifa � b is a multiple of k, or equivalently if a � b = mk for some integer m. Congruence(modulo k) is an equivalence relation on the integers, that partitions Z into k classes, calledresidue classes. For example, when k = 3 the three classes are {. . . ,�6,�3, 0, 3, 6, . . .},{. . . ,�5,�2, 1, 4, 7, . . .} and {. . . ,�4,�1, 2, 5, 8, . . .}.

Many of the standard arithmetic operations go through unchanged to modular arithmetic.For example, it is easy to establish that if

a ⌘ b (mod k) and c ⌘ d (mod k)

then each of

a+ c ⌘ b+ d (mod k)

a� c ⌘ b� d (mod k)

ac ⌘ bd (mod k)

hold. Repeated application of this last relation also quickly gives that for all positive numbersn,

a

n ⌘ b

n (mod k).

Modular arithmetic can be a great time-saver when working with problems concerningdivisibility. We give a quick and useful example.

Claim: The remainder of any integer, on division by 9, is the same as the remainder of thesum of its digits on division by 9.

Proof: Write the number in decimal form asP

n

i=0

a

i

10i (with each a

i

2 {0, . . . , 9}). Since10 ⌘ 1 (mod 9), we immediately have 10i ⌘ 1i ⌘ 1 (mod 9), and so a

i

10i ⌘ a

i

(mod 9), andsoP

n

i=0

a

i

10i ⌘P

n

i=0

a

i

(mod 9), which is exactly what we wanted to show.

Here are three more quick examples illustrating how modular arithmetic can make lifeeasy:

Question: What are the last two digits of 372?

45

Page 46: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

Answer: We are being asked: what number x between 0 and 99 is such that 372 ⌘x (mod 100)? By repeated squaring we have

3 ⌘ 3 (mod 100)

32 ⌘ 32 ⌘ 9 (mod 100)

34 ⌘ 92 ⌘ 81 (mod 100)

38 ⌘ 812 ⌘ 6561 ⌘ 61 (mod 100)

316 ⌘ 612 ⌘ 3721 ⌘ 21 (mod 100)

332 ⌘ 212 ⌘ 441 ⌘ 41 (mod 100)

364 ⌘ 412 ⌘ 1681 ⌘ 81 (mod 100)

and so372 ⌘ 36438 ⌘ 81 · 61 ⌘ 4941 ⌘ 41 (mod 100),

so the last two digits of 372 are 41.

Problem: Prove that 270 + 370 is divisible by 13.

Solution: We could use the same technique as above to discover that 270 ⌘ 10 (mod 13)and 370 ⌘ 3 (mod 13) so that 270 + 370 ⌘ 10 + 3 ⌘ 0 (mod 13). But there is a much easierway: 22 ⌘ �32 (mod 13), so 270 ⌘ (�1)35370 ⌘ �370 (mod 13), so 270 + 370 ⌘ 0 (mod 13).

Problem: Find all integers x, y satisfying x

2 � 5y2 = 6.

Solution: Some experimentation shows that no small numbers x and y work. We mightsuspect, then, that the equation has no integer solutions. One way to verify this is to workmodulo 4. If there was an x and y with x

2 � 5y2 = 6, then for that x and y we would havex

2 � 5y2 ⌘ 6 (mod 4).If x ⌘ 0, 1, 2, 3 (mod 4) then x

2 ⌘ 0, 1, 0, 1 (mod 4), and if y ⌘ 0, 1, 2, 3 (mod 4) then5y2 ⌘ 0, 1, 0, 1 (mod 4). So, modulo 4, x2 � 5y2 is equivalent to one of �1, 0, 1, or one of0, 1, 3, and so we cannot have x

2 � 5y2 ⌘ 6 (mod 4).Hence the equation indeed has no solutions.

The greatest common divisor

Closely related to modular arithmetic is the greatest common divisor function in numbertheory. Here is a brief introduction to some ideas around the greatest common divisor.

1. Divisibility: For integers a, b, a|b (a divides b) if there is an integer k with ak = b.

For positive integers a and b, the greatest common divisor of a, b, gcd(a, b) (sometimesjust written (a, b)) is the largest positive number that is a divisor of both a and b (thisexists, since 1 is a common divisor, and all common divisors are at most the minimumof a and b). This means that if d = gcd(a, b), and e is any positive number with e|aand e|b, then e d; but in fact it turns out that moreover e|d. This very useful factfollows easily from looking at the prime factorizations of a and b, see below.

The least common multiple of a, b, lcm(a, b) is the smallest positive number f suchthat a|f and and b|f ; for any positive number g with a|g and b|g we have f g; butin fact, as with gcd, it turns out that we even have f |g in this case.

46

Page 47: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

If gcd(a, b) = 1 (so no factors in common other that 1) then a and b are said to becoprime or relatively prime.

2. Primes: If p > 1 only has 1 and p as divisors, it is said to be prime; otherwise it iscomposite.

The fundamental fact about prime numbers (other that there are infinitely many ofthem!) is that every number n > 1 has a prime factorization:

n = p

a11

. . . p

a

k

k

with each p

i

a prime, and each a

i

> 0. Moreover, the factorization is unique if weassume that p

1

< . . . < p

k

.

The prime factorization gives one way (not the most computationally e�cient way) ofaccessing gcd(a, b) and lcm(a, b). Indeed, if

a = p

a11

. . . p

a

k

k

and b = p

b11

. . . p

b

k

k

(with some of the a

i

and b

i

possibly 0), then

gcd(a, b) = p

min(a1,b1)

1

. . . p

min(a

k

,b

k

)

k

and lcm(a, b) = p

max(a1,b1)

1

. . . p

max(a

k

,b

k

)

k

.

Using min(x, y) + max(x, y) = x+ y, we get the nice identity

ab = gcd(a, b)lcm(a, b).

Since any common divisor of a and bmust be of the formQ

k

i=1

p

i

i

for some �i

’s satisfying�

i

min(a1

, b

1

), we quickly get the fact, alluded to earlier, that if d = gcd(a, b) and e

is a common divisor of a and b, then not only do we we have e d but also e|d.

3. Euclidean algorithm: Euclid described a simple way to compute gcd(a, b). Assumea > b. Write

a = kb+ j

where 0 j < b. If j = 0, then gcd(a, b) = b. If j > 0, then it is fairly easy tocheck that gcd(a, b) = gcd(b, j). Repeat the process with the smaller pair b, j, andkeep repeating as long as necessary. For example, suppose I want gcd(63, 36):

63 = 1.36 + 27

36 = 1.27 + 9

27 = 3.9.

We conclude 9 = gcd(27, 9) = gcd(36, 27) = gcd(63, 36).

4. Bezout’s Theorem: Given a, b, there are integers x, y such that ax+ by = gcd(a, b).Moreover, the set of numbers that can be expressed in the form ax

0 + by

0 = c forintegers x0

, y

0 is exactly the set of multiples of gcd(a, b).

47

Page 48: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

The proof comes from working the Euclidean algorithm backwards. I’ll just do anexample, with the pair 63, 36. We have

9 = 36� 1.27

= 36� 1(63� 1.36)

= �1.63 + 2.36

so we can take x = �1 and y = 2.

Once we have found an x and y, the rest is easy. Suppose c = kgcd(a, b) is a multipleof gcd(a, b); then (kx)a+ (ky)b = cgcd(a, b). On the other hand, if ax0 + by

0 = c thensince gcd(a, b)|a and gcd(a, b)| we have gcd(a, b)|c, so c is a multiple of gcd(a, b).

The most common form of Bezout’s Theorem is that if (a, b) = 1 then every integerk can be written as a linear combination of a and b; in particular there is x, y withax+ by = 1.

In the language of modular arithmetic, this says that if (a, k) = 1, then there is anumber x such that ax ⌘ 1 (mod k). We may think of x as an inverse of a (modulok); this is a starting point for thinking about division in modular arithmetic.

5. Useful facts/theorems concerning modular arithmetic:

(a) Inverses (repeating a previous observation): If p is a prime, and a 6⌘ 0 (mod p),then there is a whole number b such that ab ⌘ 1 (mod p); more generally if a andk are coprime then there is a whole number b such that ab ⌘ 1 (mod k).

(b) Fermat’s theorem: If p is a prime, and a 6⌘ 0 (mod p), then a

p�1 ⌘ 1 (mod p).

More generally, for arbitrarym (prime or composite) define '(m) to be the numberof numbers in the range 1 through m that are coprime with m. If (a,m) = 1 thena

'(m) ⌘ 1 (mod m). (When m = p this reduces to Fermat’s Theorem.)

We refer to ' as Euler’s totient function. A quick way to calculate its value: if mhas prime factorization m = p

a11

. . . p

a

k

k

, then

'(m) = m

kY

i=1

✓1� 1

p

i

◆.

(c) Chinese Remainder Theorem: Suppose n

1

, n

2

, . . . , n

k

are pairwise relativelyprime. If a

1

, a

2

, . . . , a

k

are any integers, there is a number x that simultaneouslysatisfies x ⌘ a

k

(mod n

k

). Moreover, modulo n

1

n

2

. . . n

k

, this solution is unique.

48

Page 49: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

6.1 Week five problems

1. Prove that the product of three consecutive integers is divisible by 504 if the middleone is a perfect cube.

2. Find all integers n such that (2n + n)|(8n + n).

3. Compute the sum of the digits of the sum of the digits of the sum of the digits of thenumber 44444444.

4. Prove that the expressiongcd(m,n)

n

✓n

m

is an integer for all pairs of integers n � m � 1.

5. Several positive integers are written on a chalk board. One can choose two of them,erase them, and replace them with their greatest common divisor and least commonmultiple. Prove that eventually the numbers on the board do not change.

6. How many primes numbers have the following (decimal) form: digits alternating be-tween 1’s and 0’s, beginning and ending with 1?

49

Page 50: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

6.2 Week five solutions

1. Prove that the product of three consecutive integers is divisible by 504 if the middleone is a perfect cube.

Solution: Let the middle integer be m

3 where m is an integer. Then the product ofthe three integers is

(m3 � 1)m3(m3 + 1) = (m� 1)(m2 +m+ 1)m3(m+ 1)(m2 �m+ 1).

The prime factorization of 504 is 504 = 23 ⇥ 32 ⇥ 7.

We first show that 7|(m � 1)(m2 + m + 1)m3(m + 1)(m2 � m + 1) by looking at m

modulo 7.

• If m ⌘ 0 (modulo 7) then clearly 7|(m� 1)(m2 +m+ 1)m3(m+ 1)(m2 �m+ 1).

• If m ⌘ 1 (modulo 7) then m�1 ⌘ 0 (modulo 7) and 7|(m�1)(m2+m+1)m3(m+1)(m2 �m+ 1).

• If m ⌘ 2 (modulo 7) then m

2 +m + 1 ⌘ 0 (modulo 7) and 7|(m� 1)(m2 +m +1)m3(m+ 1)(m2 �m+ 1).

• If m ⌘ 3 (modulo 7) then m

2 �m + 1 ⌘ 0 (modulo 7) and 7|(m� 1)(m2 +m +1)m3(m+ 1)(m2 �m+ 1).

• If m ⌘ 4 (modulo 7) then m

2 +m + 1 ⌘ 0 (modulo 7) and 7|(m� 1)(m2 +m +1)m3(m+ 1)(m2 �m+ 1).

• If m ⌘ 5 (modulo 7) then m

2 �m + 1 ⌘ 0 (modulo 7) and 7|(m� 1)(m2 +m +1)m3(m+ 1)(m2 �m+ 1).

• If m ⌘ 6 (modulo 7) then m+1 ⌘ 0 (modulo 7) and 7|(m�1)(m2+m+1)m3(m+1)(m2 �m+ 1).

Next we show that 32|(m � 1)(m2 +m + 1)m3(m + 1)(m2 �m + 1) by looking at mmodulo 3.

• If m ⌘ 0 (modulo 3) then 32|(m� 1)(m2+m+1)m3(m+1)(m2�m+1) becauseof the m

3 factor.

• If m ⌘ 1 (modulo 3) then m � 1 ⌘ 0 (modulo 3) and m

2 +m + 1 ⌘ 0 (modulo3), so 32|(m� 1)(m2 +m+ 1)m3(m+ 1)(m2 �m+ 1).

• If m ⌘ 2 (modulo 3) then m + 1 ⌘ 0 (modulo 3) and m

2 �m + 1 ⌘ 0 (modulo3), so 7|(m� 1)(m2 +m+ 1)m3(m+ 1)(m2 �m+ 1).

Finally we show that 23|(m� 1)(m2 +m+ 1)m3(m+ 1)(m2 �m+ 1) by looking at mmodulo 2, and modulo 4.

• If m ⌘ 0 (modulo 2) then 23|(m� 1)(m2+m+1)m3(m+1)(m2�m+1) becauseof the m

3 factor.

• If m ⌘ 1 (modulo 2) and m ⌘ 1 (modulo 4) then m � 1 ⌘ 0 (modulo 4) andm+ 1 ⌘ 0 (modulo 2), so 23|(m� 1)(m2 +m+ 1)m3(m+ 1)(m2 �m+ 1).

50

Page 51: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

• If m ⌘ 1 (modulo 2) and m ⌘ 3 (modulo 4) then m � 1 ⌘ 0 (modulo 2) andm+ 1 ⌘ 0 (modulo 4), so 23|(m� 1)(m2 +m+ 1)m3(m+ 1)(m2 �m+ 1).

We conclude that 23327|(m� 1)(m2 +m+ 1)m3(m+ 1)(m2 �m+ 1), as required.

Source: Kenyon College Putnam prep class.

2. Find all integers n such that (2n + n)|(8n + n).

Solution: NEED TO CORRECT!!! Setting n = 0 leads to 1|1, which is true, so thisis one possible solution. Setting n = 1 leads to 3|9, which is true, so this is anotherpossible solution.

From here on we assume n � 2 (note that for n �1, neither 2n + n nor 8n + n areintegers).

It seems like, if 2n + n|8n + n, then the quotient should be something like 4n, so let ushypothesize that it is 4n+k for some integer k. The equation (2n+n)(4n+k) = 8n+n

reduces to k2n + n4n + nk = n.

If k = 0 this becomes n4n = n or 4n = 1. This holds for no n � 2.

If k � 1, then k2n + n4n + nk > n, so the equality holds for no n � 2.

If k �1, say k = �` for ` � 1, then the equality becomes

n4n = (`+ 1)n+ `2n.

For this to hold, we probably need ` ⇡ n2n, so we try ` = n2n +m for integer m. Theequality becomes

n

22n +mn+ n+m2n = 0.

This can’t hold for m � 0 (recall n � 2), so consider m = �k �1, k an integer (andk � 1). We reduce to

n

22n + n = k(2n + 1).

The solution to this is probably of the form k = n

2 + r. Substituting this in leads to

n = n

2 + r(2n + 1).

Since n

2

> n for n � 2, there is no solution with r � 0. If r = �s with s � 1, thenthe equation becomes

s(2n + 1) = n

2 � n.

But s(2n + 1) � 2n + 1, and it is easy to check that 2n + 1 > n

2 � n for all n � 2 —indeed, it is evident for n = 2, and it is implied by 2n � n

2 for n � 3, which is impliedby (n+ 1)2/n2 2, or 1 + 1/n

p2, which is certainly true for n � 3.

So s(2n + 1) = n

2 � n has no solution for s � 1 an integer, n � 2 an integer.

Conclusion: n = 0, 1 are the only solutions.

Source: Northwestern Putnam prep class.

51

Page 52: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

3. Compute the sum of the digits of the sum of the digits of the sum of the digits of thenumber 44444444.

Solution: We start with

44444444 < 1000010000 = 1040000.

Among all numbers below 1040000, none has a larger sum of digits than 1040000 � 1 (astring of 40000 9’s). So the sum of the digits of 44444444 is at most 9⇥40000 < 1000000.Among all numbers below 1000000, none has a larger sum of digits than 999999. Sothe sum of the digits of the sum of the digits of 44444444 is at most 54. Among allnumbers at most 54, none has a larger sum of digits than 49. So the sum of the digitsof the sum of the digits of the sum of the digits of 44444444 is at most 13.

Now we use a useful fact: the remainder of a number, on division by 9, is the same asthe remainder of the sum of the digits on division by 9. . This fact implies that thesum of the digits of the sum of the digits of the sum of the digits of 44444444 leaves thesame remainder on division by 9 as 44444444 itself does.

To calculate the remainder of 44444444 on division by 9, we can use a repeated multi-plication trick. It’s easy that

4444 ⌘ 7 (mod 9)

and so

44442 ⌘ 49 ⌘ 4 (mod 9)

44444 ⌘ 16 ⌘ 7 (mod 9)

44448 ⌘ 49 ⌘ 4 (mod 9)

444416 ⌘ 16 ⌘ 7 (mod 9)

444432 ⌘ 49 ⌘ 4 (mod 9)

444464 ⌘ 16 ⌘ 7 (mod 9)

4444128 ⌘ 49 ⌘ 4 (mod 9)

4444256 ⌘ 16 ⌘ 7 (mod 9)

4444512 ⌘ 49 ⌘ 4 (mod 9)

44441024 ⌘ 16 ⌘ 7 (mod 9)

44442048 ⌘ 49 ⌘ 4 (mod 9)

44444096 ⌘ 16 ⌘ 7 (mod 9).

It follows that

44444444 = 4444409644442564444644444164444844444 ⌘ 7.7.7.7.4.7 ⌘ 7 (mod 9).

So 44444444 leaves a remainder of 7 on division by 9, and also the sum of the digits ofthe sum of the digits of the sum of the digits of 44444444 leaves a remainder of 7 ondivision by 9; but we’ve calculated that this last is at most 13. The only number atmost 13 that leaves a remainder of 7 on division by 9 is 7 it self; so the sum of thedigits of the sum of the digits of the sum of the digits of 44444444 must be 7.

52

Page 53: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

Source: International Mathematical Olympiad 1975, problem 4.

Remark: This was an IMO (International Mathematical Olympiad) problem. Appro-priately enough, if you had got this question fully correct at the IMO, you would havescored 7 points!

4. Prove that the expressiongcd(m,n)

n

✓n

m

is an integer for all pairs of integers n � m � 1.

Solution: We know that gcd(m,n) = am+ bn for some integers a, b; but then

gcd(m,n)

n

✓n

m

◆= a

✓m

n

✓n

m

◆◆+ b

✓n

n

✓n

m

◆◆.

Since ✓n

m

◆=

n

m

✓n� 1

m� 1

(the committee-chair identity again, or easy algebra), we get

gcd(m,n)

n

✓n

m

◆= a

✓n� 1

m� 1

◆+ b

✓n

m

◆,

and so (since a, b,�n�1

m�1

�and

�n

m

�are all integers) we get the desired result.

Source: 2000 Putnam competition, problem B2.

5. Several positive integers are written on a chalk board. One can choose two of them,erase them, and replace them with their greatest common divisor and least commonmultiple. Prove that eventually the numbers on the board do not change.

Solution: CHECK DOES THIS WORK!!! Here’s a very quick, slick solution shownto me by Do Trong Thanh: If you pick two numbers a, b with a|b or b|a, then sincegcd(a, b) = min{a, b} and lcm(a, b) = max{a, b} in this case, the numbers do notchange. In general gcd(a, b)|lcm(a, b), so if it is not the case that a|b or b|a, then afterthe swap it is the case for that particular pair. Initially there are only finitely manypairs (a, b) with a 6 |b and b 6 |a; either eventually we replace all these pairs with pairsof which one divides to other (in which case we are done), or we eventually commit toavoiding all remaining such pairs (in which case we are done).

Here’s my laborious solution: When we take a pair of numbers (a, b), and replace themwith (gcd(a, b), lcm(a, b)), we preserve something, namely the product of the pair ofnumbers (that ab = gcd(a, b)lcm(a, b) is easily seen from the prime factorization of aand b: if

a =nY

i=1

p

a

i

i

, b =nY

i=1

p

b

i

i

53

Page 54: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

(with maybe some of the a

i

, bi

zero) then

ab =nY

i=1

p

a

i

+b

i

i

,

gcd(a, b) =nY

i=1

p

min{ai

,b

i

}i

, lcm(a, b) =nY

i=1

p

max{ai

,b

i

}i

,

so

gcd(a, b)lcm(a, b) =nY

i=1

p

min{ai

,b

i

}+max{ai

,b

i

}i

.

Thus ab = gcd(a, b)lcm(a, b) follows from x+ y = min{x, y}+max{x, y}, valid for anypositive integers x, y.)

For any fixed positive number, there are only finitely many ways to write it as theproduct of a fixed number of positive numbers (if the target of the product is N , andwe are using d numbers, then each of the d numbers must be a divisor of N , so thenumber of ways of writing N as a product of d terms is at most a(N)d, where a(N) isthe number of divisors of N). This shows that there are only finitely many possibilitiesfor the numbers written on the board.

Consider the sum of the numbers. How does this change with the swap operation? Itdepends on how a+ b compares to gcd(a, b)+ lcm(a, b). Experimentation suggests thatgcd(a, b) + lcm(a, b) � a + b, with equality i↵ the pair (a, b) coincides (in some order)with the pair (lcm(a, b), gcd(a, b)). To prove this, first consider a = b, for which theresult is trivial. For all other cases, assume without loss of generality that a > b. Wehave

lcm(a, b) � a > b � gcd(a, b).

If any one of a = lcm(a, b), b = gcd(a, b) holds then by the conservation of product theother must too, and the result we are trying to prove is true. So now we may assume

lcm(a, b) > a > b > gcd(a, b),

and what we want to show is that this implies gcd(a, b) + lcm(a, b) > a + b. Letn = ab = gcd(a, b)lcm(a, b), so

gcd(a, b) + lcm(a, b) = gcd(a, b) +n

gcd(a, b)and a+ b = b+

n

b

.

A little calculus shows that the function f(x) = x + n/x is decreasing on the interval(0,

pn]. Since gcd(a, b) < b <

pn, this shows that

gcd(a, b) +n

gcd(a, b)> b+

n

b

which is exactly what we want to show.

So, suppose we have the bunch of numbers in front of us, and we perform the swapoperation infinitely often. All swaps preserve the product. Some swaps also preserve

54

Page 55: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

the sum; these swaps are exactly the swaps that don’t change the set of numbers.All other swaps increase the sum. We can only increase the sum finitely many times(there are only finitely many di↵erent configurations of numbers). Therefore theremust be some point (curiously, not boundable as a function of the original numbers!)after which we make no more sum-increasing swaps; from that point on, the numbersremain unchanged.

Source: Stanford Putnam prep class.

6. How many primes numbers have the following (decimal) form: digits alternating be-tween 1’s and 0’s, beginning and ending with 1?

Solution: The number xn

= 1010 . . . 101, with n 0’s, can be written as

1 + 100 + 1000 + 1000000 + . . .+ 1000 . . . 000 = 1 + (100) + (100)2 + . . .+ (100)n,

in other words, xn

= P

n

(100) where P

n

(x) is the polynomial 1 + x+ x

2 + . . .+ x

n.

We want to know for which n the polynomial Pn

(x) is prime for x = 100.

For n = 0, it is not (P0

(100) = 1), and for n = 1 it is (P1

(100) = 101). So we assumen � 2.

Since (x� 1)(1 + x+ x

2 + . . .+ x

n) = (xn+1 � 1), we have

99Pn

(100) = 100n+1 � 1 = 102(n+1) � 1 =�10n+1

�2 � 1 =

�10n+1 � 1

� �10n+1 + 1

�.

What happens if Pn

(100) is prime? It must divide one of 10n+1 � 1, 10n+1 + 1. But,for n � 2,

P

n

(100) = 1 + (100) + (100)2 + . . .+ (100)n > 1 + 102n > 1 + 10n+1

,

so P

n

(100) is too big to divide either 10n+1 +1 or 10n+1 � 1. Hence for n � 2, Pn

(100)can’t be prime.

The conclusion is that the only prime of the given form is 101.

Source: NYU Putnam prep class.

55

Page 56: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

7 Week six (September 29) — Inequalities

Many Putnam problem involve showing that a particular inequality between two expressionsholds always, or holds under certain circumstances. There are a huge variety of generalinequalities between sets of numbers satisfying certain conditions, that are quite reasonablefor you to quote as “well-known”. I’ve listed some of them here, mostly without proofs,with stars next to the most important ones. If you are interested in knowing more aboutinequalities, consider looking at the book Inequalities by Hardy, Littlewood and Polya (QA303 .H223i at the math library).

Squares are positive ??

Surprisingly many inequalities reduce to the obvious fact that x

2 � 0 for all real x, withequality i↵ x = 0. I’ll highlight one example in what follows.

The triangle inequality

For real or complex x and y, |x + y| |x| + |y| (called the triangle inequality because itsays that the distance travelled along the line in going from x to �y — |x+ y| — does notdecrease if we demand that we go through the intermediate point 0).

Arithmetic mean — Geometric mean — Harmonic mean inequality??

For positive a

1

, . . . , a

n

n

1

a1+ . . .+ 1

a1

n

pa

1

. . . a

n

a

1

+ . . .+ a

n

n

with equalities in both inequalities i↵ all ai

are equal. The three expressions above are theharmonic mean, the geometric mean and the arithmetic mean of the a

i

.For n = 2, here’s a proof of the second inequality:

pa

1

a

2

(a1

+ a

2

)/2 i↵ 4a1

a

2

(a

1

+a

2

)2 i↵ a

2

1

�2a1

a

2

+a

2

2

� 0 i↵ (a1

�a

2

)2 � 0, which is true by the “squares are positive”inequality; there’s equality all along i↵ a

1

= a

2

.For n = 2 the first inequality is equivalent to

pa

1

a

2

(a1

+ a

2

)/2.

Power means inequality

For a non-zero real r and positive a

1

, . . . , a

n

define

M

r(a1

, . . . , a

n

) =

✓a

r

1

+ . . .+ a

r

n

n

◆1/r

,

and set M0(a1

, . . . , a

n

) = n

pa

1

. . . a

n

. For real numbers r < s,

M

r(a1

, . . . , a

n

) M

s(a1

, . . . , a

n

)

56

Page 57: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

with equality i↵ all ai

are equal.Notice that M�1(a

1

, . . . , a

n

) is the harmonic mean of the ai

’s, and M

1(a1

, . . . , a

n

) is theirgeometric mean, so this inequality generalizes the Arithmetic mean — Geometric mean —Harmonic mean inequality.

There is a weighted power means inequality: let w1

, . . . , w

n

be positive reals that add to1, and define

M

r

w

(a1

, . . . , a

n

) = (w1

a

r

1

+ . . .+ w

n

a

r

n

)1/r

for non-zero real r, with M

0

w

(a1

, . . . , a

n

) = a

w11

. . . a

w

n

n

. For real numbers r < s,

M

r

w

(a1

, . . . , a

n

) M

s

w

(a1

, . . . , a

n

).

(This reduces to the power means inequality when all wi

= 1/n.)

Cauchy-Schwarz-Bunyakovsky inequality ??

Let x1

, . . . , x

n

and y

1

, . . . , y

n

be real numbers. We have

(x1

y

1

+ . . .+ x

n

y

n

)2 �x

2

1

+ . . .+ x

2

n

� �y

2

1

+ . . .+ y

2

n

�.

Equality holds if one of the sequences (x1

, . . . , x

n

), (y1

, . . . , y

n

) is identically zero. If both arenot identically zero, then there is equality i↵ there is some real number t

0

such that xi

= t

0

y

i

for each i.Here’s a quick proof: If either sequence is identically 0, both sides are zero. So assume

that neither is identically 0. For any real t we have

nX

i=1

(xi

� ty

i

)2 � 0.

But also,nX

i=1

(xi

� ty

i

)2 =nX

i=1

x

2

i

� 2tnX

i=1

x

i

y

i

+ t

2

nX

i=1

y

2

i

,

so for all real t, sonX

i=1

x

2

i

� 2tnX

i=1

x

i

y

i

+ t

2

nX

i=1

y

2

i

� 0.

This means that viewed as a polynomial in t, the expression above must have either complexroots or a repeated real root, i.e., that

2

nX

i=1

x

i

y

i

!2

4

nX

i=1

x

2

i

! nX

i=1

y

2

i

!,

which is exactly the inequality we wanted. (Notice the key point — squares are positive!).If the inequality is an equality, then the polynomial has a repeated root, which means thereis some real t

0

at which the polynomial evaluates to 0. But the polynomial at this point

57

Page 58: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

is equal toP

n

i=1

(xi

� t

0

y

i

)2, and the only way this can happen is if each x

i

� t

0

y

i

is 0, asclaimed.

This is really a very general inequality: if you are familiar with inner products from linearalgebra, the Cauchy-Schwarz-Bunyakovsky inequality really says that if x, y are vectors inan inner product space over the reals then

|hx,yi|2 hx,xihy,yi.

Equivalently|hx,yi| ||x|| ||y||.

There is equality i↵ x and y are linearly dependent.

Holder’s inequality

Fix p > 1 and define q by 1/p+ 1/q = 1. Let x1

, . . . , x

n

and y

1

, . . . , y

n

be real numbers. Wehave

|x1

y

1

+ . . .+ x

n

y

n

| (|x1

|p + . . .+ |xn

|p)1/p (|y1

|q + . . .+ |yn

|q)1/q .

Notice that Holder becomes Cauchy-Schwarz-Bunyakovsky in the case p = 2.

Chebyshev’s sum inequality

If a1

� . . . � a

n

and b

1

� . . . � b

n

are sequences of reals, then

a

1

b

1

+ . . .+ a

n

b

n

n

�✓a

1

+ . . .+ a

n

n

◆✓b

1

+ . . .+ b

n

n

◆.

The same holds if a1

. . . a

n

and b

1

. . . b

n

; if either a1

� . . . � a

n

and b

1

. . . b

n

or a1

. . . a

n

and b

1

� . . . � b

n

, then

a

1

b

1

+ . . .+ a

n

b

n

n

✓a

1

+ . . .+ a

n

n

◆✓b

1

+ . . .+ b

n

n

◆.

The rearrangement inequality

If a1

. . . a

n

and b

1

. . . b

n

are sequences of reals, and a

⇡(1)

, . . . , a

⇡(n)

is a permutation(rearrangement) of a

1

. . . a

n

, then

a

n

b

1

+ . . .+ a

1

b

n

a

⇡(1)

b

1

+ . . .+ a

⇡(n)

b

n

a

1

b

1

+ . . .+ a

n

b

n

.

If a1

< . . . < a

n

and b

1

< . . . < b

n

, then there is equality in the first inequality i↵ ⇡ is thereverse permutation ⇡(i) = n + 1 � i, and there is equality in the second inequality i↵ ⇡ isthe identity permutation ⇡(i) = i.

58

Page 59: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

Jensen’s inequality ??

A real function f(x) is convex on the interval [c, d] if for all c a < b d, the line segmentjoining (a, f(a)) to (b, f(b)) lies entirely above the graph y = f(x) on the interval (a, b), orequivalently, if for all 0 t 1 we have

f((1� t)a+ tb) (1� t)f(a) + tf(b).

If f(x) is convex on the interval [c, d], and c a

1

. . . a

n

d, then

f

✓a

1

+ . . .+ a

n

n

◆ f(a

1

) + . . .+ f(an

)

n

(note that when n = 2, this is just the definition of convexity).We say that f(x) is concave on [c, d] if for all c a < b d, and for all 0 t 1, we

havef((1� t)a+ tb) � (1� t)f(a) + tf(b).

If f(x) is concave on the interval [c, d], and c a

1

. . . a

n

d, then

f

✓a

1

+ . . .+ a

n

n

◆� f(a

1

) + . . .+ f(an

)

n

.

As an example, consider the convex function f(x) = x

2; for this function Jensen saysthat ✓

a

1

+ . . .+ a

n

n

◆2

a

2

1

+ . . .+ a

2

n

n

,

which is equivalent to the powers means inequality M

1(a1

, . . . , a

n

) M

2(a1

, . . . , a

n

); andwhen f(x) = � ln x we get

n

pa

1

. . . a

n

a

1

+ . . .+ a

n

n

,

the AM-GM inequality.

Four miscellaneous comments

1. Maximization/minimization problems are often problems about inequalities in disguise.For example, to find the minimum of f(a, b) as (a, b) ranges over a set R, it is enoughto first guess that the minimum is m, then find an (a, b) 2 R with f(a, b) = m, andthen use inequalities to show that f(a, b) � m for all (a, b) 2 R.

2. If an expression is presented as a sum of n squares, it is sometimes helpful to think ofit as the (square of the) distance between two points in n dimensional space, and thenthink of the problem geometrically.

3. Sometimes a little calculus is all that is needed. For example, here is a very usefulinequality:

1 + x e

x for all x 2 R.

59

Page 60: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

To prove this for x � 0 note that both sides are equal at x = 0, and the derivative of1+x, which is 1, is smaller than the derivative of ex, which is ex, for all x � 0; so the twosides start together but always the right-hand side is growing faster than the left-handside, so the right-hand side is always bigger. A similar argument proves the inequalityfor x 0: 1 + x, with derivative 1, falls faster as we move along the x-axis negativelyaway from 0, than does e

x, which has derivative positive but strictly less than 1 forx < 0. (To formalize this second half of the argument, consider f(y) = 1 � y andg(y) = e

�y, defined for y � 0. We have f(0) = g(0), and f

0(y) = �1 �e

�y = g

0(y)for y � 0, so f(y) g(y) for y � 0. It follows that for x 0, 1� x e

�x.)

4. If f(x) is a positive, increasing function on (0,1), then by considering Riemann sumswe have Z

n

0

f(x) dx nX

k=1

f(k) Z

n+1

1

f(x) dx

(assuming the left-hand integral converges). For example, consider f(x) = x

k for k > 0.We have Z

n

0

x

k

dx =n

k+1

k + 1

and Zn+1

1

x

k

dx =(n+ 1)k+1

k + 1� 1

k + 1.

It easy to check that✓(n+ 1)k+1

k + 1� 1

k + 1

◆/

✓n

k+1

k + 1

◆! 1 as n ! 1,

so we have a quick proof that for each fixed k > 0 (not necessarily an integer)

limn!1

1k + . . .+ n

k

n

k+1

=1

k + 1;

in other words, the sum of the first n perfect kth powers grows like n

k+1

/(k + 1).

Some warm-up problems

You should find that these are all fairly easy to prove by direct applications of an appropriateinequality from the list above.

1. n! <�n+1

2

�n

for n = 2, 3, 4, . . ..

2.p

3(a+ b+ c) �pa+

pb+

pc for positive a, b, c.

3. Minimize x

1

+ . . .+ x

n

subject to x

i

� 0 and x

1

. . . x

n

= 1.

4. Minimizex

2

y + z

+y

2

z + x

+z

2

x+ y

subject to x, y, z � 0 and xyz = 1.

60

Page 61: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

5. If triangle has side lengths a, b, c and opposite angles (measured in radians) A,B,C,then

aA+ bB + cC

a+ b+ c

� ⇡

3.

6. Identify which is bigger:

1999!(2000) or 2000!(1999).

(Here n!(k) indicates iterating the factorial function k times, so for example 4!(2) = 24!.)

7. Identify which is bigger:19991999 or 20001998.

8. Minimizesin3

x

cos x+

cos3 x

sin x

on the interval 0 < x < ⇡/2.

Solutions

1. n! <�n+1

2

�n

for n = 2, 3, 4, . . ..

Solution: Use the geometric mean — arithmetic mean inequality, with (a1

, . . . , a

n

) =(1, . . . , n).

2.p

3(a+ b+ c) �pa+

pb+

pc for positive a, b, c.

Solution: Use the power means inequality, with (a1

, a

2

, a

3

) = (a, b, c) and r = 1/2, s =1.

3. Minimize x

1

+ . . .+ x

n

subject to x

i

� 0 and x

1

. . . x

n

= 1.

Solution: Guess: the minimum is n, achieved when all x1

= 1. Then use geometricmean - arithmetic mean inequality to show

✓x

1

+ . . .+ x

n

n

◆� n

px

1

. . . x

n

= 1

for positive x

i

satisfying x

1

. . . x

n

= 1.

4. Minimizex

2

y + z

+y

2

z + x

+z

2

x+ y

subject to x, y, z � 0 and xyz = 1.

61

Page 62: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

Solution: Apply Cauchy-Schwartz with the vectors�p

y + z,

pz + x,

px+ y

�and⇣

xpy+z

,

ypz+x

,

zpx+y

⌘to get

(x+ y + z)2 ✓

x

2

y + z

+y

2

z + x

+z

2

x+ y

◆2 (x+ y + z) ,

leading tox

2

y + z

+y

2

z + x

+z

2

x+ y

� x+ y + z

2.

By the AM-GM inequality,

x+ y + z

3� 3

pxyz = 1,

sox

2

y + z

+y

2

z + x

+z

2

x+ y

� 3

2.

This lower bound can be achieved by taking x = y = z = 1, so the minimum is 3/2.

5. If triangle has side lengths a, b, c and opposite angles (measured in radians) A,B,C,then

aA+ bB + cC

a+ b+ c

� ⇡

3.

Solution: Assume, without loss of generality, that a b c. Then also A B C,so by Chebychev,

aA+ bB + cC

3�✓a+ b+ c

3

◆✓A+B + C

3

◆=

✓a+ b+ c

3

◆⇡

3,

from which the result follows.

6. Identify which is bigger:

1999!(2000) or 2000!(1999).

(Here n!(k) indicates iterating the factorial function k times, so for example 4!(2) = 24!.)

Solution: For n � 1, n! is increasing in n (1 n < m implies n! < m!). So, startingfrom the easy

1999! > 2000,

apply the factorial function 1999 more times to get

1999!(2000) > 2000!(1999).

62

Page 63: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

7. Identify which is bigger:19991999 or 20001998.

Solution: Consider f(x) = (1999 � x) ln(1999 + x). We have e

f(0) = 19991999 ande

f(1) = 20001998, so we want to see what f does on the interval [0, 1]: increase ordecrease? The derivative is

f

0(x) = � ln(1999 + x) +1999� x

1999 + x

,

which is negative on [0, 1] (since, for example,

1999� x

1999 + x

1 = ln e < ln(1999 + x)

on that interval). So20001998 < 19991999.

8. Minimizesin3

x

cos x+

cos3 x

sin x

on the interval 0 < x < ⇡/2.

Solution: We can use the rearrangement inequality on the pairs�sin3

x, cos3 x�(which

satisfies sin3

x cos3 x on [0, ⇡/4], and sin3

x � cos3 x on [⇡/4, ⇡/2]), and (1/ cos x, 1/ sin x)(which also satisfies 1/ cos x 1/ sin x on [0, ⇡/4], and 1/ cos x � 1/ sin x on [⇡/4, ⇡/2]),to get

sin3

x

cos x+

cos3 x

sin x� sin3

x

sin x+

cos3 x

cos x= sin2

x+ cos2 x = 1

on the whole interval. Since 1 can be achieved (at x = ⇡/4) the minimum is 1.

Source: These problems were all taken from a Northwestern Putnam prep problem set.

63

Page 64: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

7.1 Week six problems

1. Show that for non-negative reals a1

, . . . , a

n

and b

1

, . . . , b

n

,

(a1

. . . a

n

)1/n + (b1

. . . b

n

)1/n ((a1

+ b

1

) . . . (an

+ b

n

))1/n .

2. For positive integers m,n, show

(m+ n)!

(m+ n)m+n

<

m!

m

m

n!

n

n

.

3. Minimize

(u� v)2 +

✓p2� u

2 � 9

v

2

◆2

in the range 0 u p2, v � 0.

4. Maximize x

3 � 3x subject to x

4 + 36 13x2.

5. Show that for every positive integer n,

✓2n� 1

e

◆ 2n�12

1 · 3 · 5 · . . . · (2n� 1) <

✓2n+ 1

e

◆ 2n+12

.

6. Suppose that f(x) is a polynomial with all real coe�cients, satisfying f(x)+ f

0(x) > 0for all x. Show that f(x) > 0 for all x.

64

Page 65: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

7.2 Week six solutions

1. Show that for non-negative reals a1

, . . . , a

n

and b

1

, . . . , b

n

,

(a1

. . . a

n

)1/n + (b1

. . . b

n

)1/n ((a1

+ b

1

) . . . (an

+ b

n

))1/n .

Solution: If any a

i

is 0, the result is trivial, so we may assume all ai

> 0. Dividingthrough by (a

1

. . . a

n

)1/n, the inequality becomes

1 + (c1

. . . c

n

)1/n ((1 + c

1

) . . . (1 + c

n

))1/n

for ci

� 0. Raising both sides to the power n, this is the same as

nX

k=0

✓n

k

◆(c

1

. . . c

n

)k/n nX

k=0

e

k

where e

k

is the sum of the products of the c

i

’s, taken k at a time. So it is enough toshow that for each k,

✓n

k

◆(c

1

. . . c

n

)k/n X

A✓{1,...,n}, |A|=k

Y

i2A

c

i

.

We apply the AM-GM inequality to the numbersQ

i2A c

i

as A ranges over all subsetsof size k of {1, . . . , n}. Note that each a

i

appears exactly�n�1

k�1

�times in all these

numbers. So we we get

(c1

. . . c

n

)(n�1k�1)/(

n

k

) P

A✓{1,...,n}, |A|=k

Qi2A c

i�n

k

�.

Since�n�1

k�1

�/

�n

k

�= k/n, this is the same as

(c1

. . . c

n

)k/n P

A✓{1,...,n}, |A|=k

Qi2A c

i�n

k

�,

which is exactly what we wanted to show.

Much quicker solution, shown to me by Jonathan Sheperd: If there is any i

for which a

i

+ b

i

= 0, then the inequality trivially holds. If not, divide both sides bythe right-hand side to get the equivalent inequality

nY

i=1

✓a

i

a

i

+ b

i

◆! 1n

nY

i=1

✓b

i

a

i

+ b

i

◆! 1n

1.

Applying the arithmetic mean – geometric mean inequality to both terms on the left-hand side, we find that the left-hand side is at most

1

n

nX

i=1

a

i

a

i

+ b

i

!+

1

n

nX

i=1

b

i

a

i

+ b

i

!

65

Page 66: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

which is the same as1

n

nX

i=1

a

i

+ b

i

a

i

+ b

i

!,

which is indeed at most (in fact exactly) 1.

Source: Putnam competition 2003 problem A2.

2. For positive integers m,n, show

(m+ n)!

(m+ n)m+n

<

m!

m

m

n!

n

n

.

Solution: Rearranging, this is the same as✓m+ n

m

◆✓m

m+ n

◆m

✓n

m+ n

◆n

< 1.

This suggests looking at the binomial expansion✓

m

m+ n

+n

m+ n

◆m+n

.

The whole binomial expansion sums to 1; one term of the expansion is✓m+ n

m

◆✓m

m+ n

◆m

✓n

m+ n

◆n

.

Since all terms are strictly positive, we get the required inequality.

Source: Putnam competition 2003, problem A3.

3. Minimize

(u� v)2 +

✓p2� u

2 � 9

v

2

◆2

in the range 0 u p2, v � 0.

Solution: The expression to be minimized is the (square of the) distance between apoint of the form (u,

p2� u

2) on 0 < u <

p2, and a point of the form (v, 9/v) on

v > 0; in other words, we are looking for the (square of the) distance between the circlex

2 + y

2 = 2 in the first quadrant and the hyperbola xy = 9 in the same quadrant. Bysymmetry, it strongly seems that the two closed points are (3, 3) on the hyperbola and(1, 1) on the circle (squared distance 8). To prove that this is the minimum, note thatthe tangent lines to the two curves at those two points are parallel, that the distancebetween them at these points is the perpendicular distance between the two tangentlines, and that the hyperbola (in the first quadrant) lies completely above its tangentline, while the circle (in the first quadrant) lies completely below its tangent line; sothe distance between ant other two points is at least the distance between the twotangent lines.

Source: Putnam competition 1984 problem B2.

66

Page 67: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

4. Maximize x

3 � 3x subject to x

4 + 36 13x2.

Solution: The inequality x

4+36 13x2 factors as (x+3)(x+2)(x�2)(x�3) 0, so�3 x �2 or 2 x 3. The derivative of x3� 3x is 3x2� 3 = 3(x+1)(x� 1), andso we see that x3�3x is increasing on both [�3,�2] and [2, 3]. Setting f(x) = x

3�3x.The maximum is therefore the maximum of f(�2) and f(3), which is f(3) = 18.

Source: Putnam competition 1986, problem A1.

5. Show that for every positive integer n,

✓2n� 1

e

◆ 2n�12

1 · 3 · 5 · . . . · (2n� 1) <

✓2n+ 1

e

◆ 2n+12

.

Solution: We estimate the integral of ln x, which is convex and hence easy to estimate.Take the integral from 1 to 2n�1. This is less than 2(ln 3+ln 5+. . .+ln(2n�1)). But theantiderivative of ln x is x ln x�x, so the integral evaluates to (2n�1) ln(2n�1)�2n+2.Hence (2n� 1) ln(2n� 1)� (2n� 1) < (2n� 1) ln(2n� 1)� 2n + 2 < 2(ln 3 + ln 5 +. . .+ ln(2n� 1)). Exponentiating gives the right-hand inequality.

Similarly, the integral from e to 2n+ 1 is greater than 2(ln 3 + ln 5 + . . .+ ln(2n� 1)),and an explicit evaluation of the antiderivative here leads to the right-hand side of theinequality. The choice of lower bound e for the integral here is just the right thing tomake the computations work out nicely.

Source: Putnam competition 1996, problem B2.

6. Suppose that f(x) is a polynomial with all real coe�cients, satisfying f(x)+ f

0(x) > 0for all x. Show that f(x) > 0 for all x.

Solution: f(x) and f(x)+f

0(x) have the same leading coe�cient, so the same limitingbehavior as x goes to±1, namely they both tend to +1 (since f(x)+f

0(x) > 0 always,the limits cannot be �1).

f(x) cannot have a repeated root: at a repeated root, the derivative is also 0, sof(x) + f

0(x) = 0 at this point. So all of f(x)’s real roots (if it has any) are simple.Since f(x) goes to +1 as x approaches both ±1, it must thus have an even numberof real zeroes.

Suppose it has any. Let x1

and x

2

be the first two. Between x

1

and x

2

, at some pointthe derivative is 0 (Rolle’s theorem); at that point f(x)+f

0(x) must be negative (sincef(x) negative here). This contradiction shows that f(x) has no real roots, so can’tchange sign, so must be always positive.

Remark: The example of f(x) = �e

�2x shows that the hypothesis that f(x) is apolynomial is crucial here.

Source: Northwestern Putnam preparation class.

67

Page 68: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

8 Week seven (October 6) — Polynomials

This week’s problem are all about polynomials, which come up in virtually every Putnamcompetition.

Things to know about polynomials

• Fundamental Theorem of Algebra: Every polynomial p(x) = x

n + a

1

x

n�1 +a

2

x

n�2 + . . .+ a

n�1

x+ a

n

, with real or complex coe�cients, has a root in the complexnumbers, that is, there is c 2 C such that p(c) = 0.

• Factorization: In fact, every polynomial p(x) = x

n+a

1

x

n�1+a

2

x

n2+ . . .+a

n�1

x+a

n

,with real or complex coe�cients, has exactly n roots, in the sense that there is a vector(c

1

, . . . , c

n

) (perhaps with some repetitions) such that

p(x) = (x� c

1

)(x� c

2

) . . . (x� c

n

).

If a c appears in this vector exactly k times, it is called a root or zero of multiplicity k.The next bullet point gives a very useful consequence of this.

• Two di↵erent polynomials of the same degree can’t agree too often: If p(x)and q(x) (over R or C) both have degree at most n, and there are n+1 distinct numbersx

1

, . . . , x

n+1

such that p(xi

) = q(xi

) for i = 1, . . . , n + 1, then p(x) and q(x) are equalfor all x. [Because then p(x)� q(x) is a polynomial of degree at most n with at leastn+ 1 roots, so must be identically zero].

• Complex conjugates: If the coe�cients of p(x) = x

n+a

1

x

n�1+a

2

x

n2+. . .+a

n�1

x+a

n

are all real, then the complex roots occur in complex-conjugate pairs: if s + it (withs, t real, and i =

p�1) is a root, then s� it is also a root.

• Coe�cients in terms of roots: If (c1

, . . . , c

n

) is the vector of roots of a polynomialp(x) = x

n+a

1

x

n�1+a

2

x

n2+ . . .+a

n�1

x+a

n

(over R or C), then each of the coe�cientscan be expressed simply in terms of the roots: a

1

is the negative of the sum of the ci

’s;a

2

is the sum of the products of the c

i

’s, taken two at a time, a3

is the negative of thesum of the products of the c

i

’s, taken three at a time, etc. Concisely:

a

k

= (�1)kX

A✓{1,...,n}, |A|=k

Y

i2A

c

i

.

• Elementary symmetric polynomials: The kth elementary symmetric polynomialin variables x

1

, . . . , x

n

is�

k

=X

A✓{1,...,n}, |A|=k

Y

i2A

x

i

(these polynomials have already appeared in the last bullet point). A polynomialp(x

1

, . . . , x

n

) in n variables is symmetric if for every permutation ⇡ of {1, . . . , n}, wehave

p(x1

, . . . , x

n

) ⌘ p(x⇡(1)

, . . . , x

⇡(n)

).

68

Page 69: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

(For example, x2

1

+ x

2

2

+ x

2

3

+ x

2

4

is symmetric, but x2

1

+ x

2

2

+ x

2

3

+ x

1

x

4

is not.) Everysymmetric polynomial in variables x

1

, . . . , x

n

can be expressed as a linear combinationof the �

k

’s.

• Some special values tell things about the coe�cients: (Rather obvious, butworth keeping in mind) If p(x) = a

0

x

n + a

1

x

n�1 + a

2

x

n2 + . . .+ a

n�1

x+ a

n

, then

p(0) = a

n

p(1) = a

0

+ a

1

+ a

2

+ . . .+ a

n

p(�1) = a

n

� a

n�1

+ a

n�2

� a

n�3

+ . . .+ (�1)na0

.

• Intermediate value theorem: If p(x) is a polynomial with real coe�cients (or infact any continuous real function) such that for some a < b, p(a) and p(b) have di↵erentsigns, then there is some c, a < c < b, with p(c) = 0.

• Lagrange interpolation: Suppose that p(x) is a real polynomial of degree n, whosegraph passes through the points (x

0

, y

0

), (x1

, y

1

), . . ., (xn

, y

n

). Then we can write

p(x) =nX

i=0

y

i

Y

j 6=i

x� x

j

x

i

� x

j

.

• The Rational Roots theorem: Suppose that p(x) is a polynomial of degree n withinteger coe�cients, and that x is a rational root a/b with a and b having no commonfactors. Then the leading coe�cient of p(x) (the coe�cient of xn) is a multiple of b,and the constant term is a multiple of a. An immediate corollary of this is that if p(x)is a monic polynomial (integer coe�cients, leading coe�cient 1), then any rationalroot must in fact be an integer; conversely, if a real number x is a root of a monicpolynomial but is not an integer, it must be irrational (for example,

p2 is a root of

monic x

2 � 2, but is clearly not an integer, so it must be irrational)!

• Gauss’ lemma: Here is a weak form of Gauss’ lemma, but one that is very useful: ifc is an integer root of a monic polynomial p(x) (integer coe�cients, leading coe�cient1), then p(x) factors as (x�c)q(x), where q(x) is also a monic polynomial (the surprisebeing not that q(x) has leading coe�cient 1, but that it has all integer entries).

• One more fact about integer polynomials: Let p(x) be a (not necessarily monic)polynomial of degree n with integer coe�cients. For any integers a, b,

(a� b)|(p(a)� p(b)).

(So also,(p(a)� p(b))|(p(p(a))� p(p(b))),

etc.)

69

Page 70: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

8.1 Week seven problems

1. For which real values of p and q are the roots of the polynomial x3 � px

2 + 11x � q

three consecutive integers? Give the roots in these cases.

2. Let p(x) be a polynomial with integer coe�cients, for which p(0) and p(1) are odd.Can p(x) have any integer zeroes?

3. (a) Determine all polynomials p(x) such that p(0) = 0 and p(x+1) = p(x)+ 1 for allx.

(b) Determine all polynomials p(x) such that p(0) = 0 and p(x2 + 1) = (p(x))2 + 1for all x.

4. Does there exist a non-zero polynomial f(x) for which xf(x� 1) = (x+ 1)f(x) for allx?

5. Let p(x) = x

n + a

n�1

x

n�1 + . . . + a

1

x + a

0

be a polynomial with integer coe�cients.Suppose that there exist four distinct integers a, b, c, d with p(a) = p(b) = p(c) =p(d) = 5. Prove that there is no integer k with p(k) = 8.

6. Is there an infinite sequence a

0

, a

1

, a

2

, . . . of nonzero real numbers such that for n =1, 2, 3, . . . the polynomial

p

n

(x) = a

0

+ a

1

x+ a

2

x

2 + . . .+ a

n

x

n

has exactly n distinct real roots?

70

Page 71: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

8.2 Week seven solutions

1. For which real values of p and q are the roots of the polynomial x3 � px

2 + 11x � q

three consecutive integers? Give the roots in these cases.

Solution: A polynomial with roots being three consecutive integers is of the form

(x� (a� 1))(x� a)(x� (a+ 1)) = x

3 � 3ax2 + (3a2 � 1)x� (a3 � a)

for some integer a. So, matching coe�cients, we must have 3a2 � 1 = 11, or a = ±2.When a = 2 we get roots 1, 2, 3 and p = 6, q = 6; when a = �2 we get roots �3,�2,�1and p = �6, q = �6.

Source: From a Harvey Mudd Putnam prep class.

2. Let p(x) be a polynomial with integer coe�cients, for which p(0) and p(1) are odd.Can p(x) have any integer zeroes?

Solution: If k is an even integer we have p(k) ⌘ p(0) ⌘ 1 (mod 2) (Why? Supposea ⌘ b (mod m). Then a

` ⌘ b

` (mod m) for any `, so ca

` ⌘ cb

` (mod m) for any c,so (summing), p(a) ⌘ p(b) (mod m) for any polynomial p). By the same token, if kis odd then p(k) ⌘ p(1) ⌘ 1 (mod 2). So we never have p(k) ⌘ 0 (mod 2), and neverhave p(k) = 0.

Source: From a Northwestern Putnam prep class.

3. (a) Determine all polynomials p(x) such that p(0) = 0 and p(x+1) = p(x)+ 1 for allx.

Solution: By induction, p(x) = x for all positive integers x, so p(x) � x is apolynomial with infinitely many zeros, so must be identically 0. We concludethat p(x) = x is the only possible polynomial satisfying the given conditions.

(b) Determine all polynomials p(x) such that p(0) = 0 and p(x2 + 1) = (p(x))2 + 1for all x.

Solution: We have p(0) = 0, p(1) = p(0)2 + 1 = 1, p(2) = p(1)2 + 1 = 2,p(5) = p(2)2 + 1 = 5, p(26) = p(5)2 + 1 = 26 and in general, by induction, if thesequence (a

n

) is defined recursively by a

0

= 0 and a

n+1

= a

2

n

+1, then p(an

) = a

n

.Since the sequence (a

n

) is strictly increasing, we find that there are infinitelymany distinct values x for which p(x) = x; as in the last part, this tells us thatp(x) = x is the only possible polynomial satisfying the given conditions.

Source: Modified from Putnam competition, 1971 problem A2.

4. Does there exist a non-zero polynomial f(x) for which xf(x� 1) = (x+ 1)f(x) for allx?

71

Page 72: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

Solution: For positive integer n we have

f(n) =n

n+ 1f(n?1) =

n?1

n+ 1f(n?2) = . . . = 0f(?1) = 0.

Hence f(x) has infinitely many zeros, and must be identically zero; f(x) ⌘ 0.

Source: From a Northwestern Putnam prep class.

5. Let p(x) = x

n + a

n�1

x

n�1 + . . . + a

1

x + a

0

be a polynomial with integer coe�cients.Suppose that there exist four distinct integers a, b, c, d with p(a) = p(b) = p(c) =p(d) = 5. Prove that there is no integer k with p(k) = 8.

Solution: Set q(x) = p(x) � 5. We have q(a) = q(b) = q(c) = q(d) = 0 and soq(x) = r(x)(x � a)(x � b)(x � c)(x � d), where r(x) is some rational polynomial; butin fact (by Gauss’ Lemma), r(x) is a polynomial over integers.

Aside: Why is r(k) above a polynomial over integers? Suppose xn + a

n�1

x

n�1 + . . .+a

1

x+a

0

(call this expression 1), with all ai

integers, factors as (x�c)(xn�1+r

n�2

x

n�2+. . . + r

1

x + r

0

) (call this expression 2), where c is an integer. Then necessarily the r

i

are rational numbers; but in fact, we can show that they are all integers. This isobvious when c = 0, so assume c 6= 0. Expanding out the factorization and equatingcoe�cients, we get

a

n�1

= r

n�2

� c

a

n�2

= r

n�3

� cr

n�2

a

n�3

= r

n�4

� cr

n�3

· · ·a

2

= r

1

� cr

2

a

1

= r

0

� cr

1

a

0

= �cr

0

.

Now evaluating both expression 1 and expression 2 at x = c, we get

c

n + a

n�1

c

n�1 + . . .+ a

2

c

2 + a

1

c+ a

0

= 0.

lugging in a

0

= �cr

0

yields

c

�c

n�1 + a

n�1

c

n�2 + . . .+ a

2

c+ a

1

� r

0

�= 0.

Utilizing c 6= 0, we conclude that

c

n�1 + a

n�1

c

n�2 + . . .+ a

2

c+ a

1

= r

0

and so, since the left-hand side is clearly an integer, so is the right-hand side, r0

. Nowplugging a

1

= r

0

� cr

1

into this last inequality, and dividing by c, we get

c

n�2 + a

n�1

c

n�3 + . . .+ a

2

= r

1

72

Page 73: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

so r

1

is also an integer. Continuing in this manner we get, for general k,

c

n�(k+1) + a

n�1

c

n�(k+2) + . . .+ a

k+1

= r

k

for k n�2 (this could be formally proved by induction), which allows us to concludethat all of the r

i

’s are integers.

Back to solution: Now suppose there is an integer k with p(k) = 8. Then q(k) = 3,so r(k)(k� a)(k� b)(k� c)(k� d) = 3. Since r(k), (k� a), (k� b), (k� c) and (k� d)are all integers, and 3 is prime, one of the five must be ±3 and the remaining fourmust be ±1. It follows that at least three of (k� a), (k� b), (k� c) and (k� d) mustbe ±1, and so at least two of them must take the same value; this contradicts the factthat a, b, c and d are distinct.

Source: From a Northwestern Putnam prep class.

6. Is there an infinite sequence a

0

, a

1

, a

2

, . . . of nonzero real numbers such that for n =1, 2, 3, . . . the polynomial

p

n

(x) = a

0

+ a

1

x+ a

2

x

2 + . . .+ a

n

x

n

has exactly n distinct real roots?

Solution: We can explicitly construct such a sequence. Start with a

0

= 1 and a

1

= �1(so case n = 1 works fine). We’ll construct the a

i

’s inductively, always alternating insign. Suppose we have a

0

, a

1

, . . . , a

n�1

. The polynomial pn�1

(x) = a

0

+ a

1

x + a

2

x

2 +. . .+ a

n�1

x

n�1 has real distinct roots x1

< . . . < x

n�1

. Choose y

1

, . . . , y

n

so that

y

1

< x

1

< y

2

< x

2

< . . . < y

n�1

< x

n�1

< y

n

.

The sequence pn�1

(y1

), pn�1

(y2

), . . . , pn�1

(yn

) alternates in sign (think about the graphof y = p

n�1

(x)). As long as we choose an

su�ciently close to 0, the sequence pn

(y1

), pn

(y2

), . . . , pn

(yn

)alternates in sign (this is by continuity). So, choose such an a

n

. Now choose a y

n+1

su�ciently large that pn

(yn+1

) has the opposite sign to p

n

(yn

) (this is where alternat-ing the signs of the a

i

’s comes in — such a y

n+1

exists exactly because a

n

and a

n�1

have opposite signs). We get that the sequence p

n

(y1

), pn

(y2

), . . . , pn

(yn+1

) alternatesin sign. Hence p

n

(x) has n distinct real roots: one between y

1

and y

2

, one between y

2

and y

3

, etc., up to one between y

n

and y

n+1

. This accounts for all its roots, and we aredone.

Source: Putnam competition, 1990 problem B5.

73

Page 74: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

9 Week eight (October 13) — A grab-bag

This is a selection of uncategorized problems to keep you entertained over the fall break!This week’s preamble concerns general problem solving tips, and specific writing tips.

I have shamelessly appropriate much of this from Ravi Vakil’s Stanford Putnam Prepa-ration website (http://math.stanford.edu/

~

vakil/putnam05/05putnam7.pdf), and fromIoana Dumitriu’s UWashington’s “The Art of Problem Solving” website (http://www.math.washington.edu/

~

putnam/index.html). Both of these websites are filled with what I thinkis great advice.

Some specific mathematical tips

Here are some very simple things to remember, that can be very helpful, but that peopletend to forget to do.

1. Try a few small cases out. Try a lot of cases out. Remember that the three hours ofthe Putnam competition is a long time — you have time to spare! If a question askswhat happens when you have n things, or 2015 things, try it out with 1, 2, 3, 4 things,and try to form a conjecture. This is especially valuable for questions about sequencesdefined recursively.

2. Don’t be afraid to use lots and lots of paper.

3. Don’t be afraid of diving into some algebra. (Again, three hours is a long time . . ..)

4. If a question asks to determine whether something is true or false, and the directionyou initially guess doesn’t seem to be going anywhere, then try guessing the oppositepossibility.

5. Be willing to try (seemingly) stupid things.

6. Look for symmetries. Try to connect the problem to one you’ve seen before. Askyourself “how would [person X] approach this problem”? (It’s quite reasonable herefor [Person X] to be [Chuck Norris]!)

7. Putnam problems always have slick solutions. That leads to a helpful meta-approach:“The only way this problem could have a nice solution is if this particular approachworked out, unlikely as it seems, so I’ll try it out, and see what happens.”

8. Show no fear. If you think a problem is probably too hard for you, but you have anidea, try it anyway. (Three hours is a long time.)

Some specific writing tips

You’re working hard on a problem, focussing all your energy, applying all the good tipsabove, and all of a sudden a bulb lights above your head: you have figured out how to solveone of the problems! Awesome! But here’s the hard, unforgiving truth: that warm tingleyou’re feeling is no guarantee

74

Page 75: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

• that you have actually solved the problem (are you sure you have all the cases covered?Are you sure that all the little details work out? . . .) and

• that you will get any or all credit for it.

Solving the problem is only half the battle. Now you have launch into the other half,convincing the grader that you have actually done so.

Life is tough, and Putnam graders may be even tougher. But here’s a list of things which,when done properly, will yield a nice write-up which will appease any reasonable grader.

1. All that scrap paper, filled with your musings on the problem to date? Put it aside;you must write a clean, coherent solution on a fresh piece of paper.

2. Before you start writing, organize your thoughts. Make a list of all steps to the solution.Figure out what intermediary results you will need to prove. For example, if theproblem involves induction, always start with the base case, and continue with provingthat “true for n implies true for n + 1”. Make sure that the steps follow from eachother logically, with no gaps.

3. After tracing a “road to proof” either in your head or (preferably) on scratch paper,start writing up the solution on a fresh piece of paper. The best way to start this isby writing a quick outline of what you propose to do. Sometimes, the grader will justlook at this outline, say “Yes, she knows what she is doing on this problem!”, and givethe credit.

4. Complete each step of the “road” before you continue to the next one.

5. When making statements like “it follows trivially” or “it is easy to see”, listen forquiet, nagging doubts. If you yourself aren’t 100% convinced, how will you convincesomeone else? Even if it seems to follow trivially, check again. Small exceptions maynot be obvious. The strategy “I am sure it’s true, even if I don’t see it; if I state thatit’s obvious, maybe the grader will believe I know how to prove it” has occasionallyled its user to a score of 0 out of 10.

6. Organize your solution on the page; avoid writing in corners or perpendicular to thenormal orientation. Avoid, if possible, post-factum insertion (if you discover you’vemissed something, rather than making a mess of the paper by trying to write it over,start anew. You have the time!)

7. Before writing each phrase, formulate it completely in your mind. Make sure it ex-presses an idea. Starting to write one thing, then changing course in mid-sentence andsaying another thing is a sure way to create confusion.

8. Be as clear as possible. Avoid, if possible, long-winded phrases. Use as many words asyou need – just do it clearly. Also, avoid acronyms.

9. If necessary, state intermediary results as “claims” or “lemmas” which you can proveright after stating them. If you cannot prove one of these results, but can prove theproblem’s statement from it, state that you will assume it, then show the path from itto the solution. You may get partial credit for it.

75

Page 76: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

10. When you’re done writing up the solution, go back and re-read it. Put yourself inthe grader’s shoes: can someone else read your write-up and understand the solution?Must one look for things in the corners? Are there “miraculous” moments?, etc..

76

Page 77: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

9.1 Week eight problems

1. A locker room has 100 lockers, numbered 1 to 100, all closed. I run through the lockerroom, and open every locker. Then I run through the room again, and close the lockersnumbered 2, 4, 6, etc. (all the even numbered lockers). Next I run through the room,and change the status of the lockers numbered 3, 6, 9, etc. (opening the closed ones,and closing the open ones). I keep going in this manner (on the ith run through theroom, I change the status of lockers numbered i, 2i, 3i, etc.), until on my 100th runthrough the room I change the status of locker number 100 only. At the end of all this,which lockers are open?

2. Fix an integer k � 1. Let f(x) = 1/(xk � 1). The nth derivative of f(x) may bewritten as

f

(n)(x) =g

n

(x)

(xk � 1)n+1

for some function g

n

(x). Find the value (in terms of n and k) of gn

(1).

3. Determine, with proof, the number of ordered triples (A1

, A

2

, A

3

) of sets which havethe property that

(a) A

1

[ A

2

[ A

3

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

(b) A

1

\ A

2

\ A

3

= ;.

Express your answer in the form 2a3b5c7d, where a, b, c and d are nonnegative integers.

4. (a) Is there a sequence (an

)n�1

of positive terms, such that both of the sums1X

n=1

a

n

n

3

,

1X

n=1

1

a

n

converge?

(b) Is there a sequence (an

)n�1

of positive terms, such that both of the sums1X

n=1

a

n

n

2

,

1X

n=1

1

a

n

converge?

5. Find, with proof, a simple formula for the sum2nX

k=n

✓k

n

◆22n�k

.

6. Consider the following game played with a deck of 2n cards, numbered from 1 to 2n.The deck is randomly shu✏ed and n cards are dealt to each of two players, A and B.Beginning with A, the players take turns discarding one of their remaining cards andannouncing its number. The game ends as soon as the sum of the numbers on thediscarded cards is divisible by 2n+ 1. The last person to discard wins the game.

Assuming optimal strategy by both A and B, who wins?

77

Page 78: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

9.2 Week eight solutions

1. A locker room has 100 lockers, numbered 1 to 100, all closed. I run through the lockerroom, and open every locker. Then I run through the room again, and close the lockersnumbered 2, 4, 6, etc. (all the even numbered lockers). Next I run through the room,and change the status of the lockers numbered 3, 6, 9, etc. (opening the closed ones,and closing the open ones). I keep going in this manner (on the ith run through theroom, I change the status of lockers numbered i, 2i, 3i, etc.), until on my 100th runthrough the room I change the status of locker number 100 only. At the end of all this,which lockers are open?

Solution: Locker n has its status changed once for each positive divisor of n, and so itis open in the end exactly if n has an odd number of positive divisors. If n has primefactorization p

a11

. . . p

a

k

k

, then the number of positive divisors is (a1

+ 1) . . . (ak

+ 1)(a positive divisor takes the form p

b11

. . . p

b

k

k

with 0 b

i

a

i

for each i; so there area

i

+1 choices for the value of bi

, with choices for di↵erent i’s being independent). Theproduct (a

1

+ 1) . . . (ak

+ 1) is odd only if each a

i

+ 1 is odd, so only if each a

i

iseven. So Locker n has its status changed exactly when all the exponents in the primefactorization of n are even; in other words, exactly when n is a perfect square. So theopen lockers are numbered 1, 4, 9, 16, 25, 36, 49, 64, 81 and 100.

Source: An old problem, I think; I heard of if from John Engbers.

2. Fix an integer k � 1. Let f(x) = 1/(xk � 1). The nth derivative of f(x) may bewritten as

f

(n)(x) =g

n

(x)

(xk � 1)n+1

for some function g

n

(x). Find the value (in terms of n and k) of gn

(1).

Solution: The claimed form of the nth derivative of f(x) is clearly correct: gn

(x) canbe found simply by di↵erentiating f(x) n times, and multipling the result by (xk�1)n+1.But notice that we can say a little more about g

n

(x), by doing the di↵erentiations oneat a time: for n > 0,

f

(n)(x) =d

dx

�f

(n�1)(x)�

=d

dx

✓g

n�1

(x)

(xk � 1)n

=d

dx

�g

n�1

(x)(xk � 1)�n

= �nkx

k�1

g

n�1

(x)(xk � 1)�n�1 + g

0n�1

(x)(xk � 1)�n

=�nkx

k�1

g

n�1

(x) + (xk � 1)g0n�1

(x)

(xk � 1)n+1

.

This constitutes a proof by induction of the following statement: the nth derivative off(x) may be written as

f

(n)(x) =g

n

(x)

(xk � 1)n+1

78

Page 79: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

where the function g

n

(x) satisfies:

g

n

(x) =

⇢1 if n = 0�nkx

k�1

g

n�1

(x) + (xk � 1)g0n�1

(x) if n > 0.

This makes gn

(x) a polynomial in x (one can easily prove this by induction). That inparticular means that g0

n�1

(x) is finite for all x and n � 0. So, evaluating the aboverecurrence at x = 1, we get:

g

n

(1) =

⇢1 if n = 0�nkg

n�1

(1) if n > 0

(the term (xk � 1)g0n�1

(x) disappearing at x = 1!). Now it is straightforward to proveby induction on n that

g

n

(1) = (�1)nkn

n!.

Source: Modified slightly from Putnam competition problem A1, 2002.

3. Determine, with proof, the number of ordered triples (A1

, A

2

, A

3

) of sets which havethe property that

(a) A

1

[ A

2

[ A

3

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

(b) A

1

\ A

2

\ A

3

= ;.

Express your answer in the form 2a3b5c7d, where a, b, c and d are nonnegative integers.

Solution: Idea: each i 2 {1, . . . , 10} has six possibilities, namely be in A

1

alone, A2

alone, A3

alone, be missing from A

1

alone, missing from A

2

alone, missing from A

3

alone. So there should be 610 ways to construct such a triple. Here’s a possible way ofpresenting this idea formally:

We claim that there are exactly 610 = 210310 such subsets. Indeed, let S be the set ofall triples (A

1

, A

2

, A

3

) satisfying the conditions of the question, and let T be the setof all words of length 10 over alphabet {a, b, c, d, e, f}. We will construct a bijection '

from S to T ; since |T | is evidently 610, this will prove the claim.

The bijection is the following: given S = (A1

, A

2

, A

3

) 2 S, for each i 2 {1, . . . , 10} theith letter of '(S) is a if i 2 A

1

, i 62 A

2

, i 62 A

3

; b if i 62 A

1

, i 2 A

2

, i 62 A

3

; c if i 62 A

1

,i 62 A

2

, i 2 A

3

; d if i 2 A

1

, i 2 A

2

, i 62 A

3

; e if i 2 A

1

, i 62 A

2

, i 2 A

3

; and f if i 62 A

1

,i 2 A

2

, i 2 A

3

.

Since there is no i with the property that i 62 A

1

, i 62 A

2

, i 62 A

3

(by condition (1)),and none with the property that i 2 A

1

, i 2 A

2

, i 2 A

3

(by condition (2)), '(S) 2 Tfor all S 2 S.To verify that ' is injective, consider S

1

= (A1

, A

2

, A

3

), S2

= (A01

, A

02

, A

03

) 2 S withS

1

6= S

2

. Since S1

6= S

2

there must be some i 2 {1, . . . , 10} and some j 2 {1, 2, 3} suchthat either i 2 A

j

and i 62 A

0j

or i 62 A

j

and i 2 A

0j

; in either case '(S1

) and '(S2

)di↵er on the ith letter and so are distinct.

79

Page 80: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

To verify that i is surjective, consider a word T = w

1

. . . w

10

2 T . Let A = {i : wi

= a},and define B, C, D, E and F analogously. Set A

1

= A [ D [ E, A2

= B [ D [ F ,and A

3

= C [ E [ F . We have A

1

[ A

2

[ A

3

= A [ B [ C [D [ E [ F = {1, . . . 10}.For each i 2 {1, . . . , 10}, if w

i

= a then by construction i 2 A

1

, i 62 A

2

, i 62 A

3

, soi 62 A

1

\ A

2

\ A

3

, and by similar reasoning i 62 A

1

\ A

2

\ A

3

if wi

= b, c, d, e or f ; soA

1

\ A

2

\ A

3

= ;, and hence S := (A1

, A

2

, A

3

) 2 S. By construction of S, '(S) = T .

This completes the proof that ' is a bijection, and so the proof of the initial claim.

Source: Putnam competition 1985, problem A1.

4. (a) Is there a sequence (an

)n�1

of positive terms, such that both of the sums

1X

n=1

a

n

n

3

,

1X

n=1

1

a

n

converge?

Solution: Try a

n

= n

↵. Then

1X

n=1

a

n

n

3

=1X

n=1

1

n

3�↵

which converges as long as 3� ↵ > 1 or ↵ < 2; and

1X

n=1

1

a

n

=1X

n=1

1

n

which converges as long as ↵ > 1. So a

n

= n

↵ for any ↵ satisfying 1 < ↵ < 2 willwork.

(b) Is there a sequence (an

)n�1

of positive terms, such that both of the sums

1X

n=1

a

n

n

2

,

1X

n=1

1

a

n

converge?

Solution: This time a

n

= n

↵ won’t work; we need ↵ < 1 for the first sum toconverge, and ↵ > 1 for the second. This suggests that no such a

n

exists, andhere’s a proof of that fact:

Assume that both sums converge. Then so does

1X

n=1

✓a

n

n

2

+1

a

n

◆.

But this seems fishy: if an

is small, then 1/an

is large; and if an

is large, thena

n

/n

2 is large. So it seems that the summand is always large, making convergence

80

Page 81: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

hard. We can easily formalize this: if an

� n then a

n

/n

2 � 1/n, and if an

n

then 1/an

� 1/n. So1X

n=1

✓a

n

n

2

+1

a

n

◆>

1X

n=1

1

n

= 1,

a contradiction.

Source: From A Mathematical Orchard: Problems and Solutions by Krusemeyer,Gilbert and Larson.

5. Find, with proof, a simple formula for the sum

2nX

k=n

✓k

n

◆22n�k

.

Solution: A best of 2n + 1-game series between the Royals and the Mets (first teamto win n + 1 games wind the series), goes k + 1 games, for some k = n, . . . , 2n. Thenumber of series that go k+ 1 games is 2

�k

n

�(either the Royals must win k of the first

n games, then win the (k + 1)st game, or the Mets must win k of the first n games,then win the (k + 1)st game). Assuming both teams are evenly matched, and eachwins each game with probability .5, independently of all the others, the probabilitythat the series goes k+1 games is 2

�k

n

�2�(k+1). Since with probability 1 the series goes

some number of games between n+ 1 and 2n+ 1, it follows that

2nX

k=n

2

✓k

n

◆2�(k+1) = 1

and so2nX

k=n

✓k

n

◆22n�k = 22n.

Source: 2013 University of Illinois mock Putnam

6. Consider the following game played with a deck of 2n cards, numbered from 1 to 2n.The deck is randomly shu✏ed and n cards are dealt to each of two players, A and B.Beginning with A, the players take turns discarding one of their remaining cards andannouncing its number. The game ends as soon as the sum of the numbers on thediscarded cards is divisible by 2n+ 1. The last person to discard wins the game.

Assuming optimal strategy by both A and B, who wins?

Solution: This was on the 1993 Putnam (problem B2); see the appropriate Putnambook on reserve in the library for a solution.

Basically: B wins. Think about A throwing down his first card, x. We may assumethat A also has 2n + 1 � x, otherwise B has it and wins immediately. Consider two

81

Page 82: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

cards that B has, say y and z. It must be that x + y and x + z leave a di↵erentremainder on division by 2n + 1 (if they left the same remainder, so would y and z

on their own, impossible). So each of y and z would require a di↵erent response fromA, if A were going to win on his next throw. In other words, B can associate to eachof n cards a di↵erent number, and say to himself “if I play card y, A must play cardnumber(y) to win on his next throw”. But A only has n � 1 cards, so there must bea card y in B’s hand such that A does not have number(y). B plays that card, thusensuring that the game continues at least until B gets to make his second throw. Butthen the same type of argument applies, and B can keep putting o↵ the end of thegame, until finally B has just one card left, which he throws down to win.

Source: Putnam competition 1993, problem B2.

82

Page 83: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

10 Week nine (October 27) — Recurrences

We met recurrences in the section on induction.Sometimes we are either given a sequence of numbers via a recurrence relation, or we can

argue that there is such relation that governs the growth of a sequence. A sequence (bn

)n�a

is defined via a recurrence relation if some initial values, ba

, b

a+1

, . . . , b

k

say, are given, andthen a rule is given that allows, for each n > k, b

n

to be computed as long as we know thevalues b

a

, b

a+1

, . . . , b

n�1

.Sequences defined by a recurrence relation, and proofs by induction, go hand-in-glove.

Here’s an illustrative example.

Example: Let a

n

be the number of di↵erent ways of covering a 1 by n strip with 1 by 1and 1 by 3 tiles. Prove that a

n

< (1.5)n.

Solution: We start by figuring out how to calculate an

via a recurrence. Some initial valuesof a

n

are easy to compute: for example, a1

= 1, a2

= 1 and a

3

= 2. For n � 4, we cantile the 1 by n strip EITHER by first tiling the initial 1 by 1 strip with a 1 by 1 tile, andthen finishing by tiling the remaining 1 by n � 1 strip in any of the a

n�1

admissible ways;OR by first tiling the initial 1 by 3 strip with a 1 by 3 tile, and then finishing by tiling theremaining 1 by n� 3 strip in any of the a

n�3

admissible ways. It follows that for n � 4 wehave a

n

= a

n�1

+ a

n�3

. So a

n

(for n � 1) is determined by the recurrence

a

n

=

8>><

>>:

1 if n = 1,1 if n = 2,2 if n = 3, and

a

n�1

+ a

n�3

if n � 4.

Notice that this gives us enough information to calculate a

n

for all n � 1: for example,a

4

= a

3

+ a

1

= 3, a5

= a

4

+ a

2

= 4, and a

6

= a

5

+ a

3

= 6.Now we prove, by strong induction, that a

n

< 1.5n. That a1

= 1 < 1.51, a2

= 1 < (1.5)2

and a

3

= 2 < (1.5)3 is obvious. For n � 4, we have

a

n

= a

n�1

+ a

n�3

< (1.5)n�1 + (1.5)n�3

= (1.5)n 2

3+

✓2

3

◆3

!

= (1.5)n✓26

27

< (1.5)n,

(the second line using the inductive hypothesis) and we are done by induction.

Notice that we really needed strong induction here, and we really needed all three of thebase cases n = 1, 2, 3 (think about what would happen if we tried to use regular induction,or what would happen if we only verified n = 1 as a base case).

83

Page 84: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

Solving via generating functions

Given a sequence (an

)n�0

, we can form its generating function, the function

F (x) =1X

n=0

a

n

x

n

.

Often we can use a recurrence relation to produce a functional equation that F (x) satisfies,then solve that equation to find a compact (non-infinite-summation) expression for F (x),then finally use knowledge of calculus power-series to extract an exact expression for a

n

.There are so many di↵erent varieties of this method, that I won’t describe it in general, justgive an example. The Perrin sequence is defined by p

0

= 3, P1

= 0, p2

= 2, and

p

n

= p

n�2

+ p

n�3

for n > 2.

(A quite interesting sequence: see http://en.wikipedia.org/wiki/Perrin_number#Primes_and_divisibility.) The generating function of the sequence is

P (x) = p

0

+ p

1

x+ p

2

x

2 + p

3

x

3 + p

4

x

4 + . . . .

Plugging in the given values for p

0

, p

1

and p

2

, and the recurrence’s right-hand side for allothers, we get

P (x) = 3 + 2x2 + (p0

+ p

1

)x3 + (p1

+ p

2

)x4 + . . .

= 3 + 2x2 + x

3(p0

+ p

1

x+ . . .) + x

2(p1

x+ p

2

x

2 + . . .)

= 3 + 2x2 + x

3

P (x) + x

2(P (x)� p

0

)

= 3� x

2 + (x3 + x

2)P (x).

We can now solve for P (x) as a rational function in x, and expand using partial fractions:

P (x) =3� x

2

1� x

2 � x

3

=A

1� ↵

1

x

+B

1� ↵

2

x

+C

1� ↵

3

x

where A,B and C are some constants and (1 � ↵

1

x)(1 � ↵

2

x)(1 � ↵

3

x) = 1 � x

2 � x

3, orequivalently (x � ↵

1

)(x � ↵

2

)(x � ↵

3

) = x

3 � x � 1. In other words, ↵1

,↵

2

and ↵

3

are thesolutions to x

3 � x� 1 = 0 (it happens that one of them, say ↵

1

, is real, and is roughly 1.32[it’s called the plastic number] and the other two are a complex conjugate pair with absolutevalue smaller than ↵

1

).Using

1

1� kx

= 1 + kx+ k

2

x

2 + . . . ,

we now get that

P (x) = (A+B+C)+(A↵1

+B↵

2

+C↵

3

)x+(A↵2

1

+B↵

2

2

+C↵

2

3

)x2+(A↵3

1

+B↵

3

2

+C↵

3

3

)x3+. . . ,

84

Page 85: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

and so we can read o↵ a formula for pn

(by uniqueness of power-series representations):

p

n

= A↵

n

1

+B↵

n

2

+ C↵

n

3

.

But what are A,B and C? One way to figure them out is to use the initial conditions, toget a set of simultaneous equations:

A + B + C = 3A↵

1

+ B↵

2

+ C↵

3

= 0A↵

2

1

+ B↵

2

2

+ C↵

2

3

= 2.

It turns out that the unique solution to this system is A = B = C = 1. This solution satisfiesthe first equation above, evidently; it satisfies the second since

(x�↵

1

)(x�↵

2

)(x�↵

3

) = x

3�x�1 = x

3�(↵1

+↵

2

+↵

3

)x2+(↵1

2

+↵

1

3

+↵

2

3

)x�(↵1

2

3

)(2)

implies ↵1

+ ↵

2

+ ↵

3

= 0; and it satisfies the last since

(↵1

+ ↵

2

+ ↵

3

)2 = (↵2

1

+ ↵

2

2

+ ↵

2

3

) + 2(↵1

2

+ ↵

1

3

+ ↵

2

3

),

and from (2) this reduces to 0 = ↵

2

1

+ ↵

2

2

+ ↵

2

3

� 2 so ↵

2

1

+ ↵

2

2

+ ↵

2

3

= 2.So we have an exact formula for p

n

:

p

n

= ↵

n

1

+ ↵

n

2

+ ↵

n

3

where ↵

1

,↵

2

and ↵

3

are the roots of x3 � x� 1.Notice that without even doing the explicit computation of A,B and C, we have learned

something from the generating function approach about p

n

, namely the following: since↵

1

⇡ 1.32 is real and (↵2

,↵

3

) is a complex conjugate pair with absolute value smaller than↵

1

, we have that for large n,p

n

⇡ A↵

n

1

⇡ A(1.32)n.

In other words, with very little work, we have isolated the rough growth rate of pn

.If this business of generating functions interests you, you can find out much more in Herb

Wilf’s beautiful book generatingfunctionology (just google it; it’s freely available online).

Solving via characteristic function

Mimicing what we did with the Perrin sequence, we can easily prove the following theorem:let (a

n

) be a sequence defined recursively, via the defining relation

a

n

= c

1

a

n�1

+ c

2

a

n�2

+ c

k

a

n�k

for n � k,

(for some constants ci

) together with initial values a0

, a

1

, a

2

, . . . , a

k�1

. Form the polynomial

C(x) = x

k � c

1

x

k�1 � c

2

x

k�2 � . . .� c

k�1

x� c

k

(called the characteristic polynomial of the recurrence). If C(x) = (x�↵

1

)(x�↵

2

) . . . (x�↵

k

)factors into distinct linear terms, then there are constants A

1

, A

2

, . . . , A

k

such that for alln � 0,

a

n

= A

1

n

1

+ . . .+ A

k

n

k

85

Page 86: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

with the A

i

’s explicitly findable by solving the k by k system of linear equations

A

1

+ . . .+ A

k

= a

0

A

1

1

+ . . .+ A

k

k

= a

1

A

1

2

1

+ . . .+ A

k

2

k

= a

2

. . .

A

1

k�1

1

+ . . .+ A

k

k�1

k

= a

k�1

.

Even without solving this system, if C(x) has a unique root (say ↵

1

) of greatest absolutevalue, then we know the asymptotic growth rate

p

n

⇠ A

1

n

1

as n ! 1.Similar statements can be made when C(x) has repeated roots, with the form of the final

answer changing depending on what is the right expression to use in the partial fractionsexpansion step of the generating function method. I won’t make a general statement, becauseit would be way too cumbersome (but ask me if you want to see more!); instead here’s anexample:

Suppose a

n

= 4an�1

� 4an�2

for all n � 2, with a

0

= 0 and a

1

= 1. The generatingfunction method gives that the generating function A(x) satisfies

A(x) =x

1� 4x+ 4x2

.

The correct partial fractions expansion now is

A(x) =A

1� 2x+

B

(1� 2x)2.

The coe�cient of xn in A/(1� 2x) is A(2n). For B/(1� 2x)2, we use:

1

1� kx

= 1 + kx+ k

2

x

2 + . . . ,

so di↵erentiating

k

(1� kx)2= k + 2k2

x+ 3k3

x

2 + . . .+ (n+ 1)kn+1

x

n + . . . ,

so1

(1� kx)2= 1 + 2kx+ 3k2

x

2 + . . .+ (n+ 1)kn

x

n + . . . ,

so the coe�cient of xn in B/(1� 2x)2 is B(n+1)(2n). [This trick of figuring out new powerseries from old by di↵erentiation is quite useful!] This gives

a

n

= A2n + (n+ 1)B2n.

Using a

0

= 0 we get A + B = 0, and using a

1

= 1 we get 2A + 4B = 1, so A = �1/2,B = 1/2 and

a

n

= n2n�1

(a fact that if we had guessed correctly, we could have easily proven by induction).

86

Page 87: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

Solving via matrices

The Perrin recurrence can be encoded in matrix form: start with p

n+2

= p

n

+ p

n�1

, and addthe trivial identities p

n+1

= p

n+1

and p

n

= p

n

to get0

@p

n

p

n+1

p

n+2

1

A =

2

40 1 00 0 11 1 0

3

5

0

@p

n�1

p

n

p

n+1

1

A (3)

valid for n � 1. iteratively applying, we get that for all n � 1,0

@p

n

p

n+1

p

n+2

1

A =

2

40 1 00 0 11 1 0

3

5n

0

@302

1

A. (4)

Write this as vn

= A

n

v. If we can diagonalize A (that is, find invertible S with SAS

�1 = D,with D a diagonal matrix), then we can write A = S

�1

DS, so A

n = S

�1

D

n

S, from which wecan easily find v

n

and so p

n

explicitly. If you know enough linear algebra, you’ll quickly seethat this approach requires finding eigenvalues, which are roots of a certain cubic, and thecomputations quickly reduce to exactly the same ones as those of the previous two methodsdescribed. I mention this method just to bring up the matrix point of view of recurrences,which can sometimes be quite helpful.

Solving general recurrences

I’ve only talked about recurrences with constant coe�cients, but of course recurrences canbe far more general. While the generating function method is very good to bear in mind formore general problems, there’s really no general approach that’s sure to work; solving recur-rences generally involves ad-ho tool like playing with lots of small examples, and spotting,conjecturing and proving patterns (often by induction).

A non-Putnam warm-up exercise

Using the trick of repeatedly di↵erentiating the identity

1

1� x

= 1 + x+ x

2 + . . . ,

find a nice expression for the coe�cients of the power series (about 0) of 1/(1 � x)k. Usethis to derive, via generating functions, the identity

nX

i=0

i

2 =n(n+ 1)(2n+ 1)

6,

and if you are feeling masochistic, go on to find a nice closed-form for

nX

i=0

i

3

87

Page 88: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

using the same idea.

Solution: Di↵erentiating the left-hand side k times, we get

k!

(1� x)k+1

,

and di↵erentiating the right-hand side k times, we get an power series where the coe�cientof xn�k is n(n� 1) . . . (n� (k � 1)), so the coe�cient of xn is (n+ k)(n+ k � 1) . . . (n+ 1).Dividing through by k!, the coe�cient of xn in 1/(1� x)k+1 is

(n+ k)(n+ k � 1) . . . (n+ 1)

k!=

✓n+ k

k

◆.

Let an

=P

n

i=0

i

2; an

satisfies the recurrence a0

= 0 and a

n

= a

n�1

+n

2 for n > 0. LettingA(x) = a

0

+ a

1

x+ a

2

x

2

. . . be the generating function of the a

n

’s, we get

A(x) = 0 + (a0

+ 12)x+ (a1

+ 22)x2 + . . .

= xA(x) + (12x+ 22x2 + 32x3 + . . .)

= xA(x) + [1.0 + 1]x+ [2.1 + 2]x2 + [3.2 + 3]x3 + . . .

= xA(x) + (1.0x+ 2.1x2 + 3.2x3 + . . .) + (1x+ 2x2 + 3x3 + . . .)

= xA(x) + x

2(2.1 + 3.2x+ . . .) + x(1 + 2x+ 3x2 + . . .)

= xA(x) + x

2

d

2

dx

2

✓1

1� x

◆+ x

d

dx

✓1

1� x

= xA(x) +2x2

(1� x)3+

x

(1� x)2

= xA(x) +x

2 + x

(1� x)3

so

A(x) =x

2 + x

(1� x)4=

x

2

(1� x)4+

x

(1� x)4.

This means that a

n

consists of two parts — the coe�cient of xn�2 in 1/(1 � x)4 and thecoe�cient of xn�1 in 1/(1� x)4. By what we established earlier, this is

✓n+ 1

3

◆+

✓n+ 2

3

◆=

n(n+ 1)(2n� 1)

6.

If you were feeling masochistic, you might have used the same method to discover

nX

i=0

i

3 =

✓n(n+ 1)

2

◆2

.

88

Page 89: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

10.1 Week nine problems

1. Define a selfish set to be a set which has its own cardinality (number of elements) asan element. Find, with proof, the number of subsets of {1, 2, . . . , n} which are minimalselfish sets, that is, selfish sets none of whose proper subsets is selfish.

2. A hotel corridor has n rooms in a row numbered 1 through n. Each room is to bepainted one of three colors, Red, White or Blue, with the rule that if two rooms areadjacent then it cannot be the case that one of them is painted Red while the otheris painted Blue. Let p

n

be the number of ways in which this painting can be done.For example p

1

= 3 (R,W,B) and p

2

= 7 (WW,WR,WB,RW,RR,BW,BB). Find aclosed-form expression for p

n

(one that doesn’t involve a summation or a recurrence).

3. Let (xn

)n�0

be a sequence of nonzero real numbers such that x

2

n

� x

n�1

x

n+1

= 1 forn = 1, 2, 3, . . .. Prove there exists a real number C such that x

n+1

= Cx

n

� x

n�1

forall n � 1.

4. Define (an

)n�0

by1

1� 2x� x

2

=X

n�0

a

n

x

n

.

Show that for each n � 0, there is an m = m(n) such that am

= a

2

n

+ a

2

n+1

.

5. Define a sequence by a

k

= k for k = 1, 2, . . . , 2015 and

a

k+1

= a

k

+ a

k�2014

for k � 2015. Show that the sequence has 2014 consecutive terms each divisible by2015.

6. Define a sequence (un

)1n=0

by u

0

= u

1

= u

2

= 1, and thereafter by the condition that

det

✓u

n

u

n+1

u

n+2

u

n+3

◆= n!

for all n � 0. Show that un

is an integer for all n. (By convention, 0! = 1.)

89

Page 90: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

10.2 Week nine solutions

1. Define a selfish set to be a set which has its own cardinality (number of elements) asan element. Find, with proof, the number of subsets of {1, 2, . . . , n} which are minimalselfish sets, that is, selfish sets none of whose proper subsets is selfish.

Solution: Let f

n

be the number of minimal selfish subsets of {1, . . . , n}. We easilyhave f

1

= 1 (only {1}) and f

2

= 1 (only {1, 2}). For n > 2, minimal selfish subsets of{1, . . . , n} either include n or they don’t. Let f include

n

be the number of minimal selfishsubsets of {1, . . . , n} that include n, and f

exclude

n

be those that don’t include n.

We have f

exclude

n

= f

n�1

: a minimal selfish subset of {1, . . . , n} that doesn’t include n

is clearly a minimal selfish subset of {1, . . . , n� 1}, and vice-versa.

We also have f

include

n

= f

n�2

: consider the map that takes a minimal selfish subset of{1, . . . , n} that includes n, removes n from it, and subtracts one from each remainingelement. The result is a minimal selfish subset of {1, . . . , n � 2} (note that 1 is nota member of the minimal selfish subset of {1, . . . , n} that includes n that we startedwith, since otherwise it would not be minimal selfish). Conversely, a minimal selfishsubset of {1, . . . , n� 2} becomes a minimal selfish subset of {1, . . . , n} that includes nby the reverse process of adding one to each element, and then adding in n.

It follows that fn

= f

n�1

+ f

n�2

for n > 2, and so, recalling the initial conditions, fn

is the nth Fibonacci number.

Source: Putnam Competition 1996, problem B1.

2. A hotel corridor has n rooms in a row numbered 1 through n. Each room is to bepainted one of three colors, Red, White or Blue, with the rule that if two rooms areadjacent then it cannot be the case that one of them is painted Red while the otheris painted Blue. Let p

n

be the number of ways in which this painting can be done.For example p

1

= 3 (R,W,B) and p

2

= 7 (WW,WR,WB,RW,RR,BW,BB). Find aclosed-form expression for p

n

(one that doesn’t involve a summation or a recurrence).

Solution: As observed, p1

= 3 and p

2

= 7. For n � 3 we have the recurrence: Definea sequence (p

n

)n�1

recursively by p

1

= 3, p2

= 7 and, for n � 3,

p

n

= 4 + p

n�1

+ 2pn�2

+ . . .+ 2p1

.

Indeed, consider the number of the first room painted W. If it is room 1, there are pn�1

ways to finish. If it is room 2, there are two choices for the color of room 1 (R or B)and p

n�2

ways to paint rooms 3 through n. If it is room 3, there are two choices forthe colors of room 1 and 2 (RR or BB) and p

n�3

ways to paint rooms 4 through n.In general, if the first room painted W is room k for some k = 2, . . . , n� 1, there aretwo choices for the colors of rooms 1 through k (all R or all B) and p

n�k

ways to paintrooms k + 1 through n. If the first room painted W is room n there are two choicesfor the colors of rooms 1 through n� 1 (all R or all B). Finally, if no room is paintedwhite, there are two choices for the colors of rooms 1 through n (all R or all B). Thisgives the recurrence.

90

Page 91: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

The first few values are p

1

= 3, p2

= 7, p3

= 17, p4

= 41, p3

= 17, p4

= 41. A patternseems to be emerging: p

n

= 2pn�1

+ p

n�2

, with p

1

= 3, p2

= 7. We verify this byinduction on n. It’s certainly true for n = 3. For n > 3,

p

n

= 4 + p

n�1

+ 2pn�2

+ 2pn�3

+ . . .+ 2p3

+ 2p2

+ 2p1

= (pn�1

+ p

n�2

) + 4 + p

n�2

+ 2pn�3

+ . . .+ 2p3

+ 2p2

+ 2p1

= (pn�1

+ p

n�2

) + p

n�2

(induction)

= 2pn�1

+ p

n�2

,

as required. With this new recurrence, it is easy to apply the method of generatingfunctions, as described in the introduction, to get

p

n

=(1 +

p2)n+1

2+

(1�p2)n+1

2.

Source: This problem arose in my research. A graph is a collection of points, somepairs of which are joined by edges. AWidom-Rowlinson coloring of a graph is a coloringof the points using 3 colors, red, white and blue, in such a way that no point colored redis joined by an edge that is colored blue. I was looking at how many Widom-Rowlinsoncolorings there are of the graph P

n

that consists of n points, numbered 1 up to n, withedges from 1 to 2, from 2 to 3, etc., up to from n� 1 to n.

3. Let (xn

)n�0

be a sequence of nonzero real numbers such that x

2

n

� x

n�1

x

n+1

= 1 forn = 1, 2, 3, . . .. Prove there exists a real number C such that x

n+1

= Cx

n

� x

n�1

forall n � 1.

Solution: Set

f

n

=x

n

+ x

n�2

x

n�1

for n � 2 (well-defined since all xi

are non-zero), so that

f

n+1

=x

n+1

+ x

n�1

x

n

.

We claim that for all n � 2, fn+1

= f

n

for n � 2. Indeed, this equality is equivalent to

x

n

+ x

n�2

x

n�1

=x

n+1

+ x

n�1

x

n

orx

2

n

+ x

n

x

n�2

= x

n�1

x

n+1

+ x

2

n�1

orx

2

n

� x

n�1

x

n+1

= x

2

n�1

� x

n

x

n�2

;

but this last is true since both sides equal 1 for n � 2. It follows that there is some C

such that for all n � 2,Cx

n�1

= x

n

+ x

n�2

91

Page 92: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

orx

n

= Cx

n�1

� x

n�2

,

so for all n � 1x

n+1

= Cx

n

� x

n�1

,

as was required to show.

Source: Putnam Competition 1993, problem A2.

4. Define (an

)n�0

by1

1� 2x� x

2

=X

n�0

a

n

x

n

.

Show that for each n � 0, there is an m = m(n) such that am

= a

2

n

+ a

2

n+1

.

Solution: Using partial fractions, we can get the Taylor series of 1/(1� 2x� x

2), anddiscover that

a

n

=1

2p2

⇣(1 +

p2)n+1 � (1�

p2)n+1

⌘.

After a little (messy) algebra, we find that

a

2

n

+ a

2

n+1

= a

2n+2

,

so m = 2n+ 2 works.

Source: Putnam Competition 1999, problem A3.

5. Define a sequence by a

k

= k for k = 1, 2, . . . , 2015 and

a

k+1

= a

k

+ a

k�2014

for k � 2015. Show that the sequence has 2014 consecutive terms each divisible by2015.

Solution: The given recurrence can be used to extend the sequence to to a

0

(a0

is theunique integer satisfying a

2015

= a

2014

+ a

0

, so a

0

= 1), and indeed in the same wayit can be extended to all negative k. So we can consider that we are working with adoubly-infinite sequence, indexed by Z.For future reference, it will be useful to know the following: a

0

= 1; a�1

is definedby a

2014

= a

2013

+ a�1

, so also a�1

= 1; a�2

is defined by a

2013

= a

2012

+ a�2

, soalso a�2

= 1; this continues down to a�2013

, which is defined by a

2

= a

1

+ a�2013

, soalso a�2013

= 1. Here things change a little. We have that a�2014

, which is defined bya

1

= a

0

+a�2014

, takes value 0. Also, a�2015

, which is defined by a

0

= a�1

+a�2015

, takesvalue 0. This continues down to a�4027

, which is defined by a�2012

= a�2013

+ a�4027

,and so also takes value 0. Notice that we have found 2014 consecutive values of thesequence, albeit with negative indices, that take value 0, namely a�2014

through a�4027

.

In the section on pigeon-hole principle, we showed that the Fibonacci numbers, viewedsimilarly as a doubly-infinite sequence, are periodic modulo any modulus; that is, if

92

Page 93: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

we take any integer n and consider the remainder of the terms of the doubly-infiniteFibonacci sequence modulo n, we get a periodic sequence. The same proof works toshow that the given sequence (a

k

)k2Z is periodic modulo 2014.

So, it is enough to show that the doubly-infinite sequence (ak

)k2Z has 2014 consecutive

terms (some perhaps with negative indices), each divisible by 2015; the periodicity willthen give us such a long sequence of terms with positive index, also. But now we aredone, since a�2014

through a�4027

gives such a sequence.

Source: 2006 Putnam Competition, problem A3.

6. Define a sequence (un

)1n=0

by u

0

= u

1

= u

2

= 1, and thereafter by the condition that

det

✓u

n

u

n+1

u

n+2

u

n+3

◆= n!

for all n � 0. Show that un

is an integer for all n. (By convention, 0! = 1.)

Solution: Here’s the solution as published in American Mathematical Monthly.

Source: 2004 Putnam competition, problem A3.

93

Page 94: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

11 Week ten (November 3) — Graphs

A graph G = (V,E) consists of a set V of vertices and a set E of edges, each of which is atwo-element subset of V . Think of the vertices as points put down on a piece of paper, andof the edges as arcs joining pairs of points. There is no inherent geometry to a graph — allthat matters is which pairs of points are joined, not the exact position of the points, or thenature of the arcs joining them.

Thinking about the data of a problem as a graph can sometimes be helpful. Althoughsome Putnam problems in the past have been non-trivial results from graph theory in dis-guise, there is no real need to know much graph theory, so in this discussion I’ll just mentionsome basic ideas that might be useful. A little more background on graph theory can befound, for example, at http://www.math.ucsd.edu/

~

jverstra/putnam-week6.pdf.

Problem: n people go to a party, and each one counts up the number of other people sheknows at the party. Show that there are an even number of people who come up with ananswer that is an odd number. (Assuming that “knowing” is a two-way relation; I know youif and only if you know me.)

Solution: Model the problem as a graph. V is the set of n party goers, and E consists ofall pairs of people who know each other. For person i, denote by d

i

the number of edgesthat involve i (d

i

is the degree of vertex i). We have

nX

i=1

d

i

= 2|E|

since as we run over all vertices and count degrees, each edge gets counted exactly twice(once for each vertex in that edge). So the sum of degrees is even. But if there were anodd number of vertices with odd degree, the sum would be odd; so there are indeed an evennumber of people who know an odd number of people.

The useful fact that is true about all graphs that lies at the heart of the solution is this:in any graph G = (V,E),

nX

i=1

d

i

= 2|E|.

Problem: Show that two of the people at the party have the same number of friends.

Solution: The possible values for d

i

are 0 through n � 1, n of them, so the pigeon-holeprinciple doesn’t immediately apply. But: it’s not possible for there to be one vertex withdegree 0, and another with degree n � 1. So the possible values of d

i

are either 1 throughn� 1, n� 1 of them, or 0 through n� 2, n� 1 of them, and in either case the pigeon-holeprinciple gives that there are two people with the same number of friends.

The useful fact that is true about all graphs that lies at the heart of the solution is this:in any graph G = (V,E), there must be two vertices with the same degree.

A walk in a graph from vertex u to vertex v is list of (not necessarily distinct) edges, withu in the first, v in the last, and every pair of consecutive edges sharing a vertex in common

94

Page 95: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

— graphically, a walk is a way to trace a path from u to v, always using complete arcs ofthe drawing, and never taking pencil of paper.

Problem: How many di↵erent walks are there from u to v, that use k edges?

Solution: Form the adjacency matrix of the graph: rows and columns indexed by vertices,entry (a, b) is 1 if {a, b} is an edge, and 0 otherwise. Then form the matrix A

k. The (u, v)entry of this matrix is exactly the number of di↵erent walks from u to v, that use k edges.The proof uses induction of k, and the definition of matrix multiplication. The key point isthat the number of walks from u to v that use k edges is the sum, over all neighbours w ofu (i.e., vertices w such that {u, w} is an edge), of the number of walks from w to v that usek � 1 edges. I’ll skip the details.

The relation “there is a walk between” is an equivalence relation on vertices, so any graphcan be partitioned into equivalence classes, with each class having the property that betweenany two vertices in the class, there is a walk, but there is no walk between any two verticesin di↵erent classes. These classes are called components of the graph. If a graph has justone component, meaning that between any two vertices in the graph, there is a walk, it issaid to be connected.

Problem: Given a graph G, under what circumstances is it possible to take a walk thatuses every edge of the graph exactly once, and ends up at the same vertex that it startedat?

Solution: Such a walk is called an Euler circuit, after the man who first studied them(google “Bridges of Konigsberg”). Such a circuit is a tracing of the graphical representationof the graph, with each arc traced out exactly once, the pencil never leaving the paper,ending where it started. Two fairly obvious necessary conditions for the existence of anEuler circuit are:

• the graph is connected, and

• every degree is even (because each time an Euler circuit visits a vertex, it eats up twoedges — one going in and one coming out).

Euler proved that these necessary conditions are su�cient: a connected graph has an Eulercircuit if and only if all vertex degrees are even. The details are given in any basic graphtheory textbook.

What if we don’t require the tracing to end at the same vertex it began?

Problem: Given a graph G, and two distinct vertices u and v, under what circumstancesis it possible to take a walk from u to v that uses every edge of the graph exactly once?

Solution: Such a walk is called an Euler trail. Euler proved that a connected graph has anEuler trail from u to v if and only if all vertex degrees are even except the degrees of u andv, which must be odd. It follows easily from his result on Euler circuits: just add an edgefrom u to v, apply the Euler trails theorem, and delete the added edge.

Problem: Given a graph G with n vertices, under what circumstances is it possible tolist the vertices in some order v

1

, . . . , v

n

, in such a way that each of {v1

, v

2

}, {v2

, v

3

}, . . .,{v

n�1

, v

n

}, {vn

, v

1

} are all edges?

95

Page 96: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

Solution: Such a list is called a Hamiltonian cycle, after the man who first studied them(google “icosian game”). Unlike with Eulerian trials, there is no simple set of necessary-and-su�cient conditions known to allow one to determine whether such a thing exists in a givengraph. There is one useful su�cient condition, due to Dirac, that has an elementary butinvolved proof that can be found in any graph theory textbook.

Dirac’s theorem: A graph G with n vertices has a Hamiltonian cycle if all vertices havedegree at least n/2.

A connected graph with the fewest possible number of edges is called a tree. It turns outthat all trees on n vertices have the same number of edges, namely n�1. One way to see thisis to imagine building up the tree from a set of n totally disconnected vertices, edge-by-edge.At each step, you should add an edge that bridges two components, since adding an edgewithin a component does not help; in the end such an edge can be removed without hurtingconnectivity. Since two components get merged each time an edge is added, exactly n � 1are needed to get to a single component.

A characterization of trees is that they are connected, but have no cycles — a cycle ina graph is a list of distinct vertices u

1

, u

2

, . . . , u

k

such that each of {u1

, u

2

}, {u2

, u

3

}, . . .,{u

k�1

, u

k

}, {uk

, u

1

} are all edges.

A planar graph is a graph that can be drawn in the plane with no two arcs meetingexcept at a vertex (if they have one in common). A planar drawing of a graph partitionsthe plane into connected regions, called faces. Euler discovered a remarkable formula thatrelates the number of vertices, edges and faces in a planar graph:

Euler’s formula: Let G be a planar graph with V vertices, E edges and F faces. Then

V � E + F = 2.

Proof sketch: By induction on F . If F = 1 then the graph has only one face, so it mustbe a tree. A tree on V vertices has V � 1 edges, and so fits the formula.

Now suppose F > 1. Then the graph contains a cycle. If we remove an edge e ofthat cycle then F drops by one, V stays the same, and E drops by 1. Now by induction,V � (E � 1) + (F � 1) = 2 and this gives V � E + F = 2.

Problem: Show that five points can’t be connected up with arcs in the plane in such a waythat no two arcs meet each other except at a vertex (if they have one in common).

Solution: Suppose such a connection was possible. The resulting planar graph would have5 vertices and

�5

2

�= 10 edges, so by Euler’s formula would have 7 faces. The sum, over the

faces, of the number of edges bounding the faces, is then at least 21, since each faces has atleast three bounding edges. But this sum is at most twice the number of edges, since eacheach edge can be on the boundary of at most two faces; so it is at most 20, a contradiction.

A bipartite graph is a graph whose vertex set can be partitioned into two classes, Xand Y , such that the graph only has edges that go from X to Y (and so none that areentirely within X or entirely within Y ). It’s fairly easy to see that any odd-length cycle isnot bipartite, so any graph that has an odd-length cycle sitting inside it is also not bipartite.This turns out to be a characterization of bipartite graphs; the proof can be found in anytextbook on graph theory.

96

Page 97: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

Theorem: A graph is bipartite if an only if it has no odd cycle.

Amatching in a graph is a set of edges, no two of which share a vertex. A perfect matchingis a matching that involves all the edges. A famous result, whose proof can be found in anygraph theory textbook, is Hall’s marriage theorem. A consequence of it says that if thereare n women and n men, each women likes exactly d men, and each man is liked by exactlyd women, then it is possible to pair the men and women o↵ into n pairs, such that eachwomen is paired with a man she likes. Here’s the statement in graph-theory language:

Theorem: Let G be a bipartite graph that is regular (all vertices have the same degree). Ghas a perfect matching.

97

Page 98: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

11.1 Week ten problems

1. In a town there are three newly build houses, and each needs to be connected by a lineto the gas, water, and electricity factories. The lines are only allowed to run along theground. Is there a way to make all nine connections without any of the lines crossingeach other?

2. n teams play each other in a round-robin tournament (so each team plays each of theother teams exactly once). There are no ties. Show that there exists an ordering ofthe teams, (a

1

, a

2

, a

3

, . . . , a

n

), such that team a

1

beats team a

2

, team a

2

beats teama

3

, . . ., team a

n�1

beats team a

n

.

3. An airline operates flights out of 2n airports. In all, the airline operates n2+1 di↵erentroutes (all there-and-back: South Bend to Chicago is considered the same route asChicago to South Bend). Prove that there are three airports a, b, c such that it ispossible to fly directly from a to b, then b to c, then c back to a.

4. The complete graph K

n

on vertex set {1, . . . , n} is the graph in which all�n

2

�possible

edges are present. Suppose that the edges of Kn

are colored with two colors, say Redand Blue (meaning, each edge is either assigned the color Red or the color Blue, butnot both). Prove that is possible to partition {1, . . . , n} as A[B, such that there is aRed path that covers all the vertices in A and a Blue path that covers all the verticesin B. (By this is meant: the elements of A can be ordered as (a

1

, a

2

, . . . , a

`

) in such away that each of the edges a

1

a

2

, a

2

a

3

, . . . , a

`�1

a

`

are all colored Red, and similarly forB.)

5. Is there a way to list the 2n subsets of {1, . . . , n} (with each subset appearing on thelist once and only once) in such a way that the first element of the list is the empty set,and every element on the list is obtained from the previous element either by addingan element or deleting an element?

6. Let G be a finite group of order n generated by a and b. Prove or disprove: there isa sequence g

1

, g

2

, g

3

, . . . , g

2n

such that every element of G occurs exactly twice in thesequence, and, for each i = 1, 2, . . . , 2n, g

i+1

equals gi

a or gi

b. (Interpret g2n+1

as g1

.)

98

Page 99: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

11.2 Week ten solutions

1. In a town there are three newly build houses, and each needs to be connected by a lineto the gas, water, and electricity factories. The lines are only allowed to run along theground. Is there a way to make all nine connections without any of the lines crossingeach other?

Solution: The question is asking whether the graph on six vertices, 1, 2, . . . , 6, withan edge from i to j if and only if 1 i 3 and 4 j 6, can be drawn inthe plane without crossing edges. It has 6 vertices and 9 edges, so if it could, anyrepresentation would have 5 faces (Euler’s formula). Each face is bounded by at least4 edges (note that the graph we are working with clearly has no triangles), so summing“#(bounding edges)” over all faces, get at least 20. But this sum counts each edge atmost twice, so we get at most 18, a contradiction that reveals that there is no suchplanar representation.

Source: This is folklore.

2. n teams play each other in a round-robin tournament (so each team plays each of theother teams exactly once). There are no ties. Show that there exists an ordering ofthe teams, (a

1

, a

2

, a

3

, . . . , a

n

), such that team a

1

beats team a

2

, team a

2

beats teama

3

, . . ., team a

n�1

beats team a

n

.

Solution: Proof by induction on n, with n = 1, and indeed n = 2, trivial. So assumen � 3. Fix an arbitrary vertex x. By induction there exists an ordering of the remainingteams, (a

1

, a

2

, a

3

, . . . , a

n�1

), such that team a

1

beats team a

2

, team a

2

beats team a

3

,. . ., team a

n�2

beats team a

n�1

.

If x beats a

1

, then the ordering (x, a1

, . . . , a

n�1

) works. If x looses to everyone,then the ordering (a

1

, . . . , a

n�1

, x) works. If neither of these things happen, thenthere must be an i such that x looses to a

i

, but beats a

i+1

, and then the ordering(a

1

, . . . , a

i

, x, a

i+1

, . . . , a

n�1

) works.

Source: This was on the Putnam competition in 1958.

3. An airline operates flights out of 2n airports. In all, the airline operates n2+1 di↵erentroutes (all there-and-back: South Bend to Chicago is considered the same route asChicago to South Bend). Prove that there are three airports a, b, c such that it ispossible to fly directly from a to b, then b to c, then c back to a.

Solution: Suppose there were no such three cities a, b, c. For each city x, denote byd(x) the number of cities with direct connection to x. If there is a connection betweencities x and y, then there cannot be a third city y directly connected to both (or wewould have a triangle), so

(d(x)� 1) + (d(y)� 1) 2n� 2, d(x) + d(y) 2n.

99

Page 100: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

Now in the sum of d(x)+d(y) over all pairs of connected cites, for each x we have thatd(x) appears exactly d(x) times (once for each city directly connected to x), so

X(d(x) + d(y)) =

X

x

d

2(x) (n2 + 1)2n.

Now use the Cauchy-Schwartz-Bunyakovski inequality to bound:

2n

X

x

d

2(x)

!� X

x

d(x)

!2

= (2(n2 + 1))2

(note that inP

x

d(x), each route gets counted exactly twice, once for each endpoint).We conclude that

4(n2 + 1)2 4n2(n2 + 1),

which fails to hold for any n � 0.

Here’s an alternate solution taken from https://mks.mff.cuni.cz/kalva/putnam/

psoln/psol5612.html: Model the problem as one about graphs: we are given a graphon 2n vertices with n

2 + 1 edges, and we want to find a triangle.

Induction. For n = 2, the result is obviously true, because there is only one graph with4 points and 5 edges and it certainly contains a triangle. Suppose the result is true forsome n � 2. Consider a graph G with 2n+2 vertices and n

2 +2n+2 edges. Take anytwo vertices x and y joined by an edge. We consider two cases. If there are fewer than2n+ 1 other edges joined to either x or y (or both), then if we remove x and y we geta graph with 2n vertices and at least n2 + 1 edges, which must contain a triangle (byinduction), so G does also. If there are at least 2n + 1 other edges joined to either xor y (or both) then by pigeon-hole principle there is at least one vertex joined to both,and that gives a triangle.

Source: This is Mantel’s theorem, proved in 1907. It is the first result in the fertilefield of extremal graph theory.

4. The complete graph K

n

on vertex set {1, . . . , n} is the graph in which all�n

2

�possible

edges are present. Suppose that the edges of Kn

are colored with two colors, say Redand Blue (meaning, each edge is either assigned the color Red or the color Blue, butnot both). Prove that is possible to partition {1, . . . , n} as A[B, such that there is aRed path that covers all the vertices in A and a Blue path that covers all the verticesin B. (By this is meant: the elements of A can be ordered as (a

1

, a

2

, . . . , a

`

) in such away that each of the edges a

1

a

2

, a

2

a

3

, . . . , a

`�1

a

`

are all colored Red, and similarly forB.)

Solution: Let A and B be disjoint subsets of {1, . . . , n}, with a Red path coveringA and a Blue path covering B, and with A [ B as large as possible subject to thiscondition. If A [ B = {1, . . . , n} then we are done. If not, then we may assume thatboth A and B are not empty, since if one of them, B say, was empty, then we couldreplace B by {x} where x is any vertex not in A, and the result would be a valid pair

100

Page 101: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

(A,B) with the size of the union one larger, a contradiction of maximality (note thata Blue path covers a single vertex).

Let A be covered by the Red path given by the ordering (a1

, a

2

, . . . , a

`

), and let B becovered by the Blue path given by the ordering (b

1

, b

2

, . . . , b

k

). Let x be any vertex notin A[B. If either the edge a

`

x is Red or the edge bk

x is Blue, then we can either addx to A or add x to B and get a valid pair that covers more vertices, a contradiction.So we may assume that a

`

x is Blue and b

k

x is Red.

Now look at edge a

`

b

k

. If this is Red, then we can replace A by {a1

, . . . , a

`

, b

k

, x} andreplace B by {b

1

, . . . , b

k�1

} and get a valid pair that covers more vertices, a contra-diction. If a

`

b

k

is Blue, then we can replace A by {a1

, . . . , a

`�1

} and replace B by{b

1

, . . . , b

k

, a

`

, x} and again get a valid pair that covers more vertices, a contradiction.

We conclude that A [B = {1, . . . , n}.

Source: I learned of this problem in a recent paper of Andras Gyarfas , at http:

//arxiv.org/pdf/1509.05539.pdf.

5. Is there a way to list the 2n subsets of {1, . . . , n} (with each subset appearing on thelist once and only once) in such a way that the first element of the list is the empty set,and every element on the list is obtained from the previous element either by addingan element or deleting an element?

Solution: We’ll prove by induction on n that it is possible, and that moreover it ispossible to do so in such a way that the last element listed is a singleton (so thatthe list can be considered a cycle). In fact, the question is asking for a Hamiltonianpath (a walk that visits every vertex once) in the graph whose vertex set in the powerset of {1, . . . , n}, with two vertices adjacent if they have symmetric di↵erence of sizeexactly 1; this graph is called the n-dimensional hypercube (when n = 2 it is just asquare, when n = 3 it is the usual 3-cube). We’ll prove by induction on n � 2 that then-dimensional hypercube has a Hamiltonian cycle, from which we can clearly constructa Hamiltonian path of the required kind by deleting an edge out of ;.The case n = 2 is trivial: ;, {1}, {1, 2}, {2}, ; works.

For n � 2, start with a Hamiltonian cycle C, ;, {1}, . . . , {2}, ;, of the (n � 1)-dimensional hypercube (we known there’s one by induction), and then also consider thesequence C

0, {n}, {1, n}, . . . , {2, n}, {n}, obtained by unioning every term of C with{n}. C

0 has the property that it is a cycle list of the elements of the n-dimensionalhypercube that are not listed in C, and also has the property that adjacent elementshave symmetric di↵erence of size exactly 1. A Hamiltonian cycle of the n dimensionalhypercube is now obtained by starting with all the elements of C except the final;, then going to the second-from-last element of C 0, and then listing the remainingelement of C 0 (except for the final ;) in reverse order.

Source: I learned of this problem from Imre Leader.

101

Page 102: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

6. Let G be a finite group of order n generated by a and b. Prove or disprove: there isa sequence g

1

, g

2

, g

3

, . . . , g

2n

such that every element of G occurs exactly twice in thesequence, and, for each i = 1, 2, . . . , 2n, g

i+1

equals gi

a or gi

b. (Interpret g2n+1

as g1

.)

Solution: See https://mks.mff.cuni.cz/kalva/putnam/psoln/psol9010.html.

Source: 1990 Putnam competition.

102

Page 103: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

12 Week eleven (November 10) — Probability

Discrete probability may be thought about along the following lines: an experiment is per-formed, with a set S, the sample space, of possible observable outcomes (e.g., roll a dice andnote the uppermost number when the dice lands; then S would be {1, 2, 3, 4, 5, 6}). S maybe finite or countable for our purposes. An event is a subset A of S; the event occurs if theobserved outcome is one of the elements of A (e.g., if A = {2, 4, 6}, which we might describeas the event that an even number is rolled, then we would say that A occurred if we rolled a4, and that it did not occur if we rolled a 5). The compound event A [ B is the event thatat least one of A, B occur; A \ B is the event that both A and B occur, and A

c (= S \ A)is the event that A did not occur.

A probability function is a function P that assigns to each event a real number, which isintended to measure how likely A is to occur, or, in what proportion of a very large numbersof independent repetitions of the experiment does A occur. P should satisfy the followingthree rules:

1. P (A) � 0 always (events occur with non-negative probability);

2. P (S) = 1 (something always happens); and

3. if A and B are disjoint events (no outcomes in common) then P (A[B) = P (A)+P (B);more generally, if A

1

, A

2

, . . . is a countable collection of mutually disjoint events, then

P (Ui

A

i

) =X

i

P (Ai

).

Three consequences of the rules are the following relations that one would expect:

1. If A ✓ B then P (A) P (B);

2. P (;) = 0; and

3. P (Ac) = 1� P (A).

Usually one constructs the probability function in the following way: intuitition/experiment/someunderlying theory suggests that a particular s 2 S will occur a proportion p

s

of the time,when the experiment is repeated many times; a reality check here is that p

s

should benon-negative, and that

Ps2S ps = 1. One then sets

P (A) =X

s2A

p

s

;

it is readily checked that this function satisfies all the axioms.In the particular case when S is finite and intuition/experiment/some underlying theory

suggests that all outcomes s 2 S are equally likely to occur, we get the classical “definition”of the probability of an event:

P (A) =|A||S| ,

103

Page 104: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

and calculating probabilities comes down to counting.

Example: I toss a coin 100 times. How likely is it that I get exactly 50 heads?

Solution: All 2100 lists of outcomes of 100 tosses are equally likely, so each one should occurwith probability 1/2100. The number of outcomes in which there are exactly 50 heads is�100

50

�, so the required probability is �

100

50

2100.

A random variable X is a function that assigns to each outcome of an experiment a(usually real) numerical value. For example, if I toss a coin 100 times, I may not be interestedin the particular list of heads and tails I get, just in the total number of heads, so I coulddefine X to be the function that takes in a string of 100 heads and tails, and returns asthe numerical value the number of heads in the string. The density function of the randomvariable X is the function p

X

(x) = P (X = x), where “P (X = x)” is shorthand for theevent “the set of all outcomes for which X evaluates to x”. For tossing a coin 00 times andcounting the number of heads, the density function is

p

X

(x) =

⇢ �100

x

�2�100 if x = 0, 1, 2, . . . , 100

0 otherwise.

More generally, we have the following:

Binomial distribution: I toss a coin n times, and each time it comes up heads with someprobability p. Let X be the number of heads that comes up. The random variable X iscalled the binomial distribution with parameters n and p, and has density function

p

X

(x) =

⇢ �n

x

�p

x(1� p)n�x if x = 0, 1, 2, . . . , n0 otherwise.

Note that by the binomial theorem.

nX

k=0

✓n

k

◆p

k(1� p)n�k = (p+ (1� p))n = 1.

The expected value of a probability distribution/random variable is a measure of theaverage value of a long sequence of readings from that distribution; it is calculated as aweighted average:

E(X) =X

x

xp

X

(x)

with reading x being given weight p

X

(x). For example, if X is the binomial distributionwith parameters n and p, then E(X) is

nX

k=0

k

✓n

k

◆p

k(1� p)n�k = np

nX

k=0

✓n� 1

k � 1

◆p

k�1(1� p)n�k

= np(p+ (1� p))n�1

= np,

104

Page 105: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

as we would expect.It is worth knowing that expectation is a linear function:

Linearity of expectation: If a probability distribution/random variable X can be writtenas the sum X

1

+ . . .+X

n

of n (usually simpler) probability distributions/random variables,then

E(X) = E(X1

) + . . .+ E(Xn

)

Example: n boxes have labels 1 through n. n cards with numbers 1 through n writtenon them (one number per card) are distributed among the n boxes (one card per box). Onaverage how many boxes get the card whose number is the same as the label on the box?

Solution: Let X

i

be the random variable that takes the value 1 if card i goes into boxi, and 0 otherwise; p

X

i

(1) = 1/n, pX

i

(0) = 1 � (1/n) and p

X

i

(x) = 0 for all other x’s, soE(X

i

) = 1/n. Let X be the random variable that counts the number of boxes that get theright card; since X = X

1

+ . . . X

n

we have

E(X) = E(X1

) + . . .+ E(Xn

) = n(1/n) = 1

(independent of n!) [This is the famous problem of derrangements.]

One of the rules of probability is that for disjoint events A, B, we have P (A [ B) =P (A) + P (B). If A and B have overlap, this formula overcounts by including outcomes inA \ B twice, so should be corrected to

P (A [ B) = P (A) + P (B)� P (A \B).

For three events A,B,C, a Venn diagram readily shows that

P (A [ [C) = P (A) + P (B) + P (C)� P (A \ B)� P (A \ C)� P (B \ C) + P (A \B \ C).

There is a natural generalization:

Inclusion-exclusion (also called the sieve formula):

P ([n

i=1

A

i

) =nX

i=1

P (Ai

)�X

i<j

P (Ai

\ A

j

)

+X

i<j<k

P (Ai

\ A

j

\ A

k

) + . . .

+(�1)`�1

X

i1<i2<...<i

`

P (Ai1 \ A

i2 \ A

i

`

) + . . .

+(�1)n�1

P (A1

\ A

2

\ A

n

).

Inclusion-exclusion is often helpful because calculating probabilities of intersections iseasier than calculation probabilities of unions.

Example: In the problem of derrangements discussed above, what is the exact probabilitythat no box gets the correct card?

105

Page 106: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

Solution: Let Ai

be the event that box i gets the right card. We have P (Ai

) = 1/n, andmore generally for i

1

< i

2

< . . . < i

`

we have

P (Ai1 \ A

i2 \ A

i

`

) =(n� `)!

n!

(there are n! distributions of cards, and to make sure that boxes i1

through i

`

get the rightcard, we are forced to place these ` cards each in a predesignated box; but the remainingn� ` cards can be completely freely distributed among the remaining boxes). By inclusion-exclusion,

P ([n

i=1

A

i

) =nX

`=1

(�1)`�1

✓n

`

◆(n� `)!

n!,

the binomial term coming from selecting i

1

< i

2

< . . . < i

`

. We want the probability of noneof the boxes getting the right card, which is the complement of [n

i=1

A

i

:

P (([n

i=1

A

i

)c) = 1�nX

`=1

(�1)`�1

✓n

`

◆(n� `)!

n!

=nX

`=0

(�1)`✓n

`

◆(n� `)!

n!

=nX

`=0

(�1)`

`!.

Note that this is the sum of the first n+1 terms in the power series of ex around 0, evaluatedat x = �1, so as n gets larger the probability of there being no box with the right cardapproaches 1/e.

There is a counting version of inclusion-exclusion, that is very useful to know:

Inclusion-exclusion (counting version):

| [n

i=1

A

i

| =nX

i=1

|Ai

|�X

i<j

|Ai

\ A

j

|

+X

i<j<k

|Ai

\ A

j

\ A

k

|+ . . .

+(�1)`�1

X

i1<i2<...<i

`

|Ai1 \ A

i2 \ A

i

`

|+ . . .

+(�1)n�1|A1

\ A

2

\ A

n

|.

Example: How many numbers are there, between 1 and n, that are relatively prime to n

(have no factors in common)?

Solution: Let n have prime factorization p

a11

p

a22

. . . p

a

k

k

. Let A

i

be the set of numbersbetween 1 and n that are multiples of p

i

. We have |Ai

| = n/p

i

, and more generally fori

1

< i

2

< . . . < i

`

we have

|Ai1 \ A

i2 \ A

i

`

| = n

p

i1 . . . pi`

.

106

Page 107: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

We want to know |(Ai1 \ A

i2 \ A

i

`

)c| (complement taken inside of {1, . . . , n}), because thisis exactly the set of numbers below n that share no factors in common with n. By inclusion-exclusion,

| ([n

i=1

A

i

)c | = n

1�

kX

i=1

1

p

i

+X

i<j

1

p

i

p

j

� . . .+(�1)n

p

1

p

2

. . . p

k

!

= n

✓1� 1

p

1

◆. . .

✓1� 1

p

k

◆.

The function

'(n) = n

kY

i=1

✓1� 1

p

i

counting the number of numbers between 1 and n that are relatively prime to n, is calledthe Euler totient function.

The only mention I’ll make of probability with uncountable underlying sample spaces isthis: if R is a region in the plane, then a natural model for “selecting a point from R, allpoints equally likely”, is to say that for each subset R0 of R, the probability that the selectedpoint will be in R

0 is Area(R0)/area(R), that is, proportional to the area of R0. This ideanaturally extends to more general spaces.

Example: I place a small coin at a random location on a 3 foot by 5 foot table. How likelyis it that the coin is within one foot of some edge of the table?

Solution: There’s a 1 foot by 3 foot region at the center of the table, consisting of exactlythose points that are not within one foot of some edge of the table; assuming that thecoin is equally likely to be placed at any location, the probability of landing in this region is(1⇥3)/(3⇥5) = .2, so the probability of landing withing one foot of some edge is 1� .2 = .8.

107

Page 108: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

12.1 Week eleven problems

1. Shanille O’Keal shoots free throws on a basketball court. She hits the first and missesthe second, and thereafter the probability that she hits the next shot is equal to theproportion of shots she has hit so far. What is the probability that she hits exactly 50of her first 100 shots?

2. A dart, thrown at random, hits a square target. Assuming that any two parts of thetarget of equal area are equally likely to be hit, find the probability that the point hitis nearer to the center than to any edge. Express your answer in the form (a

pb+ c)/d

where a, b, c and d are positive integers.

3. A bag contains 2015 red balls and 2015 black balls. We remove two balls at a timerepeatedly and (i) discard both if they are the same color and (ii) discard the blackball and return the red ball to the bag if their colors di↵er. What is the probabilitythat this process will terminate with exactly one red ball in the bag?

4. You have coins C

1

, C

2

, . . . , C

n

. For each k, coin C

k

is biased so that, when tossed,it has probability 1/(2k + 1) of falling heads. If the n coins are tossed, what is theprobability that the number of heads is odd? Express the answer as a rational functionof n.

5. Two real numbers x and y are chosen at random in the interval (0, 1) with respect tothe uniform distribution. What is the probability that the closest integer to x/y iseven? Express the answer in the form r + s⇡, where r and s are rational numbers.

6. Let k be a positive integer. Suppose that the integers 1, 2, 3, . . . , 3k + 1 are writtendown in random order. What is the probability that at no time during the process,the sum of the integers that have been written up to that time is a positive integerdivisible by 3? Your answer should be in closed form, but may include factorials.

108

Page 109: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

12.2 Week eleven solutions

1. Shanille O’Keal shoots free throws on a basketball court. She hits the first and missesthe second, and thereafter the probability that she hits the next shot is equal to theproportion of shots she has hit so far. What is the probability that she hits exactly 50of her first 100 shots?

Solution: Some doodling with small examples suggests the following: if Shanillethrows a total of n free throws, n � 3, then for each k in the range [1, n � 1] theprobability that she makes exactly k shots in 1/(n� 1) (independent of k).

We can prove this by induction on n, with n = 3 very easy. For n > 3, we start withthe extreme case k = 1. The probability that she makes exactly one shot in total isthe probability that she misses each of shots 3 through n, which is

1

2· 23· 34· . . . · n� 3

n� 2· n� 2

n� 1=

1

n� 1.

For k > 1, there are two (mutually exclusive) ways that she can make k shots in total:

(a) Make k�1 of the first n�1, and make the last; the probability of this happeningis, by induction,

1

n� 2· k � 1

n� 1,

or

(b) make k of the first n� 1, and miss the last; the probability of this happening is,by induction,

1

n� 2· n� 1� k

n� 1.

Thus the net probability of making k shots is

1

n� 2· k � 1

n� 1+

1

n� 2· n� 1� k

n� 1=

1

n� 1,

and we are done by induction.

The answer to the given question is 1/99 (n = 100).

Source: Putnam Competition 2002, Problem B1.

2. A dart, thrown at random, hits a square target. Assuming that any two parts of thetarget of equal area are equally likely to be hit, find the probability that the point hitis nearer to the center than to any edge. Express your answer in the form (a

pb+ c)/d

where a, b, c and d are positive integers.

Solution: Place the dartboard on the x-y plane, with vertices at (0, 0), (0, 2), (2, 2)and (2, 0), so center at (1, 1). We want to compute the are of the set of points insidethis square which are closer to (1, 1) than any of x = 0, 2, y = 0, 2. We’ll just considerthe triangle T bounded by vertices (0, 0), (1, 0), (1, 1); by symmetry, this is one eightof the desired area.

109

Page 110: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

For a point (x, y) in T , the distance to (1, 1) isp

(x� 1)2 + (y � 1)2, and the distanceto the nearest of x = 0, 2, y = 0, 2 is just y. So the curve

p(x� 1)2 + (y � 1)2 = y, or

y =x

2 � 2x+ 2

2

cuts T into two regions, one (containing (1, 1)) being the points that are closer to (1, 1)than the nearest of x = 0, 2, y = 0, 2. This curve hits the line x = y at (2�

p2, 2�

p2).

So the desired area inside T is the total area of T (which is 1/2) minus the area boundedby x = y from (0, 0) to (2 �

p2, 2 �

p2), then y = (x2 � 2x + 2)/2 to (1, 1/2), then

x = 1 to (1, 0), then the x-axis back to (0, 0). This area is the area of the trianglebounded by (0, 0), (2�

p2, 2�

p2), and (2�

p2, 0) (which is (2�

p2)2/2), plus

Z1

2�p2

x

2 � 2x+ 2

2dx =

1

3(4p2� 5);

grand total (1/3)(4� 2p2). It follows that the desired area inside T is

1

2� 1

3(4� 2

p2) =

1

6(4p2� 5),

and so the total desired area is eight times this, or (4/3)(4p2� 5).

Since the total area of the square is 4, the desired probability is thus

1

3(4p2� 5) ⇡ .218951.

Source: Putnam Competition 1989, Problem B1. Note that this is an example of aPutnam question with a typo: the correct (and o�cially sanctioned) answer is as givenabove, but notice that c = �5, which is not a positive integer.

3. A bag contains 2015 red balls and 2015 black balls. We remove two balls at a timerepeatedly and (i) discard both if they are the same color and (ii) discard the blackball and return the red ball to the bag if their colors di↵er. What is the probabilitythat this process will terminate with exactly one red ball in the bag?

Solution: It helps to generalize to r red balls and b black balls, since as the process goesalong the number of balls of the two colors will not be equal. A little experimentationsuggests the following: if the process is started with and odd number r � 1 of red balls,and b � 0 balls, then it always ends with one red ball. We prove this by induction onr+ b. Formally: for each n � 1, P (n) is the proposition “if the process is started withand odd number r � 1 of red balls, and b � 0 balls, with r + b = n, then it alwaysends with one red ball”, and we prove P (n) by induction on n.

Base case n = 1 is trivial, as is base case n = 2. For base case n = 3, we either startwith three red balls, in which case after one step we are down to one red, or we startwith one red and two blues. In this case, one third of the time we first pick the two

110

Page 111: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

blacks, and we are down to one red, while two thirds of the time we first pick a blackand a red, and we are down to one red and one black, leaving us with one red afterstep two.

Now consider n � 4, and start with r red balls and b black balls, r odd and r+ b = n.If on the first step we pick two reds, then we are left with r � 2 red balls and b blackballs. Note that r � 2 is odd and (r � 2) + b = n� 2, so by induction in this case wealways end with one red. If on the first step we pick two blacks, then we are left withr red balls and b � 2 black balls. Note that r is odd and r + (b � 2) = n � 2, so byinduction in this case we always end with one red. Finally, if on the first step we picka black and a red, then we are left with r red balls and b� 1 black balls. Note that ris odd and r + (b � 1) = n � 1, so by induction in this case we always end with onered. This completes the induction.

Since 2015 is odd, the probability of ending with one red, starting with 2015 red ballsand 2015 black balls is 1.

Source: I heard this problem from David Cook.

4. You have coins C

1

, C

2

, . . . , C

n

. For each k, coin C

k

is biased so that, when tossed,it has probability 1/(2k + 1) of falling heads. If the n coins are tossed, what is theprobability that the number of heads is odd? Express the answer as a rational functionof n.

Solution: Let pn

be the required probability. We have p

1

= 1/3. For n � 2 we canexpress p

n

in terms of pn�1

as follows: we get an odd number of heads either by gettingan odd number of heads among the first n� 1 (probability p

n�1

) and a tail on the nthcoin (probability 2n/(2n+ 1)), or by getting an even number of heads among the firstn� 1 (probability 1� p

n�1

) and a head on the nth coin (probability 1/(2n+1)). Thisleads to the recurrence

p

n

=2np

n�1

2n+ 1+

1� p

n�1

2n+ 1=

1 + (2n� 1)pn�1

2n+ 1

valid for n � 2. We claim that the solution to this recurrence is pn

= n/(2n+ 1). Weprove this claim by induction on n. This base case n = 1 is clear. For n � 2 we have,using the inductive hypothesis in the second equality,

p

n

=1 + (2n� 1)p

n�1

2n+ 1

=1 + (2n� 1) n�1

2(n�1)+1

2n+ 1

=n

2n+ 1,

completing the induction.

Source: Putnam Competition 2001, A2.

111

Page 112: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

5. Two real numbers x and y are chosen at random in the interval (0, 1) with respect tothe uniform distribution. What is the probability that the closest integer to x/y iseven? Express the answer in the form r + s⇡, where r and s are rational numbers.

Solution: The closest integer to x/y is 0 if x < 2y. It is 2n (for n > 0) if 2x/(4n+1) <y < 2x/(4n� 1). (We can ignore y/x = 2/(2m+ 1) since it has probability zero.)

Hence the required probability is p = 1/4 + (1/3� 1/5) + (1/7� 1/9) + . . . . But nowrecall that ⇡/4 = 1� 1/3 + 1/5� 1/7 + . . . , so p = 5/4� ⇡/4.

Source: Putnam competition 1993, problem B3.

6. Let k be a positive integer. Suppose that the integers 1, 2, 3, . . . , 3k + 1 are writtendown in random order. What is the probability that at no time during the process,the sum of the integers that have been written up to that time is a positive integerdivisible by 3? Your answer should be in closed form, but may include factorials.

Solution: The o�cial solution, published in the American Mathematical Monthly, isvery nicely presented, so I reproduce it here verbatim:

“The number of ways to write down 1, 2, 3, . . . , 3k + 1 in random order is (3k + 1)!, sowe want to count the number of ways in which none of the “partial sums” is divisibleby 3. First, consider the integers modulo 3 : 1, 2, 0, 1, 2, 0, . . . , 1, 2, 0, 1. To write thesewith none of the partial sums divisible by 3, we must start with a 1 or a 2. After that,we can include or omit 0’s at will without a↵ecting whether any of the partial sumsare divisible by 3, so suppose [initially] we omit all 0’s. The remaining sequence of 1’sand 2’s must then be of the form

1, 1, 2, 1, 2, 1, 2, . . .

or2, 2, 1, 2, 1, 2, 1, . . .

(once you start, the rest of the sequence is forced by the condition that no partial sumis divisible by 3). However, a sequence of the form 2, 2, 1, 2, 1, 2, 1, . . . has one more 2than 1, and we need to have one more 1 than 2. So the only possibility for our sequencemodulo 3, once the 0’s are omitted, is 1, 1, 2, 1, 2, 1, 2, . . .. There are 2k+1 numbers inthis sequence, and the k 0’s can be returned to the sequence arbitrarily except at thebeginning. So the number of ways to form the complete sequence modulo 3 equals thenumber of ways to distribute the k identical 0’s over 2k+1 boxes (the “slots” after the1’s and 2’s), which by a standard “stars and bars” argument is

�3k

k

�. Once this is done,

there are k! ways to replace the k 0’s in the sequence modulo 3 by the actual integers3, 6, . . . , 3k. Also, there are k! ways to “reconstitute” the 2’s and (k+ 1)! ways for the1’s. So the answer is �

3k

k

�k!k!(k + 1)!

(3k + 1)!.

00

Source: Putnam competition, problem A3.

112

Page 113: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

13 Week twelve (November 17) — Games

These problem are all about games played between two players. Usually when these problemsappear in the Putnam competition, you are asked to determine which player wins whenboth players play as well as possible. Once you have decided which player wins (maybebased on analyzing small examples), you need to prove this in general. Often this entailsdemonstrating a winning strategy: for each possible move by the losing player, you can try toidentify a single appropriate response for the winning player, such that if the winning playeralways uses these responses as the game goes on, then she will indeed win. It’s important toremember that you must produce a response for the winning player for every possible moveof the losing player — not just a select few.

113

Page 114: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

13.1 Week twelve problems

1. A chocolate bar is made up of a rectangular m by n grid of small squares. Two playerstake turns breaking up the bar. On a given turn, a player picks a rectangular pieceof chocolate and breaks it into two smaller rectangular pieces, by snapping along onewhole line of subdivisions between its squares. The player who makes the last breakwins. If both players play optimally, who wins?

2. Two players play a game in which the first player places a king on an empty 8 by8 chessboard, and then, starting with the second player, they alternate moving theking (in accordance with the rules of chess) to a square that has not been previouslyoccupied. The player who moves last wins. Which player has a winning strategy?

3. I shu✏e a regular deck of cards (26 red, 26 black), and begin to turn them face-up,one after another. At some point during this process, you say “STOP!”. You can saystop as early as before I’ve even turned over the first card, or as late as when there isonly one card left to be turned over; the only rule is that at some point you must sayit. Once you’ve said stop, I turn over the next card. If it is red, you win the game,and if it is black, you lose.

If you play the strategy “say stop before even a single card has been turned over”, youhave a 50% chance of winning the game. Is there a more clever strategy that gives youa better than 50% chance of winning the game?

4. A game involves jumping to the right on the real number line. If a and b are realnumbers and b > a , then the cost of jumping from a to b is b3 � ab

2.

For what real numbers c can one travel from 0 to 1 in a finite number of jumps withtotal cost exactly c?

5. Alan and Barbara play a game in which they take turns filling entries of an initiallyempty 1024 by 1024 array. Alan plays first. At each turn, a player chooses a realnumber and places it in a vacant entry. The game ends when all the entries are filled.Alan wins if the determinant of the resulting matrix is nonzero; Barbara wins if it iszero. Which player has a winning strategy?

6. Two players alternately draw diagonals between vertices of a regular polygon. Theymay connect two vertices if they are non-adjacent (i.e. not a side) and if the diagonalformed does not cross any of the previous diagonals formed. The last player to draw adiagonal wins.

Who wins if the polygon has 2015 vertices?

114

Page 115: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

13.2 Week twelve solutions

1. A chocolate bar is made up of a rectangular m by n grid of small squares. Two playerstake turns breaking up the bar. On a given turn, a player picks a rectangular pieceof chocolate and breaks it into two smaller rectangular pieces, by snapping along onewhole line of subdivisions between its squares. The player who makes the last breakwins. If both players play optimally, who wins?

Solution: There is one piece of chocolate to start, and mn pieces at the end. Eachturn by a player increases the number of squares by 1. Hence a game lasts mn � 1turns, completely independently of the strategies of the two players! The winner isdetermined by the parity of m and n: if m and n are both odd, mn � 1 is even andplayer 2 wins. Otherwise mn� 1 is odd and player 1 wins.

Source: Peter Winkler told me this problem.

2. Two players play a game in which the first player places a king on an empty 8 by8 chessboard, and then, starting with the second player, they alternate moving theking (in accordance with the rules of chess) to a square that has not been previouslyoccupied. The player who moves last wins. Which player has a winning strategy?

Solution: Player 2 has a winning strategy. She can imagine the board as being coveredwith non-overlapping 2-by-1 dominos (there are many ways to cover an 8 by 8 boardwith dominos). Wherever player 1 puts the king, player 2 moves it to the other squarein the corresponding domino. She then repeats this strategy until the game is over.

Source: University of Texas Putnam prep.

3. I shu✏e a regular deck of cards (26 red, 26 black), and begin to turn them face-up,one after another. At some point during this process, you say “STOP!”. You can saystop as early as before I’ve even turned over the first card, or as late as when there isonly one card left to be turned over; the only rule is that at some point you must sayit. Once you’ve said stop, I turn over the next card. If it is red, you win the game,and if it is black, you lose.

If you play the strategy “say stop before even a single card has been turned over”, youhave a 50% chance of winning the game. Is there a more clever strategy that gives youa better than 50% chance of winning the game?

Solution: Here’s the quick-and-dirty solution: The game fairly easily seen to be equiv-alent to the following: exactly as before, except now when you say “STOP”, I turnover the bottom card in the pile of cards that remains. In this formulation, it is clearthat there cannot be a strategy that gives you better than a 50% chance of winning.

Here’s a more prosaic solution. Suppose that instead of being played with a balanceddeck, it is played with a deck that has we claim that if there are a red cards and b

black cards, then there is no strategy better than the naive one of saying stop before asingle card has been turned over; note that with this strategy you win with probability

115

Page 116: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

a/(a + b). We prove this by induction on a + b. If a + b = 1, then (whether a = 1or a = 0) the result is trivial. Suppose a + b � 2. To get a strategy that potentiallyimproves on the proposed best strategy, you must at least wait for the first card to beturned over. Two things can happen:

• The first card turned over is red; this happens with probability a/(a + b). Oncethis happens, you are playing a new version of the game, with a�1 red cards andb black cards, and by induction your best winning strategy has you winning withprobability (a� 1)/(a� 1 + b).

• The first card turned over is black; this happens with probability b/(a+ b). Oncethis happens, you are playing a new version of the game, with a red cards andb � 1 black cards, and by induction your best winning strategy has you winningwith probability a/(a+ b� 1).

Your probability of winning the original game is therefore at most

a

a+ b

⇥ a� 1

a+ b� 1+

b

a+ b

⇥ a

a+ b� 1=

a

a+ b

.

Source: Asked me by David Wilson, in an interview for a job at Microsoft Research.

4. A game involves jumping to the right on the real number line. If a and b are realnumbers and b > a , then the cost of jumping from a to b is b3 � ab

2.

For what real numbers c can one travel from 0 to 1 in a finite number of jumps withtotal cost exactly c?

Solution: All c such that 1/3 c 1. For a detailed solution, see e.g. http:

//math.hawaii.edu/home/pdf/putnam/Putnam_2009.pdf.

Source: 1999 Putnam Competition, B2.

5. Alan and Barbara play a game in which they take turns filling entries of an initiallyempty 1024 by 1024 array. Alan plays first. At each turn, a player chooses a realnumber and places it in a vacant entry. The game ends when all the entries are filled.Alan wins if the determinant of the resulting matrix is nonzero; Barbara wins if it iszero. Which player has a winning strategy?

Solution: Barbara has a winning strategy. For example, Whenever Alan plays x inrow i, Barbara can play �x in some other place in row i (since there are an evennumber of places in row i, Alan will never place the last entry in a row if Barbaraplays this strategy). So Barbara can ensure that all row-sums of the final matrix are0, so that the column vector of all 1’s is in the kernel of the final matrix, so it hasdeterminant zero.

Source: Putnam competition 2008, problem A2.

116

Page 117: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

6. Two players alternately draw diagonals between vertices of a regular polygon. Theymay connect two vertices if they are non-adjacent (i.e. not a side) and if the diagonalformed does not cross any of the previous diagonals formed. The last player to draw adiagonal wins.

Who wins if the polygon has 2015 vertices?

Solution: This problem may not be what I thought it was: it’s easy to prove (byinduction) that if the game is played on an n-sided polygon (n � 4) then it will haveexactly n� 3 moves. So on a 2015-sided polygon, there will by 2012 moves, and player2 must move last (and win).

Source: University of Texas Putnam prep.

117

Page 118: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

14 Week thirteen (November 24) — Preparing for thePutnam Competition

The Putnam Competition will take place on

Saturday December 5,

in

Hayes-Healy 229,

with these being the times of the two papers:

10am-1pm (paper A), 3pm-6pm (paper B).

Lunch will be provided between the two papers, in the Math department lounge.Paper, pencils, erasers and sharpeners will be provided. Feel free to bring brain fuel.

Notes, calculators, book, laptops etc. are not allowed.

This last handout is a “mock Putnam” exam. Look over the problems, pick out somethat you feel good about, and tackle them! You’ll do best if you engage your conscious brainfully on a single problem, rather than hopping back-and-forth between problems every fewminutes (but it’s also a good idea to read all the problems before tackling one, to allow yoursubconscious brain to mull over the whole set). The ideal way to approach this set would beto give yourself three quite, uninterrupted hours, and see how you do.

In what follows, I’m going to repeat some of the advice I’ve given on some previoushandouts. I encourage you to look over this carefully, and bear it in mind as you goover this week’s problems and (more importantly) as you take the Putnam competition.I have shamelessly appropriate much of this from Ravi Vakil’s Stanford Putnam Prepa-ration website (http://math.stanford.edu/

~

vakil/putnam05/05putnam7.pdf), and fromIoana Dumitriu’s UWashington’s “The Art of Problem Solving” website (http://www.math.washington.edu/

~

putnam/index.html). Both of these websites are filled with what I thinkis great advice.

Some general problem-solving tips

Remember that problem solving is a full-contact sport: throw everything you know at theproblem you are tackling! Sometimes, the solution can come from an unexpected quarter.Here are some slogans to keep in mind when solving problems:

• Try small cases!

• Plug in small numbers!

• Do examples!

• Look for patterns!

• Draw pictures!

118

Page 119: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

• Write lots!

• Talk it out!

• Choose good notation!

• Look for symmetry!

• Break into cases!

• Work backwards!

• Argue by contradiction!

• Consider extreme cases!

• Modify the problem!

• Make a generalization!

• Don’t give up after five minutes!

• Don’t be afraid of a little algebra!

• Take a break!

• Sleep on it!

• Ask questions!

And above all:

• Enjoy!

General Putnam tips

Getting ready

1. Try, if possible, to get a good night’s sleep beforehand.

2. Wear comfortable clothes.

3. There’s no need to bring paper, pencils, erasers or pencil sharpeners (unless you havesome “lucky” ones); I will provide all of these necessary materials.

4. Bring snacks and drinks, to keep your energy up during each three-hour session. I’llprovide pizza, fruit and soda for lunch, so if you are happy with that, there’s no needto bring any lunch supplies.

5. During the competition, you can’t use outside notes, computers, calculators, etc..

119

Page 120: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

During the competition

1. Spend some time at the start looking over the questions. The earlier questions in eachhalf tend to be easier, but this isn’t always the case — you may be lucky/inspired andspot a way in to A4, before A1. Remember that you have three hours for each paper;that’s a lot of time, so take some time to begin calmly.

2. When (rather than if) your mind gets tired, take a break; go outside, get a snack, usethe bathroom, clear your head.

3. The “fifteen minute rule” can be helpful: if you find that you’ve been thinking abouta problem aimlessly without having any serious new ideas for 15 minutes, then jumpto a di↵erent problem, or take a break.

4. Don’t become discouraged. Don’t think of this as a test or exam. Think of it insteadas a stimulating challenge. Often a problem will break open a couple of hours intothe session. And the problem with your name on it might be in the afternoon session.Remember that the national median score for the entire competition is usually 0 or1; getting somewhere on one question is significant (it puts you on the top half of thecurve); getting a full question is a big deal.

5. If you solve a problem, write it up very well (rather than starting a new problem);grading on the Putnam competition is very severe. See the later section on writing formore on this.

Some specific mathematical tips

Here are some very simple things to remember, that can be very helpful, but that peopletend to forget to do.

1. Try a few small cases out. Try a lot of cases out. Remember that the three hours ofthe Putnam competition is a long time — you have time to spare! If a question askswhat happens when you have n things, or 2015 things, try it out with 1, 2, 3, 4 things,and try to form a conjecture. This is especially valuable for questions about sequencesdefined recursively.

2. Don’t be afraid to use lots and lots of paper.

3. Don’t be afraid of diving into some algebra. (Again, three hours is a long time . . ..)You shouldn’t waste that much time, thanks to the 15-minute rule.

4. If a question asks to determine whether something is true or false, and the directionyou initially guess doesn’t seem to be going anywhere, then try guessing the oppositepossibility.

5. Be willing to try (seemingly) stupid things.

120

Page 121: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

6. Look for symmetries. Try to connect the problem to one you’ve seen before. Askyourself “how would [person X] approach this problem”? (It’s quite reasonable herefor [Person X] to be [Chuck Norris]!)

7. Putnam problems always have slick solutions. That leads to a helpful meta-approach:“The only way this problem could have a nice solution is if this particular approachworked out, unlikely as it seems, so I’ll try it out, and see what happens.”

8. Show no fear. If you think a problem is probably too hard for you, but you have anidea, try it anyway. (Three hours is a long time.)

Some specific writing tips

You’re working hard on a problem, focussing all your energy, applying all the good tipsabove, and all of a sudden a bulb lights above your head: you have figured out how to solveone of the problems! Awesome! But here’s the hard, unforgiving truth: that warm tingleyou’re feeling is no guarantee

• that you have actually solved the problem (are you sure you have all the cases covered?Are you sure that all the little details work out? . . .)

and

• that you will get any or all credit for it.

Solving the problem is only half the battle. Now you have launch into the other half,convincing the grader that you have actually done so.

Life is tough, and Putnam graders may be even tougher. But here’s a list of things which,when done properly, will yield a nice write-up which will appease any reasonable grader.

1. All that scrap paper, filled with your musings on the problem to date? Put it aside;you must write a clean, coherent solution on a fresh piece of paper.

2. Before you start writing, organize your thoughts. Make a list of all steps to the solution.Figure out what intermediary results you will need to prove. For example, if theproblem involves induction, always start with the base case, and continue with provingthat “true for n implies true for n + 1”. Make sure that the steps follow from eachother logically, with no gaps.

3. After tracing a “road to proof” either in your head or (preferably) on scratch paper,start writing up the solution on a fresh piece of paper. The best way to start this isby writing a quick outline of what you propose to do. Sometimes, the grader will justlook at this outline, say “Yes, she knows what she is doing on this problem!”, and givethe credit.

4. Lead with a clear statement of your final solution.

5. Complete each step of the “road” before you continue to the next one.

121

Page 122: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

6. When making statements like “it follows trivially” or “it is easy to see”, listen forquiet, nagging doubts. If you yourself aren’t 100% convinced, how will you convincesomeone else? Even if it seems to follow trivially, check again. Small exceptions maynot be obvious. The strategy “I am sure it’s true, even if I don’t see it; if I state thatit’s obvious, maybe the grader will believe I know how to prove it” has occasionallyled its user to a score of 0 out of 10.

7. Organize your solution on the page; avoid writing in corners or perpendicular to thenormal orientation. Avoid, if possible, post-factum insertion (if you discover you’vemissed something, rather than making a mess of the paper by trying to write it over,start anew. You have the time!)

8. Before writing each phrase, formulate it completely in your mind. Make sure it ex-presses an idea. Starting to write one thing, then changing course in mid-sentence andsaying another thing is a sure way to create confusion.

9. Be as clear as possible. Avoid, if possible, long-winded phrases. Use as many words asyou need – just do it clearly. Also, avoid acronyms.

10. If necessary, state intermediary results as “claims” or “lemmas” which you can proveright after stating them. If you cannot prove one of these results, but can prove theproblem’s statement from it, state that you will assume it, then show the path from itto the solution. You may get partial credit for it.

11. Rather than using vague statements like “and so on” or “repeating this process”,formulate and prove by induction.

12. When you’re done writing up the solution, go back and re-read it. Put yourself inthe grader’s shoes: can someone else read your write-up and understand the solution?Must one look for things in the corners? Are there “miraculous” moments?, etc..

122

Page 123: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

14.1 Week 13 problems

1. A sequence a

0

, a

1

, a

2

, . . . of real numbers is defined recursively by

a

0

= 1, a

n+1

=a

n

1 + na

n

(n = 0, 1, 2, . . .).

Find a general formula for an

.

2. Consider a 7 by 7 checkerboard with the squares at the four corners removed (so thatthe remaining board has 45 squares). Is it possible to cover this board with 1 by 3 tilesso that no two tiles overlap? Explain!

3. Let f be a function on [0, 2⇡] with continuous first and second derivatives and suchthat f 00(x) > 0 for 0 < x < 2⇡. Show that the integral

Z2⇡

0

f(x) cosx dx

is positive.

4. Given a nonnegative integer b, call a nonnegative integer a b a subordinate of b ifeach decimal digit of a is at most equal to the decimal digit of b in the same position(counted from the right). For example, 1329 and 316 are subordinates of 1729, but1338 is not since the second-last digit of 1338 is greater than the corresponding digitin 1729. Let f(b) denote the number of subordinates of b. For example, f(13) = 8,since 13 has exactly 8 subordinates: 13, 12, 11, 10, 3, 2, 1, 0. Find a simple formulafor the sum

S(n) =X

0b<10

n

f(b).

5. Let a1

, a

2

, . . . , a

65

be positive integers, none of which has a prime factor greater than13. Prove that, for some i, j with i 6= j, the product a

i

a

j

is a perfect square.

6. Let n be an even positive integer, and let S

n

denote the set of all permutations of{1, 2, . . . , n}. Given two permutations �

1

, �

2

2 S

n

, define their distance d(�1

, �

2

) by

d(�1

, �

2

) =nX

k=1

|�1

(k)� �

2

(k)|.

Determine, with proof, the maximal distance between two permutations in S

n

, i.e.,determine the exact value of max

�1,�22Sn

d(�1

, �

2

).

123

Page 124: Problem Solving in Math (Math 43900)dgalvin1/43900/43900_F15/43900F15notes.pdf · Problem Solving in Math (Math 43900) Fall 2015 ... – Putnam and beyond by Gelca and Andreescu ...

14.2 Week 13 Solutions

These problems were taken from the Putnam preparation pages of the University of Illinoisat Urbana-Champaign; specifically the six problems on the previous page comprised the2008 UIUC mock Putnam exam. Solutions can be found at http://www.math.uiuc.edu/

~

hildebr/putnam/problems/mock08sol.pdf.

124