0% found this document useful (0 votes)
29 views165 pages

Math 145 Book 2022

The document is the third edition of 'Strategies of Problem Solving' by Maria Nogin, aimed at enhancing mathematical problem-solving skills. It includes various topics such as logic, mathematical induction, number theory, and combinatorics, structured to guide readers through different problem-solving strategies. Acknowledgments highlight the author's gratitude towards her family, colleagues, and students for their support in writing the book.

Uploaded by

Karthik Iyer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views165 pages

Math 145 Book 2022

The document is the third edition of 'Strategies of Problem Solving' by Maria Nogin, aimed at enhancing mathematical problem-solving skills. It includes various topics such as logic, mathematical induction, number theory, and combinatorics, structured to guide readers through different problem-solving strategies. Acknowledgments highlight the author's gratitude towards her family, colleagues, and students for their support in writing the book.

Uploaded by

Karthik Iyer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 165

STRATEGIES

OF
PROBLEM SOLVING
Third Edition

Maria Nogin

Department of Mathematics
College of Science and Mathematics

California State University, Fresno


2022
Acknowledgements
I am very thankful to my parents for introducing me to the beautiful world of mathematics
problem solving. Since my very young age, they constantly asked me intriguing questions
answering which required logical thinking, counting, experimenting, and noticing patterns.
They bravely gave me very hard problems, but encouraged me when I got stuck. Some
problems took me up to two years to solve. But they never just gave answers to me. They
believed in my ability to solve those problems on my own.

I would also like to thank my colleagues in the Mathematics Department at CSU Fresno,
especially Larry Cusick, Marat Markin, Adnan Sabuwala, and Agnes Tuska, for numerous
valuable discussions about interesting problems and solutions as well as teaching and eval-
uating problem solving. Also thank you to the students in all of my MATH 145 (Problem
Solving) classes for their careful reading and catching errors in my materials.

Finally, I am thankful to my family and friends for encouraging me to write this book.
To my daughters Katya and Misha.
I hope you will grow to love mathematics
and enjoy problem solving as much as I do.
Table of Contents

0 Preliminaries 3
0.1 Review of logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
0.2 Types of proofs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

1 Introduction 13

2 Principle of Mathematical Induction 15

3 Dirichlet’s Box Principle 21

4 Number theory 25

5 Case analysis 31

6 Finding a pattern 35

7 Working backwards 39

8 Invariants 45

9 Coloring 51

10 Graphs 57

11 Combinatorics 67

12 Calculus 75

13 Various problems 83

Solutions and answers to selected problems 87


0 Preliminaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
0.1 Review of logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
0.2 Types of proofs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
2 Principle of Mathematical Induction . . . . . . . . . . . . . . . . . . . . . . . 93
3 Dirichlet’s Box Principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
4 Number theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
5 Case analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
6 Finding a pattern . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
7 Working backwards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121

1
2 TABLE OF CONTENTS

8 Invariants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
9 Coloring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
10 Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
11 Combinatorics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
12 Calculus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
13 Various problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
Chapter 0

Preliminaries

0.1 Review of logic


In this section we will recall some basic logic terminology and notations. It will be useful
when we discuss types of proofs (see section 0.2).

Definition 0.1. A proposition (or statement) is a declarative sentence that is either true
or false.

For example, “3 plus 2 is 5” is a true proposition, “3 times 2 is 7” is a false proposition,


while “x minus 4 is 8” is not a proposition because the value of x has not been defined, and
“is 3 plus 3 equal 6?” is not a proposition because it is an interrogative, not declarative,
sentence.

Definition 0.2. Let p and q be propositions.

• The negation of p, denoted by ¬p (or ∼ p), is the proposition “not p.” It is true if and
only if p is false.

• The conjunction of p and q, denoted by p ∧ q, is the proposition “p and q.” It is true


if and only if both p and q are true.

• The disjunction of p and q, denoted by p ∨ q, is the proposition “p or q.” It is true


if and only if at least one of p and q is true. Note that if both p and q are true, then
p ∨ q is true, so “or” is not exclusive.

• The exclusive or of p and q, denoted by p ⊕ q, is the proposition “either p or q but


not both.” It is true if and only if exactly one of p and q is true.

• The implication of p and q, denoted by p → q (or p ⇒ q), is the proposition “if p then
q.” It is false when p is true and q is false, and true otherwise.

• The biconditional of p and q, denoted by p ↔ q (or p ⇔ q), is the proposition “p if


and only if q.” It is true when p and q have the same truth values and is false otherwise.

Below is the so-called truth table that shows the truth values of the compound proposi-
tions defined above depending on the truth values of p and q.

3
4 CHAPTER 0. PRELIMINARIES

p q ¬p p ∧ q p ∨ q p ⊕ q p → q p ↔ q
T T F T T F T T
T F F F T T F F
F T T F T T T F
F F T F F F T T
Notice that p → q is false if and only if p is true and q is false. We will need this
observation in section 0.2. Here is some more useful terminology.

• Symbols ¬, ∧, ∨, ⊕, →, and ↔ are called logical connectives.


• A compound proposition that is always true, no matter what the truth values of the
propositions that occur in it are, is called a tautology.
For example, p ∨ ¬p is a tautology.
• A compound proposition that is always false is called a contradiction.
For example, p ∧ ¬p is a contradiction.
• Propositions p and q are called logically equivalent if p ↔ q is a tautology. The
notation p ≡ q (sometimes p ⇔ q) denotes that p and q are logically equivalent. Note
that p and q are logically equivalent if and only if they always have the same truth
values.

Example 0.3. Show that ¬(p ∨ q) and (¬p) ∧ (¬q) are logically equivalent.
Solution. We construct the truth table.

p q p∨q ¬(p ∨ q) ¬p ¬q (¬p) ∧ (¬q)


T T T F F F F
T F T F F T F
F T T F T F F
F F F T T T T
We see that the truth values of ¬(p ∨ q) and (¬p) ∧ (¬q) are always the same, therefore
these propositions are logically equivalent.
Definition 0.4. A statement P (x) that depends on the value of a variable (x in this case)
is called a propositional function. Once a value has been assigned to the variable x, the
statement P (x) becomes a proposition and has a truth value.
For example, if P (x) is the statement “x > 3,” then P (4) is true and P (2) is false.
Definition 0.5. Let P (x) be a propositional function. Then
• ∀xP (x) means “for every x, P (x) is true.”
• ∃xP (x) means “there exists a value of x for which P (x) is true.”
• ∃!xP (x) means “there exists a unique value of x for which P (x) is true.”
Symbols ∀ and ∃ are called quantifiers. Namely, ∀ is called the universal quantifier,
and ∃ is called the existential quantifier.
When interpreting expressions ∀xP (x), ∃xP (x), ∃!xP (x), we need to specify a set S of
all possible choices of x. Such a set is called the domain of discourse. Unless the domain
of discourse has already been specified or is clear from context, we can write ∀x ∈ S P (x),
etc. to make it explicit. For example, “the square of every integer x is nonnegative” can be
written as ∀x ∈ Z x2 ≥ 0.
0.1. REVIEW OF LOGIC 5

Propositional functions can be functions of two or more variables, and then we can use two
or more quantifiers with them. It is important to realize that the order of quantifiers makes a
difference. For example, in problem 3 below we use the propositional function F (x, y) which
means that x and y are friends (the domain of this function can be a set of people). Then
e.g. ∀x∃yF (x, y) means that everybody has at least one friend, while ∃y∀xF (x, y) means
that there is a person who is friends with everybody.
Propositions with negations can always be written so that no negation is outside a quan-
tifier or an expression involving logical connectives, for example:

• ¬(p ∧ q) ≡ ¬p ∨ ¬q,

• ¬(p ∨ q) ≡ ¬p ∧ ¬q,

• ¬∀xP (x) ≡ ∃x¬P (x),

• ¬∃xP (x) ≡ ∀x¬P (x).

Problems

1. Show that the following propositions are logically equivalent.

(a) p → q and ¬q → ¬p
(b) p → q and ¬p ∨ q
(c) ¬(p ∧ q) and ¬p ∨ ¬q
(d) p ∨ (q ∧ r) and (p ∨ q) ∧ (p ∨ r)

2. Which of the following sentences are statements? For those that are, indicate the truth
value.

(a) Five plus eight is thirteen.


(b) Five minus eight is three.
(c) Two times x is 6.
(d) The number 2n + 6 is an even integer.
(e) There are 200 elephants in the San Diego Wild Animal Park.
(f) I have solved all problems in chapter 1.
(g) Did you do your homework today?

3. Translate the statement

∀x(C(x) ∨ ∃y(C(y) ∧ F (x, y)))

into plain English, where C(x) is “x has a computer,” F (x, y) is “x and y are friends,”
and the domain of discourse is the set of all students at your university.

4. Let F (x, y) be statement “x can fool y.” Use quantifiers to express each of the following
statements.

(a) Everybody can fool Amy.


(b) Mike can fool everybody.
6 CHAPTER 0. PRELIMINARIES

(c) Everybody can fool somebody.


(d) There is no one who can fool everybody.
(e) Everyone can be fooled by somebody.
(f) No one can fool both Kate and Jerry.
(g) Tim can fool exactly two people.
(h) There is exactly one person whom everybody can fool.
(i) No one can fool himself or herself.

5. Let P (x) denote the propositional function “x = −5” and let Q(x) denote the propo-
sitional function “x2 = 25” and let the domain of discourse be the set of real numbers.
Determine the truth values of the following propositions.

(a) P (4)
(b) P (4) → Q(4)
(c) ∃x¬P (x)
(d) ∀x(P (x) ∨ Q(x))
(e) ∃x(P (x) ∧ Q(x))
(f) ∀x(P (x) → Q(x))
(g) ∃x(P (x) → Q(x))
(h) ∀x(P (x) ↔ Q(x))

6. Let P (x) denote the propositional function “(x < 3) ∨ (x > 5)” and let the domain
of discourse be the set of real numbers. Determine the truth values of the following
propositions.

(a) P (2)
(b) P (4)
(c) P (2) ∧ P (4)
(d) ∀xP (x)
(e) ∃xP (x)
(f) ∃!xP (x)
(g) ∀x(P (x) ∨ P (−x))

7. Let Q(x, y) denote “x + y = 0” and let the domain of discourse be the set of real
numbers. What are the truth values of the statements ∀x∃yQ(x, y) and ∃y∀xQ(x, y)?

8. Rewrite each of the following statements so that negations appear only immediately
before propositional functions.

(a) ¬∀x∀yP (x, y)


(b) ¬∀y∃xP (x, y)
(c) ¬∀y∀x(P (x, y) ∨ Q(x, y))
(d) ¬(∃x∃y¬P (x, y) ∧ ∀x∀yQ(x, y))
(e) ¬∀x(∃y∀zP (x, y, z) ∧ ∃z∀yP (x, y, z))
(f) ¬∃!xP (x)
0.1. REVIEW OF LOGIC 7

9. Let P (x, y) denote the proposition “x < y” and let the domain of discourse be the set
of real numbers. Determine the truth values of the following propositions.
(a) ∃x∃yP (x, y)
(b) ∀x∀yP (x, y)
(c) ∀xP (−x, x)
(d) ∃x∀yP (x, y)
(e) ∀y∃xP (x, y)
(f) ∃y∀xP (x, y)
(g) ∀x∃yP (x, y)
10. Let Q(x, y) be the statement “x + y = x − y” and let the domain of discourse be the
set of integers. Determine the truth values of the following propositions.
(a) Q(2, 0)
(b) ∀yQ(1, y)
(c) ∃x∀yQ(x, y)
(d) ∀y∃xQ(x, y)
(e) ∃y∀xQ(x, y)
(f) ∀x∃yQ(x, y)
11. Let R(x, y) denote the propositional function “x2 + y = 5” where x and y are real
numbers. Determine the truth values of the following propositions.

(a) ∃x∀y R(x, y)


(b) ∀y∃x R(x, y)
(c) ∃y∀x R(x, y)
(d) ∀x∃y R(x, y)

12. Determine the truth values of the following statements. Remember to pay attention to
the domains.
(a) ∀a, b, c ∈ R (a2 + b2 = c2 )
(b) ∃a ∈ Q ∀b ∈ Z ∃c ∈ Q (a2 + b2 = c2 )
(c) ∃b ∈ R ∃c ∈ R ∀a ∈ R (a2 + b2 = c2 )
(d) ∀c ∈ Z ∃a ∈ Z ∃b ∈ Z (a2 + b2 = c2 )
(e) ∀a ∈ Z ∃b ∈ R ∃c ∈ Z (a2 + b2 = c2 )
13. Which of the following compound propositions are logically equivalent, i.e. have the
same truth values for any propositional functions P (x) and Q(x)? If propositions are
logically equivalent, explain why. If not, give an example of propositional functions
P (x) and Q(x) (and be sure to specify the domain for each) for which one of the
propositions is true and the other one is false.
(a) ∀x(¬P (x)) and ¬(∀xP (x))
(b) ∀x(P (x) ∨ Q(x)) and (∀xP (x)) ∨ (∀xQ(x))
(c) ∀x(P (x) ∧ Q(x)) and (∀xP (x)) ∧ (∀xQ(x))
8 CHAPTER 0. PRELIMINARIES

(d) ∀x(P (x) → Q(x)) and (∀xP (x)) → (∀xQ(x))


(e) ∀x(P (x) ↔ Q(x)) and (∀xP (x)) ↔ (∀xQ(x))
(f) ∃x(¬P (x)) and ¬(∃xP (x))
(g) ∃x(P (x) ∨ Q(x)) and (∃xP (x)) ∨ (∃xQ(x))
(h) ∃x(P (x) ∧ Q(x)) and (∃xP (x)) ∧ (∃xQ(x))
(i) ∃x(P (x) → Q(x)) and (∃xP (x)) → (∃xQ(x))
(j) ∃x(P (x) ↔ Q(x)) and (∃xP (x)) ↔ (∃xQ(x))

14. Give an example of a propositional function P (x, y) (remember to specify the domain
for each variable) such that the statement ∃!x∃!y P (x, y) is true but the statement
∃!y∃!x P (x, y) is false.

15. Give an example of a set S and a propositional function P (x, y) over S such that the
statement ∀x∀y∀z ((P (x, y) ∧ P (y, z)) → P (x, z)) is true. What does this condition
remind you of?

16. Express the definition of the limit lim f (x) = L using quantifiers.
x→a

17. Express the definition of a convergent sequence a1 , a2 , a3 , . . . using quantifiers.

18. In one country there are two cities, A and B, that are only a few miles apart, and whose
residents often visit each other. All residents of city A always say the truth, while all
residents of city B always lie. A stranger is passing through one of these cities, but
he doesn’t know which one. How could he, by asking the first man he sees only one
question, determine which city he is passing through?

0.2 Types of proofs


In this chapter we summarize basic types of proofs, and then give a few examples to illustrate
them.
Suppose we want to prove a proposition p. Then

• a direct proof just shows that p holds;

• a proof by contradiction assumes that p is false and derives a contradiction. The


contradiction is usually of the form r ∧ ¬r for some proposition r.

If we want to prove an implication “if p, then q”, then

• a direct proof assumes that p holds and proves q;

• a proof by contradiction assumes that p → q is false, i.e. p is true and q is false, and
derives a contradiction;

• a proof by contrapositive shows that ¬q implies ¬p.

Often, we actually want to prove a statement of the form ∀xP (x) or ∀x(P (x) → Q(x))
rather than just p or p → q. The classification of proofs is similar in these cases. For ∀xP (x),

• a direct proof considers an arbitrary value of x in the domain and shows that P (x)
holds for it;
0.2. TYPES OF PROOFS 9

• a proof by contradiction assumes that ∀xP (x) is false, that is, assumes ∃x¬P (x),
and derives a contradiction.

For ∀x(P (x) → Q(x)),

• a direct proof considers an arbitrary value of x for which P (x) holds and proves that
Q(x) holds for such a value;

• a proof by contradiction assumes that ∀x(P (x) → Q(x)) is false, that is, there exists
a value of x for which P (x) is true and Q(x) is false, and derives a contradiction;

• a proof by contrapositive shows that for any value of x such that ¬Q(x) holds, ¬P (x)
also holds.

Remark. To prove a statement of the form “∀xP (x)” where the domain of discourse is a
subset of integer numbers, it is often (but not always!) a good idea to use Mathematical
Induction (see chapter 2).
A proof of a statement of the form “∃xP (x)” can be

• constructive – when we provide (construct) such a value of x explicitly;

• existential, or nonconstructive – when we show the existence of such a value of x


without actually providing (constructing) it.

To prove a statement of the form “p ↔ q” (resp. “∀x(P (x) ↔ Q(x))”), we can either

• prove p → q and q → p (resp. ∀x(P (x) → Q(x)) and ∀x(Q(x) → P (x))) separately, or

• have each step of our proof of the form “if and only if.”

To disprove a statement means to show that it is false. To disprove a statement of the


form ∀xP (x) it is sufficient to show that there exists at least one counterexample, that is,
there exists at least one case when the statement does not hold.
Below are some examples of various types of proofs listed above.

Example 0.6. Prove that every odd integer is the difference of two perfect squares.

Direct proof. Every odd integer has the form 2n + 1 for some integer n. Observe that
2n + 1 = (n + 1)2 − n2 .

Example 0.7. Prove that 2 is irrational.

Proof by contradiction. Suppose 2 is rational. Then there exists an irreducible
p √
fraction = 2. (Irreducible means that the greatest common divisor of p and q is 1.) Then
q
p2
= 2, thus p2 = 2q 2 . If follows that p2 is even, so p is even (see problem 2 below). Let
q2
p = 2m, where m is an integer, then p2 = 4m2 . We have 4m2 = 2q 2 , or 2m2 = q 2 . Now we
see that q 2 is even, therefore q is even. We get a contradiction because we have that on one
hand, p and q have the greatest common divisor 1, but on the other hand p and q are both
even.

Example 0.8. Prove that if a and b are integers and ab is even, then either a or b is even
(or both).
10 CHAPTER 0. PRELIMINARIES

Proof by contrapositive. Suppose that neither a nor b is even, and we will prove that
ab is not even. That is, we suppose that both a and b are odd, and we will prove that ab
is odd. Any odd numbers a and b can be written in the form a = 2n + 1 and b = 2m + 1
for some integers n and m. Then we have ab = (2n + 1)(2m + 1) = 4nm + 2n + 2m + 1 =
2(2nm + n + m) + 1 is an odd number.

Example 0.9. Prove that for every positive integer n, there exist n consecutive composite
numbers.

Constructive proof. We claim that (n + 1)! + 2, (n + 1)! + 3, . . . , (n + 1)! + (n + 1) are


all composite. Indeed, (n + 1)! is divisible by 2, by 3, . . . , and by n + 1. Therefore (n + 1)! + 2
is divisible by 2, (n + 1)! + 3 is divisible by 3, . . . , (n + 1)! + (n + 1) is divisible by n + 1.

Example 0.10. Prove that x3 + x − 1 = 0 has a real root.

Nonconstructive proof. Let f (x) = x3 +x−1. Then f (−1) = −3 < 0 and f (1) = 1 > 0.
Since f (x) is a polynomial, it is continuous. By the Intermediate Value Theorem, there exists
c between −1 and 1 such that f (c) = 0.

Example 0.11. Prove or disprove that every odd integer is prime.

Counterexample. Observe that 9 is odd but not prime. Thus the statement is false.

Problems

1. Prove that if n is an integer and 3n + 5 is odd, then n is even. Is your proof direct, by
contradiction, or by contrapositive?

2. Prove that an integer a is even if and only if a2 is even. Did you prove the two
implications separately or simultaneously?

3. Let n be an integer. Prove that if 145n − 1 is odd, then n + 1000 is even. Is your proof
direct, by contrapositive, by contradiction, or none of these? (If it is none of the listed
proof types, then describe/summarize your proof type/strategy.)

4. Prove or disprove that 11n + 5 is composite for every natural number n.

5. Prove or disprove that 2n + 1 is prime for all nonnegative integers n.

6. Prove that for any integer n there is a prime number greater than n. Is your proof
constructive?

7. Every odd number is either of the form 4n + 1 (if it has remainder 1 when divided by
4) or of the form 4n + 3 (if it has remainder 3) where n is an integer. Prove that if an
odd number is a perfect square, then it has the form 4n + 1. What type of proof did
you use? State the converse. Prove or disprove the converse.

8. Prove or disprove each of the following statements. For each part, what type of proof
did you use? (Direct, by contradiction, by contrapositive, by counterexample, etc.)

(a) If a and b are rational numbers, then a + b is also rational.


(b) If a and b are irrational numbers, then a + b is also irrational.
(c) If a is rational and b is irrational, then a + b is irrational.
0.2. TYPES OF PROOFS 11

(d) If a is rational and b is irrational, then ab is irrational.


(e) If a and b are rational numbers, then ab is also rational.
(f) If a and b are irrational numbers, then ab is also irrational.
9. Prove that the equation x101 + x51 + x + 1 = 0 has exactly one real solution. Split this
into two statements:
(a) the equation has at least one solution. Is your proof constructive or nonconstruc-
tive?
(b) the equation can not have two distinct roots. Is your proof direct, by contradiction,
or by contrapositive?

10. Prove that if the sum of two numbers is irrational, then at least one of the numbers
is irrational. Is your proof direct, by contradiction, or by contrapositive? State the
converse. Prove or disprove the converse.
11. Prove that the equation 4 sin2 x = 1 has a real solution. Is your proof constructive?

12. Prove that the equation x + sin x = 1 has a real solution. Is your proof constructive?
13. Prove that the equation 2x2 + 8x + 7 = 0 has no rational solutions. Is your proof direct,
by contradiction, or by contrapositive?
14. Prove that 0 is a root of the equation an xn + · · · + a1 x + a0 = 0 if and only if the free
term a0 = 0. Did you prove the two implications separately or simultaneously?

15. Prove that if a positive integer is divisible by 8, then it is the difference of two perfect
squares. Is your proof direct, by contradiction, or by contrapositive? Is it constructive
or nonconstructive?
16. Prove that for any integers n and m, if nm + 2n + 2m is odd, then both n and m are
odd. Is your proof direct, by contradiction, or by contrapositive?
12 CHAPTER 0. PRELIMINARIES
Chapter 1

Introduction

Solving mathematical problems is both a science and an art. It is a science because we


need to learn some basic concepts and skills, and use proper terminology when explaining
our solution to others. At the same time, it is an art because very often we need to be
creative, especially as we strive to find elegant solutions. There are infinitely many types
of math problems. While it is important to learn some basic principles of problem solving,
it is impossible to learn how to solve every problem in the world, just like it is impossible
to learn how to construct every possible model using Lego Blocks. However, after you have
constructed a few models following the directions in your Lego set, you can create your own.
When you finish school and move on to solving real world problems, you may need some
initial training in your field, but no training can ever give you detailed instructions on what
to do in every possible situation. You will have to think, make decisions, try things out, and
learn from your successes and failures. This is what we are going to do in this book: learn
some basics and then explore on our own and learn from our experience.
Below are some problems. Their solutions will illustrate some things mentioned above as
well as will introduce a few concepts and principles that will be discussed in later chapters.

1. Eleven children contributed money to buy a present for their classmate. The total
amount of money collected was $30.00. Prove that at least one child gave at least
$2.73.

2. (a) Prove that any two-digit number is divisible by 3 if and only if the sum of its
digits is divisible by 3.
(b) Prove that any natural number is divisible by 3 if and only if the sum of its digits
is divisible by 3.

3. Is it true or false that for any natural number n, the number n2 + n + 41 is prime?

4. In a 4 × 4 table, six cells are marked by a star and all others are blank. Show that it
is possible to cross out 2 columns and 2 rows so that the remaining cells are blank.

5. Is it true or false that for any natural number n, the number n3 + 2n is divisible by 3?

6. Sketch the graph of f (x) = |x + 2| + |2x − 5|.

7. Konigsberg is a city which was the capital of East Prussia but now is known as Kalin-
ingrad in Russia. The city is built around the River Pregel where it joins another river.
An island named Kniephof is in the middle of where the two rivers join. There are
seven bridges that join the different parts of the city on both sides of the rivers and the
island.
13
14 CHAPTER 1. INTRODUCTION

People tried to find a way to walk all seven bridges without crossing a bridge twice,
but no one could find a way to do it. The problem came to the attention of a Swiss
mathematician named Leonhard Euler. In 1735, Euler presented the solution to the
problem before the Russian Academy. Now, you too try to solve this problem. If such
a tour exists, find it. If not, explain why not.
8. (a) Is it possible for a chess knight to start at the upper-left corner and go through
every square on an 8 × 8 chessboard exactly once? (A knight’s move is 2 squares
up, down, or to the right or left, and 1 square in a perpendicular direction. All
allowed moves from a certain square are shown below.)

(b) Is it possible for a knight to start at the upper-left corner, go through every square
on an 8 × 8 chessboard exactly once, and then come back to the starting point in
just one additional move?
(c) Is it possible for a knight to start at the upper-left corner and go through every
square on an 8 × 8 chessboard exactly once so that to finish at the lower-right
corner?

As mentioned above, learning to solve problems is in part difficult because problems can
be very different. However, there are a few basic principles that are good to know. There are
a few approaches and methods that can be useful. In this book, we will study some of them.
After you study the material of this book you should be able to solve many problems pretty
easily. The material and problems in this book are meant to be accessible to motivated high
school and college students. They could be used by teachers for a math club or math team
training sessions, however, many problems are tricky, and some may present a challenge even
to a seasoned mathematician. So don’t get discouraged when you struggle!
While using intuition and working out a few examples may help us find an idea, it is
also important to write rigorous proofs. Since our intuition is not always correct, we need to
justify each step in a solution. We will therefore try to avoid words such as ‘obviously.’
In each chapter, we provide basic definitions and facts to get you started. We do not prove
most of the facts given in this book, since our main goal is to learn how to solve problems,
i.e. use these facts. You will probably prove most, if not all, of the facts given in this
book in courses such as Mathematical Analysis, Discrete Mathematics, Abstract Algebra,
and Number Theory. Sometimes the idea of a proof of a theorem can be used for solving
many problems. In such cases we provide the proof.
Chapter 2

Principle of Mathematical
Induction

Theorem 2.1. (Principle of Mathematical Induction) Let Sn be a statement about a positive


integer n. Suppose that

1. S1 is true, and

2. if k ≥ 1 and Sk is true, then Sk+1 is true.

Then Sn is true for all positive integers n.

Note. Conditions 1 and 2 in the above theorem are called the basis step and inductive step,
respectively.
This principle is easy to understand using the following example: suppose we know how
to get to the first floor of a building (e.g. we know where an entrance is), and we also know
how to get from any floor to the next one (e.g. we know where an elevator or a staircase is).
Then we’ll be able to get to any floor in this building. Namely, we’ll be able get to the first
floor, and then from the first to the second, and then from the second to the third, and so
on. The same is true for any statement. If we can check that S1 is true, then the second
condition in theorem 2.1 ensures that S2 follows from S1 , S3 follows from S2 , and so on.
Thus Sn is true for any natural number n.
Mathematical Induction is used in all areas of mathematics. It can be used to prove
summation formulas such as the one in the next example, various number theory, algebraic,
and geometric statements.

Example 2.2. Prove that for any natural number n,

n(n + 1)
1 + 2 + 3 + ··· + n = .
2
Proof. We will prove this identity using Mathematical Induction.
1 · (1 + 1)
Basis step. If n = 1, the formula says that 1 = which is true.
2
Inductive step. Suppose the formula holds for n = k, i.e. that

k(k + 1)
1 + 2 + 3 + ··· + k = (2.1)
2

15
16 CHAPTER 2. PRINCIPLE OF MATHEMATICAL INDUCTION

is true. We have to show that the formula holds for n = k + 1, i.e. that
(k + 1)((k + 1) + 1)
1 + 2 + 3 + · · · + (k + 1) =
2
is true. Adding k + 1 to both sides of (2.1) gives:

k(k + 1)
1 + 2 + 3 + · · · + k + (k + 1) = + (k + 1)
2
k(k + 1) + 2(k + 1)
=
2
(k + 2)(k + 1)
=
2
((k + 1) + 1)(k + 1)
= .
2

Note. For any specific value of n, it is easy to check that the identity holds. For example,
for the first four natural numbers we have:
1 · (1 + 1) 2 · (2 + 1) 3 · (3 + 1) 4 · (4 + 1)
1= , 1+2= , 1+2+3= , 1+2+3+4= .
2 2 2 2
However, remember that it is not sufficient to check some values of n. We have to prove the
statement for all natural numbers n.
Remark. Sometimes we want to prove a statement Sn for all n ≥ 0, or for all n ≥ 2, etc.,
rather than for all n ≥ 1. In this case, the basis step should check that the statement is valid
for the smallest value of n in the desired range, say, n = 0, or n = 2 in the above cases, and
the inequality k ≥ 1 in the inductive step should be modified accordingly (k ≥ 0, or k ≥ 2,
etc.).
Sometimes to prove Sk+1 , it is insufficient to assume Sk alone, but Sn for n ≤ k is needed.
Then we use the so-called Strong Induction formulated below.
Theorem 2.3. (Strong Mathematical Induction) Let Sn be a statement about a positive
integer n. Suppose that
1. S1 is true, and
2. if k ≥ 1 and Sn is true for all 1 ≤ n ≤ k, then Sk+1 is true.
Then Sn is true for all positive integers n.
Remark. As above, we might want to start with 0 or 2 or something else rather than with 1.
Example 2.4. Prove that any integer n ≥ 2 can be written in the form n = 2a + 3b for
some nonnegative integers a and b (we will say that n is a nonnegative linear combination of
2 and 3).
Proof. Basis step. If n = 2, we have n = 2 · 1 + 3 · 0.
Inductive step. Suppose that k ≥ 2 and the statement holds for all 2 ≤ n ≤ k. We want to
prove it for n = k + 1.
Case I: k = 2. Then k + 1 = 3 = 2 · 0 + 3 · 1.
Case II: k ≥ 3, then 2 ≤ k − 1 ≤ k, thus the statement holds for n = k − 1. We have
k − 1 = 2a + 3b for some nonnegative integers a and b. Then k + 1 = k − 1 + 2 = 2a + 3b + 2 =
2(a + 1) + 3b, so k + 1 is a nonnegative linear combination of 2 and 3.
17

Remark. Notice that case I above simply checks that the statement holds for n = 3. This
calculation is often moved to the basis step.

Problems

1. Prove that the following formulas hold for any natural n.


n(n + 1)(2n + 1)
(a) 12 + 22 + 32 + · · · + n2 =
6
 2
n(n + 1)
(b) 13 + 23 + 33 + · · · + n3 =
2
(c) 1 · 1! + 2 · 2! + · · · + n · n! = (n + 1)! − 1
(d) 1 + 3 + 5 + · · · + (2n − 1) = n2
n(n + 1)(n + 2)
(e) 1 · 2 + 2 · 3 + 3 · 4 + · · · + n(n + 1) =
3
n(n + 1)(2n + 7)
(f) 1 · 3 + 2 · 4 + 3 · 5 + · · · + n(n + 2) =
6
(g) 2 · 21 + 3 · 22 + · · · + (n + 1) · 2n = n2n+1
2. (a) Prove that for any positive integer n, n < 2n .
(b) Prove that for any integer n ≥ 4, 2n < n!.
q
3. Prove that if q is a positive integer, then 32 − 1 is divisible by 2q+2 .
4. Prove that for any natural number n, the number
n7 n5 2n3 n
+ + −
7 5 3 105
is an integer.
5. Let {F0 , F1 , F2 , . . . } be the Fibonacci sequence defined by F0 = 0, F1 = 1, and
Fn+1 = Fn + Fn−1 , n ≥ 1. Prove the following identities and inequalities.
2
(a) F1 F2 + F2 F3 + · · · + F2n−1 F2n = F2n
(b) F12 + F22 + · · · + Fn2 = Fn Fn+1
(c) Fn−1 Fn+1 = Fn2 + (−1)n
 n  
1 1 Fn+1 Fn
(d) =
1 0 Fn Fn−1
2
(e) Fn−1 + Fn2 = F2n−1
 n−2
3
(f) Fn ≥
2
6. Prove that any integer n ≥ 4 can be written as n = 2a + 5b for some non-negative
integers a and b.
7. Prove that for every natural number n,
1 1 1
1< + + ··· + < 2.
n+1 n+2 3n + 1
18 CHAPTER 2. PRINCIPLE OF MATHEMATICAL INDUCTION

8. Let sn be the number of ways to cover a 2 × n board by n dominoes (2 × 1 tiles). It


is easy to check that s1 = 1, s2 = 2, s3 = 3, s4 = 5, and s5 = 8. Prove that for any
natural n, sn = Fn+1 (where {Fn } is the Fibonacci sequence defined in problem 5).
9. The triangle inequality states that the length of a triangle’s side is always smaller than
the sum of the lengths of the other two sides of that triangle. Prove that a side length
of
(a) a quadrilateral
(b) a pentagon
(c) any polygon
is less than the sum of all of its other side lengths.
10. Suppose that n ∈ N and n lines are given in the plane. They divide the plane into
regions. Show that it is possible to color the plane with two colors so that no regions
with a common boundary line are colored the same way. (Regions that share only one
boundary point may be colored the same way.) Note: such a coloring is called a proper
coloring.
11. Suppose that n ∈ N and n circles are given in the plane. They divide the plane into
regions. Show that it is possible to color the plane with two colors so that no regions
with a common boundary line are colored the same way. (Regions that share only
finitely many boundary points may be colored the same way.)
12. Suppose that n ∈ N and n circles and a chord of each circle are drawn in a plane.
They divide the plane into regions. Show that it is possible to color the plane with
three colors so that no regions with a common boundary line are colored the same way.
(Regions that share only finitely many boundary points may be colored the same way.)
13. Consider a few points in the plane and a few line segments connecting some of them
so that (1) no two line segments intersect, and (2) each point is connected with at
least two other points (so there are no isolated points and there are no “hanging” line
segments). Such line segments divide the plane into several regions. Such a picture is
called a map. Prove that a map can be properly colored with two colors if and only if
each point is connected with an even number of other points. (See problem 10 for the
definition of a proper coloring.)
1 1
14. Let α be any real number such that α + ∈ Z. Prove that αn + n ∈ Z for any n ∈ N.
α α
15. Show that for any n ≥ 3, there exist distinct positive integers a1 , a2 , . . . , an such that
1 1 1
1= + + ··· + .
a1 a2 an
n(n − 1)
16. Prove that for any natural number n, the set {1, 2, . . . , n} has subsets con-
2
taining exactly two elements.
17. Prove that the determinant of the n × n matrix Mn with entries

 5 if i = j
mij = 2 if |i − j| = 1
0 otherwise

1 n+1
is equal to (4 − 1).
3
19

18. Find the determinant of the n × n matrix An with entries



 2 if i = j
aij = 1 if |i − j| = 1 .
0 otherwise

Hint: calculate the determinants of A1 , A2 , A3 , and A4 . Notice the pattern. Guess a


formula for det An , and then prove it by Mathematical Induction.
19. Prove that for any integer n ≥ 6, a square can be subdivided into n (not necessarily
congruent) smaller squares.
20. Suppose that 2n points are given in space, where n ≥ 2, none of which are collinear.
Altogether n2 + 1 line segments are drawn between these points. Prove that there is at
least one triangle (i.e. a set of three points which are joined pairwise by line segments).
21. Prove that if any one square of a 2n × 2n board is removed, then the remaining board
can be covered (without overlap) by L-trominoes, i.e. the tiles consisting of 3 squares
as shown below.

22. Consider a triangle consisting of 4n identical smaller triangles. Remove one of the three
corner triangles. Here is an example for n = 2:

−→

Show that the remaining region can be tiled with pieces shown below.

23. (a) Prove that all numbers in the sequence 1007, 10017, 100117, . . . are divisible by
53.
(b) Prove that all numbers in the sequence 12008, 120308, 1203308, 12033308, . . . are
divisible by 19.
24. A chess tournament consists of a few players, all playing at least one game with each
of the other players. A player is called a champion if they have won at least one game
against but lost none to each of the other players (draws are OK). Note that there is
at most one champion, however, there may be no champion at the tournament. Your
20 CHAPTER 2. PRINCIPLE OF MATHEMATICAL INDUCTION

assignment is to find the champion, if one exists (or determine that there is none), at
the tournament, by asking only one type of question — asking a player whether they
have won any games against a second player. Everyone must answer your questions
truthfully. For example, if Alice and Bob are two players at the tournament, you may
ask Alice whether she has won any games against Bob; she must answer truthfully.
Prove that if there are n players at the tournament, then you can find the champion,
if there is one, with at most 3(n − 1) questions.
25. Every road in the magical land of Sikinia is one-way. Every pair of cities is connected
by exactly one direct road. Show that there exists a city which can be reached from
every other city either directly or via at most one other city.

26. Let n be any natural number. Consider all nonempty subsets of the set {1, 2, . . . , n},
which do not contain any neighboring elements. Prove that the sum of the squares of the
products of all numbers in these subsets is (n+1)!−1. (For example, if n = 3, then such
subsets of {1, 2, 3} are {1}, {2}, {3}, and {1, 3}, and 12 +22 +32 +(1·3)2 = 23 = 4!−1.)
27. Suppose 2n dots are placed around the circle, and n of them are colored red while the
remaining n are colored blue. Going around the circle clockwise, we keep count of how
many red and blue dots we have passed. If at all times the number of red dots we have
passed is at least the number of blue dots, we consider it a successful trip around the
circle. Prove that no matter how the dots are colored red and blue, it is possible to
have a successful trip around the circle if we start at a correct point.

28. There are n identical cars on a circular track. Among all of them, they have just enough
gas for one car to complete a lap. Show that there is a car which can complete a lap
by collecting gas from other cars on its way around.
Chapter 3

Dirichlet’s Box Principle

Theorem 3.1. (Dirichlet’s Box Principle) If n + 1 or more objects are put into n boxes,
then at least one box contains more than one object.
Proof. Assume to the contrary that each box contains at most one object. Since there are n
boxes, altogether there are at most n objects. However, we are given that there are at least
n + 1 objects. We reached a contradiction, therefore, our assumption must be false.
Dirichlet’s Box Principle is often called the Pigeonhole Principle and is formulated as
follows.
Suppose there are n pigeonholes in the tree, and there are at least n + 1 pigeons flying into
these n holes. Then there is at least one hole containing more than one pigeon.
More formally and more generally, this principle can be formulated in the following way.
If the cardinality of a set S is bigger than the cardinality of a set T , and f is a function from
S to T , then f is not one-to-one.
In the above theorem the function f
S −→ T
is
{n + 1 objects} −→ {n boxes}
or
{n + 1 pigeons} −→ {n pigeonholes}.
Dirichlet’s Box Principle is often used to prove statements involving remainders or divisibility.
Recall that for any natural number n, there are n possible remainders upon division by n,
namely, 0, 1, 2, . . ., n−2, and n−1. If we are given more than n numbers, then by Dirichlet’s
Box Principle at least two of them have the same remainder. Note that this implies that the
difference of these two numbers is divisible by n. Read more on remainders and divisibility
in chapter 4. We should also note that all statements that can be proved using Dirichlet’s
Box Principle can also be proved by contradiction which mimics the above proof. However,
it is considered more elegant to refer to the principle.
Here is another, also very useful, principle.
Theorem 3.2. If n − 1 or fewer objects are put into n boxes, then at least one box is empty.
More formally,
If the cardinality of a set S is smaller than the cardinality of a set T , and f is a function
from S to T , then f is not onto.
Below are generalizations of the above principles.

21
22 CHAPTER 3. DIRICHLET’S BOX PRINCIPLE

Theorem 3.3. (Generalized Dirichlet’s Box Principle) If qn + 1 or more objects are put into
n boxes, then at least one box contains more than q objects.
Theorem 3.4. If n − k or fewer objects are put into n boxes, then at least k boxes are empty.

Problems

1. Prove that among 13 persons, at least two were born in the same month.
2. Prove that among 50 persons, at least five were born in the same month.
3. A Martian has an infinite number of red, blue, yellow, and black socks in a drawer. He
pulls out a few socks without looking, then looks at the socks he got, and decides what
to wear. How many socks must the Martian pull out of the drawer to guarantee he has
a matching pair?
4. The capital of Sikinia has 300,001 inhabitants, and it is known that none of them has
more than 300,000 hairs on his or her head. Can you assert with certainty that there
are two persons with the same number of hairs on their heads?
5. Prove that among 120 distinct integers, there are two whose difference ends with 00.
6. Given 50 distinct positive integers less than 99, prove that some two of them add up
to 99.
7. Let a1 , a2 , and a3 be integers. Show that (a1 − a2 )(a1 − a3 )(a2 − a3 ) is even.
Y
8. Let a1 , a2 , a3 , and a4 be integers. Show that (ai − aj ) is divisible by 12.
1≤i<j≤4

9. Prove that from any 12 distinct two-digit numbers, we can select two with a two-digit
difference of the form aa.
10. A few distinct numbers are randomly selected from the set {1, 2, 3, . . . , 9, 10}. What
is the smallest number of numbers that must be selected to guarantee that among the
selected numbers there are two numbers such that one of them is equal to half of the
other?
11. Kevin is paid every other week on Friday. Show that every year, in some month he is
paid three times.
12. Five numbers are randomly picked from the following set:

{0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100}.

Prove that among these numbers there are two whose difference is divisible by 5.
13. Seven points are given inside a regular hexagon with sides of length 1. Prove that there
are two among these seven points such that the distance between them is at most 1.
14. Twenty-six points are given inside a 20 × 15 rectangle. Prove that there are at least
two points with distance less than or equal to 5.
15. (a) Seven points are given inside a 9 × 12 rectangle. Prove that there are two of them
such that the distance between them is less than 7.
23

(b) Is the above assertion also valid for six points?

16. Suppose that fifty-one small insects are placed inside a square of side 1. Prove that at
any moment there are at least three insects which can be covered by a single disk of
radius 1/7.

17. Three hundred points are given inside a cube with edge 7. Prove that we can place a
small cube with edge 1 inside the big cube such that the interior of the small cube does
not contain any of the given points.

18. There are n people in a hiking club. Each person counted with how many other club
members they have gone hiking. Prove that there are two people who have gone hiking
with the same number of other club members.

19. Inside a circle of radius


√ 4 are chosen 61 points. Show that among them there are two
at distance at most 2 from each other.

20. Given nine points inside the unit square, prove that some three of them form a triangle
1
whose area does not exceed .
8
21. (a) Prove that among any 11 distinct natural numbers, there are two numbers a < b
such that the difference b − a ends with 0 (i.e. has the units digit 0).
(b) Is the above statement true for the tens digit? That is, is it true that among any
11 distinct natural numbers, there are two numbers a < b such that the difference
b − a has 0 in the tens place?

22. (a) Prove that from any 52 positive integers, we can select two such that their sum or
difference is divisible by 100.
(b) Is the above assertion also valid for 51 positive integers?

23. Let n be a positive integer which is not divisible by 2 or 5. Prove that there is a multiple
of n consisting entirely of ones.

24. Suppose that five lattice points (i.e. points with integer coordinates) are given in the
plane. Prove that we can choose two of these points such that the segment joining
these two points passes through another lattice point.

25. Let {a1 , a2 , . . . , an+1 } be numbers from the set {1, 2, . . . , 2n}. Prove that at least two
of the ai s are relatively prime.

26. Let {a1 , a2 , . . . , an+1 } be numbers from the set {1, 2, . . . , 2n}. Prove that one of the
ai s is divisible by another.

27. Prove that in any convex 2n-gon, there is a diagonal not parallel to any side.

28. Prove that any 21-gon has two diagonals (not necessarily having a common point) such
that the smaller angle between them is less than 1◦ .

29. Let f be a one-to-one function from X = {1, 2, . . . , n} onto X. Let f k = f ◦ f ◦ · · · ◦ f


| {z }

denote the k-fold composition of f with itself. Show that for some positive integer m,
f m (x) = x for all x ∈ X.

30. Show that there is a positive term of the Fibonacci sequence that is divisible by 1000.
24 CHAPTER 3. DIRICHLET’S BOX PRINCIPLE

31. Prove that every set of 10 two-digit numbers has two disjoint nonempty subsets with
the same sum of elements.
32. One thousand coins of diameter 1 cm each are placed on a table of size 55 cm by 60
cm. Prove that it is possible to put one more coin of the same size so that it does not
touch any of the 1000 original coins. (The coin must lie completely on the surface of
the table, i.e. it cannot stick out.)
33. Every block of a 3 × 7 board is colored either black or white. Prove that no matter how
the board is colored, it contains a rectangle consisting of more than one row and more
than one column whose four corners have the same color.
34. Every block of a 5 × 41 board is colored in one of four colors. Prove that, no matter
how the board is colored, there exists at least one same-color-corner rectangle (as in
problem 33).
35. On each face of a dodecahedron is written a nonnegative integer such that the sum of
all 12 integers is 11. Show that there are two faces that share an edge and have the
same integer written on them.

36. On each face of an icosahedron is written a nonnegative integer such that the sum of
all 20 integers is 39. Show that there are two faces that share a vertex and have the
same integer written on them.
37. A chess player trains (indefinitely) by playing at least one game per day, but, to avoid
exhaustion, no more than 12 games a week. Prove that there will be a group of
consecutive days in which he plays exactly 20 games.
38. Assume in a class of students each of a number of committees contains more than half
of all the students.
(a) Prove that there is a student who is a member in more than half of the committees.
(b) Prove that if the number of committees is 30, then it is possible to select just 4
students to be committee representatives so as not to leave a committee without
a representative. (Committees may be only represented by their own members,
but one student may represent any number of committees.)
Chapter 4

Number theory

In this chapter we recall basic properties of integers. (Some of them have been used in
previous chapters.)
Definition 4.1. If a 6= 0 and b = aq, then we say that a divides b, or that b is divisible
by a, and write a | b.
Theorem 4.2. (Fundamental properties of divisibility.) Let a, b, and c be integers.
1. If a | b and b | c, then a | c.
2. If a | b and a | c, then a | (bx + cy) for any integers x and y.
Important special cases:
(a) If a | b, then a | bx for any integer x.
(b) If a | b and a | c, then a | (b + c) and a | (b − c).
Definition 4.3. Let a or b be nonzero integers. The largest number that divides both a and
b is called the greatest common divisor of a and b, and is denoted by gcd(a, b) or just
(a, b).
Theorem 4.4. For any nonzero integers a and b, gcd(a, a) = a, gcd(a, 1) = 1, gcd(a, 0) = a,
gcd(a, b) = gcd(b, a).
Definition 4.5. An integer greater than 1 is called prime if it has exactly two positive
divisors, 1 and itself. An integer greater than 1 that is not prime is called composite.
Theorem 4.6. There are infinitely many primes.
Theorem 4.7. (Euclid’s lemma.) Let a and b be integers. If p is prime and p | ab, then
p | a or p | b.
Theorem 4.8. (Fundamental theorem of arithmetic.) Every positive integer larger than 1
has a prime factorization, i.e. can be written as a product of primes, and such a product is
unique up to order of the factors.
Example 4.9. Observe that 12 = 2 · 2 · 3 = 2 · 3 · 2 = 3 · 2 · 2 are the only prime factorizations
of 12. The order of the factors is different, but the set of factors is the same.
Corollary 4.10. If a is an integer and p and q are distinct primes such as p | a and q | a,
then (pq) | a.

25
26 CHAPTER 4. NUMBER THEORY

Definition 4.11. Integers a and b are called relatively prime, or coprime, if gcd(a, b) = 1.
Remark. Integers a and b may be relatively prime even if they are both composite. For
example, 8 = 2 · 2 · 2 and 15 = 3 · 5 are composite but relatively prime since they do not share
any factors larger than 1.
Theorem 4.12. For any pair of nonzero integers a and b, their greatest common divisor
gcd(a, b) is a linear combination of a and b, i.e. there exist integers x and y such that
gcd(a, b) = ax + by. Moreover, gcd(a, b) is the smallest positive integer that can be written
in the form ax + by for some integers x and y.
Corollary 4.13. Nonzero integers a and b are relatively prime if and only if there exist
integers x and y such that ax + by = 1.
Definition 4.14. For any integers a and b > 0 there exist unique integers q and r such that

a = bq + r, 0 ≤ r < b.

The numbers q and r are called the quotient and remainder respectively upon division of
a by b. The notation a mod b is commonly used for the remainder.
The following observations are often useful when solving problems involving integers.
• Any integer can be written in the form 10q+r for some integers q and r where 0 ≤ r ≤ 9.
• An integer an an−1 . . . a1 a0 (with digits an , an−1 , . . . , a1 , a0 ) can be written as

10n an + 10n−1 an−1 + · · · + 102 a2 + 10a1 + a0 .

If two integers have the same remainder upon division by a b, then they can be written
as bq1 + r and bq2 + r. Their difference is b(q1 − q2 ), and thus it is divisible by b. As was
discussed in chapter 3, since there are b possible remainders upon division by b, given b + 1
or more numbers, by Dirichlet’s Box Principle at least two of them have the same remainder.
Their difference is divisible by b.
Definition 4.15. Let m > 1 be an integer. We say that integers a and b are congruent
modulo m, and we write a ≡ b (mod m), if m | (a − b).
Example 4.16. We have 22 ≡ 7 (mod 5) because 5 | (22 − 7). Note that 22 and 7 have the
same remainder upon division by 5.
Theorem 4.17. Let a, b, and m > 1 be integers. The following conditions are equivalent:
• a ≡ b (mod m),
• a − b = mq for some integer q,
• a = b + mq for some integer q,
• a mod m = b mod m.
Theorem 4.18. (Properties of congruences.) Let a, b, c, d, and m > 1 be integers.
1. If a ≡ b (mod m) and c ≡ d (mod m), then a±c ≡ b±d (mod m) and ac ≡ bd (mod m).
2. If a ≡ b (mod m) then ac ≡ bc (mod m) for c ≥ 0.
3. If c ≥ 1 and ac ≡ bc (mod cm), then a ≡ b (mod m).
27

4. If (c, m) = 1 and ca = cb (mod m), then a ≡ b (mod m).


Theorem 4.19. (Fermat’s theorem.) If a is an integer and p is prime, then ap ≡ a (mod p).
Corollary 4.20. If a is an integer, p is prime, and p does not divide a, then ap−1 ≡
1 (mod p).
Example 4.21. Let p = 5. Then 14 ≡ 1 (mod 5), 24 ≡ 16 ≡ 1 (mod 5), 34 ≡ 81 ≡ 1 (mod 5),
44 ≡ 256 ≡ 1 (mod 5), etc.
Finally, we recall two useful formulas.
Theorem 4.22. Let a and b be integers.
• For any natural n,

an − bn = (a − b)(an−1 + an−2 b + · · · + abn−2 + bn−1 ).

• If n is odd,

an + bn = (a + b)(an−1 − an−2 b + · · · + (−1)n−2 abn−2 + (−1)n−1 bn−1 ).

Problems

1. (a) Prove that a natural number is divisible by 9 if and only if the sum of its digits is
divisible by 9.
(b) Prove that if the sum of the digits of a number is 66, then it is not a perfect square
(the square of an integer).
2. (a) The number 82460 is written on a board (it contains over 2,000 digits, so we hope
that the reader doesn’t mind that we didn’t write it out here). The sum of its
digits is calculated, then the sum of the digits of the result is calculated, and so
on, until we get a single digit. What is this digit?
(b) Same question as in part (a), for the number 21357 .
3. (a) If an integer number is a perfect square, what are the possible values of its units
digit?
(b) Conclude that a number ending with 3 cannot be a perfect square.
4. (a) If c is a perfect square, what are the possible values of its remainder upon division
by 4?
(b) Conclude from part (a) that a number ending with 66 cannot be a perfect square.
(c) Prove that the sum of two perfect squares cannot end with 123.
(d) Prove that the sum of the squares of two odd numbers cannot be a perfect square.
5. Does there exist a perfect square that ends with
(a) 65?
(b) 1000?
(c) 120864?
28 CHAPTER 4. NUMBER THEORY

6. Prove that a natural number that consists of 300 ones, some zeros, and no other digits,
cannot be a perfect square.
7. (a) Prove that no perfect square has a remainder of 6 when divided by 7.
(b) How many perfect cubes have a remainder of 6 when divided by 7?
8. Find the remainder when the sum

1! + 2! + 3! + · · · + 99! + 100!

is divided by 12.
9. Show that 2457 + 3457 is divisible by 5.
10. Show that A = 3105 + 4105 is divisible by 7. Find A mod 11 and A mod 13.
11. Show that if the units digit of a natural number n is 3, then 5|(n2 + 1).
12. Prove that if n is an integer, n2 + 5 is not divisible by 11.
13. Show that for any integer n, 6 | (n3 + 5n).
m3 + 3m2 + 2m
14. Prove that for every integer m, the number is also an integer.
6
100
15. For how many natural numbers n is the number also natural?
n+1
3n + 24
16. Find all integers n for which the number is also an integer.
n+2
17. Prove that the sum of four consecutive odd integers is divisible by 8.
18. Find all four-digit numbers aabb that are perfect squares.
19. Find all quadruples of consecutive integers with the product equal to 3024.
20. Prove that if p > 3 is prime, then p2 ≡ 1 (mod 24).
21. Find 2100 mod 5 (that is, find the remainder of 2100 upon division by 5).
9
22. Find the last two digits of 99 .
23. Show that if n is composite, then 2n − 1 is composite.
24. Show that for any n ∈ N, 2n does not divide n!.
25. How many zeros are there at the end of 100!?
26. Prove that if a polynomial P (x) = an xn + an−1 xn−1 + · · · + a1 x + a0 with integer
coefficients has odd values at x = 0 and x = 1, then the equation P (x) = 0 has no
integer roots.
27. Prove that the following equations have no integral solutions.
(a) x2 + 10y = 5xy + 2
(b) x2 y = xy 2 + 1
(c) x2 − 3y 2 = 17
29

(d) x4 − 5xy − y 2 = 3
28. Find all primes p and q such that p2 − 2q 2 = 1.
29. Find all integral solutions of the following equations.
(a) x + y = xy
(b) xyz + x + y + z = xy + xz + yz
(c) x2 + y 2 + z 2 + 2 = 2x + 2y + 2z
(d) x + y = x2 − xy + y 2
30. Prove that in any Pythagorean triple (a, b, c), that is, integer numbers a, b, and c such
that a2 + b2 = c2 , at least one of the numbers is divisible by 5.
31. How many pairs of positive integers are solutions to the equation
(a) 2x + 3y = 100?
(b) 5x + 7y = 1234?
32. Do there exist integers m and n such that
(a) m2 + 1234567 = n2 ?
(b) m2 + 12345678 = n2 ?
33. Does there exist a positive integer that
(a) starts with 123
(b) ends with 123
and is divisible by 4567? If so, find it.
34. Suppose we write a natural number at each vertex of a cube. Then at the midpoint
of each edge we write the sum of the two numbers that are at the ends of this edge.
Finally, in the middle of each face we write the sum of the four numbers that are at
the vertices of this face. Could the sum of all 26 numbers be equal to 1234?
35. When 3 was appended to a three-digit number on the left (i.e. written before the
number), the number increased by 9 times. What was the number?
36. When 6 was appended to a number on the right (i.e. as the rightmost digit), it increased
by 13 times. What was the number?
37. When 36 was appended to a number on the right, it increased by 103 times. What was
the number?
38. The first digit of a six-number digit number is 1. When this digit 1 is moved from the
first digit position to the end so that it becomes the last digit, the new 6 digit number
is 3 times larger than the original number. What is the original number?
39. Crookshanks multiplied two 3-digit numbers. Then he covered three of the digits, so
the equation looked like

12 × 30 = 33, 84.


What is the product of the covered digits?
30 CHAPTER 4. NUMBER THEORY

40. Jerry came up with an encrypted problem:

AB − BA = 7.

(As always in such puzzles, he wants the same letter to always stand for the same digit,
and different letters to stand for different digits.) However, no matter how hard he
tried, he couldn’t solve it. Explain why.
41. If 792 divides the integer 13xy45z, find the digits x, y, and z.
42. How many positive three-digit integers have a remainder of 2 when divided by 6, a
remainder of 5 when divided by 9, and a remainder of 7 when divided by 11?

43. Prove that the following numbers are irrational.


√3
(a) 25
(b) log2 5
44. There is a row of one hundred light bulbs, numbered from 1 to 100. Each one is
controlled by an ordinary switch that has two positions: ON and OFF. Initially all
the switches are in the OFF position. Cameron turns every switch on. Then he starts
from number 1, and turns all the even-numbered switches off. Starting from number
1 again, he changes the position of every switch whose number is divisible by 3 (turns
it off if it’s on, and turns it on if it’s off). Starting from number 1 again, he changes
the position of every switch whose number is divisible by 4 (turns it off if it’s on, and
turns it on if it’s off). He repeats this procedure 96 more times, every time changing
the switches whose numbers are divisible by 5, 6, and so on, all the way to 100. (So, his
last step is to change just the switch with number 100). After he is done, how many
lights are on, and what are they?
Chapter 5

Case analysis

We have seen in previous chapters that some problems can be solved by considering a few
different cases. For example, in number theory it was sometimes helpful to consider separately
the cases of odd and even integers, or, more generally, consider all possible remainders upon
division by a certain number. Below are three more examples of situations where it is helpful
to consider two or more cases. As we will see in the future chapters, this technique can be
used in many other types problems.
Recall that the absolute value of a real number x is denoted |x| and is defined by

x if x ≥ 0,
|x| =
−x if x < 0.
Here is the graph of y = |x|.
y

y = −x y=x

To solve problems involving an absolute value, we consider the following two cases: when the
expression inside the absolute value is positive or 0, and when it is negative.
Example 5.1. Solve 3|x2 − 9| − 11x + 7 = 0.
Solution. Case I: x2 − 9 ≥ 0, then |x2 − 9| = x2 − 9, and the equation becomes 3(x2 − 9) −
11x + 7 = 0, or 3x2 − 11x − 20 = 0. Using the quadratic formula, we find x = 5 or x = −4/3.
The root x = 5 satisfies the condition x2 − 9 ≥ 0. However, x = −4/3 does not, so we throw
it away.
Case II: x2 − 9 < 0, then |x2 − 9| = −(x2 − 9), and the equation becomes −3(x2 − 9) −
11x + 7 = 0, or −3x2 − 11x + 34 = 0. The roots are 2 and −17/3, however, the second root
does not satisfy the condition x2 − 9 < 0, so we throw it away.
Thus the only roots are 5 and 2.
If there are several absolute values, we can consider two cases for each absolute value.
Note that if there are n absolute values, then we have 2n cases total. An alternative, often
shorter, approach is to find all the points at which the expressions inside absolute values
change sign. These points divide the real number line into several intervals (two of which are
infinite). Then we can consider each interval separately.

31
32 CHAPTER 5. CASE ANALYSIS

Theorem 5.2. If a and b are integers, then ab = 1 if and only if at least one of the following
holds:

• a = 1,

• a 6= 0, b = 0,

• a = −1 and b is even.
2
−9x+20
Example 5.3. Find all integer values of x for which (x2 − 5x + 5)x = 1.

Solution. Let a = x2 − 5x + 5 and b = x2 − 9x + 20. Then we have ab = 1, where a, b ∈ Z.


Case I: a = 1, then x2 − 5x + 5 = 1. Therefore x = 1 or x = 4.
Case II: a 6= 0, b = 0. First solve b = 0, i.e. x2 − 9x + 20 = 0. We have x = 4 or x = 5.
Note that for both roots a 6= 0.
Case III: a = −1 and b is an even integer. First solve a = −1, i.e. x2 − 5x + 5 = −1.
We have x = 2 or x = 3. Note that for both roots b is even.
Thus solutions are 1, 2, 3, 4, and 5.

Many logic puzzles can be solved by considering all possible scenarios.

Example 5.4. There are three hats, each with an accompanying statement.
Hat One: “The cat is in this hat.”
Hat Two: “The cat is not in this hat.”
Hat Three: “The cat is not in Hat One.”
Exactly one of the statements is true. Exactly one hat contains a cat. Do we have enough
information to deduce which hat contains the cat?

Solution. Let’s consider all possible cases for the cat.


Case I: the cat is in Hat One. Then the statements of Hat One and Hat Two are both true,
which contradicts the given information, so this case is not possible.
Case II: the cat is in Hat Two. Then the statement of Hat Three is the only correct one,
thus this case is possible.
Case III: the cat is in Hat Three. Then the statements of Hat Two and Hat Three are both
true, so this case is not possible.
Thus the given information is sufficient to state with certainty that the cat is in Hat Two.

Problems

1. Solve the following equations over R.

(a) x2 + |2x − 2| = 1
(b) 2x2 + |4x + 3| = 3

2. Solve the following equations over R.

(a) |2x + 3| − |x| = 3


(b) |2x − 1| − |x + 5| = 3
(c) |3x + 6| + |x − 1| = 2
(d) |x + 1| + |3x + 1| = |2x + 1| + |4x + 1|
33

3. Solve the following inequalities over R.


(a) x2 − |5x − 6| ≤ 0
(b) |x + 1| + 5 − x2 > 0
(c) x2 − |7x + 15| ≥ 3
(d) x2 − 2x + |x − 1| < 5
(e) x2 + |x − 3| ≤ 2
4. Solve the following inequalities over R.
(a) |x − 5| + |2x − 4| ≤ 6
(b) |x − 5| − |x − 2| ≥ 1
(c) |x − 1| − |x − 3| > 5
5. Sketch the graph of the following equations.
(a) y = |x2 − 4| + 2
(b) y = |x2 − 1| − |x2 − 4|
(c) y = |x + |x + 2||
(d) y = |x2 − 4|x| + 3|
6. Sketch the graph of |x| + |y| = 1 + |xy|.
7. Sketch the following regions.
(a) {(x, y) | |x| + |y 3 | < 8}
(b) {(x, y) | ||x| + |y| − 3| > 1}
(c) {(x, y) | 2|y − x| + |y + x| ≤ 1}
(d) {(x, y) | |x − y| + |x| − |y| ≤ 2}
8. How many ordered pairs of real numbers (x, y) satisfy the following system of equations?

x + 3y= 3
|x| − |y| = 1

9. Solve the following equations over Z.


2
−7x+12
(a) xx =1
x2 −8x+15
(b) (x − 3) =1
2
(c) (xx+1 )x = 1
(d) (5x + 2)x+3 = 1
10. Solve the following equations over Z.
2
(a) x(x )
= x2
2
(b) x((x+1) )
= x16
x
(c) x(x ) = (xx )x
√ √
(d) xx+1 = x x+1
34 CHAPTER 5. CASE ANALYSIS

11. Solve the following systems over Z.


 2x
x = y+1
(a)
xy = 1
 x+y
x = y4
(b) x+y
y = x
12. Find all integral solutions of the following equations.
(a) ab = 625
(b) (ab )c = 64
13. If exactly one of the following statements is false, which statement is false?
A. “Statement D is true.”
B. “Statement A is false.”
C. “Statement B is false.”
D. “Statement C is true.”
14. Four men are taken to police headquarters following a bank robbery. The police are
certain that one of the men is guilty, but they don’t know for sure which one. Here’s
what the four men had to say for themselves:
Alan: “Bill did it.”
Bill: “Don did it.”
Charlie: “I didn’t do it.”
Don: “Bill lied when he said I did it.”
If only one of the four statements is true, who is the guilty man?
15. If an octopus has an even number of legs, it always tells the truth, but if it has an odd
number of legs, it always lies.
One day a green octopus said to a blue one, “I have eight legs. You only have six.”
“I have eight legs. You have just seven,” indignantly replied the blue octopus.
“The blue octopus really does have eight legs,” agreed the purple octopus. “I have
nine,” added he.
A striped octopus joined in, saying, “None of you have eight legs. I’m the only one
who does!”
Which of these octopuses actually has eight legs?
16. On an Island of Knights and Knaves, there are two kinds of people: knights, who
always tell the truth, and knaves, who always lie. One day you meet an islander and
they tell you: “I met two fellow islanders yesterday. One of them said that they were
both knights, and the other said that they were both knaves.” Is this islander a knight
or a knave?
17. I told my friend a riddle. First I told her that the product of my three siblings’ ages
was 36, and the sum of their ages was the day of the month on which her birthday fell.
After a bit of thinking, she told me that I haven’t given her enough information. So
I told her that I had to pick up my oldest sibling from soccer practice. Then she was
able to determine their ages. How old are my three siblings?
18. How many ways are there to “paint” all natural numbers, either red or green each, so
that the sum of any two distinct red numbers is red and the sum of any two distinct
green numbers is green?
Chapter 6

Finding a pattern

Sometimes (e.g. in problems such as number 18 in chapter 2), a formula can be guessed after
computing a few values. Although a guess is not sufficient and a rigorous proof is needed to
ensure correctness of a formula, guessing often is a powerful technique. In this chapter we
will consider problems in which we can find the first few values of a certain sequence, guess
a formula for a general case, and then prove it (e.g. using Mathematical Induction or some
other proof technique).
Example 6.1. Guess a closed formula for the n-th term of the sequence

1, 3, 6, 10, 15, 21, . . . .

(A closed formula means that the n-th term of the sequence is expressed in terms of n and
not in terms of the previous terms of the sequence.)
Solution. Notice that the difference between the first and the second terms is 2, the difference
between the second and the third terms is 3, and then the differences are 4, 5, 6, and so on.
Thus

a1 = 1,
a2 = 1 + 2,
a3 = 1 + 2 + 3,
a4 = 1 + 2 + 3 + 4,
a5 = 1 + 2 + 3 + 4 + 5,
a6 = 1 + 2 + 3 + 4 + 5 + 6.

n(n + 1)
It appears that an = 1 + 2 + · · · + n = .
2
Note. For problems like this one, since only a few terms of a sequence are given, there are
many different ways to continue the sequence, thus there are many different formulas valid
1 1 11 7 77
for these few terms. For example, an = 2n − n5 + n4 − n3 + n2 − n is another
60 6 12 3 30
valid formula for this sequence. Note that it gives a7 = 30 while the formula we have in the
above solution gives a7 = 28, so these two formulas really define different sequences. Above,
we tried to find a simple one. However, in problems such as in the next example and all
problems except the first one in this chapter, it is important to prove the formula that we
guess based on our observation.

35
36 CHAPTER 6. FINDING A PATTERN

Example 6.2. Find a closed formula for the n-th derivative of f (x) = 5x .

Solution. Find the first few derivatives (until you can see a pattern):

f 0 (x) = ln 5 · 5x ,
f 00 (x) = ln 5 · ln 5 · 5x = (ln 5)2 · 5x ,
f 000 (x) = (ln 5)2 · ln 5 · 5x = (ln 5)3 · 5x .

We notice that f (n) (x) = (ln 5)n · 5x . It is easy to prove this formula using Mathematical
Induction. The basis step is f 0 (x) = ln 5 · 5x . For the inductive step, suppose f (k) (x) =
(ln 5)k · 5x is true. Then

f (k+1) (x) = (f (k) (x))0 = ((ln 5)k · 5x )0 = (ln 5)k · ln 5 · 5x = (ln 5)k+1 · 5x .

Problems

1. Guess a closed formula for the n-th term of the sequence a1 , a2 , a3 , . . . whose first few
terms are given. Try to find the simplest possible formula, but any correct formula
(that is, any formula that works for the given terms) is acceptable.

(a) 1, 4, 9, 16, 25, 36, 49, . . .


(b) -1, 0, 1, 2, 3, 4, 5, . . .
(c) 5, 7, 9, 11, 13, 15, . . .
(d) 8, 10, 12, 14, 16, 18, . . .
(e) 3, 1, −1, −3, −5, −7, . . .
(f) 1, 2, 1, 4, 1, 6, 1, 8, . . .
(g) 1, 3, 4, 6, 7, 9, 10, 12, . . .
(h) 0, 1, 3, 7, 15, 31, . . .
1 1 3 1 5 3 7
(i) , , , , , , , ...
2 2 8 4 32 32 128
1 1 1 1
2. Compute Sn = + + +···+ for some small values of n. Notice
1·2 2·3 3·4 (n − 1)n
the pattern. Write a closed formula for Sn and prove it using Mathematical Induction.
1 1 1
3. Find a closed formula for + + ··· + .
1·3 3·5 (2n − 1)(2n + 1)
1 2 3 n−1
4. Find a closed formula for + + + ··· + .
2! 3! 4! n!
5. Find a closed formula for
2n−1
Y  (−1)i
      
−1 1 −1 −1
1− = 1− 1− 1− ... 1 − .
i=1
i 1 2 3 2n − 1

6. How many binary sequences (i.e. consisting of 0s and 1s) of length n have no consecutive
0s?
37

7. Let the sequence {an } be defined by a1 = 1, a2 = 2, and an = an−1 + 2an−2 for n ≥ 3.


Find a closed formula for an .
8. Let the sequence {an } be defined by a1 = 1, a2 = 3, and an = 4an−1 − 3an−2 for all
n ≥ 3. Find a closed formula for an .
9. Let f1 (x) = 2x + 1 and fn = f1 ◦ fn−1 for n ≥ 2. Find a closed formula for fn (x).
1
10. Let f1 (x) = and fn = f1 ◦ fn−1 for n ≥ 2. Find a closed formula for fn (x).
2−x
11. The units digit of a number ab can be found by computing the units digits of the first
few powers of a, i.e. a1 , a2 , a3 , etc. and noticing a pattern. Find the units digit of the
following numbers.
(a) 107107
(b) 12345678
12. Find the last two digits of 750 .
13. Find the remainder of 2100 upon division by 12.
14. Find the remainder of 54321 upon division by 11.

15. Find the n-th derivative of


(a) f (x) = sin(x),
(b) g(x) = ln(x),
(c) h(x) = 2e5x .

16. Suppose that n lines in general position are given in a plane. (General position means
that no two lines are parallel, and no three lines have a common point.) Into how many
regions do they divide the plane?
17. Suppose that n circles are given in a plane, such that every pair of circles has 2 inter-
section points, but no 3 circles have a common point. Into how many regions do they
divide the plane?
18. Suppose we are given ten planes in a general position (i.e. no two are parallel, no
three are parallel to the same line, no four have a common point). Into how many
(3-dimensional) regions do they divide R3 ?

19. Let F0 = 0, F1 = 1, F2 = 1, . . ., F99 be the first 100 Fibonacci numbers (recall that
Fn = Fn−1 + Fn−2 for n ≥ 2).
(a) How many of them are even?
(b) How many of them are divisible by 3?
(c) How many of them are divisible by 5?

20. Amanda is training her rabbit to climb a flight of 10 steps. The rabbit can hop up 1 or
2 steps each time he hops. He never hops down, only up. In how many different ways
can he hop up the flight of 10 steps?
38 CHAPTER 6. FINDING A PATTERN
Chapter 7

Working backwards

“Working backwards” is a very powerful tool that can be used to solve many different prob-
lems.

Theorem 7.1. Let a and b be nonzero integers, and let d = gcd(a, b). Then there exist
integer numbers x and y such that x · a + y · b = d. When we find such integers x and y, we
say that we wrote d as a linear combination of a and b.

Euclid’s algorithm. Given integers a and b, where b 6= 0, we can divide a by b and obtain
quotient q and remainder r. Notice that since a = qb + r, the greatest common divisor of
a and b is equal to the greatest common divisor of b and r. Euclid’s algorithm of finding
gcd(a, b) and expressing it as a linear combination of a and b is based on this fact:

a = q1 · b + r1 , r1 < b, (a, b) = (b, r1 ), r1 = a − q1 · b,


b = q2 · r1 + r2 , r2 < r1 , (b, r1 ) = (r1 , r2 ), r2 = b − q2 · r1 ,
r1 = q3 · r2 + r3 , r3 < r2 , (r1 , r2 ) = (r2 , r3 ), r3 = r1 − q3 · r2 ,
... ↓ ... ... ... ↑
rn−2 = qn · rn−1 + rn , rn < rn−1 , (rn−2 , rn−1 ) = (rn−1 , rn ), rn = rn−2 − qn · rn−1 ,
rn−1 = qn+1 · rn , rem. = 0, (rn−1 , rn ) = rn .

Thus gcd(a, b) = rn . Now we can work backwards using the equations on the right to
express rn as a linear combination of a and b.

Example 7.2. Find the greatest common divisor d of a = 115 and b = 80, and find x and
y such that x · a + y · b = d.

Solution. First perform divisions to find the greatest common divisor:

115 = 1 · 80 + 35,
80 = 2 · 35 + 10,
35 = 3 · 10 + 5,
10 = 2 · 5.

Therefore gcd(a, b) = 5.
Note. To find gcd(a, b), we could simply factor 115 = 5·23, 80 = 24 ·5, so gcd(115, 80) = 5.
However, we need the above divisions to find the desired linear combination:

39
40 CHAPTER 7. WORKING BACKWARDS

5 = 35 − 3 · 10,
10 = 80 − 2 · 35,
35 = 115 − 1 · 80,

so

5 = 35 − 3 · 10
= 35 − 3(80 − 2 · 35) = 35 − 3 · 80 + 6 · 35 = 7 · 35 − 3 · 80
= 7(115 − 1 · 80) − 3 · 80 = 7 · 115 − 7 · 80 − 3 · 80 = 7 · 115 − 10 · 80.

Thus x = 7 and y = −10.


Example 7.3. Suppose four 1s and five 0s are written along a circle. Between every two
equal numbers we write 1 and between two distinct numbers we write 0. Then the original
numbers are wiped out. For example, a possible initial distribution of ones and zeros and
the first step are shown below:

0 0
0 0 0 0
1 1 1 1
1 0 1 0
1 0 1 0
1 1
0 0
0 0 0 0
0 1 0 1
1 0 1 0
0 0

This step is repeated indefinitely. Show that we can never reach nine 1s.
Solution. Suppose that nine 1s are attainable. Look at the first time we have nine 1s. One
step before that we must have nine equal numbers. Since it was the first time we got nine 1s,
one step before we must have nine 0s. Still one step before we have nine changes from 0 to 1
or from 1 to 0. In other words, the 0s and 1s are alternating. However, with an odd number
of integers, this is not possible. We have a contradiction.
Example 7.4. Two players play the following game. There are initially 10 counters in a
pile. The players take turns removing 1 or 2 counters. The game ends when all counters have
been removed. The player who takes the last counter loses. Find a winning strategy for one
of the players.
Solution. We do not want to take the last counter as then we would lose. On our last turn
we want to leave one counter so that to force our opponent to take it. We will call leaving one
counter a good position. We would not want to leave two counters after our move as then our
opponent can take one and get into a winning positions. We will call leaving two counters
a bad position. Similarly, we would not want to leave three counters after our move as our
opponent can take two and leave just one. So leaving three counters is also a bad position.
However, leaving four counters is a good position: our opponent can take one or two, leaving
three or two, respectively, and we already know that these are bad positions (and we want to
force our opponent to go to such). So leaving four counters is a good position. Continuing in
this manner, we will find that 5 and 6 are bad positions, 7 is good, 8 and 9 are bad, and 10
41

is good. This means that we want to go second. Our opponent will make the first move and
be forced to go to a bad position. Then, we make sure that we go to a good position on every
move.

Note. In the above game, the initial number of counters was rather low and it was quick to
classify all possible positions. If the initial number was higher, we would want to find a more
general approach. Often, we can work out a few positions and notice a pattern. In the above
case, notice that no matter how our opponent plays, we can always play in such a way that
the number of counters our opponent takes plus the number of counters we take is equal to 3
(namely, if they take 1, we can take 2; if they take 2, we can take 1). Since we want to leave
just one counter in the end, we should always leave a number that is congruent to 1 modulo
3. Since the initial amount, 10, is congruent to 1 modulo 3, we want to go second.

Problems

1. Use Euclid’s algorithm to find the greatest common divisor d of the given numbers a
and b, and find numbers x and y such that xa + yb = d.

(a) a = 46, b = 32
(b) a = 24, b = 10
(c) a = 96, b = 54
(d) a = 219, b = 51

2. Find integer numbers a and b such that 6 = 67a + 25b.

3. Find a and b such that in Euclid’s algorithm r7 = (a, b). Write out all the divisions.

4. Find a > 1000 and b > 1000 such that it will take exactly 5 divisions to reach the
greatest common divisor of a and b.

5. Find positive a and b such that it will take at least 5 divisions to reach the greatest
common divisor of a and b with the smallest possible number a and b < a.

6. In the sequence an , each term starting with the third is the sum of the two previous
terms. Find a1 and a2 such that a5 = 17 and a7 = 76.

7. Consider the function f : Z → Z defined by


( x
if x is even,
f (x) = 2
3x + 1 if x is odd.

Find all values of x for which f 5 (x) = 1.

8. Consider the function f : Z → Z defined by



2x − 11 if x is even,
f (x) =
3x − 11 if x is odd.

Prove that there is no value of x for which f 5 (x) = 141.


42 CHAPTER 7. WORKING BACKWARDS

9. The integers 1, 2, . . . , n are placed in order, so that each value is either bigger than all
preceding values or is smaller than all preceding values. In how many ways can this be
done?
10. Consider all sequences {a1 , a2 , a3 , . . . , a7 } that have the following property: the dif-
ference between any two consecutive terms is 1, that is, ak+1 = ak ± 1. How many
sequences with this property have a7 = 10?
11. Starting with 1, 2, 3, 4, we construct the sequence 1, 2, 3, 4, 0, 9, 6, . . . , where each
new digit is the mod 10 sum of the preceding four terms. Prove that the 4-tuple 0, 5,
0, 5 will never occur.
12. Starting with 1, 2, 3, 4, we construct the sequence 1, 2, 3, 4, 0, 9, 6, . . . , where each
new digit is the mod 10 sum of the preceding four terms. Will the 4-tuple 0, 6, 5, 0
ever occur?
13. Two players play the following game. There are initially 27 counters in a pile. The
players take turns removing 1, 2, 3, or 4 counters. The game ends when all counters
have been removed. The player who takes the last counter loses. Find a winning
strategy for one of the players.
14. Two players play the following game. There are initially 27 counters in a pile. The
players take turns removing 1, 2, 3, or 4 counters. The game ends when all counters
have been removed. The player who takes the last counter wins. Find a winning
strategy for one of the players.
15. Two players play the following game. There are initially 10 counters in a pile. The
players take turns removing 1, 2, or 4 counters. The game ends when all counters have
been removed. The player who takes the last counter wins. Find a winning strategy
for one of the players.
16. Two players play the following game. There are initially 15 counters in a pile. The
players take turns removing 2, 3, or 4 counters. The game ends when a player cannot
make a move. The player who made the last move wins. Find a winning strategy for
one of the players.
17. Two players play the following game. There are initially 50 counters in a pile. The
players take turns removing 1, 2, 4, 8, 16, or 32 counters. The game ends when all
counters have been removed. The player who takes the last counter wins. Find a
winning strategy for one of the players.
18. Two players play the following game. Initially X = 0. The players take turns adding
any number between 1 and 10 (inclusive) to X. The game ends when X reaches 100.
The player who reaches 100 wins. Find a winning strategy for one of the players.
19. Two players play the following game. A box initially contains 300 matches. The players
take turns removing some (more than zero) but no more than half of the matches in
the box. The player who cannot take any matches loses. Find a winning strategy for
one of the players.
20. Two players play the following game. There are two piles of candy. Initially one pile
contains 20 pieces, and the other 21. The players take turns eating all of the candy
in one pile and separating the remaining candy into two (not necessarily equal) piles.
(A pile may have 0 candies in it.) The player who cannot eat a candy on his/her turn
loses. Find a winning strategy for one of the players.
43

21. Two players play the following game. The number 55 is written on the board. The
players take turns subtracting from the number on the board any of its positive divisors,
and replacing the original number with the result of this subtraction. The player who
writes the number 0 loses. Find a winning strategy for one of the players.

22. The game begins with the number 1000. Two players take turns subtracting from the
current number any natural number that is a power of 2 and less than the current
number. (Note that 1 is a power of 2, since 1 = 20 .) The player who reaches the
number 1 wins. Find a winning strategy for one of the players.

23. The game begins with the number 2. Two players take turns adding to the current
number any natural number smaller than it. The player who reaches the number 1000
wins. Find a winning strategy for one of the players.

24. Initially X = 1. Two players take turns multiplying X by any whole number from 2
to 9 (inclusive). The player who first names a number greater than 1000 wins. Find a
winning strategy for one of the players.

25. A counter is placed in the upper right corner of a 7 × 7 board. Two players take turns
moving the counter. It can be moved only one square to the left, one square down, or
diagonally one to the left and one down. The winner is the player who puts the counter
in the bottom left corner. Determine all winning positions for this game (that is, the
“good” positions: the positions to which you would want to move the counter on your
move). Find a winning strategy for one of the players.

26. A counter is placed in the upper right corner of a 7 × 8 board. Two players take
turns moving the counter. It can be moved any number of spaces to the left, down, or
diagonally to the left and down. The winner is the player who puts the counter in the
bottom left corner. Determine all winning positions for this game (that is, the positions
to which you would want to move the counter on your move). Find a winning strategy
for one of the players.

27. A counter is placed in one of the squares of an 8 × 8 board. Two players take turns
moving the counter. It can be moved one space to the left, or one space down, or any
number of spaces diagonally to the left and down. The winner is the player who puts
the counter in the bottom left corner. Determine all winning positions for this game
(that is, the positions to which you would want to move the counter on your move).
Which player (first or second) has a winning strategy, depending on where the counter
is placed initially?

28. A counter is placed in one of the squares of an 8 × 8 board. Two players take turns
moving the counter. It can be moved any number of spaces to the left, any number
of spaces down, or just one space diagonally to the left and down. The winner is the
player who puts the counter in the bottom-left corner. Determine all winning positions
for this game (that is, the positions to which you would want to move the counter on
your move). Which player (first or second) has a winning strategy, depending on where
the counter is placed initially?

29. There are two piles of counters, both containing 6 counters. Two players take turns
taking either one counter from one of the piles, or one counter from each pile. The
player who cannot make a move loses. Determine all winning positions for this game
(i.e. how many counters you would want to leave in each pile after your move) and
which player has a winning strategy.
44 CHAPTER 7. WORKING BACKWARDS

30. There are two piles of counters. One contains 6 counters and the other one contains 7
counters. Two players take turns taking either any number of counters from one of the
piles, or an equal number from each pile. The player who cannot make a move loses.
Determine all winning positions for this game (i.e. how many counters you would want
to leave in each pile after your move) and which player has a winning strategy.

31. There are two piles of 7 counters each, pile A and pile B. Two players take turns taking
either a single counter from one of the piles, or one counter from each pile, or taking
one counter from pile A and placing it in pile B. The player who cannot move loses.
Determine all winning positions for this game (i.e. how many counters you would want
to leave in each pile after your move) and which player has a winning strategy.

32. A regular 6-sided die, in which the sum of the numbers on any two opposite faces is 7,
is rolled. The game begins with the number on the top face. Two players take turns
turning the die to the side and adding the number on the new top face to the previous
sum. Note: the die must be turned at each move, but only by 90 degrees (it cannot be
turned over). The player who first obtains a sum larger than 31 loses. Determine all
winning positions for this game and which player has a winning strategy.

33. Suppose you are writing a set of calculus exercises. You want to find a few cubic
polynomials f (x) = ax3 + bx2 + cx + d (preferably with integer coefficients) whose
critical numbers are integers. (Recall that a critical number is a value of x at which
the derivative is equal to 0.) How would you find such polynomials? Use your strategy
to find a couple of polynomials.

34. Suppose you want to give your high school students a system of two linear equations
with two variables. You would like the system to have one solution which is a pair of
integers. You could, of course, try random coefficients, say

2x + 3y = 4
,
5x − 6y = 7

solve your systems, and hope that sooner or later you will find a system with one integer
pair solution, but is there a better strategy?
35. Suppose you are teaching linear algebra, and you need to find matrices with integer
entries whose reduced echelon forms also have integer entries. How would you find such
matrices?
Chapter 8

Invariants

Definition 8.1. An invariant is a quantity or a property that does not change.


Example 8.2. The numbers 1, 2, . . . , 10 are written on a board. We pick any two numbers,
let us call them a and b. We erase these numbers, and write a + 1 and b − 1 instead. Is it
possible to get ten 5s by a sequence of such operations?
Solution. Notice that when we increase a by 1 and decrease b by 1, their sum does not
change. Therefore, the sum of all ten numbers does not change (so in this example the sum
of the ten numbers is an invariant). Initially the sum is 1 + 2 + · · · + 10 = 55, however,
10 · 5 = 50, therefore it is not possible to get ten 5s.
Here are a few quantities that are very often invariants in problems involving sets of
numbers and allowed operations, so you may want to try to look at them. Sometimes, of
course, you have to be very creative!
• The sum or the product of all given numbers.
• The number of positive or negative numbers.
• The number of even or odd numbers, or, more generally, the number of numbers con-
gruent to a modulo b for some integers a and b.
• One of the above modulo a positive number (e.g. the sum modulo 2, i.e. the parity of
the sum; the product modulo 3; the number of positive numbers modulo 4; etc.).
Sometimes it is useful to introduce a change even if none was given in the problem itself.
Example 8.3. Each of the numbers a1 , a2 , . . . , an is either 1 or −1, and

a1 a2 a3 a4 + a2 a3 a4 a5 + · · · + an−3 an−2 an−1 an + an−2 an−1 an a1 + an−1 an a1 a2 + an a1 a2 a3 = 0.

Prove that 4 | n.
Solution. Let

S = a1 a2 a3 a4 + a2 a3 a4 a5 + · · · + an−3 an−2 an−1 an + an−2 an−1 an a1 + an−1 an a1 a2 + an a1 a2 a3 .

Observe that if we replace ai by −ai , then S does not change modulo 4 since four terms (the
ones containing ai ) change their sign. Indeed, if all four terms have the same sign, then their
sum changes either from −4 to 4 or from 4 to −4, thus S changes by ±8. If one or three

45
46 CHAPTER 8. INVARIANTS

of these four terms are positive, then the sum of the four terms changes either from −2 to
2 or from 2 to −2, thus S changes by ±4. Finally, if two of these four terms are positive
and two are negative, then the sum does not change. Initially, we have S = 0 which implies
S ≡ 0 (mod 4). Now, step-by-step, we can change each −1 into a 1. At the end, we have
S = n, and we must still have S ≡ 0 (mod 4), so 4 | n.
Sometimes a quantity that may change is useful as well. Especially if it can change
only in a certain way, say, it can only increase or decrease. A quantity that only changes
monotonically is called a monoinvariant. For instance, in the example below we find a
positive decreasing function rather than a constant function. The idea is that the value of
that function must be nonnegative. We apply a series of steps each of which decreases the
value of the function. Since the value cannot become negative, sooner or later it will reach 0.
Example 8.4. Suppose that 2n ambassadors are invited to a banquet. Every ambassador
has at most n − 1 enemies. Prove that the ambassadors can be seated around a round table
so that nobody sits next to their enemy.
Solution. First, we seat the ambassadors randomly. Let H be the number of neighboring
hostile couples. We want to find an algorithm which reduces this number whenever H > 0.
Let {A, B} be a hostile couple with B sitting to the right of A:

A B
We want to separate them so as to not gain any new neighboring hostile couples. This
can be achieved by reversing some arc BC as shown below. The number H will be reduced if
{A, C} and {B, D} are friendly couples.

D D
C B

A B A C
It remains to be shown that such a couple {C, D} always exists. We start at A and go
around the table counterclockwise. We will encounter at least n friends of A. To their right,
there are at least n seats. They cannot all be occupied by enemies of B since B has at most
n − 1 enemies. Thus there is a friend C of A with the right neighbor D being a friend of B.

Problems
Some problems below deal with a list (e.g. of numbers). By a list we mean an unordered
collection, with repetition allowed.
47

1. We start with the list {−3, −2, −1, 1, 2, 3}. In each step we may choose any two of these
numbers and change their signs. We may repeat this step as many times as we want.
Show that it is not possible to reach the list {3, 2, 1, 1, 2, 3}.

2. We start with the list {−3, −2, −1, 1, 2, 3}. In each step we may multiply or divide any
of these numbers by any positive number. We may repeat this step as many times as
we want. Show that it is not possible to reach the list {−2, −1, 1, 2, 3, 4}.

3. We start with the list {1, 1, 1, 1}. In each step we may either multiply one of the
numbers by 3, or subtract 2 from it. We may repeat this step as many times as we
want. Is it possible to reach the list {1, 2, 3, 4}?

4. We start with the list {1, 4, 32, 128, 256}. In each step we may divide one number by
2 and multiply another number by 2. We may repeat this step as many times as we
want. Is it possible to reach the list {512, 32, 16, 16, 2}?

5. Initially 1 is written in every cell of a 5 × 5 table. In each step we may change the signs
of the numbers in any two adjacent cells. We may repeat this step as many times as
we want. Is it possible to make all of the numbers −1?

6. We start with the list {1, 2, 3, 4, 5, 6}. In each step we may either add 2 to any 5
numbers or subtract 1 from any 5 numbers. We may repeat this step as many times as
we want. Can we reach the list {1, 2, 4, 8, 16, 32}?

7. We start with the list {1, 2, 3, 4}. In each step we may either add 2 times one of the
numbers to another number or subtract 2 times one number from another number. For
example, we may replace 1 by 1 + 2 · 2, or by 1 − 2 · 2, or by 1 + 2 · 3, etc. We may
repeat this step as many times as we want. Can we reach the list {10, 20, 30, 40}?

8. We start with the list {1, 2, 3, 5, 8, 13}. At each step, we may choose any two or three
numbers from this list and replace each of them by their average. For example, we
2 + 3 + 13
could choose 2, 3, and 13, and replace each of them by = 6 to obtain
3
{1, 5, 6, 6, 6, 8}. We may repeat this step as many times as we want. Is it possible to
obtain the list {5, 5, 5, 5, 5, 5}?

9. Six stacks of coins are placed on the table. The first has 1 coin, the second 2, and so
on, until the last, which has 6 coins. We are allowed to select any two stacks and add
one coin to each. We may repeat this operation as many times as we want. Can we
make all the stacks equal?

10. We start with the table shown below. In one step we may either add 1 to all the numbers
in any row or column, or subtract 1 from all the numbers in any row or column. We
may repeat this step as many times as we want.

0 0 0
0 1 0
0 0 0

(a) Prove that it is not possible to reach nine 0s.


(b) Prove that it is not possible to reach nine odd numbers.
48 CHAPTER 8. INVARIANTS

11. There are several + and − signs written on a board. We may erase any two signs and
write, instead, + if they are equal and − if they are unequal. We do this until only one
sign remains. Prove that the last sign on the board does not depend on the order of
erasure.

12. Assume we have an 8 × 8 chessboard with the usual coloring. We may switch the colors
of all the squares in any row or column. We may repeat this step as many times as we
want. The goal is to attain just one black square. Can we reach the goal? What if we
are allowed to switch the colors of all the squares in any 2 × 2 square?

13. Each of the numbers from 1 to 1,000,000 is repeatedly replaced by its digital sum until
we reach 1,000,000 single-digit numbers. For example, 987654 is replaced by 39 (since
9 + 8 + 7 + 6 + 5 + 4 = 39), then 39 is replaced by 12 (since 3 + 9 = 12), and finally, 12
is replaced by 3 (since 1 + 2 = 3). Among these 1,000,000 single-digit numbers, will we
have more 1s or 2s?

14. We may write all the digits from 1 to 9 in a row in any order we like, and then we write
plus signs between some digits (as many plus signs as we like). For example, we could
write 7 + 35 + 19 + 4 + 286. Finally, we evaluate the obtained expression. Prove that
there is no way to get the value of 100. Or 101. Or 102. Or 103... What is the smallest
three-digit number that can be obtained in this process?

15. We compute and write out the number 71234 . Then we strike its first digit and add it
to the remaining number. Suppose that this step is repeated until a number with ten
digits remains. Prove that this number has at least two equal digits.

16. Alice and Bob have a large chocolate bar in the shape of a rectangular grid. They play
a game where Alice goes first, then Bob, and then their turns alternate. At each turn
a player may either eat an entire bar of chocolate or break any chocolate bar into two
smaller rectangular chocolate bars along a grid line. The player who moves last loses.
Who wins this game?

17. Let n be any positive integer. We start with the integers 1, 2, . . . , 4n − 1. In each step
we may replace any two integers by their difference. We do this until only one number
remains. Prove that an even integer will be left after 4n − 2 steps.

18. Let n be an odd positive integer. We start with the numbers 1, 2, 3, . . . , 2n. In each
step we may replace any two integers by their difference. We do this until only one
number remains. Prove that an odd number will remain at the end.

19. The numbers from 0 to 9 are written along a circle in random order. Between every two
neighboring numbers a and b (in the clockwise order) we write 2b − a. Then we erase
the original ten numbers. (For example, the numbers could be written in the following
order: 1, 5, 3, 9, 0, 2, 4, 6, 8, 7. Then the new numbers would be 9, 1, 15, −9, 4, 6, 8,
10, 6, −5.) This step can be repeated as many times as we want. Show that it is not
possible to reach ten 5s.

20. We start with the list {1, 3, 6}. In each step we may choose any two of these numbers,
let’s call them a and b, and replace them by 0.6a − 0.8b and 0.8a + 0.6b. We may repeat
this step as many times as we want. Can we reach the list {2, 4, 5}?

21. We arrange the integers 1, 2, 3, 4, 5, 6 in any order on six places numbered 1 through 6.
Next we add each number to its place. Prove that at least two of the sums have the
same remainder upon division by 6.
49

22. There are seven 1s and eight −1s on a board. In each step we may erase any two
numbers, say, a and b, and write −ab instead. We do this until only one number
remains. Show that no matter in what order we erase the numbers, 1 will remain in
the end.
23. A circle is divided into six sectors. Some 0s and 1s are written into the sectors as shown
below. We may increase any two neighboring numbers by 1. We may repeat this step
as many times as we want. Is it possible to equalize all the numbers?
(a) (b)

1 1
0 0 0 0
1 1 0 1
0 0

24. In each table below, we may switch the signs of some numbers as indicated. We may
repeat this step as many times as we want. Prove that at least one −1 will always
remain in the table.
(a) We may switch the signs of all the numbers in any row, any column, or any
diagonal.
−1 1 −1 1
1 1 1 1
−1 1 −1 1
1 1 1 1
(b) We may switch the signs of all the numbers in any row, any column, or on any line
parallel to a diagonal (see pictures below; note that in particular, we may switch
the sign of each corner square).

−1 1 −1 1
1 1 1 1
−1 1 −1 1
1 1 −1 1

Examples of lines parallel to a diagonal.


25. There are a white, b black, and c red chips on a table. In one step we may choose two
chips of different colors and replace them by one chip of the third color. We do this
until all remaining chips are of the same color. If only one chip remains, prove that
its color does not depend on the evolution of the game, but it only depends on the
numbers a, b, and c.
50 CHAPTER 8. INVARIANTS

26. (a) On the island of Camelot live 12 gray, 17 green, and 19 crimson chameleons. If
two chameleons of different colors meet, they both simultaneously change color to
the third color (e.g., if a gray chameleon and a green chameleon meet each other,
they both change to crimson). Is it possible that at some point they all become
gray? How about all green? All crimson? Is it possible that there will eventually
be the same numbers of gray, green, and crimson chameleons?
(b) Same questions as above for 13 gray, 17 green, and 19 crimson chameleons.
27. There is a mob of 3000 people, one of whom is a zombie while the other 2999 are not.
Every minute, all 3000 people form 1000 groups of three. If there are any zombies in a
group of three, all three end up zombies. What is the probability that after five minutes
there will be exactly 100 zombies in the mob?
28. There are several letters a, b, and c on a board. We may replace: two a’s by one b, two
b’s by one a, two c’s by one c, an a and a b by one c, an a and a c by one a, or a b and
a c by one b. We do such replacements until only one letter remains. Prove that this
last letter does not depend on the order of erasure.

29. A dragon has 100 heads. A knight can cut off 5, 15, 17, or 20 heads, respectively, with
one blow of his sword. In each of these cases 17, 24, 2, or 14, new heads grow on its
shoulders, respectively. If all heads are blown off, the dragon dies. Can the dragon ever
die?
30. There is an integer in each square of an 8 × 8 board. In one move, we may choose any
4 × 4 or 3 × 3 square and add 1 to each integer in the chosen square. Can we always
get a board with each entry being even?
31. (a) In a regular pentagon all diagonals are drawn. Initially each vertex and each
point of intersection of the diagonals is labeled by the number 1. In one step it is
permitted to change the signs of all numbers on a side or a diagonal. Is it possible
to change all labels to −1 by a sequence of such steps?
(b) Same problem for a regular hexagon.
32. We start with the list of numbers {1, 5, 25, 125, 625}. In each step, we may choose any
two of these numbers, let’s call them a and b, and replace them either by a + 1 and
b − 1, or by a + 3 and b − 2. We may repeat this step as many times as we want. Is it
possible to obtain the list {145, 150, 155, 160, 165}?
33. Nine 1 × 1 cells of a 10 × 10 square are infected. Two cells are called neighbors if they
have a common side. In one time unit, the cells with at least two infected neighbors
become infected. Can the infection spread to the whole square (in any amount of time)?
34. Twelve 1 × 1 cells of a 10 × 10 square are infected. Two cells are called neighbors if they
share at least one vertex (thus an inner cell has 8 neighbors). In one time unit, the
cells with at least four infected neighbors become infected. Can the infection spread to
the whole square (in any amount of time)?
35. In the Parliament of Sikinia each member has at most three enemies. Prove that the
parliament can be separated into two houses so that each member has at most one
enemy in their own house.
Chapter 9

Coloring

Example 9.1. In 1961, the British theoretical physicist M. E. Fisher solved a famous and
very tough problem. He showed that an 8 × 8 chessboard can be covered by 2 × 1 dominoes
(with no dominoes overlapping or overhanging) in 24 · 9012 = 12,988,816 ways. Now let us
cut out two diagonally opposite corners of the board. In how many ways can we cover the
62 squares of the mutilated chessboard with 31 dominoes?
Solution. Zero. There is no way to cover the mutilated chessboard. Each domino covers
one black and one white square. If a covering of the board existed, the 31 dominoes would
cover 31 black and 31 white squares. However, the mutilated chessboard has 30 squares of
one color and 32 squares of the other color.
Example 9.2. A rectangular floor is covered by 2 × 2 and 4 × 1 tiles. One tile got smashed.
There is a tile of the other kind available. Show that the floor cannot be covered by rear-
ranging the tiles.
Solution. Let us color the floor as shown in the picture below. A 4 × 1 tile always covers
either 0 or 2 black squares. A 2 × 2 tile always covers one black square. Therefore it is
impossible to exchange one tile for a tile of the other kind.

Besides the colorings used in the above examples, the “stripe colorings” and the ”diagonal
colorings” shown below are often helpful.

51
52 CHAPTER 9. COLORING

Also, you can use the stripe or diagonal pattern with more colors; or the stripe pattern
with one stripe of one color followed by several stripes of another color; and so on. Of course,
sometimes you have to be creative and find your own coloring that would work for a particular
problem!

Problems

Some problems below deal with tiles. A tile consisting of 2 squares is called a domino, a
3-square tile is a tromino, a 4-square tile is a tetromino, and so on. Starting with trominoes,
there are different shapes possible, and we will use the following names for trominoes and
tetrominoes.

domino straight
tromino L-tromino

straight
tetromino T-tetromino square L-tetromino skew tetromino
tetromino

By covering a board with tiles we mean completely covering with no tiles overlapping or
overhanging.

1. Prove that the figure shown below (with the center square removed) cannot be covered
by dominoes.

2. Each square of a 9 × 9 board has a bug sitting on it. On a signal, each bug crawls onto
one of the squares which shares a side with the one the bug was on. Is it possible for
all the bugs to be on different squares now?

3. King Dodon announced a challenging chess problem with a prize of 1000 shmollars: “A
chess knight is at the bottom left corner of an 8 × 8 chessboard. Invent a sequence of
eleven chess-knight moves that brings the knight to the same spot where it started.”
This prize has not yet been claimed. Explain why.

4. A counter is placed in the upper-left square of an 8 × 8 chessboard. In one move, it can


be moved 1 square up, down, to the right, or to the left. Is it possible to move it so that
the counter visits every square of the board exactly once and ends in the lower-right
square?
53

5. A new chess piece called camel can move similarly to a knight, but in a (3, 1) pattern
instead of (2, 1). One allowed move is shown in the picture below. Can the camel get
from the top-left to the top-right corner of an 8 × 8 chessboard in a few moves?

6. In a game called Monorail, a rectangular grid (sometimes with one corner removed) of
points and some pieces of a “monorail” are given. The goal is to construct a monorail
(that is, a path) that goes through every point once, uses the given pieces, and makes
a closed loop. Below are two examples of given starting positions and solutions.
Example 1.

−→

Example 2.

−→

Why is a corner sometimes removed from the grid?

7. Prove that a 10 × 10 board cannot be covered by 25 T-tetrominoes.

8. Prove that a 10 × 10 board cannot be covered by 20 square tetrominoes and 5 T-


tetrominoes.

9. Prove that a 10×10 board cannot be covered by 15 T-tetrominoes and 10 L-tetrominoes.

10. Prove that a 10 × 10 board cannot be covered by 25 straight tetrominoes.

11. Prove that a 10 × 10 board cannot be covered by 25 L-tetrominoes.

12. Prove that an 8 × 8 board cannot be covered by 11 straight tetrominoes and 5 L-


tetrominoes.

13. Prove that an 8 × 8 board with one corner square removed (so, 63 squares remain)
cannot be covered by 21 straight trominoes.

14. Prove that a 15 × 8 board cannot be covered by 2 L-tetrominoes and 28 skew tetromi-
noes.

15. Prove that a 23 × 23 board cannot be covered by 2 × 2 and 3 × 3 tiles.


54 CHAPTER 9. COLORING

16. A 7 × 7 board is covered by sixteen 3 × 1 and one 1 × 1 tiles. What are the possible
positions of the 1 × 1 tile?

17. Is it always possible to cover a chessboard with two squares removed, one black and
one white, by 31 dominoes?

18. A rectangular board is covered by tetrominoes. Prove that the number of T-tetrominoes
is even.

19. The vertices and midpoints of the faces are marked on a cube, and all face diagonals
are drawn.

(a) Prove that there is no path along the face diagonals that visits each marked point
exactly once.

(b) Show that if one walk along an edge is allowed, then there is a path visiting all
the marked points. (Find such a path.)

20. The figure below shows a road map connecting 14 cities. Is there a path passing through
each city exactly once?

21. Prove that an a × b rectangle can be covered by 1 × n rectangles if and only if n|a or
n|b.

22. The map below shows the cities and one-way roads in Sikinia.

(a) Prove that there is no closed path (a path is closed if it starts and quits in the
same city) that visits every city exactly once.
(b) Is there a closed path that visits every city exactly twice?
55

(c) Is there a path, not necessary closed, that starts in the upper left corner and visits
every city exactly once?
(d) Is there a path, not necessarily closed, that starts in the upper left corner and
visits every city exactly twice?

23. Is it possible for a chess knight to pass through all the squares of a 123×4 board having
visited each square exactly once, and return to the initial square?
24. Show that it is not possible to cover any rectangle by one tile of type 1 shown below,
one tile of type 2, and any number of tiles of type 3.

1 2 3

25. Prove that there is no way to pack fifty-four 1 × 1 × 4 bricks into a 6 × 6 × 6 box.
26. Show that if 4 × 1 × 1 bricks and 2 × 2 × 2 cubes fill an 8 × 8 × 8 cube, then the number
of 2 × 2 × 2 cubes is even.
27. Is it possible to write distinct natural numbers from 1 to 16 in the small triangles in
the figure below so that the sum of the two numbers in any two triangles that have a
common side is prime?
56 CHAPTER 9. COLORING

28. (a) A bug sits on each square of a 9 × 9 board. On a signal each bug crawls onto a
neighboring square (so that the old square and the new square share a side). It
may happen that several bugs will sit on some squares and none on others. Find
the smallest possible number of free squares.
(b) What if each bug crawls diagonally onto a neighboring square (that is, the old
square and the new square share only a vertex)?
29. The figure on the left below shows the top view of five heavy boxes which can be
displaced only by rolling them about once of their edges. Their tops are labeled by the
letter T. The figure on the right shows the same five boxes rolled into a new position.
Which box in this row was originally at the center of the cross?

T
T T T T T T T
T

30. One corner of a (2n + 1) × (2n + 1) board is cut off. For which values of n is it possible
to cover the remaining squares by dominoes so that exactly half of the dominoes are
horizontal?
Chapter 10

Graphs

Definition 10.1. A graph is an object consisting of a set of points called vertices, some
of which are connected by lines (or arcs) called edges.

Definition 10.2. A graph is simple if any 2 vertices are connected by at most one edge
and there are no loops (edges starting and ending at the same vertex).
Definition 10.3. If the edges are oriented, then we have an oriented or directed graph.
An example of an oriented graph is a one-way road system.

Definition 10.4. If an edge e connects the vertices v1 and v2 , then we say that v1 and v2
are the endpoints of e and we write e = (v1 , v2 ). Also, we say that v1 and v2 are adjacent
vertices. If two edges e1 and e2 share a common vertex, then we say that e1 and e2 are
adjacent edges. A vertex v has degree m if m endpoints of edges coincide with v (a loop
contributes 2 to the degree of a vertex).
Theorem 10.5. In any graph, the sum of the degrees of the vertices equals twice the number
of the edges.
Corollary 10.6. In any graph, the number of vertices with odd degrees is even.
Definition 10.7. An undirected graph in which every two distinct vertices are connected
by exactly one edge is called a complete graph. Kn denotes the complete graph with n
vertices. The graphs K2 , K3 , K4 , and K5 are shown below.

57
58 CHAPTER 10. GRAPHS

Definition 10.8. If the vertices of a graph can be separated into two parts X and Y so that
for every edge in the graph, one of its endpoints belongs to X and the other belongs to Y ,
then we call such a graph a bipartite graph.

X
Definition 10.9. If every vertex in the set X is connected to every vertex in the set Y by
exactly one edge, then the graph is called a complete bipartite graph. Km,n denotes the
complete bipartite graph with m vertices in the set X and n vertices in the set Y . The graphs
K2,4 and K3,3 are shown below.

Definition 10.10. A graph is called planar if it is possible to draw it in such a way that
no two edges intersect. For example, the graph K4 is planar.

Theorem 10.11. Graphs K5 and K3,3 are not planar.


Definition 10.12. A path is a sequence of edges e1 , e2 , . . ., en such that e1 = (x0 , x1 ),
e2 = (x1 , x2 ), . . ., en = (xn−1 , xn ). When there are no multiple edges connecting the same
vertices in a graph, a path can be denoted by its vertex sequence x0 , x1 , . . . , xn . A path
that begins and ends at the same vertex is called a cycle. A path is simple if it does not
contain the same edge more than once.
Definition 10.13. An Euler path (resp. Euler cycle) is a simple path (resp. cycle)
containing every edge of the graph.
Theorem 10.14. A connected graph has an Euler cycle if and only if each of its vertices
has an even degree.
Definition 10.15. A Hamilton path (resp. Hamilton cycle) is a simple path (resp.
cycle) visiting every vertex exactly once. (Note: in a cycle, the first and last vertices must
coincide, so the start and finish count as one “visit.”)
Definition 10.16. If all vertices of a graph can be visited by walking on edges, the graph is
connected.
59

Definition 10.17. A connected graph without simple cycles is called a tree. Below is an
example of a tree.

Example 10.18. Assume that in a group of people, any two either both know each other
or both do not know each other. Prove that in any subset containing six people either there
are three people that all know each other or there are three people that all do not know each
other.

Solution. Let’s translate this problem into a graph theory problem. Let six vertices a, b, c,
d, e, and f represent the six people. If two people know each other, then we use a red edge
to join these two vertices. If two people do not know each other, then we use a blue edge to
join these two vertices. Since there are edges between every two vertices in the graph, it’s a
complete graph K6 with red and/or blue edges. Now the problem has been translated into the
following problem.
Suppose each edge in the complete graph K6 is colored either red or blue. Prove that there
exist either three vertices such that the edges joining them are all red or three vertices such
that the edges joining them are all blue.
To prove the above statement, we pick any vertex in K6 , let’s call it a. The five edges between
this vertex and the other five vertices are each either red or blue. According to Dirichlet’s
Principle, at least three edges of the five have the same color. Let b, c, and d be the other
endpoints of such edges. Without loss of generality, let’s assume that edges (a, b), (a, c), (a, d)
are red. Now consider the triangle bcd. If one of the edges (b, c), (b, d), (c, d) is red, then we
have a red triangle. Otherwise, if (b, c), (b, d), (c, d) are all blue, then the triangle bcd is a
blue triangle. This proves that there exists a triangle all of whose edges are colored with the
same color.

Example 10.19. Is it possible to draw “a triangular map” inside a pentagon so that the
degree of each vertex is even? (See problem 13 in chapter 2 for a definition of a map. A map
is called triangular if every region is a triangle. Below is an example of a triangular map
inside a pentagon, however, some vertices have an odd degree.)
60 CHAPTER 10. GRAPHS

Solution. The answer is no. We will prove this by contradiction. Suppose such a map exists.
We know (see problem 13 in chapter 2) that every map with all vertices of even degree admits
a proper coloring, i.e. its regions can be colored with 2 colors so that no neighboring regions
have the same color. Color our map in blue and red so that the (infinite) region outside of
the pentagon is blue. All the other regions are triangles. Each edge has a red triangle on one
side and a blue region (either a triangle or that infinite outside region) on the other side.
Now, count the number of edges (boundaries) in the map in two ways: each red triangle has 3
sides, so the number of edges is a multiple of 3, say, 3n. Each blue triangle has 3 sides, and
the infinite region has 5 edges, so the number of edges is a multiple of 3 plus 5, say, 3m + 5.
Thus we have 3n = 3m + 5 where n and m are integers. But this is impossible.

Problems

1. Explain why a graph cannot have seven vertices of degrees 2, 2, 3, 3, 3, 4, 4.


2. (a) Does there exist a graph with four vertices of degrees 1, 1, 1, and 5?
(b) Does there exist a simple graph with four vertices of degrees 1, 1, 1, and 5?
3. (a) Does there exist a graph with eight vertices of degrees 0, 1, 2, 3, 4, 5, 6, 7?
(b) Does there exist a simple graph with eight vertices of degrees 0, 1, 2, 3, 4, 5, 6, 7?
4. (a) Does there exist a graph with six vertices of degrees 1, 2, 3, 4, 5, 5?
(b) Does there exist a simple graph with six vertices of degrees 1, 2, 3, 4, 5, 5?
5. A graph has five vertices of degrees 2, 2, 3, 3, 4. How many edges does it have? Draw
an example of such a graph.
6. A graph has six vertices of degrees 2, 3, 4, 4, 5, and 6. How many edges does it have?
Draw two different examples of such graphs.
7. In a certain kingdom, there are 100 cities, and some pairs of them are connected by
roads. Four roads lead out of each city. How many roads are there altogether in the
kingdom?
8. In a certain kingdom, some pairs of cities are connected by roads. If exactly three roads
lead out of each city, can the kingdom have exactly 100 roads?
9. A simple graph has six vertices. The degrees of five of them are 1, 2, 3, 4, and 5. What
is the degree of the sixth vertex?
10. The Math Club at the Smart University consists of seven students who like to write
papers together. Every club member has written a joint paper with at least one other
club member. Each club member counted the number of other club members with
whom they have a joint paper. Six of these numbers are: 1, 2, 3, 4, 5, and 6. What is
the seventh number?
11. There are ten people in a chess club. Each counted the number of other members of
the club with whom they have played chess. Nine of the numbers are 4, 4, 4, 4, 5, 9, 9,
9, and 9. With how many people did the tenth person play?
12. In a graph with 8 vertices and 15 edges, the degrees of any two vertices either are equal
or differ by 1. What are the degrees, and how many vertices of each degree are there?
61

13. There are eight counties in Sikinia. There are no “four corners” points (like Arizona,
Colorado, New Mexico, and Utah). Each county counted the number of neighboring
counties. The numbers are 5, 5, 4, 4, 4, 4, 4, 3. Prove that at least one county made a
mistake.
14. Can nine line segments be drawn in the plane, each of which intersects exactly 3 others?
15. Prove that in any group of people, the number of people that are mutual friends with
an odd number of people is even.
16. Find the number of vertices and edges in Kn and Kn,m .
17. In the country of Fifteen there are 15 towns, each of which is connected to at least 7
others by roads. Prove that one can travel (by these roads) from any town to any other
town, possibly passing through some towns in between.
18. Prove that a simple graph with n vertices, each of which has degree at least (n − 1)/2,
is connected.
19. In Never-Never-Land there is only one means of transportation: magic carpet. Twenty-
one carpet lines serve the capital. A single line flies to Farville, and every other city is
served by exactly 20 carpet lines. Prove that it is possible to travel by magic carpet
from the capital to Farville (perhaps by transferring from one carpet line to another).
20. In a certain kingdom, some pairs of cities are connected by roads so that 100 roads lead
out of each city, and one can travel along those roads from any city to any other. One
road is closed for repairs. Prove that one can still get from any city to any other.
21. Determine which of the following graphs are bipartite:

22. A math circle leader assigned 20 problems as homework. At the next meeting, he found
out that each student solved exactly 4 problems, and that each problem was solved by
exactly 5 students. How many students are in the circle?
23. A connected simple bipartite graph G has eight vertices. Recall that the vertices of a
bipartite graph can be divided into two groups A and B so that every edge connects
a vertex in group A and a vertex in group B. Both groups for G have four vertices.
Three of the vertices in group A have degrees 4, 2, and 2. Three of the vertices in B
have degrees 3, 1, and 1. What are the degrees of the remaining vertices?
24. There are ten 9-graders and ten 12-graders interested in a peer mentor program. Each
of the 12-graders will be a mentor for one 9-grader, and each 9-grader will have one
mentor. It turns out that in this group, every 12-grader knows exactly two 9-graders
62 CHAPTER 10. GRAPHS

and every 9-grader knows exactly two 12-graders (assume that the relationship “knows”
is mutual, i.e. either both people know each other or both people do not know each
other). Prove that there exists a pairing such that every person would be paired up
with one that they know.

25. There are seven kids from school A and seven kids from school B attending a chess
night. Each game is between one kid from school A and one kid from school B. The
following day, they recall the number of people they have played with. The numbers
are as follows: 3, 3, 3, 3, 3, 3, 3, 5, 6, 6, 6, 6, 6, 6. Prove that at least one of them
made a mistake.

26. In a connected graph the degrees of four of the vertices equal 3 and the degrees of all
other vertices equal 4. Prove that it is impossible to delete one edge in such a way that
the graph splits into two isomorphic connected components.

27. Find a necessary and sufficient condition for a graph to have an Euler path but not an
Euler cycle.

28. Which of the graphs in problem 21 have

(a) an Euler path?


(b) an Euler cycle?
(c) a Hamilton path?
(d) a Hamilton cycle?

29. Can one draw the following graphs without lifting the pencil from the paper, and tracing
over each edge exactly once?

30. Which of the following pictures can be traced without lifting the pencil from the paper
so that each line segment is traced exactly once? Does it matter where we start?

31. A bug is crawling along the edges of a cube. It wants to crawl along each edge exactly
once. Is this possible?
63

32. For which of the platonic solids there exists a path along the edges that contains every
edge exactly once?

33. (a) Prove that it is impossible to bend a 12 in long wire so that to make a cube whose
sides are 1 in long.
(b) Suppose that we are allowed to cut the wire (still 12 in long) into two pieces, bend
each piece, and glue the two pieces together. Prove that it is still impossible to
make a 1 in cube.
(c) What is the least number of pieces into which we need to cut the wire so that to
make the cube by bending each piece and then gluing the pieces?

34. A group of islands are connected by bridges in such a way that one can walk from any
island to any other. One day, a tourist walked around every island, crossing each bridge
exactly once. He visited the island of Thrice three times that day. How many bridges
are there to Thrice, if

(a) the tourist neither started nor ended on Thrice?


(b) the tourist started on Thrice, but didn’t end there?
(c) the tourist started and ended on Thrice?

35. Lake Kingdom has four islands: Castle, Orchard, Rose Garden, and Forest. The islands
are connected by six bridges so that there is exactly one bridge between any two islands.
Prince’s teacher told him to jog every morning as follows: start from the castle, cross
every bridge exactly once, then take a break, and walk back to the castle. Prove that
the teacher gave the prince an impossible task.

36. A map of major cities and roads of Mathland is shown below.


64 CHAPTER 10. GRAPHS

(a) Is there a tour that starts and ends at the same city and uses each road exactly
once?
(b) Is there a tour that starts and ends at the same city and visits each of the other
cities exactly once?

37. Below is a map of the river and the bridges in Konigsberg. As we know from problem
7 in chapter 1, it is not possible to design a tour of the town that crosses each bridge
exactly once and returns to the starting point. Could the citizens of Konigsberg create
such a tour by building a new bridge?

38. For what values of n does Kn have

(a) an Euler path?


(b) a Hamilton path?

39. For what values of n and m does Kn,m have

(a) an Euler cycle?


(b) an Euler path?
(c) a Hamilton cycle?
(d) a Hamilton path?

40. What is the smallest number of edges that have to be removed from the graph K6 in
order for the remaining graph to have an Euler cycle?

41. Hamilton’s “Round the World” puzzle asks: does [the graph consisting of vertices and
edges of] the dodecahedron (shown below) have

(a) a Hamilton path?


(b) a Hamilton cycle?
65

42. A knight’s tour is a sequence of legal moves by a knight starting at some square of a
chessboard and visiting each square exactly once. (See problem 8 in chapter 1 for a
description and picture of legal knight moves.) A knight’s tour is called reentrant if
there is a legal move that takes the knight from the last square of the tour back to
where the tour began.

(a) Draw the graph that represents all legal moves of a knight on a 3 × 4 chessboard.
(b) Show that there is no reentrant tour on a 3 × 4 chessboard.
(c) Find a non-reentrant tour on a 3 × 4 chessboard.

43. Show that there is no reentrant knight’s tour on a 4 × 4 chessboard.

44. Show that there is no knight’s tour at all (reentrant or not) on a 4 × 4 chessboard.

45. There are 17 scientists who communicate with each other discussing some problems.
They discuss only three topics, and each pair discusses at least one of these three. Prove
that there are at least 3 scientists who are all pairwise discussing the same topic.

46. Nine mathematicians met at an international conference. They found that among any
three of them there are at least two that have a language in common. If every mathe-
matician speaks at most three languages, prove that at least three of the mathematicians
can speak the same language.

47. (a) Prove that in a finite simple graph having at least two vertices there are always
two vertices with the same degree.
(b) Does the above hold for graphs with loops but no multiple edges?
(c) Does the above hold for graphs with multiple edges but no loops?

48. A graph Kk,l,m has k + l + m vertices divided into three sets: k vertices in one set, l
vertices in another set, and m vertices in the third set. Two vertices are connected if
and only if they are in different sets. Prove that there do not exist k, l, m ≥ 1 such that
Kk,l,m has exactly 6 edges.

49. Does K1,2,4 have

(a) an Euler cycle?


(b) an Euler path?
(c) a Hamilton cycle?
(d) a Hamilton path?

50. Find a necessary and sufficient condition on k, l, m for which Kk,l,m has

(a) a Hamilton cycle.


(b) a Hamilton path.

51. Four knights are placed on a 3 × 3 board as shown in Figure A below. They can be
moved, one at a time, using the usual chess knight’s moves. At most one knight can
occupy each square at any given time. Is it possible to move the knights to the position
shown in Figure B?
66 CHAPTER 10. GRAPHS

A B

52. Given a set of positive integers, a graph is constructed as follows. The vertices represent
these integers, and two vertices are connected if and only if the corresponding integers
are relatively prime. For example, the set {1, 2, 3, 4, 5, 6} produces the following graph.

1 2

6 3

5 4

What is the smallest possible value of the sum of eight positive integers that produce
the graph shown below?
Chapter 11

Combinatorics

Combinatorics is an area of mathematics primarily concerned with counting. In this chapter,


we will study a few techniques for counting the number of certain objects, the number of
ways to perform a task, and so on.

Theorem 11.1. (The Multiplication and Addition Principles.)

1. Suppose that a procedure consists of a sequence of two tasks. If there are m ways to
perform the first task and for each of these ways, there are n ways to perform the second
task, then there are mn ways to perform the procedure.

2. If a task can be performed in one of m ways or in one of n ways, and none of the m
ways is the same as one of the n ways, then there is a total of m + n ways to perform
the task.

Example 11.2. There are three towns A, B, and C in Wonderland, and only seven roads.
Three roads go from A to B, and four roads go from B to C. In how many ways can we drive
from A to C if we want to choose one road from A to B and then one road from B to C? (We
do not want to go back and forth.)
B

A C

Solution. There are three ways to choose a road from A to B and four ways to choose a
road from B to C. So there are 3 · 4 = 12 ways to drive from A to C.

Example 11.3. A new town D, five roads from A to D, and two roads from C to D were
built. How many ways are there to drive from A to C now?
B

A C

67
68 CHAPTER 11. COMBINATORICS

Solution. From A to C, we can drive via B or via D. There are 3 · 4 = 12 ways to drive via
B. Similarly, there are 5 · 2 = 10 ways to drive via D. Thus there are 12 + 10 = 22 total ways
to drive from A to C.
Definition 11.4. The number of ways to select k objects out of  a collection
 of n objects, if
n
the order does not matter, is called “n choose k” and is denoted .
k
 
n n!
Theorem 11.5. For 0 ≤ k ≤ n, we have = .
k k!(n − k)!
Example 11.6. How many ways are there to select two objects out of five?
Solution. One way to count this is as follows. First, we have five ways to select the first
object. After we select the first object, there are four ways to select the second one. The
total number of ways is 5 · 4 = 20. However, each selection was counted twice, as each pair
{A, B} was also counted as {B, A}. Therefore,
  there are actually only 10 distinct selections.
5 5! 1·2·3·4·5
Another way is to use the above formula: = = = 10.
2 2!3! 1·2·1·2·3
 
n n(n − 1)
Note that in general, = .
2 2
Theorem 11.7. (Inclusion-Exclusion Principle.) For any finite sets A, B, and C,

|A ∪ B| = |A| + |B| − |A ∩ B|,


|A ∪ B ∪ C| = |A| + |B| + |C| − |A ∩ B| − |A ∩ C| − |B ∩ C| + |A ∩ B ∩ C|.

Remark. The above principle can be generalized to any number of sets.


Example 11.8. How many of the first 100 natural numbers are divisible by 3 or 5?

Solution. Let A be the set of all positive integers not exceeding 100 and divisible by 3 and let
B be the set of all positive integers not exceeding 100 and divisible by 5. Then A ∩ B consists
of all positive integers not exceeding 100 and divisible by 15, and we want to find |A ∪ B|.
Using the Inclusion-Exclusion Principle, we have

|A ∪ B| = |A| + |B| − |A ∩ B|,


     
100 100 100
= + −
3 5 15
= 33 + 20 − 6
= 47.

Finally, let us clarify some terminology before we proceed to problems. A few of the
problems below deal with multi-digit numbers. The leading digit of a natural number should
not be zero. For example, 01234 would not be considered a 5-digit number. It is a 4-digit
number and is written as 1234. On the other hand, a string of digits may begin with any
digit, including zero. Thus, 01234 would be counted as a 5-digit string.
69

Problems

1. There are five different teacups, three saucers, and four teaspoons in a cupboard.
(a) How many ways are there to select a set of three items of different types (i.e. one
teacup, one saucer, and one teaspoon)?
(b) How many ways are there to select two items of different types?
2. (a) If we toss a coin three times, how many different sequences of heads and tails are
possible? List all of them.
(b) What if we toss the coin ten times?
(c) What if we toss the coin n times?
3. Let’s call a natural number “odd-looking” if all of its digits are odd. For example, 1353
and 9175 are odd-looking. How many four-digit odd-looking numbers are there?
4. The old Wonderland language consisted of only three letters: A, B, and C. A word in
this language is an arbitrary sequence of no more than four letters.
(a) How many four-letter words are there in this language?
(b) How many words are there in this language total?
5. Each of the two novice collectors has 20 stamps and 10 postcards. We call an exchange
fair if they exchange a stamp for a stamp or a postcard for a postcard. How many ways
are there to carry out one fair exchange between these two collectors?
6. A number (or a word, or any string of characters) is called palindromic if it reads
the same backward as forward. For example, the numbers 2002 and 123454321 are
palindromic. How many five-digit numbers are palindromic?
7. A die has 1, 2, 3, 4, 5, and 6 dots on its six faces. We roll it three times.
(a) How many outcomes are possible?
(b) How many outcomes have at least one occurrence of six?
8. How many license plates with three decimal digits followed by three letters do not
contain both the number 0 and the letter O?
9. The modern language of Wonderland is using 6 letters: A, B, C, D, E, F, and allows
words of up to six letters. A word is an arbitrary string of letters.
(a) How many two-letter words are there?
(b) How many two-letter words are there with two different letters?
(c) How many three-letter words are there with no letter repeating?
(d) How about n-letter words with no letter repeating?
10. Suppose we have three different flags and can raise one, two, or all of them up a flagpole
as a signal. How many different signals can we send if the order of the flags in the signal
matters?
11. In how many ways can a striped rectangular flag be designed if it must consist of 11
horizontal stripes of equal length, each colored either red, blue, or white, and any two
adjacent stripes must be of different colors?
70 CHAPTER 11. COMBINATORICS

12. How many ways are there to choose four cards of different suits and different values
from a deck of 52 cards if the order does not matter?

13. The fifth-graders are going to visit Kindergarteners and read books to them. Each fifth-
grader will be reading a book to one Kindergartener. There are 20 children in each
class. How many ways are there to pair up each fifth-grader with a Kindergartener?

14. Roma has 15 different books that she wants to put on a bookshelf. She wants her two
volumes of Roald Dahl’s short stories to be next to each other, with volume II to the
right of volume I. In how many different orders can she arrange the books?

15. How many ten-digit numbers have at least two equal digits?

16. How many odd five-digit numbers have all digits different?

17. How many five-digit numbers have exactly four equal digits?

18. How many four-digit numbers have the sum of their digits equal to 33?

19. How many positive factors does 4000 have?

20. (a) Find the prime factorization of 3010 .


(b) How many positive factors does 3010 have?
(c) How many of the positive factors of 3010 are even?
(d) How many of the positive factors of 3010 are divisible by 12?
(e) How many of the positive factors of 3010 are perfect squares?

21. How many strictly increasing sequences of whole numbers start with 1 and end with
10? For example, 1, 3, 10 and 1, 2, 4, 5, 6, 8, 10 are two such sequences.

22. How many diagonals are there in a convex

(a) octagon?
(b) n-gon?

23. How many ways are there to put one white and one black rook on an 8 × 8 chessboard
so that they do not attack each other? (The rooks attack each other if they are in the
same row or column).

24. How many ways are there to put two identical counters on an 8 × 8 chessboard so that
they are in different rows and in different columns?

25. In how many ways can a black and a white square on a regular chessboard be chosen
so that the chosen squares do not lie in the same row or column?

26. How many strings of digits 1 though 5, containing each of these digits exactly once,
have 1 to the left of 3? (For example, 14235 is such a string, but 34152 is not.)

27. A “word” is any sequence of letters. How many “words” can be made by rearranging
the letters in the following words?

(a) CIRCLE
(b) SCIENCE
(c) SEQUENCE
71

(d) MATHEMATICS
28. How many 8-digit numbers can be made by rearranging the digits in 10102020?
29. How many seven-digit binary (base 2) numbers have no more than three 1s in them?
30. How many ways are there to put eight identical rooks on a chessboard so that they do
not attack each other?
31. How many ways are there to place one white and one black bishop on a chessboard so
that they do not attack each other?
32. How many ways are there to place two identical bishops on a chessboard so that they
do not attack each other?
33. Seven girls and seven boys are to be seated in a row on a bench. The girls and boys
should alternate. How many ways are there to seat everyone?
34. (a) How many ways are there to split ten people into six pairs?
(b) Generalize to any even number of people.
35. A fair coin is flipped ten times. How many ways are there to get more heads than tails?
36. If we flip a coin 7 times, what is the probability of getting
(a) exactly 7 heads?
(b) exactly 6 heads?
(c) exactly 5 heads?
(d) exactly 4 heads?
37. How many ways are there to select three out of 11 vertices of a regular 11-gon so that
these three points are vertices of an isosceles triangle? (One example of such three
vertices is shown below.)

38. How many even 5-digit numbers have all their digits distinct and not exceeding 5?
39. How many 4-digit positive integers divisible by 5 have four different digits, of which 5
is the largest digit?
40. (a) How many 4-digit strings of digits 0-9 contain exactly two different digits (for
example, 1121, 0444, and 5995 are such strings)?
(b) Generalize to k-digit strings, for k ≥ 2.
41. Corey and Tony are friends on the same basketball team. There are eight players on
the team. How many starting groups of five players include Corey, Tony, or both?
42. There are four married couples in a club. How many ways are there to choose a
committee of three members so that no two spouses are members of the committee?
72 CHAPTER 11. COMBINATORICS

43. There are 31 students in a class, including Pete and John who only talk about computer
games whenever they see each other. How many ways are there to choose a soccer team
of 11 players so that Pete and John are not on the team together?

44. There are 4 girls and 6 boys in a chess club. A team of four persons must be chosen
for a tournament, and there must be members of both genders on the team. In how
many ways can this be done?

45. We want to join points A and B by a path that goes along the lines and has the shortest
possible length (which is 7). How many ways are there to do this? For example, one
way is shown below.

B B

A A

46. How many ways are there to join points A and B by a path that goes along the lines
and has the shortest possible length?
(a)
B

A
(b) (c)
B B

A A

47. A spider has eight different socks and eight different shoes. It wants to put one sock
and one shoe on each of its eight legs.
73

(a) How many different distributions of socks and shoes are there?
(b) Now the spider has decided which sock and which shoe should go on which leg.
In how many different orders can it put on its socks and shoes, assuming that, on
each leg, the sock must be put on before the shoe?
48. Let S = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}. How many subsets of S have an odd sum of
their elements? (For example, {2, 3, 4, 5, 8, 11} is one such subset since 2+3+4+5+8+11
is odd.)
49. Six boxes are numbered 1 through 6. How many ways are there to distribute 20 identical
balls among the boxes if some of the boxes can be empty?
50. Six boxes are numbered 1 through 6. How many ways are there to distribute 20 identical
balls among the boxes if each box must contain at least one ball?
51. How many triples (a, b, c) of natural numbers are there such that a + b + c = 10? In
other words, how many ways are there to write 10 as a sum of three natural numbers?
(The ways 10 = 2 + 1 + 7 and 10 = 2 + 7 + 1 are considered different.)
52. How many ways are there to represent the natural number n as a sum of k natural
numbers if the order of the k numbers matters?
53. Susie has twelve identical cookies. She wants to give some to each of her brothers, Sam
and Steve, and leave the rest for herself. She wants each person to have at least one
cookie. How many ways are there to distribute the cookies?
54. A standard six-faced die is rolled four times. How many ways are there to get a sum
of 9?
55. Each of the numbers from 1 to 10 is placed in a bag and drawn at random with
replacement. In how many ways can three numbers whose sum is 13 be drawn?
56. You are ordering six doughnuts, and need to choose from among four flavors: glazed,
powdered, cream-filled, and jelly-filled. How many different doughnut orders are pos-
sible?
57. How many bit strings of length 3n consisting of exactly n zeros and 2n ones have no
consecutive zeros?
58. How many bit strings of length n, where n ≥ 4, contain exactly two occurrences of 01?
59. How many ways are there to divide 30 students into three groups of 10 students each?
60. (a) Six colors of paint are available to paint all the faces of a cube. Each face of the
cube must be painted a distinct color. Two colorings of the cube are considered
to be the same if one can be obtained from the other by rotating the cube. How
many different colorings are possible?
(b) Same problem for a dodecahedron and twelve colors of paint.
61. A traveling agent has to visit four cities, each of them five times. In how many different
ways can he do this if he does not want to start and finish in the same city?
62. Alice randomly picks three distinct numbers from the set {1, 2, 3, 4, 5, 6, 7, 8, 9} and
arranges them in descending order to form a 3-digit number. Bob randomly picks three
distinct numbers from the set {1, 2, 3, 4, 5, 6, 7, 8} and also arranges them in descending
order to form a 3-digit number. What is the probability that Alice’s number is larger
than Bob’s number?
74 CHAPTER 11. COMBINATORICS

63. Suppose we want to color the six vertices of the graph shown below so that any two
adjacent vertices have different colors.

How many ways are there to do this if we have

(a) 3 colors available (say, red, blue, and green)?


(b) 4 colors available (say, red, blue, green, and yellow)?
64. How many 8-bit strings begin with 1010 or end with 01?

65. How many of the first 100 positive integers are not divisible by 5 or 7?
66. How many of the first 1000 positive integers are either a perfect square or a perfect
cube?
67. How many strings of five digits (from 0 to 9) contain at least one 4 and at least one 7?

68. How many permutations of the 26 letters of the English alphabet do not contain any
of the strings
(a) cat, dog, fish?
(b) dog, rat, bird?
69. How many strings of length 7 over the alphabet {a, b, c} contain each letter at least
once?
70. How many strings of a’s, b’s, and c’s, of total length 6, have exactly two a’s or exactly
two b’s (or both; also, the two a’s or the two b’s do not have to be consecutive)? For
example, acaccc, acbaab, and bcbcaa are such strings (the first one has exactly two a’s,
the second has exactly two b’s, and the third has both exactly two a’s and exactly two
b’s).
Chapter 12

Calculus

We recall a few important definitions and useful theorems.

Definition 12.1. If a, x ∈ R+ , a 6= 1, and y ∈ R, then

loga x = y ⇔ ay = x.

Theorem 12.2. (Properties of logarithms) If a, x, y ∈ R+ , a 6= 1, and r ∈ R, then

1. loga (xy) = loga x + loga y,


 
x
2. loga = loga x − loga y,
y
3. loga (xr ) = r loga x,
ln x
4. loga (x) = .
ln a
Definition 12.3. A function f (x) is called even if f (−x) = f (x) for all x in the domain of
f . It is called odd if f (−x) = −f (x) for all x in the domain of f .

Definition 12.4. Let f : A → B be a function. A function f −1 : B → A is called the


inverse of f if for all x ∈ A and y ∈ B

f −1 (y) = x ⇔ f (x) = y.

Theorem 12.5. If f −1 is the inverse of f : A → B where A and B are subsets of R, then


the graphs of y = f (x) and y = f −1 (x) are symmetric about the line y = x.
Theorem 12.6. (Intermediate value theorem) Suppose f (x) is continuous on [a, b]. Let N
be any number between f (a) and f (b). Then there exists c ∈ [a, b] such that f (c) = N .
Definition 12.7. The derivative of f (x) at a point a is

f (a + h) − f (a)
f 0 (a) = lim ,
h→0 h
if this limit exists.

75
76 CHAPTER 12. CALCULUS

The derivative f 0 (a) is the slope of the tangent line to y = f (x) at (a, f (a)). Also, f 0 (a)
is the rate of change of f (x) with respect to x at x = a.

y
y=f(x)

slope=f (a)
f(a)

a x

Theorem 12.8. (Important derivatives) Whenever the following derivatives are defined,

(xn )0 = nxn−1 , (ex )0 = ex , (ax )0 = (ln a)ax ,


1 1
(c)0 = 0, (ln x)0 = , (loga x)0 = ,
x (ln a)x
(sin x)0 = cos x, (cos x)0 = − sin x, (tan x)0 = (sec x)2 ,

(csc x)0 = − csc x cot x, (sec x)0 = sec x tan x, (cot x)0 = −(csc x)2 ,
1 1 1
(arcsin x)0 = √ , (arccos x)0 = − √ , (arctan x)0 = 2 .
1 − x2 1 − x2 x +1
Theorem 12.9. If f (x) is defined on some open interval containing a point c and has a local
maximum or minimum c, then c is a critical number of f (x) (i.e. either f 0 (c) = 0 or f 0 (c)
does not exist).
Definition 12.10. Let f (x) be continuous on an interval [a, b]. Divide the interval into n
subintervals of equal length: [x0 , x1 ], [x1 , x2 ], . . ., [xn−1 , xn ] where x0 = a and xn = b. Let
b−a
∆x = be the length of each subinterval. Then the sum
n
n
X
Rn = f (xi )∆x
i=1

is called the Riemann sum of f (x) on [a, b] using n subintervals. It can be proved that the
limit of Rn as n approaches infinity exists, and
Z b Xn
f (x)dx = lim f (xi )∆x
a n→∞
i=1

is called the integral of f (x) from a to b.


Z b
If f (x) ≥ 0, then f (x)dx is the area of the region under the curve y = f (x) and above
a
the x-axis from a to b. Z b
If f (x) takes on both positive and negative values, then f (x)dx is the sum of the areas
a
under the curve and above the x-axis minus the sum of the areas under the x-axis and above
the curve.
77

y y
y=f(x)
y=f(x)
+
x + x
a b a b

Theorem 12.11. (Fundamental Theorem of Calculus) If f (x) is continuous on [a, b], then
Z x 
d
I. f (t)dt = f (x) for all x ∈ [a, b].
dx a

Z b
0
II. If F (x) = f (x) for all x ∈ [a, b], then f (x)dx = F (b) − F (a).
a

Theorem 12.12.Z (Substitution Rule)


Z If g(x) is differentiable and f (x) and g 0 (x) are con-
tinuous, then f (g(x))g 0 (x)dx = f (u)du, where u = g(x), du = g 0 (x)dx.

Theorem 12.13. (Some important series)



X 1 1 1 1
= 1 + + + + . . . is divergent.
n=1
n 2 3 4

∞  1
X
n 2 3 if |q| < 1,
q = 1 + q + q + q + ··· = 1−q
 divergent if |q| ≥ 1.
n=0

X xn x x2 x3
=1+ + + + · · · = ex for all x.
n=0
n! 1! 2! 3!

X 1 1 1 1 
in particular, if x = 1, then = 1 + + + + · · · = e.
n=0
n! 1! 2! 3!
∞ 2n+1 3 5 7
X x x x x
(−1)n =x− + − + · · · = arctan x for all x.
n=0
2n + 1 3 5 7

X 1 1 1 1 π 
in particular, if x = 1, then (−1)n = 1 − + − + · · · = arctan 1 = .
n=0
2n + 1 3 5 7 4
78 CHAPTER 12. CALCULUS

Problems

1. Explain why the curve shown below cannot be the graph of a cubic polynomial.

p
2. (a) Show that the function f (x) = ln(x + x2 + 1) is odd.
(b) Find the inverse of f (x).
x2 y 2 z 2
3. Show that any ellipsoid (given by + + = 1) has a cross-section that is a circle.
a2 b2 c2
4. Let T (x) denote the temperature at the point x on the surface of Earth at some fixed
time. Assuming that T is a continuous function of x, show that at this moment in time
there are at least two diametrically opposite points on the equator that have the same
temperature.
5. Find all values of a such that x2 + ax + 1 ≥ cos x for all real x.
6. Find all positive values of a such that that ax ≥ 1 + x for all real x.
7. Show that for x > 0,
x
< arctan x < x.
x2 + 1
8. The figure below shows a point P on the parabola y = x2 and the point Q where the
perpendicular bisector of OP intersects the y-axis. As P approaches the origin along
the parabola, what happens to Q? Does it have a limiting position? If so, find it.

y
y=x2

Q
P
x
O
79

9. Find a cubic polynomial p(x) = ax3 + bx2 + cx + d that has a local maximum at (0, 1)
and a local minimum at (1, 0).

10. Find a polynomial function that has local maxima at (0, 1) and (2, 1) and a local
minimum at (1, 0).

11. Find a number c such that the line y = x − 1 is tangent to the parabola y = cx2 .

12. Find a quadratic polynomial y = ax2 + bx + c whose graph passes through the origin
and is tangent to the line y = x − 2 at the point (2, 0).

13. The parabola y = x2 + 2 has two tangent lines that pass through the origin. Find their
equations.

14. Find the number a such that the parabola given by y = x2 + a is tangent to the lines
y = x and y = −x.

15. The figure below shows a circle with radius 1 inscribed in the parabola y = x2 . Find
the center of the circle.

y
y=x 2

16. Find an equation of a line tangent to both of the following parabolas: y = (x + 2)2 − 1
and y = 1 − (x − 2)2 .
1
17. Find the n-th derivative of f (x) = .
x2 +x
xn
18. Find the n-th derivative of the function f (x) = .
1−x
19. The parabola y = x2 and the line y = mx + 1 are given. They have two intersection
points, A and B. Find the point C on the parabola that lies between A and B and
maximizes the area of 4ABC.
Z b
20. Find the interval [a, b] for which the integral (2 + x − x2 )dx has the largest possible
a
value.

21. Find an equation of the line with a negative slope and passing through the point (1, 1)
such that the triangle bounded by this line and the axes is divided by the parabola
y = x2 into two regions of equal area.
80 CHAPTER 12. CALCULUS

22. There is a line through the origin that divides the region bounded by the parabola
y = x − x2 and the x-axis into two regions with equal area. What is the slope of that
line?
23. Find all values of a for which the area of the region bounded by the line y = ax and
the parabola y = x2 is equal to 1.
24. Find all positive numbers a such that the area enclosed by y = x2 , x = a, and y = 0 is
equal to the area enclosed by y = x3 , x = a, and y = 0.
25. The figure below shows a horizontal line y = c intersecting the curve y = 8x − 27x3 .
Find the number c such that the areas of the shaded regions are equal.

26. The figure below shows a curve C with the property that, for every point P on the
middle curve y = 2x2 , the areas A and B are equal. Find an equation for C.

C
y=2x 2
A
B y=x 2

27. Find a curve that passes through the point (3, 2) and has the property that if the
tangent line is drawn at any point P on the curve, then the part of the tangent line
that lies in the first quadrant is bisected by P .
28. Find the volume of a 4-dimensional unit ball.
Z 1 p p 
3 7
29. Evaluate 1 − x7 − 1 − x3 dx.
0
Z
1
30. Evaluate dx.
x7 − x
The straightforward approach would be to start with partial fractions, but that would
be too brutal. We
Z Z could reduce the power of the denominator as follows. Observe that
1 x du
dx = dx. Let u = x2 , then du = 2xdx, or = xdx, and we have
x7 − x x8 − x2 2
81
Z Z
x 1 1
8 2
dx = 4
du. Now, u4 − u is better than x7 − x, but can you find an
x −x 2 u −u
even better substitution?
Z 1
31. Evaluate the integral: arcsin(x)dx.
0

32. The figure below shows a region consisting of all points inside a unit square that are
closer to the center than to the sides of the square. Find the area of the region.

33. Let a1 , a2 , . . ., a30 be real numbers. Show that a1 cos x + a2 cos(2x) + · · · + a30 cos(30x)
cannot take on only positive values.

34. If a0 , a1 , a2 , . . ., ak are real numbers and a0 + a1 + a2 + · · · + ak = 0, show that


√ √ √ √
lim (a0 n + a1 n + 1 + a2 n + 2 + · · · + ak n + k) = 0.
n→∞

35. Let f (x) = a1 sin x + a2 sin(2x) + a3 sin(3x) + · · · + an sin(nx), where a1 , . . . , an are real
numbers and n is a positive integer. If it is given that |f (x)| ≤ | sin(x)| for all x, show
that |a1 + 2a2 + · · · + nan | ≤ 1.
 
1 1 1
36. Evaluate lim √ √ +√ √ + ··· + √ √ .
n→∞ n n+1 n n+2 n n+n

X 1 1 1 1 1
37. Find the sum of the series 2n+1
= + 3 + 5 + 7 + ....
n=0
2 2 2 2 2

38. Find the sum of the series


1 1 1 1 1 1 1 1 1
1+ + + + + + + + + + ...
2 3 4 6 8 9 12 16 18
where the terms are the reciprocals of the positive integers whose only prime factors
are 2s and 3s.

39. Show that e is irrational.

40. Suppose you have a large supply of books, all the same size, and you stack them at the
edge of a table, with each book extending farther beyond the edge of the table than
the one beneath it. Show that it is possible to do this so that the top book extends
entirely beyond the table. In fact, show that the top book can extend any distance at
all beyond the edge of the table if the stack is high enough. Try the following method
of stacking: The top book extends half its length beyond the second book. The second
82 CHAPTER 12. CALCULUS

book extends a quarter of its length beyond the third. The third extends one-sixth of
its length beyond the fourth, and so on. (You could try it yourself with books, CD
cases, or something similar. To make your construction stable, make each book, CD
case, etc. extend a little bit less than described in this problem.)
Hint: consider centers of mass.

41. Find a continuous nonnegative function f (x) such that the area of the region under the
graph of f (x) (and above the x-axis) from x = 0 to x = t is A(t) = t3 for all t > 0.
42. Recall that the area of a circle with radius r is A = πr2 and the circumference of the
circle is L = 2πr. Notice that (πr2 )0 = 2πr. Similarly, the volume of a ball with radius r
 0
4 3 2 4 3
is V = πr , the surface area is S = 4πr , and πr = 4πr2 . Is this a coincidence?
3 3
Actually, it isn’t. Explain these facts. What is the ratio of the 4-dimensional volume
to the usual 3-dimensional volume of its boundary (the analog of the surface area) for
a 4-dimensional ball with radius r?

43. What is the ratio of the 5-dimensional volume of a 5-dimensional ball of radius r to the
4-dimensional volume of its boundary (the analog of the surface area)?
Chapter 13

Various problems

Most problems in this section can be solved in a few different ways.

Problems

1. December 25, 2005 was a Sunday. Without using any technology, calculate the day of
the week for December 25, 2050.

2. What is the last (units) digit of 11234 + 21234 + 31234 + 41234 + 51234 ?

3. Show that there is no reentrant knight’s tour on a 5 × 5 chessboard (recall that a tour
is called reentrant if there is a legal move that takes the knight from the last square of
the tour back to where the tour began).

4. Prove that for any integer number n, n7 − n is divisible by 7.

5. A sequence {an } is defined recursively by the equations

a0 = a1 = 1, n(n − 1)an = (n − 1)(n − 2)an−1 − (n − 3)an−2 .



X
Find the sum of the series an .
n=0
Z 3
6. Evaluate the integral: ||x| − 1| dx
−2

7. Solve the inequality: |6 − |x| − x| + x ≤ 3.

8. What is the area of the region defined by the inequality

|3x − 18| + |2y + 7| ≤ 3?

9. (a) Find an example of a polygon and a point in its interior, so that no side of the
polygon is completely visible from that point.
(b) Find an example of a polygon and a point in its exterior, so that no side of the
polygon is completely visible from that point.

83
84 CHAPTER 13. VARIOUS PROBLEMS

10. The plane is colored with two colors (that is, each point is assigned one of two colors).
Prove that there exist three points of the same color which are vertices of a regular
triangle.

11. The plane is colored with finitely many colors (that is, each point is assigned one of
finitely many colors). Prove that one can find a rectangle with vertices of the same
color.

12. Each block of a 25 × 25 board has either 1 or −1 written on it. Let ai be the product
of all numbers in the ith row and bj be the product of all numbers in the jth column.
Prove that a1 + · · · + a25 + b1 + · · · + b25 6= 0.

13. Prove that if 40 coins are distributed among 9 bags so that each bag contains at least
one coin, then at least two bags contain the same number of coins.

14. Let twenty distinct positive integers be all less than 70. Prove that among their pairwise
differences there are four equal numbers.

15. If a camel (as defined in problem 5 in Chapter 9) starts at the lower-left corner of an
8 × 8 board, it is easy to check that it can get to the upper-right corner. What is the
smallest number of moves necessary to do this?

16. A 6 × 6 square is tiled by dominoes (2 × 1 tiles). Prove that it has at least one fault-line:
a straight line cutting the square without cutting any domino. An example of such a
line is shown below.

17. Prove that there are no Fibonacci numbers ending with 100.

18. Prove that there are infinitely many Fibonacci numbers divisible by 100.

19. How many three-digit numbers satisfy the property that the middle digit is the average
of the first and the last digits?

20. How many positive integers not exceeding 1000 are divisible by either 4 or 6?

21. A counter is placed at the top left vertex (marked “Start”) of the graph shown below.
Two players play the following game. Turns alternate. In one turn, a player may move
the counter to any adjacent vertex along an edge, in the direction of the arrow. The
player who cannot make a move loses. Find a winning strategy for one of the players.
85

Start

22. Let n be a positive odd integer. There are n computers. Each pair of computers is
connected by one cable. We want to color the computers and the cables in such a way
that (1) all computers have different colors, (2) no two cables joined to one computer
have the same color, and (3) no computer has the same color as a cable joined to it.
Below is an example for n = 3:

red
ite

blu
wh

blue white
red

Prove that for any odd n, this can be done using n colors.
5
23. Find the units digit of the number 2(3 ) .

3( )
57
24. Find the units digit of the number 2 .

25. Three grasshoppers, one green, one gray, and one brown, play leapfrog along a line.
Initially, the green one is on the left, the gray one is in the middle, and brown one is
on the right, as pictured below. Each second, one grasshopper leaps over another, but
not over two others. Can the grasshoppers return to their initial order after 11 leaps?
86 CHAPTER 13. VARIOUS PROBLEMS

26. The 4×4 grid is composed of 16 unit squares. What is the largest number of diagonals of
the unit squares that can be drawn in such a way that none of them share an endpoint?
Below is an example of eight diagonals satisfying this condition. However, it is possible
to draw more diagonals.

27. Prove that among any 21 distinct positive integers not exceeding 100 there are four
different ones, a, b, c, d, such that a + b = c + d.
28. Which natural numbers are sums of consecutive smaller natural numbers? For example,
30 = 9 + 10 + 11 and 31 = 15 + 16, but 32 has no such representation. Find a simple
necessary and sufficient condition.
29. Prove that if 1 = a1 < a2 < a3 < . . . < a8 = 100 and all ai s are integers, then
ai+1 − ai ≥ 15 for some i.
30. The Art Gallery Problem. An art gallery has the shape of an n-gon (not necessarily a
convex one). The boundary of the n-gon are the only walls, there are no walls inside it.
The gallery is to be guardedh n iby security cameras that can each rotate to obtain a full
n
field of vision. Prove that (the integer part of ) cameras can survey the building,
3 3
no matter how complicated its shape.
Below are two examples.

   
5 7
pentagon, =1 7-gon, =2
3 3
1 camera can survey the building 2 cameras can survey the building
Solutions and answers to
selected problems

0 Preliminaries
0.1 Review of logic
1. Construct the truth tables.

(a)
p q p→q ¬q ¬p ¬q → ¬p
T T T F F T
T F F T F F
F T T F T T
F F T T T T

The truth values in the columns for p → q and ¬q → ¬p are the same, thus the
propositions are logically equivalent.

3. Every student at my university has a computer or has a friend who has a computer.

5. (a) False since 4 6= −5.


(b) True since both P (4) and Q(4) are false.
(c) True. For example, x = 4 makes P (x) false, so ¬P (x) true.
(d) False. For example, if x = 4, then both P (4) and Q(4) are false, so the disjunction
is false.
(e) True. For example, if x = −5, then both P (x) and Q(x) are true, so the conjunc-
tion is true.
(f) True. If P (x) holds, then x = −5, then x2 = 25, so Q(x) holds, so the implication
holds for any x.
(g) True. For example, if x = −5, then both P (x) and Q(x) are true, so the implication
is true.
(h) False. For example, if x = 5, then P (x) is false and Q(x) is true, so the bicondi-
tional is false.

7. The statement ∀x∃y(x + y = 0) is true because for any x, let y = −x, then x + y = 0.
The statement ∃y∀x(x + y = 0) is false because there is no value of y such that for any
x the equality x + y = 0 holds: for any y, consider x = −y + 1, then x + y = 1, so
x + y 6= 0.

87
88 SOLUTIONS AND ANSWERS

9. (a) True. For example, for x = 1 and y = 2, we have 1 < 2.


(b) False. Counterexample: x = 2, y = 1. We have 2 6< 1.
(c) False. Counterexample: x = −1. We have 1 6< −1.
(d) False. There is no such x that for any y, x < y, because for any x we can take
y = x, then x 6< y.
(e) True. For any y, consider x = y − 1, then x < y.
(f) False. There is no such y that for any x, x < y, because for any y we can take
x = y, then x 6< y.
(g) True. For any x, consider y = x + 1, then x < y.
11. (a) False. There is no such x that for any y, x2 + y = 5, because for any x we can
take y = −x2 , then x2 + y = 0 6= 5.
(b) False. For example, for y = 6, there is no value of x such that x2 + 6 = 5 because
for any real x, we have x2 + 6 ≥ 0 + 6 = 6 > 5.
(c) False. There is no such y that for any x, x2 + y = 5, because if y 6= 5, we can take
x = 0, and we have x2 + y = y 6= 5, while if y = 5, we can take x = 1, and we
have x2 + y = 1 + 5 = 6 6= 5.
(d) True. For any x, consider y = 5 − x2 , then x2 + y = 5.
13. (a) Not logically equivalent. Consider P (x) =“x = 2” with domain being the set of
real numbers. Then ∀x(¬P (x)) means ∀x(x 6= 2) and is false, while ¬(∀xP (x)) is
true since ∀xP (x), or ∀x(x = 2), is false.
(c) Logically equivalent. The proposition ∀x(P (x) ∧ Q(x)) is true if and only if P (x) ∧
Q(x) is always true, which is the case if and only if both P (x) and Q(x) are always
true, or (∀xP (x)) ∧ (∀xQ(x)).
(e) Not logically equivalent. Consider P (x) =“x is an odd integer” and Q(x) =“x is
an even integer” with domain being the set of integers. Then ∀x(P (x) ↔ Q(x)) is
false (e.g. for x = 1, P (x) is true and Q(x) is false) while (∀xP (x)) ↔ (∀xQ(x))
is true since both ∀xP (x) and ∀xQ(x) are false.
(g) Logically equivalent. The proposition ∃x(P (x) ∨ Q(x)) is true if and only if for at
least one value of x, P (x) ∨ Q(x) is true. i.e. for at least one value of x at least
one of P (x) and Q(x) holds, i.e. at least one of ∃xP (x) and ∃xQ(x) holds.
(i) Not logically equivalent. Consider P (x) =“x is an even integer” and Q(x) =“x2 =
−1” with domain being the set of integers. Then ∃x(P (x) → Q(x)) is true (e.g. for
x = 1, both P (x) and Q(x) are false, so the implication is true) while (∃xP (x)) →
(∃xQ(x)) is false (because ∃xP (x) is true and ∃xQ(x) is false, so the implication
is false).
15. Let S = R and P (x, y) =“x < y.” For any x, y, and z, we have that x < y and
y < z implies x < z. This is the transitivity property, that is, the relation “<” is
transitive on the set of real numbers. Recall that transitivity is one of the properties of
an equivalence relation (you probably have learned about equivalence relations in your
previous courses). Note, however, that the above relation is not reflexive or symmetric,
so it is not an equivalence relation.
17. The definition is as follows: the sequence a1 , a2 , a3 , . . . converges if there exists a number
L such that for any positive ε there exists an index N such that for any n ≥ N ,
|an − L| < ε. We rewrite this definition using quantifiers:
∃L ∀ε > 0 ∃N ∀n ≥ N |an − L| < ε
0. PRELIMINARIES 89

(where L and ε are real numbers, and n and N are natural numbers). If we wish to
make the domains explicit, we could write it as follows:

∃L ∈ R ∀ε ∈ R (ε > 0) → ∃N ∈ N ∀n ∈ N ((n ≥ N ) → (|an − L| < ε)) .

0.2 Types of proofs


1. We will prove the statement by contrapositive: Suppose n is odd. Then n = 2k + 1 for
some integer k. Then 3n + 5 = 3(2k + 1) + 5 = 6k + 8 = 2(3k + 4). Since 3k + 4 is
an integer, 3n + 5 is even. Thus we have proved that if n is odd, then 3n + 5 is even.
Therefore if 3n + 5 is odd, then n is even.

3. Solution 1. Assume 145n − 1 is odd. Then 145n − 1 = 2k + 1 for some integer k.


Then n = 2k + 2 − 144n, and n + 1000 = 2k + 1002 − 144n = 2(k + 501 − 72n). Since
k + 501 − 72n is an integer, we have that n + 1000 is even. This is a direct proof.
Solution 2. Assume to the contrary that for some integer n, 145n − 1 is odd but
n + 1000 is not even, that is, n + 1000 is odd as well. Then 145n − 1 = 2k + 1 and
n + 1000 = 2l + 1 for some integers k and l. Adding the above two equations, we have
146n + 999 = 2k + 2l + 2. It follows that 999 = 2k + 2l + 2 − 146n = 2(k + l + 1 − 73n).
Since 999 is odd but 2(k + l + 1 − 73n) is even, we have a contradiction. Thus the
original statement is true. This is proof by contradiction.
Note. Yet another way to prove the given statement is by proving the following two
lemmas.

• If 145n − 1 is odd, then n is even.


• If n is even, then n + 1000 is even.

Perhaps one of the easiest ways to prove the first lemma is by contrapositive similarly
to problem 1, and the second lemma can be proved directly.

5. The statement is false; n = 3 is a counterexample, since 23 + 1 = 9 is not prime.

7. By problem 2, an integer is even if and only if its square is even. Therefore an integer
is odd if and only if its square is odd. Thus if an odd integer N is a perfect square,
then N = m2 for some odd integer m. Thus m = 2k + 1 for some integer k. Then
N = m2 = (2k + 1)2 = 4k 2 + 4k + 1 = 4(k 2 + k) + 1, so N is of the form 4n + 1. This
proof is direct.
The converse is “if an odd number has the form 4n + 1, then it is a perfect square.”
This is false because for example 5 = 4 · 1 + 1 but 5 is not a perfect square. Thus 5 is
a counterexample.

9. (a) Let f (x) = x101 + x51 + x + 1. Then f (−1) = −2 < 0 and f (1) = 4 > 0. Since
f (x) is a continuous function, by the intermediate value theorem f (x) has a root.
This proof is nonconstructive because we did not construct a root, we only proved
its existence.
(b) Suppose f (x) has two distinct roots. By the mean value theorem there is a number
c between these roots such that f 0 (c) = 0. However,

f 0 (x) = 101x100 + 51x50 + 1 > 0

for all x. We get a contradiction. This is a proof by contradiction.


90 SOLUTIONS AND ANSWERS

π
11. The value x = is a root of the equation. This is a constructive proof since we
6
provided an explicit example.
13. The roots of the equation
√ 2x2 +
√8x + 7 = 0 can be found using the quadratic formula.
−8 ± 8 2
We have x = = −2± . It can be proved that both roots are irrational num-
4 2
bers. Since any quadratic equation has exactly two roots (counting complex and with
multiplicity), there are no other roots. In particular, there are no rational solutions.
This proof is direct.
15. An integer divisible by 8 has the form 8n where n is an integer, and
8n = (4n2 + 4n + 1) − (4n2 − 4n + 1) = (2n + 1)2 − (2n − 1)2 .
This proof is direct and constructive: for any integer divisible by 8, we gave an explicit
example of two perfect squares whose difference is equal to that integer.

1 Introduction
1. Assume to the contrary that each of the eleven children contributed at most $2.72. Then
the total amount does not exceed 2.72 · 11 = 29.92 dollars. However, the total amount
is $30.00. Therefore our assumption is false, thus at least one child contributed at least
$2.73. This kind of proof is called a proof by contradiction (see section 0.2). Such
problems can also be solved using the Generalized Dirichlet’s Principle (see chapter 3).
2. (a) Any two-digit number N can be written in the form N = 10a + b where b is the
units digit of the number and a is its tens digit. (For example, 27 = 10 · 2 + 7.)
Suppose that N is divisible by 3. Then N = 3k for some integer k. Thus
10a + b = 3k,
9a + a + b = 3k,
a + b = 3k − 9a,
a + b = 3(k − 3a).
Since k − 3a is an integer, a + b is divisible by 3.
Conversely, suppose that a + b is divisible by 3. Then a + b = 3m for some integer
m. Thus
9a + a + b = 9a + 3m,
10a + b = 3(3a + m),
N = 3(3a + m).
Since 3a + m is an integer, N is divisible by 3.
(b) Any natural number N can be written in the form
N = 10n an + 10n−1 an−1 + · · · + 10a1 + a0
where a0 is the units digit of the number, a1 is the tens digit, and so on (this is
called the base 10 expansion of the number N , see chapter 4). Now,
N . . . 9} an + an + 99
= |99 {z . . . 9} an−1 + an−1 + · · · + 9a1 + a1 + a0
| {z
n n−1
= 99 . . . 9} an + 99
| {z . . . 9} an−1 + · · · + 9a1 + (an + an−1 + · · · + a1 + a0 ).
| {z
n n−1
1. INTRODUCTION 91

Since all multiples of 9 are divisible by 3, an argument similar to the one in part
(a) shows that N is divisible by 3 if and only if

an + an−1 + · · · + a1 + a1

is (also, see chapter 4 for divisibility properties).

3. False. For example, for n = 41, n2 + n + 41 = 412 + 41 + 41 = 41 · 43 is not prime.


Note. You may be tempted to check a few small values of n. You would discover then
that for 1 ≤ n ≤ 39, the number n2 + n + 41 is indeed prime. However, the above
example shows that this is not the case for all natural values of n. Thus checking a few
examples is not sufficient!

4. Choose a row with the biggest number of stars in it. Note that this row contains at
least two stars since if each row contained at most one star then there would be at
most four stars total. However, there are six stars. (This argument is the idea behind
Dirichlet’s box principle, see chapter 3.) So we have the following three cases:
Case I. This row contains four stars. Then cross it out, and there will only be two stars
left. If they are in different columns, then cross out any other row, and the two columns
containing the remaining two stars. If the remaining two stars are in one column then
cross out one more row, the column containing the stars, and any other column.
Case II. This row contains three stars. Then cross it out, and there will only be three
stars left. We can eliminate three stars by crossing out one more row and two columns.
Case III. This row contains two stars. Cross it out, and there will only be four stars in
three rows left. Therefore at least one of these rows contains two stars. Cross it out,
and there will only be two stars left. As above, we can eliminate two stars by crossing
out two columns.

5. True. There are several ways to prove this. One is by induction (see chapter 2), another
one is considering all possible remainders of n modulo 3 (see chapters 4 and 5). Here
is a third way: n3 + 2n = n3 − n + 3n = n(n2 − 1) + 3n = n(n − 1)(n + 1) + 3n. The
term n(n − 1)(n + 1) is the product of three consecutive numbers, and one of them is
divisible by 3 (see chapter 4), therefore the product is divisible by 3. The term 3n is
also divisible by 3. Thus the sum is divisible by 3.


x+2 if x + 2 ≥ 0, i.e. if x ≥ −2
6. Since |x + 2| = and
 −x − 2 if x + 2 < 0, i.e. if x < −2
2x − 5 if 2x − 5 ≥ 0, i.e. if x ≥ 2.5
|2x − 5| = , we have
−2x + 5 if 2x − 5 < 0, i.e. if x < 2.5


 x + 2 + 2x − 5 = 3x − 3 if x ≥ 2.5,
f (x) = |x + 2| + |2x − 5| = x + 2 − 2x + 5 = −x + 7 if − 2 ≤ x < 2.5,
−x − 2 − 2x + 5 = −3x + 3 if x < −2.

So we draw the graph of each linear function for the corresponding interval.
92 SOLUTIONS AND ANSWERS

4.5
x
−2 2.5

7. No. Consider the four regions of the town, namely, the two river banks and the two
islands. Each of them is connected with other regions by either 3 or 5 bridges. Suppose
that there is a tour of the town that crosses every bridge exactly once. For each
intermediate region on such a tour we must come to the region by a bridge and leave
the region by a bridge. So every time the tour visits a region, two bridges are crossed.
This means that for every region except the one where we start and the one where we
end there must be an even number of bridges connecting that region to others. However,
we have 4 regions with an odd number of bridges. Thus we get a contradiction.
The above solution can be explained in an easier and “smoother” way if we use the
graph terminology discussed in chapter 10.

8. The answer to parts (a) and (b) is yes. There are even many such tours. Below are
two tours (squares are numbered in the order the knight can visit them). Notice that
in the second one, it is possible to go from square number 64 back to square number
1. Such a tour is called reentrant (see chapter 10).

1 40 13 26 3 42 15 28 1 14 17 42 3 38 19 40
24 37 2 41 14 27 4 43 16 43 2 63 18 41 4 37
39 12 25 60 53 62 29 16 13 64 15 58 53 56 39 20
36 23 38 63 56 59 44 5 44 27 12 55 62 59 36 5
11 50 57 54 61 52 17 30 11 30 61 52 57 54 21 50
22 35 64 51 58 55 6 45 26 45 28 31 60 51 6 35
49 10 33 20 47 8 31 18 29 10 47 24 33 8 49 22
34 21 48 9 32 19 46 7 46 25 32 9 48 23 34 7
Note. You may not be able to find such a tour quickly. However, it is important to
recognize the fact that if you tried and were unable to find one, that does not prove
that such a tour does not exist.

The answer to (c) is no. Note that with every move, the knight goes to a square of the
opposite color. After two moves it returns to a square of the same color it started on.
Thus, after any even number of moves it is going to be on the same color, and after
any odd number of moves it is going to be on the opposite color than it started on. To
visit every square of the board exactly once, the knight has to make 63 moves. Since 63
is odd, the knight must end on a square of the opposite color. However, the upper-left
2. PRINCIPLE OF MATHEMATICAL INDUCTION 93

and lower-right corners of the board are of the same color. Thus it is impossible to end
at the lower-right corner.
While in parts (a) and (b) the colors of the chessboard squares are not important,
our proof in part (c) constructs a contradiction using the coloring. We will see more
examples of such proofs in chapter 9.

2 Principle of Mathematical Induction


1. (a) We will prove this formula by Mathematical Induction.
1·2·3
Basis step. For n = 1 we have 12 = which is true.
6
Inductive step. Suppose the formula holds for n = k, i.e.
k(k + 1)(2k + 1)
12 + 2 2 + 3 2 + · · · + k 2 = .
6
Adding (k + 1)2 to both sides gives

k(k + 1)(2k + 1)
12 + 22 + 32 + · · · + k 2 + (k + 1)2 = + (k + 1)2
6
k(k + 1)(2k + 1) + 6(k + 1)2
=
6
(k + 1)(k(2k + 1) + 6(k + 1))
=
6
(k + 1)(2k 2 + 7k + 1)
=
6
(k + 1)(k + 2)(2k + 3)
=
6
(k + 1)((k + 1) + 1)(2(k + 1) + 1)
= .
6
Thus the formula holds for n = k + 1.
(c) Proof by Mathematical Induction.
Basis step. For n = 1 we have 1 · 1! = 2! − 1, or 1 = 2 − 1 which is true.
Inductive step. Suppose the formula holds for n = k, i.e.

1 · 1! + 2 · 2! + · · · + k · k! = (k + 1)! − 1.

Adding (k + 1) · (k + 1)! to both sides gives

1 · 1! + 2 · 2! + · · · + k · k! + (k + 1) · (k + 1)! = (k + 1)! − 1 + (k + 1) · (k + 1)!


= (k + 1)!(1 + k + 1) − 1
= (k + 2)! − 1.

Thus the formula holds for n = k + 1.


(e) Proof by Mathematical Induction.
1·2·3
Basis step. For n = 1 we have 1 · 2 = which is true.
3
Inductive step. Suppose the formula holds for n = k, i.e.
k(k + 1)(k + 2)
1 · 2 + 2 · 3 + · · · + k(k + 1) = .
3
94 SOLUTIONS AND ANSWERS

Adding (k + 1)(k + 2) to both sides gives


k(k + 1)(k + 2)
1 · 2 + 2 · 3 + · · · + k(k + 1) + (k + 1)(k + 2) = + (k + 1)(k + 2)
3
k(k + 1)(k + 2) + 3(k + 1)(k + 2)
=
3
(k + 1)(k + 2)(k + 3)
= .
3
Thus the formula holds for n = k + 1.
3. Proof by Mathematical Induction. q
Basis step. If q = 1, then it is true that 32 −1 = 32 −1 = 8 is divisible by 2q+2 = 23 = 8.
k
Inductive step. Assume that the statement holds for q = k, i.e. 32 − 1 is divisible by
k+1
2k+2 . We want to prove that the statement holds for q = k + 1, i.e. 32 − 1 is divisible
k+1 k
 k
 2  k
 k 
by 2k+3 . Observe that 32 − 1 = 32 ·2 − 1 = 32 − 1 = 32 − 1 32 + 1 . By
k k
the induction hypothesis, 32 − 1 is divisible by 2k+2 . Note that 32 + 1 is the sum of
two
 kodd numbers,
 k thus
 it is an even number, that is, divisible by 2. Then the product
3 − 1 3 + 1 is divisible by 2k+2 · 2 = 2k+3 .
2 2

5. (a) Proof by Mathematical Induction.


Basis step. If n = 1, the identity says that F1 F2 = F22 , i.e. 1 · 1 = 12 which is true.
Inductive step. Assume the identity holds for n = k, i.e.
2
F1 F2 + F2 F3 + · · · + F2k−1 F2k = F2k . (1)

We want to prove that it holds for n = k + 1, i.e.


2
F1 F2 + F2 F3 + · · · + F2(k+1)−1 F2(k+1) = F2(k+1) ,

or, equivalently,
2
F1 F2 + F2 F3 + · · · + F2k+1 F2k+2 = F2k+2 .

Using (1) we have:

F1 F2 + F2 F3 + · · · + F2k+1 F2k+2
= F1 F2 + F2 F3 + · · · + F2k−1 F2k + F2k F2k+1 + F2k+1 F2k+2
2
= F2k + F2k F2k+1 + F2k+1 F2k+2
= F2k (F2k + F2k+1 ) + F2k+1 F2k+2
= F2k F2k+2 + F2k+1 F2k+2
= (F2k + F2k+1 )F2k+2
2
= F2k+2 .

Thus the identity holds for n = k + 1.


(c) Proof by Mathematical Induction.
Basis step. For n = 1 the identity is F0 F2 = F12 + (−1)1 . Since F0 = 0 and
F1 = F2 = 1, we have 0 · 2 = 1 + (−1) which is true.
Inductive step. Assume the identity holds for n = k, i.e.

Fk−1 Fk+1 = Fk2 + (−1)k .


2. PRINCIPLE OF MATHEMATICAL INDUCTION 95

We want to show that it holds for n = k + 1, i.e.


2
F(k+1)−1 F(k+1)+1 = Fk+1 + (−1)k+1 ,

or, equivalently,
2
Fk Fk+2 = Fk+1 + (−1)k+1 .
We have
Fk Fk+2 = Fk (Fk + Fk+1 )
= Fk2 + Fk Fk+1
= Fk−1 Fk+1 − (−1)k + Fk Fk+1
= Fk+1 (Fk−1 + Fk ) + (−1) · (−1)k
2
= Fk+1 + (−1)k+1 .
Thus the identity holds for n = k + 1.
(d) Hint: recall that multiplication of 2 × 2 matrices is defined by
    
a b e f ae + bg af + bh
= .
c d g h ce + dg cf + dh

(e) Proof by Strong Mathematical Induction.


Basis step. If n = 1, then the identity says that F02 + F12 = F12 , or 02 + 12 = 12
which is true.
Inductive step. Assume that the identity holds for all 1 ≤ n ≤ k. Namely, we will
use that it holds for n = k and n = k − 1, i.e.
2
Fk−1 + Fk2 = F2k−1
2 2
and F(k−1)−1 + F(k−1) = F2(k−1)−1 , or equivalently,

2 2
Fk−2 + Fk−1 = F2k−3 .
2 2
We want to prove that it holds for n = k + 1, i.e. F(k+1)−1 + Fk+1 = F2(k+1)−1 ,
or, equivalently,
Fk2 + Fk+1
2
= F2k+1 .
It may be easier here to work from the right hand side.

F2k+1 = F2k + F2k−1 = F2k−1 + F2k−2 + F2k−1


= 2F2k−1 + F2k−2 = 2F2k−1 + F2k−1 − F2k−3
2
= 3F2k−1 − F2k−3 = 3(Fk−1 + Fk2 ) − (Fk−2
2 2
+ Fk−1 )
2
= 3Fk−1 + 3Fk2 − Fk−2
2 2
− Fk−1 2
= 2Fk−1 + 3Fk2 − Fk−2
2

2
= 2Fk−1 + 3Fk2 − (Fk − Fk−1 )2
2
= 2Fk−1 + 3Fk2 − Fk2 + 2Fk Fk−1 − Fk−1
2

2
= Fk−1 + 2Fk2 + 2Fk Fk−1
= Fk−1 (Fk−1 + Fk ) + Fk (Fk + Fk−1 ) + Fk2
= Fk−1 Fk+1 + Fk Fk+1 + Fk2
= (Fk−1 + Fk )Fk+1 + Fk2 = Fk2 + Fk+1
2
.
96 SOLUTIONS AND ANSWERS

Note. The idea of the above inductive step is the following: express F2k+1 in terms
of Fi s with i odd and less than 2k + 1, e.g. in terms of F2k−1 and F2k−3 , then use
the inductive hypothesis to rewrite F2k−1 and F2k−3 as sums of squares (since we
assume that the formula holds for smaller indices), and then rewrite the obtained
expression in terms of Fk and Fk+1 (because the formula we want to prove involves
these terms).

7. First we will try to estimate the sum by estimating each term. We see that

1 1
≤ each term ≤ ,
3n + 1 n+1

and there are 2n + 1 terms, therefore we have

2n + 1 2n + 1
≤ sum ≤ .
3n + 1 n+1

The left inequality doesn’t help us, but from the right one we have

2n + 1 2n + 2
sum ≤ < = 2,
n+1 n+1

thus we do not need Mathematical Induction for this part. To show that the sum is
bigger than 1, we will use Mathematical Induction.
1 1 1 1 1 1 13
Basis step. For n = 1 we have to check that 1 < + + . We calculate + + = ,
2 3 4 2 3 4 12
and we see that this is indeed bigger than 1.

Inductive step. Assume the inequality holds for n = k, i.e.

1 1 1
1< + + ··· + . (2)
k+1 k+2 3k + 1

We want to prove that it holds for n = k + 1:

1 1 1
1< + + ··· + ,
(k + 1) + 1 (k + 1) + 2 3(k + 1) + 1

or
1 1 1 1 1 1
1< + + ··· + + + + . (3)
k+2 k+3 3k + 1 3k + 2 3k + 3 3k + 4

1
Compare (2) and (3), and notice that we “lost” the term but “gained” three
k+1
1 1 1
terms: , , and . If we can show that we gained more than we lost,
3k + 2 3k + 3 3k + 4
then the new sum (for k + 1) is bigger than 1. Thus we want to show that

1 1 1 1
+ + > .
3k + 2 3k + 3 3k + 4 k+1
2. PRINCIPLE OF MATHEMATICAL INDUCTION 97

The following inequalities are equivalent:


1 1 1 3
+ + >
3k + 2 3k + 3 3k + 4 3k + 3
1 1 2
+ >
3k + 2 3k + 4 3k + 3
6k + 6 2
>
(3k + 2)(3k + 4) 3k + 3
3k + 3 1
>
(3k + 2)(3k + 4) 3k + 3
(3k + 3)2 > (3k + 2)(3k + 4)
9k 2 + 18k + 9 > 9k 2 + 18k + 8
9>8

and the last one is true, which completes our proof.


9. (a) Let a, b, c, and d be the side lengths of a quadrilateral. Draw the diagonal as
shown in the picture below and let e be its length.

c
a e

By the triangle inequality (used twice),

d < e + c < a + b + c.

11. We will use Mathematical Induction.


Basis step. For n = 1, we can color the region inside the circle one color and the region
outside of the circle the other color.
Inductive step. Assume the statement is true for n = k circles. Suppose we have k + 1
circles. Let’s temporarily remove one circle. Then we are left with k circles, and by our
assumption, the regions can be colored using two colors so that no two regions with
a common boundary line have the same color. When we put the removed circle back,
the condition will be satisfied for all pairs of regions except the ones whose common
boundary line is an arc of the new circle. However, if we switch the colors of all regions
inside (or outside of, it doesn’t matter) the new circle, the condition will be satisfied
for all regions again. Thus the statement is true for n = k + 1 circles as well.
13. First of all, if at least one point is connected with an odd number of other points (we
will call it a vertex of odd degree, see more on the graph terminology in chapter 10),
then there is an odd number of regions around it. Since the colors must alternate in a
proper coloring, the regions can not be properly colored with two colors.
We will show that if the degree of each vertex is even, then the map can be properly
colored with two colors. We will use Strong Mathematical Induction, and the induction
will be on the number of line segments.
98 SOLUTIONS AND ANSWERS

Basis step. For n = 0 line segments, the whole plane is one big region. We can color it
with any color we like.
Inductive step. Suppose any map with with all vertices of even degree and less than
or equal to k line segments can be properly colored with two colors. We wish to show
that any map with all vertices of even degree and k + 1 line segments can be properly
colored. Suppose we are given such a map. Remove temporarily all the boundary lines
of any one region. If the boundary contains any vertices of degree 2, then remove these
vertices as well.

−→
×

We get a map with less than k line segments, and the degree of each vertex is still
even. By the inductive assumption this new map can be properly colored. Consider a
coloring, put the boundary of our region back, and change the color inside it. We get
a proper coloring for our original map with k + 1 line segments.

−→

15. Proof by Mathematical Induction.


1 1 1
Basis step: for n = 3, we have 1 = + + .
2 3 6
Inductive step: assume that for k ∈ N, there exist positive integers

a1 < a2 < · · · < ak−1 < ak

such that
1 1 1 1
1= + + ··· + + .
a1 a2 ak−1 ak
2. PRINCIPLE OF MATHEMATICAL INDUCTION 99

1 1 1
Observe that = + and ak < ak + 1 < ak (ak + 1). Then
ak ak + 1 ak (ak + 1)

1 1 1 1 1
1= + + ··· + + + ,
a1 a2 ak−1 ak + 1 ak (ak + 1)

where
a1 < a2 < · · · < ak−1 < ak + 1 < ak (ak + 1),
thus 1 is written as the sum of k + 1 fractions of the required form.

17. Proof by Strong Mathematical Induction.


15 1
Basis step. For n = 1 we have det M1 = det [5] = 5 = = (42 − 1).
3 3
1
Inductive step. Assume the formula det Mn = (4n+1 − 1) holds for 1 ≤ n ≤ k. We
3
wish to prove it for n = k + 1.
Case I: if k = 1, then k + 1 = 2, and
 
5 2 63 1
det M2 = det = 52 − 22 = 21 = = (43 − 1).
2 5 3 3

Case II: if k ≥ 2, then k − 1 ≥ 1, and we can assume that the formula holds for n = k
and n = k − 1. Expanding Mk+1 across the first row and then expanding the second
of the two obtained matrices down the first column gives
 
5 2
 2 5 2 0 
 
 2 5 
det Mk+1 = det  

 ... 

 0 5 2 
2 5 (k+1)×(k+1)
   
5 2 2 2
 2 5 2 0   0 5 2 0 
   
 2 5   2 5 
= 5 det 
  − 2 det 
 
 ... 
  ... 

 0 5 2   0 5 2 
2 5 k×k 2 5 k×k
 
5 2
 2 5 2 0 
 
2 5
= 5 det Mk − 22 det 
 


 ... 

 0 5 2 
2 5 (k−1)×(k−1)
1 1
= 5 det Mk − 4 det Mk−1 = 5 · (4k+1 − 1) − 4 · (4k − 1)
3 3
1 1 1
= (5 · 4k+1 − 5 − 4k+1 + 4) = (4 · 4k+1 − 1) = (4k+2 − 1).
3 3 3

19. Hint: use Strong Mathematical Induction. First show that it is possible to divide a
square into 6, 7, or 8 smaller (not necessarily congruent) squares. For the inductive
step, assume that it is possible to divide the square into n smaller squares for any n
100 SOLUTIONS AND ANSWERS

such that 6 ≤ n ≤ k where k ≥ 8. To show that it is possible to divide the square


into k + 1 smaller squares, use the fact that it is possible to divide it into k − 2 smaller
squares and divide one of the smaller squares into four (note that this increases the
number of the smaller squares by 3).
21. Proof by Mathematical Induction.
Basis step. A 2 × 2 board with one square removed has the shape of an L-tromino, and
thus can be covered by one L-tromino.
Inductive step. Assume that a 2k ×2k board with any square removed can be covered by
L-trominoes. Now suppose we are given a 2k+1 × 2k+1 board with one square removed.
Divide this board into four 2k × 2k boards. One of them has one square removed, and
the three others are whole boards. Temporarily remove corner squares from those three
whole boards as shown on the picture below.

By the induction assumption, each of these four boards can be covered by L-trominoes.
Now place one more L-tromino in the center to cover the 3 squares that we temporarily
removed. We are done.
23. (a) First of all, let’s write a formula for the given sequence. There are many different
ways to do this. One way is to write a recursive formula. If we look at the sequence
closely,
1007, 10017, 100117, 1001117, . . .
we notice that each term can be obtained from the previous one by shifting its
digits to the left (that is, multiplying the number by 10), and then subtracting 53.
In other words,
an+1 = 10an − 53,
where an is the n-th term of the sequence. We will use Mathematical Induction
to prove that for each natural n, the number an in this sequence is divisible by 53.
Basis step. For n = 1, we have a1 = 1007 = 53 · 19, so it is divisible by 53.
Inductive step. Assume that ak is divisible by 53, then ak = 53x for some integer
x. Then
ak+1 = 10ak − 53
= 10(53x) − 53
= 53(10x − 1),
so ak+1 is also divisible by 53.
2. PRINCIPLE OF MATHEMATICAL INDUCTION 101

25. Basis step. For n = 1 city there is nothing to prove because there is no “any other
city”. (The step n = 2, in which case we have 2 cities and one road between them, so
one city can be reached from the other, is also acceptable in this situation.)

Inductive step. Assume the statement is true for n = k. We want to prove that the
statement is true for n = k+1. Suppose we are given k+1 cities with roads as described
in the problem. Choose one city (let’s call this city N ) and eliminate it and all roads
from and to it for a moment. We are left with k cities. By the inductive hypothesis,
there is a city that can be reached from any other city either directly or via at most
one other city. Let’s call it A, and let’s call those cities from which there are direct
roads to A group B, and the rest of the cities group C. Then from every city in group
C there is a road to at least one city in group B:

group B

group C

Now we add our (k + 1)-st city N back. Consider the following three cases.

Case I. The road between A and N goes from N to A.

A N

group B

group C

Then we put N into group B, and A is still “a solution city.”

Case II. There is at least one road from N to group B.


102 SOLUTIONS AND ANSWERS

A N

group B

group C

Then we put N into group C, and A is still a solution city.


Case III. None of the above: the road between A and N goes from A to N , and all the
roads between group B and N lead to N .

A N

group B

group C

Then N is a new solution city, and A will join group B.

27. Hint. For the inductive step, temporarily remove two consecutive dots, one red and
one blue, in this order, when going clockwise.

3 Dirichlet’s Box Principle


1. Think of months as “boxes” and people’s birth dates as “objects.” Since there are more
people (13) than months (12), By Dirichlet’s Box Principle, at least two birth dates
(“objects”) are in the same month (“box”).

3. Five. If he pulls our fewer than five socks, it is possible that they are of different colors
since there are four colors available. However, if he pulls out five or more socks, then
by Dirichlet’s box principle at least two socks will be of the same color.

5. There are 100 possible remainders upon division by 100 (namely, 0, 1, 2, . . ., 99). Since
we have 120 (more than 100) numbers, by Dirichlet’s Box Principle there are at least
two numbers with the same remainder. Their difference has remainder 0, and thus is
divisible by 100. Since all numbers are distinct, the difference is nonzero, and therefore
it ends with two zeros.
3. DIRICHLET’S BOX PRINCIPLE 103

7. There are two possible remainders upon division by 2 (namely, 0 and 1). Since we have
three numbers, at least two of them have the same remainder. Their difference is even,
therefore the product (x1 − x2 )(x1 − x3 )(x2 − x3 ) is even.
8. Notation clarification:
Y
(ai − aj ) = (a1 − a2 )(a1 − a3 )(a1 − a4 )(a2 − a3 )(a2 − a4 )(a3 − a4 ).
1≤i<j≤4

9. There are 11 possible remainders upon division by 11 (namely, 0, 1, 2, . . . , 10). Since we


have 12 (more than 11) numbers, by Dirichlet’s Box Principle at least two numbers have
the same remainder. Their difference is then divisible by 11. Since the given numbers
are two-digit, this difference is at most two-digit. Since the numbers are distinct, the
difference is non-zero. There are no one-digit numbers divisible by 11. Every two-digit
number that is divisible by 11, has the form aa (such numbers are 11, 22, 33, . . . , 99).
11. Each year contains at least 365 days. Since 365 = 52 · 7 + 1, each year contains 52 whole
weeks, and thus at least 52 Fridays. Kevin is paid every other Friday, therefore he is
52
paid at least = 26 times a year. There are 12 months, and 26 = 2 · 12 + 2. By the
2
Generalized Dirichlet’s Box Principle, at least one month contains three days on which
Kevin is paid.
13. Divide the hexagon into 6 regions as shown in the figure below. Since we have 7 (more
than 6) points, by Dirichlet’s Box Principle there is a region with at least two points
in it (or on its boundary). The distance between those two points is at most 1 because
each region is an equilateral triangle with all sides of length 1.

15. (a) Divide the rectangle into six 3 × 6 rectangles as shown below. Since there are 7
points, by Dirichlet’s Box Principle at least two of them are in the same 3 × 6
rectangle. The distance between
p them√is at most the length of the diagonal of a
3 × 6 rectangle, which is 32 + 62 = 45 < 7.

(b) Answer: yes.


Note: Although the proof in part (a) does not work for 6 points, it does not mean
that the statement does not hold for 6 points.
Hint: Divide the rectangle into 5 regions with the property that the distance
between any two points in one region is less than 7. This is harder than part (a),
but is possible!
104 SOLUTIONS AND ANSWERS

17. Since 7·7·7 = 343, we can divide the cube into 343 small cubes, each with edge 1. Each
point is inside at most one small cube (if a point is on the boundary of a small cube,
then it is not inside any small cube). Since there are more small cubes than points,
there is a small cube (moreover, there are at least 43 of them) that does not contain
any points inside it.
19. A circle of radius 4 can be inscribed in an 8 × 8 square, which, in turn, can be divided
into 64 unit squares. At the first glance it may seem that 61 points is not enough since
61 is smaller than 64. Notice, however, that four of the unit squares
√ lie outside of the
circle (see the picture below; also, it is easy to check that 4 < 3 2). In other words, the
circle of radius 4 is covered by just 60 unit squares. Thus, by Dirichlet’s box principle,
at least two
√ of the 61 points are inside one unit square. The distance between them is
at most 2.

21 (a) Since there are only ten different digits (0-9), by the Dirichlet’s Box Principle,
among any 11 natural numbers, at least two must have the same units digit.
Their difference ends in 0.
(b) No. Consider the following numbers: 11, 22, 33, 44, 55, 66, 77, 88, 99, 110, and
121. Note that they all are multiples of 11. Therefore the difference of any two
of them is also a multiple of 11, so each difference is among 11, 22, 33, 44, 55,
66, 77, 88, 99, and 110. None of the differences has 0 in the tens place. [Note:
this happens because even if two numbers have the same tens place digit, their
difference does not necessarily have 0 in the tens place, as is the case, for example,
with 11 and 110, or 22 and 121.)
23. Consider the following numbers: 1, 11, 111, . . . , 11 . . . 1}. Since there are n possible
| {z
n+1
remainders upon division by n, at least two of the above numbers, say, 11 . . . 1} and
| {z
k
|11 {z . . . 1} − 11
. . . 1} for k < l, have the same remainder. Their difference is |11 {z . . . 1} =
| {z
l l k

|11 {z
. . . 1} |00 {z . . . 1} ·10k and is divisible by n. Since n is not divisible by 2 or 5, n
. . . 0} = |11 {z
l−k k l−k
and 10 are relatively prime. Therefore 11 . . . 1} is divisible by n.
| {z
l−k

24. Hint: show that we can choose 2 of the given points whose midpoint is a lattice point.
25. Divide the numbers {1, 2, . . . , 2n} into n pairs of consecutive integers: {1, 2}, {3, 4},
. . . , {2n − 1, 2n}. Since there are n + 1 numbers in the set {a1 , a2 , . . . , an+1 }, at least
two of them are in the same pair, i.e. are consecutive. Their greatest common divisor is
3. DIRICHLET’S BOX PRINCIPLE 105

1 because if a natural number p divides both k and k + 1, then p divides their difference
(k + 1) − k = 1, so p = 1. Thus our two consecutive numbers are relatively prime.

27. “Make a box” for each side. There will be 2n boxes. We will “put” a diagonal into a
“box” if it is parallel to the corresponding side.

box 1: box 2n:


diagonals parallel to side 1 ... diagonals parallel to side 2n

We will figure out the maximal possible number of diagonals that can be parallel to
one side (and thus parallel among themselves), i.e. the maximal possible number of
diagonals in each box, and we will figure out how many diagonals we have in a 2n-gon.
We will show that 2n times the maximal number of diagonals in each box is less than
the number of diagonals in a 2n-gon, thus there is not enough space for all the diagonals
in our boxes. Therefore, there is a diagonal that is not in any box, and thus not parallel
to any side.

Let p be the maximal possible number of diagonals parallel to the same side. We will
find a condition on p. Notice that the vertices of these p diagonals and the 2 vertices of
the side they are all parallel to, are distinct (because if 2 line segments have a common
vertex, they can not be parallel unless they lie on one line which is impossible in our
case). Let us draw the 2n-gon so that all these p diagonals and the parallel side are
vertical, with the side on the left. Then we must also have at least one vertex on the
right (because the rightmost line segment must be inside the 2n-gon):

. . .

. . .

. . .
p diagonals

Thus the number of vertices in this figure is at least 2p + 2 + 1. So we have 2n ≥ 2p + 3.


Since 2n is an even number and 2p + 3 is odd, we must have 2n ≥ 2p + 4. Then
2n − 4 ≥ 2p, and n − 2 ≥ p. So there may be at most n − 2 diagonals in the same box.

Next let’s count the number of diagonals in a 2n-gon. For every diagonal, there are 2n
ways to choose the first vertex. Once the first vertex has been chosen, there are 2n − 3
ways to choose the second vertex (because the first vertex and its immediate neighbors
can not be chosen as the second vertex). Thus there are 2n(2n − 3) ways to choose
an ordered pair of vertices of a diagonal. However, this way we counted each diagonal
twice.
106 SOLUTIONS AND ANSWERS

1 2

2 1

2n(2n − 3)
So we must divide by 2. Therefore there are = n(2n − 3) diagonals.
2
Thus we have 2n boxes, at most n − 2 diagonals may be in the same box, therefore
at most 2n(n − 2) = 2n2 − 4n diagonals may be in the boxes. However, we have
n(2n − 3) = 2n2 − 3n diagonals. Since 2n2 − 3n > 2n2 − 4n, there is a diagonal which
is not in any box, and thus is not parallel to any side.

29. Since f : X → X is onto, it is a 1-1 correspondence from X onto itself, i.e. it permutes
the elements of X. Then so does f k for any integer k. If follows that f k has an inverse
f −k . Since |X| = n, there are n! permutations on X. Consider functions f , f 2 , f 3 ,
. . ., f n!+1 . Since there are more functions in this list than distinct permutations, at
least two of these functions, say, f l and f m for l < m, define the same permutation, i.e.
f l (x) = f m (x) for all x ∈ X. Then f m−l (x) = f −l (f m (x)) = f −l (f l (x) = f l−l (x) = x
for all x ∈ X.

31. First note that there are 210 − 1 = 1023 nonempty subsets. Since the smallest two-digit
number is 10 and the largest possible sum of ten two-digit numbers is 90+91+· · ·+99 =
945, there are 936 possible different values of the sum of up to ten two-digit numbers.
Since there are more subsets than possible values of the sum, by Dirichlet’s Box principle
there are two distinct nonempty subsets, say, A and B, with the same sum. Next, note
that neither of them can be a subset of the other, as then the sums of their elements
could not be equal. It follows that A − B = A − (A ∩ B) and B − A = B − (A ∩ B) are
disjoint, nonempty, and have the same sum of elements.

33. Since we have 3 rows and only 2 colors, every column has some color repeated. Since
there are 7 columns, there is a color that is repeated (at least twice) in at least 4
columns. So each of these 4 columns contains at least 2 blocks of that color. If there is
a column that contains 3 blocks of that color, then choose any other of the 4 columns,
and we’ll have a rectangle, e.g. as shown in the picture below.

If no column contains 3 blocks of that color, then notice that there are 3 different ways
to have 2 out of 3 blocks of some color.
4. NUMBER THEORY 107

Since we have 4 columns, at least two of them have the same distribution of the colors.
Then, again, we have a desired rectangle, e.g. as shown below.

35. The twelve faces of a dodecahedron can be divided into four groups of three so that the
three faces in each group have a common vertex, and any two of the three faces in each
group have a common edge. Since the sum of all of the numbers is 11 and there are
four groups, at least one group has a sum of at most 2. The three faces in this group
have either numbers 0, 0, 2 or 0, 1, 1. In either case, two faces having a common edge
have equal numbers.
37. Choose any day and track the number of games the player is playing for the next 11
weeks. Consider the sequence a1 , a2 , a3 , . . . , a77 , where each an represents the total
number of games the player has played in the first n days from the chosen start day.
Since he is playing at least one game per day, this is a strictly increasing sequence.
Define the sequence b1 , b2 , b3 , . . . , b77 by bn = an + 20. Note that it is also strictly
increasing. Since the player is playing at most 12 games per week, we have a77 ≤ 132
and b77 ≤ 152. Thus there are only 152 possible values for all the numbers in these
two sequences. However, there are 77 · 2 = 154 numbers, so there must be two equal
numbers. Since each sequence is strictly increasing, we have bi = aj for some i and j.
Equivalently, ai + 20 = aj , which means that exactly 20 games were played on days
i + 1 through j.

4 Number theory
1. (a) The sum of the digits of a number
n
X
N = an an−1 . . . a1 a0 = an · 10n + an−1 · 10n−1 + · · · + a1 · 10 + a0 = ak · 10k
k=0

is
n
X
S = an + an−1 + · · · + a1 + a0 = ak .
k=0

Since 10 ≡ 1 (mod 9), 10k ≡ 1 (mod 9). Then ak · 10k ≡ ak (mod 9), and
Xn n
X
ak · 10k ≡ ak (mod 9). So N ≡ S (mod 9). Thus N is divisible by 9 if and
k=0 k=0
only if S is divisible by 9.
108 SOLUTIONS AND ANSWERS

(b) If the sum of the digits of a number is 66, then the number is divisible by 3
(see problem 2(b) in chapter 1) but not divisible by 9. But if a perfect square is
divisible by 3 then it must be divisible by 9. Therefore a number with the digital
sum 66 cannot be a perfect square.

3. (a) First notice that if k is the last digit of m, then the last digit of m2 is that of k 2
because m = 10n+k for some integer n, and m2 = (10n+k)2 = 100n2 +20nk+k 2 =
(10n2 + 2nk) · 10 + k 2 . So we consider all possible last digits and compute their
squares: 02 = 0, 12 = 1, 22 = 4, 32 = 9, 42 ends with 6, 52 ends with 5, 62 ends
with 6, 72 ends with 9, 82 ends with 4, and 92 ends with 1. Thus the last digit of
a perfect square can be 0, 1, 4, 5, 6, or 9.
(b) Since 3 is not listed above, a number ending with 3 cannot be a perfect square.

5. (a) No. Assume n = a2 is a perfect square that ends with 65, then it is divisible
by 5. Then a is divisible by 5, and therefore n is divisible by 25. Any number
divisible by 25 ends with 00, 25, 50, or 75. Thus it cannot end with 65. We get a
contradiction.

7. (a) Let a be a perfect square, then a = b2 for some integer b. If b ≡ 0 (mod 7), then
a ≡ 0 (mod 7). If b ≡ ±1 (mod 7), then a ≡ (±1)2 ≡ 1 (mod 7). If b ≡ ±2
(mod 7), then a ≡ (±2)2 ≡ 4 (mod 7). If b ≡ ±3 (mod 7), then a ≡ (±3)2 ≡ 9 ≡
2 (mod 7). There are no values of b for which a ≡ 6 (mod 7).

9. Solution 1. Since 24 ≡ 16 ≡ 1 (mod 5) and 34 ≡ 81 ≡ 1 (mod 5), 2457 + 3457 ≡


2456+1 + 3456+1 ≡ 2456 · 2 + 3456 · 3 ≡ 24·114 · 2 + 34·114 · 3 ≡ (24 )114 · 2 + (34 )114 · 3 ≡
1 · 2 + 1 · 3 ≡ 0 (mod 5). Therefore 2457 + 3457 is divisible by 5.
Solution 2. Using the second formula in Theorem 4.22, since 457 is odd, we see that
2457 + 3457 can be factored as (2 + 3) times another natural number, thus it is divisible
by 5.

11. If the units digit of n is 3, then n can be written in the form n = 10k+3 for some integer
k. Then n2 +1 = (10k+3)2 +1 = 100k 2 +60k+9+1 = 100k 2 +60k+10 = 5(20k 2 +12k+2)
is divisible by 5.

13. Solution 1. Let us consider all possible cases for n modulo 6.


If n ≡ 0 (mod 6), then n3 + 5n ≡ 03 + 5 · 0 ≡ 0 (mod 6).
If n ≡ 1 (mod 6), then n3 + 5n ≡ 13 + 5 · 1 ≡ 6 ≡ 0 (mod 6).
If n ≡ 2 (mod 6), then n3 + 5n ≡ 23 + 5 · 2 ≡ 18 ≡ 0 (mod 6).
If n ≡ 3 (mod 6), then n3 + 5n ≡ 33 + 5 · 3 ≡ 42 ≡ 0 (mod 6).
If n ≡ 4 (mod 6), then n3 + 5n ≡ 43 + 5 · 4 ≡ 84 ≡ 0 (mod 6).
If n ≡ 5 (mod 6), then n3 + 5n ≡ 53 + 5 · 5 ≡ 150 ≡ 0 (mod 6).
We see that in each case n3 + 5n ≡ 0 (mod 6), so 6|(n3 + 5n).
Solution 2. Observe that n3 + 5n = n3 − n + 6n = (n − 1)n(n + 1) + 6n. Since n − 1, n,
and n + 1 are three consecutive integers, at least one of them is divisible by 2 and at
least one of them is divisible by 3. It follows that their product is divisible by 6. Since
6n is also divisible by 6, we have that n3 + 5n is divisible by 6.
100
15. The number is natural when n + 1 is a positive factor of 100. Now, 100 = 22 52 ,
n+1
so it has nine positive factors (1, 2, 4, 5, 10, 20, 25, 50, and 100). For all values starting
with 2, we get a natural value of n. However, n + 1 = 1 produces n = 0 which is not a
natural number. Thus there are only eight such values of n.
4. NUMBER THEORY 109

17. Four consecutive odd integers can be written in the form 2n − 3, 2n − 1, 2n + 1, and
2n + 3 for some integer n. Their sum is 8n which is divisible by 8.

19. Let n, n + 1, n + 2, and n + 3 be four consecutive integers whose product is 3024. Then
we have

n(n + 1)(n + 2)(n + 3) = 3024,


 
n(n + 3) (n + 1)(n + 2) = 3024,
(n2 + 3n)(n2 + 3n + 2) = 3024,
(x − 1)(x + 1) = 3024,
x2 − 1 = 3024,
x2 = 3025,

where x = n2 +3n+1. The above equation has two roots: x = ±55. Solving n2 +3n+1 =
55, we have two cases: n = 6 and n = −9. In the former, the four consecutive numbers
are 6, 7, 8, and 9, and in the latter they are −9, −8, −7, and −6. It is easy to check
that the equation n2 + 3n + 1 = −55 does not have real solutions.

21. Since 2100 ≡ (22 )50 ≡ 450 ≡ (−1)50 ≡ 1 (mod 5), the remainder is 1.
Note. There are many other ways to obtain this answer, e.g. 2100 ≡ (24 )25 ≡ 1625 ≡
125 ≡ 1 (mod 5).

23. If n is composite, then n = ab for some integers 1 < a, b < n. Then

2n − 1 = (2a )b − 1b = (2a − 1)((2a )b−1 + · · · + 2a + 1).

Both factors are bigger than 1: 2a − 1 > 21 − 1 = 1, and (2a )b−1 + · · · + 2a + 1 > 1, so
2n − 1 is composite.

25. The problem is equivalent to the following question: what is the highest value of n for
which 100! = 10n · a where a an integer? Since the prime factorization of 10 is 2 · 5,
let’s determine how many factors 2 and 5 appear in the prime factorization of 100!. We
100
will start with 5. First, = 20 of the numbers 1 through 100 are divisible by 5, so
5
100
their prime factorizations contain at least one 5 each. However, = 4 of them are
25
divisible by 25, so their prime factorizations contain a second factor of 5. No numbers
from 1 to 100 are divisible by 125, so there is a total of 20 = 4 = 24 factors of 5 in
the prime factorization of 100! It is easy to see that there are many more factors of 2
since there are 50 even numbers, so there are at least 50 factors of 2. Thus, there are
24 zeros at the end of 100!.

27. (a) If there are integers x and y such that x2 + 10y = 5xy + 2, then x2 ≡ 2 (mod 5).
However, we can check all cases for x (namely, we have x ≡ 0 (mod 5), x ≡ ±1
(mod 5), or x ≡ ±2 (mod 5)), and in no case x2 ≡ 2 (mod 5).
(c) Suppose the equation has an integral solution. Consider the equation modulo 3.
The number x is congruent to 0, 1, or 2 modulo 3. Then x2 is congruent to either
0 or 1 modulo 3 (because 02 = 0, 12 = 1, and 22 ≡ 4 ≡ 1(mod 3)). The number
3y 2 is congruent to 0 modulo 3 since 3y 2 is divisible by 3. Thus the left hand side
is congruent to either 0 or 1 modulo 3. However, the right hand side is 17 which
is congruent to 2 modulo 3. We get a contradiction.
110 SOLUTIONS AND ANSWERS

29. (a) Solution 1. Rewrite the equation as xy − x − y = 0. Adding 1 to both sides gives
xy − x − y + 1 = 1, and factoring the left hand side gives (x − 1)(y − 1) = 1. Since
x − 1 and y − 1 are integers and their product is equal to 1, they are either both 1
or both −1. If they are both 1, then x = 2 and y = 2. If they are both −1, then
x = 0 and y = 0. Thus we have two solution pairs.
Solution 2. Rewrite the equation as y(x − 1) = x. Consider the following two
cases.
Case I: x − 1 = 0, then x = 1. The equation becomes 0 = 1 which is impossible.
x
Case II: x − 1 6= 0. Then y = . If y is an integer, then (x − 1) | x. Since
x−1
(x − 1) | (x − 1), (x − 1) | (x − (x − 1)), i.e. (x − 1) | 1. Then either x − 1 = 1 or
x − 1 = −1. Therefore either x = 2 (and then y = 2) or x = 0 (and then y = 0).
(c) The given equation can be rewritten as follows:
x2 − 2x + y 2 − 2y + z 2 − 2z + 2 = 0
x2 − 2x + 1 + y 2 − 2y + 1 + z 2 − 2z + 1 = 1
(x − 1)2 + (y − 1)2 + (z − 1)2 = 1.
It follows that one of x − 1, y − 1, and z − 1 is ±1 and the other ones are 0, thus
we have the following solutions: (2, 1, 1), (0, 1, 1), (1, 2, 1), (1, 0, 1), (1, 1, 2), and
(1, 1, 0).
31. (a) Notice first of all that y must be even because 3y = 100−2x and the right hand side
is even. Second, y must be positive. Third, y cannot exceed 32 because if y ≥ 34,
then 3y ≥ 102 and then x would have to be negative. If y satisfies all the above
conditions, namely, y is even and 2 ≤ y ≤ 32, then 3y is even and 6 ≤ 3y ≤ 96, so
100 − 3y is even and 4 ≤ 100 − 3y ≤ 94, so there exists a positive integer x such
that 2x = 100 − 3y. Thus for any even y such that 2 ≤ y ≤ 32 we have a unique
solution pair (x, y). There are 16 even numbers satisfying 2 ≤ y ≤ 32, thus 16
pairs are solutions to the given equation.
33. (a) Yes. Let’s find the remainder of 1239999 upon division by 4567 and subtract the
remainder from 1239999. We’ll get a number that satisfies the required conditions.
Since 1239999 = 4567 · 271 + 2342, the number 1237657 = 1239999 − 2342 =
4567 · 271 is divisible by 4567.
Note. This, of course, is not the only such number. Another one is 1237657 −
4567 = 1233090. Also, we could have started with e.g. 12399999, etc.
35. Appending 3 to a three-digit number on the left is equivalent to adding 3000. Let the
original number be x. Then we have 3000 + x = 9x. It follows that 8x = 3000, so
x = 375.
37. Appending 36 to a number on the right is equivalent to adding 36 to 100 times the
number. Let the original number be x. Then we have 100x + 36 = 103x. It follows
that 3x = 36, so x = 12.
39. The last digit in the product is 4 which means the last digit in 12 multiplied by the
last digit in 30 has to end with 4. So the last digit in 30 has to be either 2 or 7.
Now, the last two digits in the product are determined by the last two digits in each
number, thus the product is 33,824 in the first case (because 12 · 2 = 24) and 33,884 in
the second case (because 12 · 7 = 84). Since 33, 824/302 = 112 and 33, 884/307 is not
an integer, only the first case works, thus the whole equation is 112 × 302 = 33, 824.
The covered digits are 1, 2, 2, and their product is 4.
5. CASE ANALYSIS 111

41. Since 792 = 8 · 9 · 11, the number 13xy45z must be divisible by 8, 9, and 11. An integer
is divisible by 8 if and only if the three-digit number formed by its last three digits
is divisible by 8, so 45z must be divisible by 8. This gives us z = 6 (it is easy to see
that 456 is the only number of the above form that is divisible by 8). Now we have the
number 13xy456. It is divisible by 9 if and only if the sum of its digits is divisible by
9. Since 1 + 3 + 4 + 5 + 6 = 19, we see that x + y must be 8 or 17. Finally, the number
is divisible by 11 if and only if the alternating sum of its digits is divisible by 11, that
is, 1 − 3 + x − y + 4 − 5 + 6 = x − y + 3 must be 0 or 11. This implies that x − y is −3
or 8. Combining with the previous condition, we have four cases:
If x + y = 8 and x − y = −3, then there are no integer solutions.
If x + y = 8 and x − y = 8, then x = 8 and y = 0.
If x + y = 17 and x − y = −3, then x = 7 and y = 10. However, 10 is not a single digit,
so again we have no solutions.
If x + y = 17 and x − y = 8, then there are no integer solutions.
Thus the number is 1380456.
√3
43. (a) Suppose that the number 25 is rational. Then it can be written as an irreducible
√ m m3
quotient: 25 = , m, n ∈ Z, gcd(m, n) = 1. Then 25 = 3 , so 25n3 = m3 .
3

n n
Now there are several ways to get a contradiction.
Way 1. From the last equation, 5 | m, so m = 5a for some integer a. Then
25n3 = (5a)3 , so 25n3 = 125a3 , thus n3 = 5a3 . Now we see that 5 | n. Thus both
m and n are divisible by 5, which contradicts the condition gcd(m, n) = 1.
Way 2. If n = 1, then 25 = m3 which is impossible. If n > 1, then n | m which
contradicts gcd(m, n) = 1.
Way 3. We have 5 · 5 · n3 = m3 . Both n and m can be written as products of
primes. Since n and m are cubed, the number of 5s on the left is 2 plus a multiple
of 3, and the number of 5s on the right is a multiple of 3. This contradicts the
fundamental theorem of arithmetic.

5 Case analysis
1. (a) Consider the following two cases.
Case I: 2x − 2 ≥ 0, or, equivalently, x ≥ 1. Then |2x − 2| = 2x − 2, and the
equation becomes x2 + 2x − 2 = 1, or x2 + 2x − 3 = 0. We have two roots: x = 1
and x = −3. However, only the first root satisfies the condition x ≥ 1, so we
disregard the second root.
Case II: 2x − 2 < 0, or, equivalently, x < 1. Then |2x − 2| = −(2x − 2), and the
equation becomes x2 − (2x − 2) = 1, or x2 − 2x + 1 = 0. We have one root: x = 1.
It does not satisfy the condition x < 1, so we disregard it. (Note, however, that
this was a root in the first case, so we still keep it in the end.)
So the equation has only one root: x = 1.

3. (a) Consider the following two cases.


6
Case I: 5x − 6 ≥ 0, or, equivalently, x ≥ . Then |5x − 6| = 5x − 6, and the
5
2
inequality becomes x − 5x + 6 ≤ 0, or (x − 2)(x − 3) ≤ 0. The solution interval
6
is [2, 3], all of whose values satisfy the condition x ≥ .
5
112 SOLUTIONS AND ANSWERS

6
Case II: 5x − 6 < 0, or, equivalently, x < . Then |5x − 6| = −(5x − 6), and the
5
2
inequality becomes x + 5x − 6 ≤ 0, or (x + 6)(x − 1) ≤ 0. The solution interval
6
is [−6, 1], all of whose values satisfy the condition x < .
5
The solution set to the original inequality is the union of the above intervals, that
is, [−6, 1] ∪ [2, 3].

(c) Consider the following two cases.


15
Case I: 7x + 15 ≥ 0, or, equivalently, x ≥ − . Then |7x + 15| = 7x + 15, and the
7
2 2
inequality becomes x − 7x − 15 ≥ 3, or x − 7x − 18 ≥ 0, or (x + 2)(x − 9) ≥ 0.
The solution set is (−∞, −2] ∪ [9, ∞). However, we shouldrestrict it to the values
15 15
satisfying the condition x ≥ − , so we obtain − , −2 ∪ [9, ∞).
7 7
15
Case II: 7x + 15 < 0, or, equivalently, x < − . Then |7x + 15| = −(7x + 15), and
7
the inequality becomes x2 + 7x + 15 ≥ 3, or x2 + 7x + 12 ≥ 0, or (x + 4)(x + 3) ≥ 0.
The solution set is (−∞, −4] ∪ [−3, ∞). However, we should restrict  it tothe
15 15
values satisfying the condition x < − , so we obtain (−∞, −4] ∪ −3, − .
7 7
The solution set to the original inequality is the union of the above solution sets,
that is, (−∞, −4] ∪ [−3, −2] ∪ [9, ∞).

(e) Answer: the inequality does not have any real solutions.

5. (a) The graph of y = |x2 − 4| is obtained from the graph of y = x2 − 4 by reflecting the
portion below the x-axis (that is, between x = −2 and x = 2) about the x-axis.
Then we shift the graph 2 units up to obtain the following curve.

7 y
6
5
4
3
2
1
x
−3 −2 −1 1 2 3

(c) First let’s sketch the graph of g(x) = x + |x + 2|.


Case I: x + 2 ≥ 0, or x ≥ −2. Then |x + 2| = x + 2, so g(x) = x + (x + 2) = 2x + 2.
Case II: x + 2 < 0, or x < −2. Then |x + 2| = −(x + 2), so g(x) = x − (x + 2) = −2.

2x + 2 if x ≥ −2
Thus g(x) = . Its graph is shown below.
−2 if x < −2
5. CASE ANALYSIS 113

y
3

1
x
−3 −2 −1 1 2 3
−1

−2

−3

Since f (x) = |x + |x + 2|| = |g(x)|, the graph of f (x) is obtained from the graph
of g(x) by reflecting the piece below the x-axis about the x-axis:

y
3

1
x
−3 −2 −1 1 2 3
−1

−2

−3

7. (a) Case I: x ≥ 0, y ≥ 0. The inequality becomes x + y 3 < 8, or x < 8 − y 3 .

Case II: x ≥ 0, y < 0. The inequality becomes x − y 3 < 8, or x < 8 + y 3 .

Case III: x < 0, y ≥ 0. The inequality becomes −x + y 3 < 8, or x > y 3 − 8.

Case IV: x < 0, y < 0. The inequality becomes −x − y 3 < 8, or x > −8 − y 3 .

Now we draw the corresponding region in each quadrant, and we get the following
figure.
114 SOLUTIONS AND ANSWERS

1
x
−8 −1 1 8
−1

−2

Note: since the inequality is strict, the boundary of the region is excluded.

(c) Since y − x can be nonnegative or negative and x + y can be nonnegative or


negative, we have four cases.

Case I

x
Case II Case III

Case IV

Case I: y − x ≥ 0, x + y ≥ 0. The inequality becomes 2y − 2x + y + x ≤ 1, or


x+1
3y ≤ x + 1, or y ≤ .
3
Case II: y − x ≥ 0, x + y < 0. The inequality becomes 2y − 2x − y − x ≤ 1, or
y ≤ 3x + 1.
Case III: y − x < 0, x + y ≥ 0. The inequality becomes −2y + 2x + y + x ≤ 1, or
−y ≤ 1 − 3x, or y ≥ 3x − 1.
Case IV: y − x < 0, x + y < 0. The inequality becomes −2y + 2x − y − x ≤ 1, or
x−1
−3y ≤ 1 − x, or y ≥ .
3
Now we sketch the region in each case.
5. CASE ANALYSIS 115

y
y = 3x − 1

x+1
y=
3

x−1
y=
3
y = 3x + 1

9. (a) The given equation is in the form ab = 1 where a = x and b = x2 − 7x + 12. Thus
we consider the following three cases.
Case I: a = 1. Then x = 1.
Case II: a 6= 0 and b = 0. The second equation gives x = 3 or x = 4, which are
both nonzero, so they are roots of the original equation as well.
Case III: a = −1 and b is even. Then x = −1, and b = (−1)2 − 7(−1) + 12 is
indeed even.
Thus there are four roots: −1, 1, 3, and 4.
(c) Answer: −1, 1.

11. (a) Let us consider the following three cases for the second equation.
Case I: x = 1. Then the first equation implies y = 0.
Case II: x 6= 0 and y = 0. Then the first equation becomes x2x = 1, thus we have
three cases again.
Case IIA: x = 1. This gives the same solution as in Case I.
Case IIB: x 6= 0 and 2x = 0. This system does not have any solutions.
Case IIC: x = −1 and 2x is even. Indeed, 2x is even for x = −1.
Case III: x = −1 and y is even. This will give the same solution as in Case IIC.
Thus there are only two solutions: (1, 0) and (−1, 0).
(b) Answer: (1, −1), (1, 1), (4, −2).

13. Solution 1. Let’s consider all four possible cases for the false statement.
Case I: Statement A is false. Then Statement D is false. Since only one statements is
false, this case is not possible.
Case II: Statement B is false. Then A is true, which implies that D is true, which in
turn implies that C is true. So this case works out. Let’s still consider the other cases
in order to exclude any other possibilities.
Case III: Statement C is false. Then B is true, so A is false, which is not possible.
Case IV: Statement D is false. Then C is false as well, which is not possible.
Thus the false statement must be Statement B.
Solution 2. Consider two cases for Statement A.
Case I: Statement A is true. Then D is false, C is true, and B is false. This case works.
116 SOLUTIONS AND ANSWERS

Case II: Statement A is false. Then Statement D is false. Since only one statements is
false, this case is not possible.
Therefore the false statement is Statement B.

15. First, consider two cases for the green octopus.


Case I: the green octopus says the truth. Then the blue octopus has six legs, thus must
say the truth. However, the blue octopus says it has eight legs, so that cannot be the
case.
Case II: the green octopus lies. Then consider two cases for the blue octopus.
Case IIA: the blue octopus says the truth. Then it has eight legs, and the first statement
of the purple octopus is true. So it says the truth, but then it can’t have nine legs. So
this case is impossible.
Case IIB: the blue octopus lies also. Therefore the purple octopus lies as well. Then,
the first statement of the striped octopus is correct, therefore its second statement must
be correct as well.
Thus, the striped octopus is the only one with eight legs.

17. Consider all possible factorizations of 36 into a product of three factors, and compute
the sum of these factors:

• 1 + 1 + 36 = 38
• 1 + 2 + 18 = 21
• 1 + 3 + 12 = 16
• 1 + 4 + 9 = 14
• 1 + 6 + 6 = 13
• 2 + 2 + 9 = 13
• 2 + 3 + 6 = 11
• 3 + 3 + 4 = 10

Only the sum 13 is repeated. So the friend’s birthday must be on the 13th, and that’s
why the information given first was not sufficient. Once she was told that there was an
“oldest” sibling, she was able to determine that the ages must be 2, 2, and 9.

6 Finding a pattern
1. (a) an = n2 .
(c) an = 2n + 3.
(e) an = 5 − 2n.


3n  3n − 1

 if n is odd
(g) an = = 2 .
2 3n

 if n is even
2
n
(i) an = n .
2
6. FINDING A PATTERN 117

1 1 1
3. Let Sn = + + ··· + . Then
1·3 3·5 (2n − 1)(2n + 1)
1 1
S1 = = ,
1·3 3
1 1 6 2
S2 = + = = ,
1·3 3·5 15 5
2 1 15 3
S3 = + = = ,
5 5·7 35 7
3 1 28 4
S4 = + = = .
7 7·9 63 9
n
We guess from the above calculations that Sn = . We will prove this formula by
2n + 1
Mathematical Induction.
1
Basis step. If n = 1, the formula S1 = is correct.
2·1+1
n k
Inductive step. Suppose the formula Sn = holds for n = k, i.e. Sk = .
2n + 1 2k + 1
k+1
We want to prove that it holds for n = k + 1, i.e. Sk+1 = .
2(k + 1) + 1
1 1 1 1
Indeed, Sk+1 = + + ··· + + =
1·3 3·5 (2k − 1)(2k + 1) (2(k + 1) − 1)(2(k + 1) + 1)
1 k 1 k(2k + 3) + 1
Sk + = + = =
(2k + 1)(2k + 3) 2k + 1 (2k + 1)(2k + 3) (2k + 1)(2k + 3)
2
2k + 3k + 1 (2k + 1)(k + 1) k+1 k+1
= = = .
(2k + 1)(2k + 3) (2k + 1)(2k + 3) 2k + 3 2(k + 1) + 1
2n−1
Y  (−1)i
      
−1 1 −1 −1
5. Let P (n) = 1− = 1− 1− 1− ... 1 − .
i=1
i 1 2 3 2n − 1
4 6
First we compute the first few values of P (n): P (1) = 2, P (2) = , P (3) = ,
3 5
8 2n
P (4) = . It appears that P (n) = . This formula can be computed using
7 2n − 1
Mathematical Induction.
7. Computing the first few terms of the sequence, we have a1 = 1, a2 = 2, a3 = 4,
a4 = 8, a5 = 16. It appears that an = 2n−1 . We will prove this formula by Strong
Mathematical Induction. The basis step consists of a1 = 1 and a2 = 2 which are
given. For the inductive step, assume an = 2n−1 for all n from 1 to k, inclusive. Then
ak+1 = ak + 2ak−1 = 2k−1 + 2 · 2k−2 = 2k−1 + 2k−1 = 2k as desired.
9. First we compute fn (x) for the first few values of n:

f1 (x) = 2x + 1,
f2 (x) = 2(2x + 1) + 1 = 4x + 3,
f3 (x) = 2(4x + 3) + 1 = 8x + 7,
f4 (x) = 2(8x + 7) + 1 = 16x + 15.

It appears that fn (x) = 2n x + 2n − 1, so we will try to prove this formula by Mathe-


matical Induction.
Basis step. If n = 1, then our formula gives f1 (x) = 2x + 1 which is true.
118 SOLUTIONS AND ANSWERS

Inductive step. Suppose the formula holds for n = k, i.e. fk (x) = 2k x + 2k − 1. Then
fk+1 (x) = f1 ◦ fk (x) = 2(2k x + 2k − 1) + 1 = 2k+1 x + 2k+1 − 2 + 1 = 2k+1 x + 2k+1 − 1.
Thus the formula holds for n = k + 1.
11. (a) As discussed in chapter 4, the units digit of a positive number is its remainder
upon division by 10.
Solution 1. First we find the units digit of 107n for some small values of n:

1071 ≡ 7 (mod 10),


1072 ≡ 107 · 107 ≡ 7 · 7 ≡ 49 ≡ 9 (mod 10),
1073 ≡ 1072 · 107 ≡ 9 · 7 ≡ 63 ≡ 3 (mod 10),
1074 ≡ 1073 · 107 ≡ 3 · 7 ≡ 21 ≡ 1 (mod 10),
1075 ≡ 1074 · 107 ≡ 1 · 7 ≡ 7 (mod 10),
1076 ≡ 1075 · 107 ≡ 7 · 7 ≡ 49 ≡ 9 (mod 10).

We see that the units digits start repeating. Namely, as we keep multiplying our
number by 107, the 4-tuple of units digits 7, 9, 3, and 1 keep repeating. More
precisely, 

 7 (mod 10) if n ≡ 1 (mod 4)
9 (mod 10) if n ≡ 2 (mod 4)

107n ≡ .

 3 (mod 10) if n ≡ 3 (mod 4)
1 (mod 10) if n ≡ 0 (mod 4)

This formula can be proved by Strong Mathematical Induction.


Basis step. If n = 1, then 107n ≡ 7 (mod 10) is true.
Inductive step. Suppose the formula holds for all 1 ≤ n ≤ k. We want to prove
that it holds for n = k + 1.
Case I: k + 1 = 2. Then k + 1 ≡ 2 (mod 4), and 1072 ≡ 9 (mod 10) is true.
Case II: k + 1 = 3. Then k + 1 ≡ 3 (mod 4), and 1073 ≡ 3 (mod 10) is true.
Case III: k + 1 = 4. Then k + 1 ≡ 0 (mod 4), and 1074 ≡ 1 (mod 10) is true.
Case IV: k + 1 ≥ 5. Then k − 3 = (k + 1) − 4 ≥ 1, and we assumed that the
formula above was true for n = k − 3.
We consider all possible remainders of k + 1 modulo 4.
Case IVA: k +1 ≡ 1 (mod 4). Then k −3 ≡ 1 (mod 4), so 107k+1 ≡ 107k−3 ·1074 ≡
107k−3 · 1 ≡ 7 (mod 10).
Case IVB: k+1 ≡ 2 (mod 4). Then k−3 ≡ 2 (mod 4), so 107k+1 ≡ 107k−3 ·1074 ≡
107k−3 · 1 ≡ 9 (mod 10).
Case IVC: k+1 ≡ 3 (mod 4). Then k−3 ≡ 3 (mod 4), so 107k+1 ≡ 107k−3 ·1074 ≡
107k−3 · 1 ≡ 3 (mod 10).
Case IVD: k+1 ≡ 0 (mod 4). Then k−3 ≡ 0 (mod 4), so 107k+1 ≡ 107k−3 ·1074 ≡
107k−3 · 1 ≡ 1 (mod 10).
Thus the formula holds for n = k + 1.
Now, since 107 ≡ 3 (mod 4), 107107 ≡ 3 (mod 10), so the units digit of 107107 is
3.
Solution 2. As in solution 1, we compute the units digits of powers of 107 for a few
small exponents and discover the pattern. However, we will prove only part of this
pattern rather than the whole thing, namely, we will prove that if the exponent
is divisible by 4, then the power of 107 ends with 1. That is, we will prove that
for any nonnegative integer n, the number 1074n ends with 1. The base case is
1070 = 1 which ends with 1. For the inductive step, assume 1074k ends with 1.
6. FINDING A PATTERN 119

Then 1074(k+1) ≡ 1074k ·1074 ≡ 1074k ·1074 ≡ 1·74 ≡ 74 ≡ 492 ≡ 92 ≡ 1 (mod 10),
so 1074(k+1) ends with 1 as well. Now, 107107 ≡ 107104 · 1073 ≡ 1074·26 · 1073 ≡
1 · 73 ≡ 343 ≡ 3 (mod 10), so 107107 ends with 3.
Solution 3. Since 1074 ≡ 1 (mod 10) and 1073 ≡ 3 (mod 10) (as we saw above),
107107 ≡ 107104 · 1073 ≡ (1074 )26 · 1073 ≡ 126 · 1073 ≡ 1 · 3 ≡ 3 (mod 10), so 107107
ends with 3.
13. First we find the remainder of 2n upon division by 12 for some small n:
21 ≡ 2 ≡ 2 (mod 12),
22 ≡ 4 ≡ 4 (mod 12),
23 ≡ 8 ≡ 8 (mod 12),
24 ≡ 16 ≡ 4 (mod 12),
25 ≡ 32 ≡ 8 (mod 12).
We see that the remainders 4 and 8 start repeating. Namely,

4 (mod 12) if n is even
2n ≡ .
8 (mod 12) if n ≥ 3 is odd
As in problem 11, this can be proved by Strong Mathematical Induction. Since 100 is
even, the remainder of 2100 upon division by 12 is 4.
15. (a) For f (x) = sin(x), the first few derivatives are:
f 0 (x) = cos(x),
f 00 (x) = − sin(x),
f 000 (x) = − cos(x),
f (4) (x) = sin(x),
f (5) (x) = cos(x).
We got cos(x) again, so the derivatives cos(x), − sin(x), − cos(x), sin(x) will re-
peat. Therefore


 cos(x) if n ≡ 1 (mod 4)
− sin(x) if n ≡ 2 (mod 4)

(n)
f (x) = .

 − cos(x) if n ≡ 3 (mod 4)
sin(x) if n ≡ 0 (mod 4)

This formula can be proved by Strong Mathematical Induction (the proof is similar
to that in problem 11).
(c) For h(x) = 2e5x , the first few derivatives are:
h0 (x) = 2 · 5e5x ,
h00 (x) = 2 · 5 · 5e5x ,
h000 (x) = 2 · 5 · 5 · 5e5x .

We guess that h(n) (x) = 2 · 5n e5x , and prove this formula by Mathematical Induc-
tion.
Basis step. We have h0 (x) = 2 · 5e5x , so the formula holds for n = 1.
0
Inductive step. Suppose h(k) (x) = 2 · 5k e5x , then h(k+1) (x) = 2 · 5k e5x =
2 · 5k · 5e5x = 2 · 5k+1 e5x .
120 SOLUTIONS AND ANSWERS

17. First we find the number of regions for a few small values of n.

1 1 2 3 2 4
1
7 5
6
2 4
8
n=1 n=2 n=3
2 regions 4 regions 8 regions

16
15 17
7 8 9 7 8 9

1 3 2 3
10
6 2 10 14 6 1 18

5 4 5 4

13 11
13 12 11
12
21 19
20

14 22

n=4 n=5
14 regions 22 regions

The sequence is 2, 4, 8, 14, 22, . . . . The differences between consecutive terms are 2, 4,
6, 8, . . . . We guess that the differences are increasing consecutive even numbers, so the
number of regions into which n circles divide the plane is 2 + 2 + 4 + 6 + · · · + 2(n − 1) =
(n − 1)n
2 + 2(1 + 2 + 3 + · · · + (n − 1)) = 2 + 2 = 2 + (n − 1)n = n2 − n + 2.
2
Now we will prove this formula by Mathematical Induction.
Basis step. If n = 1, the formula gives 2, and it is true that there are 2 regions.
Inductive step. Suppose the formula is true for n = k circles. Given k + 1 circles,
temporarily remove one circle. The remaining k circles divide the plane into k 2 − k + 2
regions. Now add the (k + 1)-th circle back. This new circle intersects the old k circles
in 2k points. Thus the intersection points divide the new circle into 2k arcs. Therefore,
the number of regions increases by 2k (each arc divides an old region into 2). Then,
since k circles divided the plane into k 2 − k + 2 regions, k + 1 circles will divide it into
k 2 − k + 2 + 2k = k 2 + 2k + 1 − k − 1 + 2 = (k + 1)2 − (k + 1) + 2 regions, and thus
the formula holds for k + 1.

19. (a) We compute the first few Fibonacci numbers: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, and
notice that every third Fibonacci number is even. More precisely, Fn is even if
and only if n ≡ 0 (mod 3). Therefore exactly one third of F1 , F2 , . . ., F99 are
even which gives 33 numbers, and F0 is even, thus we have 34 even numbers total.
7. WORKING BACKWARDS 121

The pattern described above can be proved by Strong Mathematical Induction as


follows.
Basis step. If n = 0, Fn = F0 = 0 is even.
Inductive step. Suppose the statement “Fn is even if and only if n ≡ 0 (mod 3)”
holds for 0 ≤ n ≤ k. We will prove that the statement holds for n = k + 1.
Case I: k + 1 = 1. Then k + 1 6≡ 0 (mod 3), and F1 = 1 is indeed odd.
Case II: k + 1 = 2. Then k + 1 6≡ 0 (mod 3), and F2 = 1 is indeed odd.
Case III: k + 1 ≥ 3. Then we consider all possible remainders of k + 1 modulo 3.
Case IIIA: k + 1 ≡ 0 (mod 3). Then k ≡ 2 (mod 3) and k − 1 ≡ 1 (mod 3). By
the inductive hypothesis Fk and Fk−1 are both odd, so Fk+1 = Fk + Fk−1 is even.
Case IIIB: k + 1 ≡ 1 (mod 3). Then k ≡ 0 (mod 3) and k − 1 ≡ 2 (mod 3). By
the inductive hypothesis Fk is even and Fk−1 is odd, so Fk+1 = Fk + Fk−1 is odd.
Case IIIC: k + 1 ≡ 2 (mod 3). Then k ≡ 1 (mod 3) and k − 1 ≡ 0 (mod 3). By
the inductive hypothesis Fk is odd and Fk−1 is even, so Fk+1 = Fk + Fk−1 is odd.
(c) Answer: 20.
20. Hint: do not try to list all the ways. There are too many of them! Instead, replace
10 by small numbers, and guess the pattern. Prove your guess using Mathematical
Induction.

7 Working backwards
1. (a) Since
46 = 1 · 32 + 14,
32 = 2 · 14 + 4,
14 = 3 · 4 + 2,
4 = 2 · 2,
we have d = gcd(46, 32) = 2. Then
2 = 14 − 3 · 4
= 14 − 3(32 − 2 · 14) = 7 · 14 − 3 · 32
= 7(46 − 1 · 32) − 3 · 32 = 7 · 46 − 10 · 32,
so x = 7 and y = −10.
(c) Since
96 = 1 · 54 + 42,
54 = 1 · 42 + 12,
42 = 3 · 12 + 6,
12 = 2 · 6,
we have d = gcd(96, 54) = 6. Then
6 = 42 − 3 · 12
= 42 − 3(54 − 1 · 42) = 4 · 42 − 3 · 54
= 4(96 − 1 · 54) − 3 · 54 = 4 · 96 − 7 · 54,
so x = 4 and y = −7.
122 SOLUTIONS AND ANSWERS

3. Choose any remainder r7 and quotients q1 through q8 . For example, if we let all of
these be equal to 2, then
r6 = q8 · r7 = 2 · 2 = 4,
r5 = q7 · r6 + r7 = 2 · 4 + 2 = 10,
r4 = q6 · r5 + r6 = 2 · 10 + 4 = 24,
r3 = q5 · r4 + r5 = 2 · 24 + 10 = 58,
r2 = q4 · r3 + r4 = 2 · 58 + 24 = 140,
r1 = q3 · r2 + r3 = 2 · 140 + 58 = 338,
b = q2 · r1 + r2 = 2 · 338 + 140 = 816,
a = q1 · b + r1 = 2 · 816 + 338 = 1970.
Then reversing the order of the above equations gives divisions in Euclid’s algorithm.
5. To obtain the smallest possible value of a (and b < a), we need to choose the remainders
and quotients in
r4 = q6 · r5 ,
r3 = q5 · r4 + r5 ,
r2 = q4 · r3 + r4 ,
r1 = q3 · r2 + r3 ,
b = q2 · r1 + r2 ,
a = q1 · b + r1
as small as possible. These remainders and quotients have to be positive, and also we
must have r4 > r5 , so r4 must be at least 2. To get the smallest possible value of r3 ,
we let r5 = 1, r4 = 2, and q5 = 1 (so q6 = 2). After that, we let all quotients be equal
to 1, so
r4 = q6 · r5 = 2 · 1 = 2,
r3 = q5 · r4 + r5 = 1 · 2 + 1 = 3,
r2 = q4 · r3 + r4 = 1 · 3 + 2 = 5,
r1 = q3 · r2 + r3 = 1 · 5 + 3 = 8,
b = q2 · r1 + r2 = 1 · 8 + 5 = 13,
a = q1 · b + r1 = 1 · 13 + 8 = 21.

7. Let f 5 (N ) = 1. First, f (x) = 1 has only one solution, namely, x = 2 (to find it, we
x
solve = 1 to obtain x = 2 and 3x + 1 = 1 to obtain x = 0; however, 0 is not odd, so
2
we disregard it). So f 4 (N ) = 2. Since 2 is not in the form 3x + 1, f (x) = 2 also has
4
only one solution, namely, x = 4 (as = 2). Thus f 3 (N ) = 4. However, f (x) = 4 has
2
x
two solutions: x = 8 and x = 1 (which are obtained by solving = 4 and 3x + 1 = 4,
2
respectively). So f 2 (N ) is either 8 or 1. For the first case, we solve f (x) = 8 to find the
unique solution x = 16 (as 8 is not in the form 3x + 1), so f (N ) = 16. Then N is 32 or
N
5 (again, we solve two equations: = 16 and 3N + 1 = 16). For the case f 2 (N ) = 1,
2
we already know from the above work that there is only one solution: N = 4. Thus
the given equation has three roots total: 4, 5, and 32.
7. WORKING BACKWARDS 123

9. Let’s look at such list of numbers from the end. The last value in the list has two
options: it must be either the smallest or the largest, that is, either 1 or n. The next
to last value also has two options: it must be either the smallest or the largest from
the first n − 1 values. (That is, if the last value is 1, then the next to last one must be
either 2 or n, and if the last value is n, then the next to last one must be either 1 or
n − 1). The value before the next to last one again has two options, and so on, until the
second value in the list. The very first value then will have just one option: whichever
value remains at that point. So, there are 2n−1 ways to place the numbers 1 through
n so that to satisfy the given condition.
11. Solution 1. Suppose the 4-tuple 0, 5, 0, 5 does occur. Then before it we must have the
digit 0, and before that 5, and before that another 0, and so on—in fact, we will prove
that all the digits in our sequence must be 0s and 5s. Indeed, solving

an ≡ an−4 + an−3 + an−2 + an−1 (mod 10)

for an−4 gives


an−4 ≡ an − an−3 − an−2 − an−1 (mod 10).
This implies
an−4 ≡ an − an−3 − an−2 − an−1 (mod 5).
Thus if four consecutive digits are divisible by 5, then the previous digit is divisible by
5. It follows that all the digits in the sequence are divisible by 5. However, the starting
sequence 1, 2, 3, 4 contains numbers not divisible by 5. We have a contradiction.
Solution 2. If the 4-tuple 0, 5, 0, 5 does occur, look at the very first time it occurs.
Then working backwards, determine a few digits before these four:

1, 2, 3, 4, . . . . . . , 0, 5, 0, 5, . . .
1, 2, 3, 4, . . . . . . , 0, 0, 5, 0, 5, . . .
1, 2, 3, 4, . . . . . . , 5, 0, 0, 5, 0, 5, . . .
1, 2, 3, 4, . . . . . . , 0, 5, 0, 0, 5, 0, 5, . . .
1, 2, 3, 4, . . . . . . , 5, 0, 5, 0, 0, 5, 0, 5, . . .
1, 2, 3, 4, . . . . . . , 0, 5, 0, 5, 0, 0, 5, 0, 5, . . .

We see that we have this 4-tuple in the sequence again, hence the one we started with
was not the first occurrence. We have a contradiction.
13. We want to force our opponent to take the last counter. Thus we have to leave 1
counter on our last turn. To ensure that we will be able to do that, we will leave 6
counters on our next to last turn (then if our opponent takes 1, we take 4 and leave 1;
if our opponent takes 2, we take 3; if they take 3, we take 2; if they take 4, we take 1).
On the turn before the next to last we’ll leave 11, and so on. Continue in this manner
and notice the pattern: we want to leave a number congruent to 1 modulo 5. Thus we
want to go first, take 1 counter and leave 26. Then no matter how our opponent plays
we will be able to leave 21, 16, 11, 6, 1. (This is a winning strategy for the first player.)
15. In order to win we want to take the last counter. We do not want to leave 1 or 2 counters
as our opponent would be able to take them and win. So leaving 1 or 2 counters is a
bad position. However, leaving 3 counters is good: our opponent will be able to take
1 or 2 counters leaving us with 2 or 1, respectively. We do not want to leave 4 or 5
counters as our opponent would be able to take 4 or 2, respectively, and either win
right away or get into a good position. Leaving 6 is good: our opponent will be able to
124 SOLUTIONS AND ANSWERS

take 1, 2, or 4, leaving us with 5, 4, or 2 respectively, and all of these are bad positions.
Now we see that we want to go first and take 4 counters on our first turn. This will
leave 6. Then, as described above, we will win. (This is a winning strategy for the first
player.)

17. This problem is similar to problem 15, just involves bigger numbers. Working in a way
similar to the one given above for problem 15, we find that leaving 3, 6, or 9 counters is
good while leaving 1, 2, 4, 5, 7, or 8 counters is bad. We notice that the numbers 3, 6,
9 are multiples of 3 and guess that this pattern continues. We will prove that leaving
multiples of 3 is indeed a winning strategy. Suppose we leave a multiple of 3. Our
opponent will take a power of 2. Since a power of 2 is not divisible by 3, they will leave
a number not divisible by 3. Then we can take its remainder (1 or 2) upon division by
3 and leave a multiple of 3 again. Thus we want to go first, take 2 counters, and leave
48 (or take 8 and leave 42, or take 32 and leave 18). Then, each time we will be able
to leave a multiple of 3. Thus sooner or later we’ll leave 0, and we will win.

19. In order to win, we want to leave 1 match on our last turn so that our opponent cannot
take it and loses. We do not want to leave 2 matches on our turn as our opponent
would be able to take 1 and leave 1. It is good to leave 3 matches: our opponent can
only remove 1 leaving us with 2. However, it is bad to leave 4, 5, or 6 as our opponent
would be able to take 1, 2, or 3, respectively, and leave 3. Continuing in this manner,
we see that leaving 7 is good, leaving any number from 8 to 14 inclusive is bad, and
leaving 15 is good again. Notice that the numbers of matches we should leave on our
turn (going backwards) are 1, 3, 7, 15. These all are one less than powers of 2. So
it seems (and we will confirm this below) that the strategy is to always leave one less
than a power of 2. Thus we get a winning strategy for the first player. If we play first,
we should remove 45 matches leaving 255; the opponent will remove some number from
1 to 127 (inclusive), leaving some number between 254 and 128 (inclusive). We will
then be able to remove the some number between 127 and 1 leaving 127 (which means
that we removed no more than half); the opponent will remove some number between 1
and 63 leaving some number between 126 and 64. We will remove the required number
between 63 and 1 to leave 63; the opponent will remove 1-31 leaving 62-32. We will
remove the required number between 31 and 1 to leave 31; the opponent will remove
1-15 leaving 30-16. We will remove the required number between 15 and 1 to leave 15.
Then, as described above, we will leave 7, 3, and, finally, 1, and we win.

21. Writing 0 is a losing move. Writing 1 is good since then the only opponent’s choice
is to subtract 1 and write 0. Writing 2 is bad since the opponent can subtract 1 and
write 1. Writing 3 is good since the opponent can only subtract 1 or 3 and write 2 or
0, respectively, both of which are bad positions. Then, 4 is a bad position since the
opponent can subtract 1 and write 3 which is good. Continuing in this manner, we
notice that every odd number is a good position and every even number is bad. If we
don’t want to go all the way to 55 and check this manually, we need to prove that this
pattern will continue. To do so, we can prove that from any odd number one can only
go to an even number, and from any even number it is possible to go to an odd one.
Indeed, any divisor of an odd number is odd, and subtracting an odd number from an
odd number always results in an even number. Thus, if we write an odd number on our
turn, our opponent will be forced to write an even number. Next, 1 is a divisor of any
number, thus from any even number we can subtract 1 and obtain an odd one. That
is, when our opponent writes an even number, we can get to an odd one. Therefore,
we will always force our opponent to a bad position and then be able to get to a good
7. WORKING BACKWARDS 125

one on our turn. Since 55 is odd, the first player will be forced to go to a bad position
(even number), and the second player has a winning strategy.
23. Again, working backwards, we will determine good and bad positions. First, 1000 is
good. Then, 999 is bad as it is possible to add 1 and get to 1000. The number 998
is bad as well as it is possible to add 2 and get to 1000. So is 997, and 996, and, in
fact, all numbers from 501 to 999 are bad as from each one it is possible to get to 1000.
However, 500 is good as our opponent can only add a number from 1 to 499 and get to
a range from 501 to 999, and all numbers in that range are bad. Continuing in similar
manner, we find that 251-499 are bad, 250 is good, 126-249 are bad, 125 is good, 63-124
are bad, 62 is good, 32-61 are bad, 31 is good, 16-30 are bad, 15 is good, 8-14 are bad,
7 is good, 4-6 are bad, 3 is good, and 2 is bad. Since, starting from 2, the first player
can get to 3, which is a good position, the first player has a winning strategy in this
game.
25. First we mark (with a plus sign) the bottom left corner as a good position, and those
squares to which it is possible to get to it we mark (with a minus sign) as a bad position
(because if we go there, our opponent will be able to move to the winning position).
Then those squares from which it is possible to get to only bad positions we mark as
good (if we go there, we know our opponent will only be able to go to a bad position,
from which we’ll move to a good one).

+
− − − −
+ − + − +

We mark those squares from which it is possible to get to a good one as bad again, and
repeat this process until we have filled the whole board.

+ − + − + − +
− − − − − − −
+ − + − + − +
− − − − − − − − −
+ − + − + − + − +
− − − − − − − − − − −
+ − + − + − + − + − +

Note that at each step, for a square to be marked as bad it is sufficient to have just one
move from it to a good one; while for a square to be marked as good all moves from
this square must lead to bad ones. Since the top right corner is a good position, the
second player has a winning strategy. The first player will have to move to one of the
bad positions, and then the second player can move to a good one at each step.
27. The process is similar to that of the previous two problems. The first step and the
whole board are shown below.
126 SOLUTIONS AND ANSWERS

− − − + − − − − −
− + − − − − − − −
− − − + − − − − −
− + − − − − − − −
− − − + − − − − −
− + − − + − + − +
− − − − − − − − − −
+ − + − + − + − + −

If the counter is initially placed in one of the bad positions, the first player has a winning
strategy (namely, the first player should move the counter to any of the good positions
on each move). If the counter initially placed in one of the good positions, the second
player has a winning strategy.

29. Possible positions in this game are of the form (a, b) where 0 ≤ a ≤ 6 and 0 ≤ b ≤ 6
represent the numbers of counters in the first and second pile, respectively. These can
be organized in a square grid.

6
5
second pile

4
3
2
1
0
0 1 2 3 4 5 6
first pile

Then this game is equivalent to that in problem 25. We have determined before that
the second player has a winning strategy, namely, on each move they should put the
counter in an (odd, odd) position.

+ − + − + − +
− − − − − − −
+ − + − + − +
− − − − − − −
+ − + − + − +
− − − − − − −
+ − + − + − +

However, notice that an odd position, horizontally or vertically, in the board game
corresponds to an even number of counters left in the corresponding pile. (In particular,
the bottom left corner corresponds to zero counters in each pile.) Thus, in this game
the second player has a winning strategy: they should always leave an even number of
counters in each pile.
8. INVARIANTS 127

31. Hint. This game is equivalent to the following one.


A counter is placed in the upper right corner of an 8 × 8 board. Two players take turns
moving a counter. It can be moved one space to the left, one space down, diagonally
one space to the left and one down, or diagonally one space to the left and one up. The
player who cannot make a move loses.
Answer. The winning positions in this game are the same as those in problem 25.

33. The derivative of a cubic polynomial is a quadratic polynomial. We want this quadratic
polynomial to have integer roots. Instead of trying random coefficients a, b, c, and d,
let’s choose the roots of the quadratic polynomial (the derivative of f ), and then find
f.
Choose the roots, e.g. r1 = 3 and r2 = 5. Then (x − 3)(x − 5) = x2 − 8x + 15.
1
Now f (x) can be any antiderivative of this polynomial, say, x3 − 4x2 + 15x − 3.
3
However, we want it to have integer coefficients, so let’s multiply this function by 3:
f (x) = x3 −12x2 +45x−9. Then f 0 (x) = 3x2 −24x+45 = 3(x2 −8x+15) = 3(x−3)(x−5)
has integer roots.
Here is another choice of roots and the constant d: r1 = −3, r2 = 4, (x+3)(x−4) = x2 −
1 1 1
x−12, an antiderivative is x3 − x2 −12x− , multiply by 6: f (x) = 2x3 −3x2 −72x−1.
3 2 6
Then f 0 (x) = 6x2 − 6x − 72 = 6(x2 − x − 12) = 6(x + 3)(x − 4) has integer roots.

35. Start with a matrix in reduced echelon form with integer entries, and perform a few
operations (i.e. work backwards in the reducing algorithm) to modify some (or all)
coefficients. Here is an example:
       
1 0 3 1 0 3 1 1 1 1 1 1
 0 1 −2  ←  0 1 −2  ←  0 3 6  ←  −2 1 4  ←
0 0 0 0 −2 4 0 −2 4 0 −2 4
   
1 1 1 4 4 4
 −2 1 4  ←  −2 1 4  .
3 1 7 3 1 7

8 Invariants
1. Proof 1. We consider all possible cases of signs of the two numbers changed:

• positive, positive → negative, negative,


• positive, negative → negative, positive,
• negative, negative → positive, positive.

We see that the number of positive numbers either does not change or changes by ±2.
Thus the parity of the number of positive numbers is an invariant. We start with the set
containing 3 positive numbers. It is not possible to reach 6 positive numbers because
3 is odd but 6 is even.
Proof 2. When two numbers are multiplied by −1, the product of all the numbers does
not change. Initially the product is −36, so it will always be −36. It is not possible to
make it 36.
128 SOLUTIONS AND ANSWERS

3. The product of an odd number and 3 is an odd number, and the product of an even
number and 3 is an even number. So multiplication by 3 does not change the parity
of the number. Also, the difference of an odd number and 2 is an odd number, and
the difference of an even number and 2 is an even number. So neither of the permitted
operations changes the parity of the number. The initial set consists of four odd
numbers. Thus the four numbers will always be odd. Therefore it is not possible
to reach 2 odd and 2 even numbers.

5. When we change the signs of two numbers, the product of all numbers does not change.
Initially the product is 1. Since the product of twenty-five −1s is −1, it is not possible
to change all numbers into −1.

7. When we replace a by a + 2b or a − 2b (where a and b are two numbers in the set), we


do not change its parity (if a is even, then a ± 2b is even, and if a is odd, then a ± 2b is
odd). Thus the parity of each number will always be the same. Initially we have two
even and two odd numbers. It is not possible to make all of the numbers even.

9. When we add one coin to each of two stacks, the total number of coins increases by 2,
therefore, it doesn’t change its parity. Initially the total number of coins is 21, which
is odd, so it will always remain odd. The sum of six equal numbers would be divisible
by 6, and thus even. Therefore it is not possible to reach six equal stacks.

11. The parity of the number of − signs does not change:

• if two +s are replaced by a +, then the number of −s does not change,


• if two −s are replaced by a +, then the number of −s is decreased by 2,
• if a + and a − are replaced by a −, then the number of −s does not change.

Therefore if we had an even number of − signs, then a + will remain in the end, and
if we had an odd number of − signs, then a − sign will remain in the end.

13. We have seen in problem 1 in chapter 4 that any number is congruent to the sum
of its digits modulo 9. Thus the question is equivalent to whether there are more
numbers among 1, 2, . . ., 106 congruent to 1 or congruent to 2 modulo 9. Remainders
of consecutive natural numbers modulo 9 are 1, 2, 3, . . ., 8, 0, and this 9-tuple repeats.
The last number in our sequence is 106 ≡ 1 (mod 9), thus there will be more 1s.

15. Hint. Prove that the described operation does not change the number modulo 9. Prove
that the starting number and any number with ten distinct digits are not congruent
modulo 9.

17. When we replace a and b (let a ≥ b) by a − b, the sum of all the numbers changes by

−a − b + (a − b) ≡ −2b ≡ 0 (mod 2).

So the parity of the sum does not change. Initially the sum is

(4n − 1)4n
1 + 2 + · · · + (4n − 1) ≡ = (4n − 1)2n,
2
which is even. Thus the sum of the numbers is always even. Therefore an even number
will remain in the end.
8. INVARIANTS 129

19. Proof 1. The sum of the numbers does not change since a, b, c, d, . . . are replaced by
2b − a, 2c − b, 2d − c, . . .. The sum of the original numbers is 45. However, the sum of
ten 5s is 50. Therefore it is not possible to reach ten 5s.
Proof 2. Since 2b − a ≡ a (mod 2), 2c − b ≡ b (mod 2), etc., and we start with 5 even
and 5 odd numbers, we will always have 5 even and 5 odd numbers. Therefore it is not
possible to reach ten 5s.
21. Let the integers in the order they are written be a1 , a2 , a3 , a4 , a5 , and a6 . The sets
{a1 , a2 , a3 , a4 , a5 , a6 } and {1, 2, 3, 4, 5, 6} are equal. Thus the sum of all the ai s is

a1 + a2 + a3 + a4 + a5 + a6 = 1 + 2 + · · · + 6 = 21.

When we add its place number to each integer, we get

a1 + 1, a2 + 2, a3 + 3, a4 + 4, a5 + 5, a6 + 6.

The sum of these is


(a1 + 1) + (a2 + 2) + (a3 + 3) + (a4 + 4) + (a5 + 5) + (a6 + 6) =
(a1 + a2 + a3 + a4 + a5 + a6 ) + (1 + 2 + 3 + 4 + 5 + 6) = 21 + 21 = 42.
Suppose that all the sums a1 + 1, a2 + 2, a3 + 3, a4 + 4, a5 + 5, and a6 + 6 have
different remainders upon division by 6. Then the remainders are a permutation of the
set {0, 1, 2, 3, 4, 5} whose sum is

0 + 1 + 2 + 3 + 4 + 5 ≡ 15 ≡ 3 (mod 6).

Since 42 6≡ 3 (mod 6), we get a contradiction.


23. (a) Answer: no. Hint: consider, for example, the parity of the sum of all six numbers.
(b) Answer: no. Remark: the parity of the sum of all six numbers does not produce
a contradiction in this case. We need to find another invariant that does.
25. Note that when we replace two chips of different colors by a single chip of a third color,
all three numbers of white, black, and red chips change parity. So if any of them are
of the same parity, they will always be of the same parity, and if two numbers are of
different parity, they will always be of different parity. If only one chip remains in the
end, that means that the original number of chips of that color was of different parity
than the other tho numbers. In other words, the color of the chip remaining in the end
corresponds to the number – a, b, or c – that is of different parity than the other two.
(However, if all of a, b, and c are of the same parity, it is not possible to reach just a
single chip.)
27. Answer: zero. Hint: prove that after the first minute, the number of zombies is always
divisible by 3.
29. No. If 5 heads are cut off and 17 new heads grow, the number of heads increases by 12;
if 15 are cut off and 24 grow, the number increases by 9; if 17 are cut off and 2 grow,
the number decreases by 15; if 20 are cut off and 14 grow, the number decreases by 6.
Observe that all of these changes are divisible by 3. Initially the dragon had 100 heads,
which is congruent to 1 modulo 3. Since every change is divisible by 3, the number
of heads of the dragon will be congruent to 1 modulo 3 as long as the dragon is still
alive. To die, it needs to loose all its heads in a single blow of the sword, but for that
it would need to have 5, 15, 17, or 20 heads, and none of those numbers is congruent
to 1 modulo 3. Therefore the dragon will never die.
130 SOLUTIONS AND ANSWERS

31. (a) No. Consider the five vertices only (not the five intersection points of the diago-
nals). Initially all five of their labels are 1s. Observe that when all signs on one
side or one diagonal are changed, exactly two of the five vertex labels are changed.
So the number of 1s among them doesn’t change parity (as it either increases by
2 or decreases by 2 or doesn’t change). Therefore the number of 1s will always be
odd, and thus it is not possible to eliminate all of them.

33. Consider cells with two, three, or four infected neighbors. Notice that when the infection
spreads to such a cell, the perimeter of the contaminated area cannot increase (but it
may decrease). Namely, when a cell with two infected neighbors becomes infected, the
perimeter of the contaminated area does not change. When a cell with three infected
neighbors becomes infected, the perimeter decreases by 2. When a square with four
infected neighbors becomes infected, the perimeter decreases by 4. (Some examples are
shown below.) Initially the perimeter is at most 4 · 9 = 36. Since it cannot increase, it
cannot become 40.

35. First we divide the Parliament into two houses randomly. We will say that a Parliament
member is unsatisfied with their placement if they have two or more enemies in their
house. If there are unsatisfied members, we will choose any one of them and move them
to the other house. Now there is at most one enemy in their house. By this move we
reduced the number of hostile pairs (because the member moved was in at least two
hostile pairs and now they are in at most one hostile pair, and no pairs not containing
that member were affected by their move). If any unsatisfied members remains, then
again we will choose one of them and move them, thus reducing the number of hostile
pairs again. And so on. Since it is not possible for the number of hostile pairs to
become negative, sooner or later there will be no unsatisfied members.

9 Coloring
1. There are 36 squares, and each domino covers 2, so we need 18 dominoes. Color the
figure as a chessboard (see picture below). Since each domino covers one black square
and one white square, 18 dominoes must cover 18 black and 18 white squares. However,
the figure has 20 black and 16 white squares. Therefore it is not possible to cover it
with dominoes.
9. COLORING 131

3. The task is not possible because in each move, the chess knight goes from a white
square to a black one or from a black square to a white one. Therefore after eleven
(or any odd number of) moves the knight will be on the opposite color from the one it
started on. Thus it cannot be at the original position after 11 moves.
5. No, because a camel will always stay on one color, while the top-left and top-right
corners of the chessboard have opposite colors.
7. Proof 1. Suppose such a covering is possible. A 10 × 10 board has 100 squares. Color
the board using the standard chessboard coloring. Then it has 50 black squares and
50 white squares. Each T-tetromino covers either 3 black and 1 white or 1 black and
3 white squares. Suppose there are n T-tetrominoes covering 3 black squares. Then
there are 25 − n T-tetrominoes covering 1 black square. Then all 25 tetrominoes cover
3n + (25 − n) = 2n + 25 black squares. They must cover 50, so 2n + 25 = 50, or 2n = 25.
However, this equation has no integer solutions since 25 is not divisible by 2. We get a
contradiction.
Proof 2. Suppose such a covering is possible. A 10 × 10 board has 100 squares. Color
the board using the standard chessboard coloring. Then it has 50 black squares and
50 white squares. Each T-tetromino covers either 3 black and 1 white or 1 black and
3 white squares. Either way, it covers an odd number of black squares. Thus 25 (and
odd number of) T-tetrominoes must cover an odd number of black squares. However,
the board has 50, that is, an even number of black squares. We get a contradiction.
9. Proof 1. Suppose such a covering is possible. A 10×10 board has 100 squares. Consider
the standard chessboard coloring. Then the board has 50 black squares and 50 white
squares. Each T-tetromino covers either 3 black and 1 white or 1 black and 3 white
squares. Suppose there are n T-tetrominoes covering 3 black squares. Then there
are 15 − n T-tetrominoes covering 1 black square. Each L-tetromino covers 2 black
and 2 white squares. Therefore 10 L-tetrominoes cover 20 black squares. Thus all 25
tetrominoes cover 3n + (15 − n) + 20 = 2n + 35 black squares. They must cover 50, so
2n + 35 = 50, or 2n = 15. However, this equation has no integer solutions since 15 is
not divisible by 2. We get a contradiction.
Proof 2. Suppose such a covering is possible. A 10×10 board has 100 squares. Consider
the standard chessboard coloring. Then the board has 50 black squares and 50 white
squares. Each T-tertromino covers either 1 or 3 black squares, that is, an odd number
of black squares. Each L-tetromino covers 2 black squares, that is, an even number
of black squares. Then 15 (an odd number of ) T-tetrominoes and any number of L-
tetrominoes together must cover an odd number of black squares. However, the board
has an even number of black squares. We get a contradiction.
11. Proof 1. Suppose such a covering is possible. Color the board using the stripe pattern
with alternating black and white stripes (see the first of the four colorings on page
51). There are 50 black squares. The rest of the argument is the same as that in
proof 1 for problem 7. Each L-tetromino covers either 1 or 3 black squares. Let n
132 SOLUTIONS AND ANSWERS

tetrominoes cover 3 black squares, then 25 − n tetrominoes cover 1 black square, so


all 25 tetrominoes together cover 3n + (25 − n) = 2n + 25 black squares. Therefore
2n + 25 = 50, or 2n = 25. However, this equation has no integer solutions. We get a
contradiction.
Another approach is to use the coloring in proof 1 but to write a proof similar to proof
2 for problem 7.

13. Suppose the upper right corner has been removed.


Proof 1. Color the board diagonally using three colors as shown below.

The board contains 21 white, 22 black, and 20 blue squares. Since each straight tromino
must cover 1 white, 1 black, and 1 blue square, the board cannot be covered by straight
trominoes.

Proof 2. Suppose such a covering is possible. Color the board using horizontal stripes
of three colors, say, from top to bottom: white, blue, black. Then there are 23 white
squares (three rows minus one removed square), 24 blue squares (three full rows), and
16 black squares (two full rows). Each tromino covers either three squares of the same
color or one square of each color. Let a be the number of trominoes covering three
white squares, b the number of trominoes covering three blue squares, c the number of
trominoes covering three black squares, and d the number of trominoes covering one
square of each color. Then, for the total number of squares of each color, we have:
3a + d = 23, 3b + d = 24, and 3c + d = 16. Subtracting the first equation from the
second we have 3b − 3a = 1, or 3(b − a) = 1. The left-hand side is divisible by 3 and
the right-hand side is not. We get a contradiction.

15. Suppose such a covering is possible. Color the board using the stripe coloring using
two colors, say, black and white, starting with black (see the first of the four colorings
on page 51). Then there are 12 black columns and 11 white columns, so there are 23
more black squares than white ones. Each 2 × 2 tile covers 2 black and 2 white squares,
so if there are n of such tiles they cover 2n black and 2n white squares. Each 3 × 3 tile
covers either 6 or 3 black squares and, respectively, either 3 or 6 white squares. Let m
be the number of 3 × 3 tiles that cover 6 black and 3 white squares, and let k be the
number of 3 × 3 tiles that cover 3 black and 6 white squares. Then the total number of
black squares covered by 3 × 3 tiles is 6m + 3k, and the total number of white squares
covered by 3 × 3 tiles is 3m + 6k. Thus the total number of black squares covered by
all tiles is 2n + 6m + 3k, and the total number of white squares covered by all tiles
is 2n + 3m + 6k. Since there are 23 more black squares than white squares, we have
(2n + 6m + 3k) − (2n + 3m + 6k) = 23, or 3m − 3k = 23, where n, m, and k are integers.
However, we see that the left-hand side is divisible by 3, but the right-hand side is not.
We get a contradiction.
9. COLORING 133

17. Yes. Consider the following picture (we will show the black squares in gray to make it
easier to see the red borders).

Note that the squares of the whole board are organized into one continuous “loop.”
If one black square and one white square are removed, then the loop breaks into one
or two pieces. Namely, if the removed black and white squares are consecutive in this
loop, we get one piece consisting of 62 squares which can be paired up and covered by
31 dominoes. If the removed black and white squares are not consecutive, we get two
pieces. Note that each piece will have ends of opposite colors and hence contain an
even number of squares. Therefore each piece can be covered by dominoes.
19. (a) Notice that every piece of a face diagonal connects a vertex and a face midpoint.
Thus if we only use face diagonals, vertices and midpoints must alternate. How-
ever, there are 8 vertices and 6 midpoints, so there is no way to make them
alternate (there are too many vertices).
Note. We could color all the marked points, e.g. let vertices be black, and let
midpoints be white. Then black and white points must alternate, but there are
8 black points and 6 white points, so that’s impossible. In this problem coloring
points was not very useful because it was easy to refer to the points as vertices
and face midpoints. In fact, coloring made our solution longer. However, in many
problems there is no “natural” division of the points and such a coloring could
provide a way to explain a similar argument.
(b) If one edge is allowed, then we could have two vertices in the beginning, after
which we would be left with 6 midpoints and 6 vertices, and we can make them
alternate. Again, let vertices be black and midpoints white, then a path could be
e.g. bbwbwbwbwbwbwb.
Here is an example. (But there are many other such paths.)

21. Let a be the number of rows and let b be the number of columns. If n|a, then a = nk for
some integer k, and each column contains nk squares. Thus we can cover each column
134 SOLUTIONS AND ANSWERS

by k “vertical” 1 × n tiles. Similarly, if n|b, then b = nk for some integer k, and each
row contains nk squares. Thus we can cover each row by k “horizontal” 1 × n tiles.
Now suppose that n - a and n - b but an a × b board can be covered by 1 × n tiles.
Color the board diagonally using n colors. Each tile must cover exactly one square of
each color. Therefore each color must appear the same number of times. We will show
below that this is not possible, thus obtaining a contradiction.
If a > n, then in the first n rows each color appears exactly b times (because each color
appears exactly once in each column of length n). Therefore if we throw these first n
rows away, each color must still appear the same number of times. Similarly, we can
throw away the next set of n consecutive rows, and so on, until less than n rows remain.
Similarly for the columns. So now we reduced our board to, say, a c × d board where
c < n and d < n, and each color must appear the same number of times. Without loss
of generality we can assume that c ≤ d. This c × d piece is colored diagonally, and
we can assign numbers 1 through n to our colors so that they appear in the increasing
order as shown in the picture below.

1 2 3 d

2 3 d d+1
c
3 d d+1

d d+1

Since d < n, the number of colors is at least d + 1, so the first d + 1 “diagonals” are of
different colors. Since only c − 2 ≤ d − 2 < d “diagonals” remain, colors d and d + 1 will
not repeat. Therefore in this piece there are c squares of color d but only c − 1 squares
of color d + 1. Thus the colors are not distributed evenly. We get a contradiction.

23. No. Assume that such a reentrant knight tour exists. Color the board as shown on the
picture below.

...

Notice that from any black square a knight can only get to a yellow square; from any
white square a knight can only get to a red square. Since there are 123 squares of
each color, the tour must contain 123 pairs “black, yellow” and 123 pairs “white, red.”
However, there is no way to get from a yellow square to a white one or from a red
square to a black one. We get a contradiction.

25. Suppose such a filling is possible. “Color” the small (i.e. 1 × 1 × 1) cubes of the 6 × 6 × 6
cube as follows. Color each other “level” as in Example 9.2, and the other “levels” all
white.
9. COLORING 135

Then the 6 × 6 × 6 cube contains 27 black cubes. Each 4 × 1 × 1 brick fills either none
or two, so, an even number of black cubes. Therefore all bricks together must fill an
even number of black cubes. We get a contradiction.
27. Hint 1. Use a chessboard-like coloring (namely, two regions that share an edge have
different colors).
Hint 2. Consider even and odd numbers.
29. The fourth box from the left. Consider the following six cases for the position of T on
the box.
v h
I v v h h
I
v h
(a) (b) (c) (d) (e) (f)

(a) the T is on the top or bottom face (so when it’s on the top, we see it when we look
from above) and positioned vertically (correctly or upside down) when we look in
the direction discussed in the problem,
(b) the T is on the top or bottom face and is positioned sideways (to the right or to
the left),
(c) the T is on a side face that is represented by a horizontal segment in our diagram
and positioned vertically (correctly or upside down) if we look at that face from
the side, standing on the floor,
(d) the T is on a side face that is represented by a horizontal segment in our diagram
and positioned sideways,
(e) the T is on a side face that is represented by a vertical segment in our diagram
and positioned vertically,
(f) the T is on a side face that is represented by a vertical segment in our diagram
and positioned sideways.

Observe that when a box is rolled about one of its edges, only the following changes
between these six positions are possible:

(a) (c)

(f) (d)

(e) (b)

No matter how the box is rolled, an even number of steps is needed to get to the same
position, e.g. from (a) to (a), and an odd number of steps is needed to get from (a) to
(b).
Now, color the floor like a chessboard with whole squares directly under each box in
the original position. Note that initially four of the squares are on one color, and one
(the one in the center of the cross) is on the opposite color. Every time a box is rolled,
it changes the color of the square it occupies. In the final position, three boxes are on
one color and two are on the opposite color.
136 SOLUTIONS AND ANSWERS

T
T T T T T T T
T

Since these three boxes are in the same position (a), it follows that they came from some
three of the four that were on the same color initially, so they took an even number of
rolls. The fourth one is on the opposite color in the end, so it took an odd number of
rolls, thus it is the second box from the left that is in position (b). Therefore the center
box, after an even number of rolls, is the fourth one from the left in the final position.

10 Graphs
1. By corollary 10.6, in any graph, the number of vertices of odd degree is even. Here
there are 3 vertices of degree 3, so there is no such graph.
3. (a) Yes. Here are two examples.

(b) No. If one vertex has degree 7, then it is connected with every other vertex. Hence
there cannot be a vertex of degree 0.
5. Since the sum of the degrees is 2 + 2 + 3 + 3 + 4 = 14, by Theorem 10.5 the graph has
seven edges. Below is an example of such a graph.

7. Consider the graph in which vertices represent cities and edges represent roads. Since
four roads lead out of each city, the degree of each vertex is 4. There are 100 cities, so
there are 100 vertices in the graph, and thus the sum of all their degrees is 400. By
Theorem 10.5, there are 200 roads.
9. Solution 1. Let vertices A, B, C, D, E have degrees 1, 2, 3, 4, and 5, respectively, and
let F be the sixth vertex. Since E has degree 5, it is connected to every other vertex.
Since A has degree 1, it is not connected to any vertex but E. Then, since D has degree
4 but is not connected to A, it is connected to B, C, E, and F . Now, B has degree 2,
and we already know that it is connected to D and E, so it is not connected to C or
F . Finally, C has degree 3 and is connected to D and E but not A or B, so it must be
10. GRAPHS 137

connected to F . Thus F is connected to C, D, and E, but not A or B, so F also has


degree 3.

Solution 2. Since the graph is simple, the degree of the sixth vertex is at most 5. The
sum of the degrees of all six vertices must be even, so it follows that the degree of
the sixth vertex is odd. Therefore it is 1, 3, or 5. We will show that it cannot be
1 or 5. Indeed, if it were 1, there would be two vertices of degree 1. The vertex of
degree 5 must be connected to every other vertex. Then the vertices of degree 1 are
not connected to any vertex other than the one of degree 5. Then no vertex can have
degree 4 as there are not four vertices to which it can be connected. Now, if the degree
of the sixth vertex were 5, then there would be two vertices of degree 5. They must
connect to every other vertex in the graph. Then there cannot be a vertex of degree 1.
Therefore the degree of the sixth vertex is 3.

11. Answer: 5. Hint: consider the graph in which vertices represent the club members, and
two vertices are connected if and only if the corresponding members have played chess.
Then use reasoning similar to that in solution 1 to problem 9.

13. If this were possible, consider the following graph with 8 vertices: each vertex represents
a county, and two vertices are connected if and only if the corresponding counties are
neighbors. Then the degree of each vertex is the number of the neighbors of that
county. Thus we would have a graph with 8 vertices of degrees 5, 5, 4, 4, 4, 4, 4,
3. But in any graph, the sum of the degrees of all the vertices is even. The sum
5 + 5 + 4 + 4 + 4 + 4 + 4 + 3 = 33 is odd. We have a contradiction.

15. Let vertices represent people, and edges represent friendship (two vertices are connected
if and only if the corresponding people are friends). Then the degree of each vertex is
the number of friends of the corresponding person. Since in any graph the number of
vertices of odd degree is even, we have that the number of people with an odd number
of friends is even.

17. Suppose that there is no way to get from town A to town B. Then they are in two
different connected components. However, since each town is connected to at least 7
others, each connected component contains at least eight towns. This is impossible.

19. Let us represent this transportation system by a graph. Each city is represented by a
vertex, and each carpet line is an edge. Then the degree of the capital is 21, the degree of
Farville is 1, and the degree of each other vertex is 20. If the capital and Farville were
in different connected components, then the connected component of Farville would
contain itself and a few other cities that have degree 20 each. Then the sum of the
degrees of all vertices in this connected component would be odd, which is impossible.

21. We can start with any vertex and assume it’s in set X. Then consider any vertex
connected with the first one, and if the graph is bipartite, this vertex must be in the
other set, say, Y . Then consider any vertex connected with the first or second one, and
so on. If we ever run into a situation when two vertices in one set are connected, the
graph is not bipartite. If not, we’ll have a division of the set of vertices into two sets
X and Y such that there are no edges within one set, and hence the graph is bipartite.
138 SOLUTIONS AND ANSWERS

X X X X X X X X
Y Y Y Y
bipartite
X X X

X X Y X Y

Y contradiction, so not bipartite

Similarly:
X Y X Y X X Y X

X
Y X Y Y Y Y
X X
bipartite not bipartite bipartite

23. Let the degrees of the remaining vertices be a (in group A) and b (in group B). The
sum of degrees of vertices in the first group must be equal to the sum of degrees of
vertices in the second group. Thus 4 + 2 + 2 + a = 3 + 1 + 1 + b, or 3 + a = b. Since
the graph is connected, the degree of each vertex is at least 1, thus a ≥ 1. This implies
that b ≥ 4. However, the graph is simple, so b ≤ 4, and thus b = 4 and a = 1.

25. If nobody made a mistake, we would be able to draw a bipartite graph with 14 vertices,
seven vertices representing the kids from school A and seven vertices representing the
kids from school B, with two vertices connected if and only if the corresponding students
have played a game. Then the sum of the degrees of the seven vertices representing
the kids from school A should be equal to the sum of the degrees of the seven vertices
representing the kids from school B (both sums being equal to the number of edges).
However, it is not possible to divide the given 14 numbers into two groups such that
the sums are equal because one group must contain the 5, and the other group must
consist of 3s and 6s only. The sum of the numbers in the first group is congruent to 2
modulo 3, and the sum of the numbers in the second group is congruent to 0 modulo
3, so the sums cannot be equal.

27. A graph has an Euler path but not an Euler cycle if and only if it is connected and
has exactly two vertices of odd degree. The fact that it does not have an Euler cycle
follows from Theorem 10.14. Here is a proof that it contains an Euler path. Connect
the two vertices of odd degrees. Then all degrees become even and thus there exists
an Euler cycle. Now remove this added edge and obtain an Euler path of the original
graph.

29. The first graph can be drawn. A possible order of edges is shown below.
10. GRAPHS 139

1
6 2
5
7
8
3
4

The second graph cannot be drawn since there are four vertices and the degree of each
vertex is 3. The third graph cannot be drawn either because there are four vertices of
odd degree.

31. No. The degree of each vertex is 3. Since there are more than two (eight, to be precise)
vertices of an odd degree, a path that uses all edges exactly once is not possible.

33. (a) Note that the possibility to bend a wire into a cube is equivalent to the existence
of an Euler path. The cube does not have an Euler path because there are eight
vertices of odd degree.
(b) Each vertex of an odd degree must be an endpoint of a piece of wire. Since two
pieces have only four endpoints but there are more than four vertices in a cube
and each of them has an odd degree, two pieces cannot be bent into a cube.
(c) Each vertex of a cube must be an endpoint of a piece of wire. So at least four
pieces are needed. Four pieces are possible, for example ABCDAEF GHE, BF ,
CG, and DH. (There are many different solutions.)

H G
E
F

D C
A B

35. If we draw a plan of the islands and bridges, we obtain the following picture.

Thus the problem is equivalent to existence of an Euler path for the following graph.
140 SOLUTIONS AND ANSWERS

There four vertices of odd degree, therefore there is no Euler cycle.


37. We will use a graph to represent the city as follows. Let each of the four pieces of land
be represented by a vertex, and let each bridge be represented by an edge connecting
the corresponding vertices. Then we get the following graph:

Existence of a tour described in the problem is equivalent to existence of an Euler cycle


in this graph. We know that an Euler cycle exists if and only if the degree of each
vertex is even. However, the degrees of the vertices in our graph are 5, 3, 3, and 3, i.e.
all odd, and this is how we know that no such tour exists. Now, if we add one more
bridge we will change the degrees of two vertices (corresponding to the pieces of land
that this bridge connects), thus the degrees of two vertices will become even, but the
degrees of the other two vertices will remain odd. Therefore no such tour will exist
even if one bridge is built.
39. First of all, recall that Kn,m has 2 groups of vertices, n vertices in group A, m vertices
in group B, and every vertex in group A is connected to every vertex in group B.

(a) We know that an Euler cycle exists if and only if the degree of each vertex is even.
The graph Kn,m has n vertices of degree m and m vertices of degree n. Thus an
Euler cycle exists iff both m and n are even.
(b) By problem 27, an Euler path exists if and only if the graph has at most 2 vertices
of odd degree. We have the following cases:
(1) No vertices of odd degree, i.e. all the degrees are even. Then both m and n
are even.
(2) There are two vertices of odd degree and they are in the same group, say, in
group A of n vertices. Since all the vertices in this group have the same (odd)
degree, and we can have at most 2 vertices of odd degree, there are only 2 vertices
in this group, thus n = 2. Since their degree is odd, m is odd. Thus we have n = 2
and m is odd. Similarly, we could have m = 2 and n odd.
(3) There are two vertices of odd degree, one in group A and the other in group
B. Then both m and n are odd, thus all the degrees are odd, but we can have at
most 2 odd degrees, so n = m = 1.
(c) A Hamilton cycle is a cycle that visits every vertex exactly once. If a Hamilton
cycle starts at a vertex in group A, then its second vertex belongs to group B, the
10. GRAPHS 141

next one belongs to group A, the fourth one belongs to group B, and so on, i.e. A
and B will alternate. It must eventually come back to the original vertex, therefore
the number of vertices in group A must be equal to the number of vertices in group
B. Thus m = n. Conversely, if m = n, then a Hamiliton cycle can be found by
alternating groups A and B.

(d) A path does not return to the starting point, thus in addition to the case m = n
(in this case a path has the form ABAB...AB), we have m = n − 1 (then we can
find a path of the form ABAB...ABA), and m = n + 1 (then we can find a path
of the form BABA...BAB).

41. (a) Yes. See the picture below.

(b) Yes. In the above picture, we can connect the two ends of the path.

43. First draw the graph representing all possible moves of a knight:

A reentrant tour is a Hamilton cycle. Thus we have to show that this graph has no
Hamilton cycle. Notice that there are 4 vertices of degree 2, and in order to visit a
vertex of degree 2 we have to use both its edges. Consider the upper left corner vertex
and the lower right corner vertex. We must use both edges at each of them. Then
we get a cycle. There is no way of adding anything to this cycle (because if we add
more edges, we’ll have to go through some vertex more than once). However, this cycle
misses many vertices. Thus there is no Hamilton cycle.
142 SOLUTIONS AND ANSWERS

45. Let scientists be represented by vertices. Connect all vertices. We get the complete
graph K17 . Color the edges using three colors, say, blue, red, and green, according to
the topic discussed by the scientists these vertices represent. We have to prove that
there are three vertices connected (pairwise) by 3 edges of the same color. Choose
any vertex, say, vertex A. It is connected with 16 other vertices. Among the 16 edges
connecting vertex A with other vertices at least 6 are of the same color, say, blue. Look
at those 6 vertices. If at least two of them are connected by a blue edge then we have
a blue triangle. If not, look at the K6 graph for those 6 vertices. All its edges are red
and green. By example 10.18, it contains at least one triangle with all 3 sides of the
same color, either red or green.

47. (a) Suppose a simple graph has n vertices. The degree of each vertex is an integer
that is at least 0 and at most n − 1, so there are n possible values for degrees.
If all vertices have different degrees, then for each integer from 0 to n, inclusive,
there must be exactly one vertex of that degree. In particular, there is a vertex of
degree 0 and a vertex of degree n. However, this is impossible because the vertex
of degree 0 is not connected to any other vertices, while the vertex of degree n
must be connected to every other vertex.
(b) No. For example, consider the graph with two vertices which are not connected,
but one of them has a loop. The degrees are 0 and 2.

(c) No. For example, consider the graph with three vertices, with one edge between
two vertices and two edges between a different set of two vertices. The degrees
are then 1, 2, and 3.

49. The graph K1,2,4 is shown below.


10. GRAPHS 143

(a) The degrees of the vertices are 6, 5, 5, 3, 3, 3, 3. Since there are vertices of odd
degree, there is no Euler cycle.
(b) Since there are more than two vertices of odd degree, by problem 27 there is no
Euler path.
(c) No. In any cycle containing four vertices, some two vertices of the group of 4 have
to be consecutive. However, there cannot be an edge between them.
(d) Yes. See the picture below.

51. We will show that this is impossible. Let us draw the graph representing all legal moves
of a knight on such a board:

A B C

E
D F

G H I

This graph can be drawn as follows.

F
A G

E
H B

C I
D

Now, mark the positions of the white and black knights given in the figures A and B
in the problem:

A B
144 SOLUTIONS AND ANSWERS

F F
white black black white
A G A G

E E
H B H B

C I C I
white black white black
D D

Since in the first graph the white knights are next to each other and the black knights
are next to each other, while in the second graph the white and black knights alternate,
and the knights cannot “jump over” each other, there is no way to go from one position
to the other.

52. Hint: draw the complement of the given graph, that is, the graph that has the same
vertices, but two vertices are connected if and only if they are not connected in the
given graph. The edges in this graph represent pairs of integers that have a common
factor. In this case, the graph has fewer edges and might be easier to work with.

11 Combinatorics
1. (a) There are 5 ways to select a teacup. For each of those selections, there are 3 ways
to select a saucer. Thus, there are 5 · 3 ways to select a teacup and a saucer. For
each of these, there are 4 ways to select a spoon, thus there are 5 · 3 · 4 = 60
selections total.
(b) There are 5 · 3 = 15 ways to select a teacup and a saucer, 5 · 4 = 20 ways to select
a teacup and a spoon, and 3 · 4 = 12 ways to select a saucer and a teaspoon. So
there are 15 + 20 + 12 = 47 ways to select two items with different names.

3. There are 5 odd digits, so each of the four digits in the number can be chosen in 5
different ways. Thus there are 5 · 5 · 5 · 5 = 54 = 625 such numbers.

5. There 20 · 20 = 400 ways to exchange a stamp for a stamp, and 10 · 10 = 100 ways to
exchange a postcard for a postcard. So there are 400 + 100 = 500 ways to carry out a
fair exchange between the collectors.

7. (a) There are 6 possible results for each of the three rolls, thus there are 63 = 216
possible outcomes total.
(b) Of the 216 possible outcomes, 53 = 125 do not have any 6s. Thus, 216 − 125 = 91
outcomes have at least one 6.

9. (a) There are 6 ways to choose each letter, so there are 62 = 36 two-letter words.
(b) There are 6 ways to choose the first letter, and, after the first letter has been
chosen, there are 5 ways to choose the second letter. So there are 6 · 5 = 30
two-letter words.
(c) If all letters have to be different, each next letter starting with the second one has
one less choices than the previous one. So there are 6 · 5 · 4 = 120 three-letter
words.
11. COMBINATORICS 145

6!
(d) Answer: if n ≤ 6, and 0 if n > 6.
(6 − n)!

11. There are three ways to choose the color of the first strip and two ways to choose the
color of each subsequent strip (as it has to be different from the one chosen at the
previous step). So there are 3 · 210 = 3072 ways to choose all the colors.

13. Let’s order the fifth graders. There are 20 ways to choose a Kindergartener for the first
fifth grader, 19 ways to choose a Kindergartener for the second fifth grader, and so on,
so 20 · 19 · · · · · 2 · 1 = 20! ways to pair up all fifth-graders with Kindergarteners.

15. Since the first digit cannot be 0, there are 9 · 109 ten-digit numbers total, and 9 · 9! of
them have all digits different, so 9 · 109 − 9 · 9! numbers have at least two equal digits.

17. There are five ways to chose the digit that is different from the rest. Then, since the
leading digit cannot be 0, there are 9 ways to choose the leftmost digit, and there are 9
ways to choose the other digit that appears in the number. Thus there are 5 · 9 · 9 = 405
such numbers total.

19. Since the prime factorization of 4000 is 25 53 , a positive integer is a factor of 4000 if and
only if it has prime factorization of the form 2a 5b where 0 ≤ a ≤ 5 and 0 ≤ b ≤ 3. So,
there are 6 choices for a and 4 choices for b. Thus there are 6 · 4 = 24 positive factors.

21. Each of the numbers 2 through 9 has two choices: be present or not be present in the
sequence. Thus there are 28 = 256 such sequences.

23. There are 64 ways to choose a square for the white rook. The black rook must be in a
different row and in a different column, so there are 49 ways to choose a square for it.
Thus there are 64 · 49 = 3136 ways total.

25. Let us choose a black square first, and then a white square. There are 32 ways to choose
a black square. Once it is chosen, there are 24 ways to choose a white square since out
of the 32 white squares 4 are in the same row and 4 are in the same column as the black
one. So there are 32 · 24 = 768 ways total. Alternatively, there are 64 ways to choose
the first square, 24 ways to choose the second square (since it must be of the opposite
color and in a different row and in a different column), however, we must divide by 2
since every choice of two squares was counted twice.

27. (a) Notice that the letter C appears twice, and all other letters are different. Make,
for a moment, the two Cs different, for example, color one of them red: CIRCLE.
Then there are 6! ways to rearrange the letters. However, since in the original word
the two Cs were indistinguishable, we now counted each rearrangement twice: once
with the black C before the red one, and once with the black C after the red one.
For example, we counted the rearrangements ERCLCI and ERCLCI as different,
while they are actually the same rearrangement if the two Cs are identical. So, we
6!
divide by 2 to account for double counting, and get = 360 different “words.”
2
(b) Here both C and E appear twice, so using the same idea as in part (a), we have
to divide by 2 · 2 = 4 (for example, the rearrangement NEICECS is counted 4
times when the two Cs and the two Es are made different: NEICECS, NEICECS,
7!
NEICECS, and NEICECS). Thus, there are = 1260 different “words.”
4
146 SOLUTIONS AND ANSWERS

(c) In the word “SEQUENCE” the letter E appears three times. If we make these
three Es distinguishable, there will be 8! arrangements. However, since there are
8!
3! ways to order the three Es, we divide by 3! and get = 8 · 7 · 6 · 5 · 4 = 6720
3!
different “words.”
(d) Since three letters (M, A, and T) appear twice each, we now have to divide 11! by
11!
23 = 8, so the number of different “words” is .
8
29. The first digit in a binary number must be a 1, and there should be no more than two
1s among the remaining six digits. There is only one number thathas  all 0s in those
6
positions, six that have exactly one 1 among those six digits, and = 15 numbers
2
that have two 1s among those six digits, so there are 1 + 6 + 15 = 22 such numbers
total.

31. Solution 1. Observe that if the white bishop is on any border square (a1-a8, h1-h8,
b1-g1, or b8-g8 – there are 28 of these), then it occupies or attacks eight squares, so
the black bishop has 56 choices. If the white bishop is on any square that is not on the
border but is adjacent to a border square (b2-b7, g2-g7, c2-f2, or c7-f7 – there are 20
of these), then it occupies or attacks ten squares, so the black bishop has 54 choices.
If the white bishop is on a square in the next “layer” (c3-c6, f3-f6, d3, e3, d6, or e6 –
there are 12 of these), then it occupies or attacks twelve squares, so the black bishop
has 52 choices. Finally, if the white bishop is on one of the four squares in the center
(d4, e4, d5, or e5), then it occupies or attacks 14 squares, so the black bishop has 50
choices. So there are 28 · 56 + 20 · 54 + 12 · 52 + 4 · 50 = 3472 ways total.

a b c d e f g h
8 8
7 7
6 6
5 5
4 4
3 3
2 2
1 1
a b c d e f g h

Solution 2. If the two bishops are on squares of opposite color, they do not attack
each other. There are 64 · 32 = 2048 ways to place them since there are 64 ways to
choose a square for the white bishop and then 32 ways to choose a square for the black
bishop. If they are on squares of the same color, we need to make sure they are not
on a line parallel to a diagonal. This requires considering a few cases. If the white
bishop is on any border square (a1-a8, h1-h8, b1-g1, or b8-g8 – there are 28 of these
total), the black bishop has 24 possibilities. If the white bishop is on any square that
is not on the border but is adjacent to a border square (b2-b7, g2-g7, c2-f2, or c7-f7
– there are 20 of these), the black bishop has 22 choices. If the white bishop is on
a square in the next “layer” (c3-c6, f3-f6, d3, e3, d6, or e6 – there are 12 of these),
the black bishop has 20 choices. Finally, if the white bishop is on one of the four
11. COMBINATORICS 147

squares in the center (d4, e4, d5, or e5), the black bishop has 18 choices. So there are
64 · 32 + 28 · 24 + 20 · 22 + 12 · 20 + 4 · 18 = 3472 ways total.
33. The arrangement can be GBGBGBGBGBGBGB or BGBGBGBGBGBGBG. There are
7! · 7! ways to seat the children in each of these arrangements, so there are 2(7!)2 ways
to seat them total.
 
10 10 · 9 · 8 · 7 · 6
35. There are 210 = 1024 possible outcomes total, and = = 9·2·7·
5 5!
2 = 252 of them have five heads and five tails. Of the remaining 1024 − 252 = 772
outcomes, half have more heads than tails, and the other half have more tails than
772
heads. Therefore there are = 386 ways to get more heads than tails.
2
37. Note that since the number of vertices is not divisible by 3, the triangle cannot be
equilateral. There are 11 ways to select the vertex at which the angle is different from
the other two (this vertex is labeled A in the picture below). For each of these selections,
there are 5 ways to select the other two vertices (labeled B and C) so that they are
equidistant from the first vertex. Thus the number of such triangles is 11 · 5 = 55.

39. The integer is a multiple of 5 when its units digit is 0 or 5. Let us consider these cases
separately. If the units digit is 0, then 5 must be in one of the other 3 positions. Once
we chose the position for 5, the other two digits have 4 · 3 = 12 choices (since the digits
cannot repeat). So we have 3 · 12 = 36 numbers in this case. If the units digit is 5,
then the first digit has 4 choices (since it cannot be 0 or 5), and the other two digits
have 4 · 3 = 12 choices (again, since the digits cannot repeat). So we have 4 · 12 = 48
numbers in this case. Thus there are 36 + 48 = 84 such numbers total.
   
8 8 8·7·6
41. Solution 1. There are = = = 56 ways to choose any five players
   5 3 6
6 6
from the team, but = = 6 of them do not include Corey or Tony. Therefore
5 1
56 − 6 = 50 starting groups of five include at least one of Corey and Tony.
   
6 6 6·5
Solution 2. There are = = = 15 ways to choose Corey, not Tony, and 4
4 2 2
more players out of the remaining 6. There are also 15 ways to  choose
 Tony, not Corey,
6 6·5·4
and 4 more players out of the remaining 6. Finally, there are = = 20 ways
3 6
to choose Corey, Tony, and 3 more players out of the remaining 6. Therefore there are
15 + 15 + 20 = 50 ways total.
   
31 31! 29 29!
43. There are = ways to choose a team of 11 players, and =
11 11!20! 9 9!20!
of them include both Pete and John (since if both Pete an John are on the team, we
31! 29!
still have to select 9 players out of 29 remaining students). Therefore − =
11!20! 9!20!
148 SOLUTIONS AND ANSWERS
   
29! 31 · 30 29! 93 82 · 29!
−1 = −1 = ways do not have both Pete and
9!20! 11 · 10 9!20! 11 11 · 9!20!
John on the same team.
45. Note that there is a total of seven pieces of the path, of which four go to the right and
the other three go up. To construct a path,we  have to choose which three of the seven
7
moves go up, thus the number of paths is = 35.
3
47. (a) There are 8! ways to distribute the socks and the same number of ways to distribute
the shoes. Thus there are (8!)2 distributions total.
(b) There are 16! ways to order all socks and all shoes. However, this includes the
orders in which some socks come after their corresponding shoes. In exactly half
of the orders the sock for leg 1 comes before the shoe for leg 1, and in the other
half it comes after. So we divide the total number of orders by 2 to obtain the
number of orders in which the order of sock 1 and shoe 1 is correct. Then, using
the same reasoning, we divide by 2 to obtain the number of orders in which the
order of sock 2 and shoe 2 is correct. Continuing in this manner for all eight legs,
16!
we obtain 8 possible orders in which all socks come before their corresponding
2
shoes.
49. Place all 20 balls in a row. Distributing them into six boxes is equivalent to placing
five sticks somewhere among the balls so that the balls before the first stick would be
placed into the first box, the balls between the first and second sticks would be placed
into the second box, and so on. The balls after the fifth stick would be placed into the
sixth box. This can be depicted by a diagram using circles for balls and vertical bars
for sticks. For example, if three balls are put in box 1, no balls in box 2, seven balls in
box 3, eight balls in box 4, two balls in box 5, and no balls in box 6, then we get the
following diagram.

Now we have to count the number of such diagrams with 20 circles and 5 vertical bars.
Since there are 25 objects total
  and we have to choose 5 positions for the bars, the
25
number of such diagrams is . This technique is often referred to as “sticks and
5
stones” or “circles and bars” or “stars and bars” (some sources use stars instead of
circles).
51. Place 10 counters in a row (these will represent the total sum, 10). Writing 10 as a
sum a + b + c is equivalent to placing two sticks between the counters so that there
a counters before the first stick, b counters between the first and the second, and c
counters after the second. For example, 10 = 2 + 1 + 7 can be represented as follows.

Thus, the number of ways to write 10 as a sum of three natural numbers is the same
as the number of ways to choose  locations
 for the two sticks. There are nine possible
9
locations for these, and there are = 36 ways to choose two of them.
2
11. COMBINATORICS 149

53. Hint: use the same idea as inproblem


 51. There are twelve counters and two sticks, so
11
the total number of ways is = 55.
2

55. Let’s first count the total number of ways to write 13 as a sum of three positive integers.
Using the same idea as in problem 51, we have 13 counters and need two sticks which
can
  be placed anywhere in the 12 possible locations. Thus, the number of ways is
12
= 66. However, this counts all possible ways, including the ones containing the
2
number 11 (there are three of them, namely, 1 + 1 + 11, 1 + 11 + 1, and 11 + 1 + 1) which
we want to exclude. Thus the number of ways to write 13 as a sum of three positive
integers not exceeding 10 is 66 − 3 = 63.

57. Let’s first put 2n ones. Since no two zeros may be consecutive, at most one zero can
be placed in the very beginning, between any two consecutive ones, or at the very end.
The number  of ways to choose n positions for the zeros out of 2n + 1 possible positions
2n + 1
is .
n
 
30
59. Solution 1. For the first group, there are ways to select students, and for the
  10
20
second group, there are ways. The remaining 10 students will form the third
  10 
30 20 30!
group. So, there are = ways to select students for the three groups
10 10 10!3
(group 1, group 2, group 3). However, since the order in which we formed the groups
30! 30!
does not matter, we divide by 3! to get = .
(10!)3 3! 6(10!)3
 
29
Solution 2. Choose any student. There are ways to choose the students who
9
will
 be in the same group. Then choose any of the remaining students. There are
19
ways to choose the students who will be in the same group as this student. The
9
remaining ten students will form the third group. Thus the total number of ways to
divide the students into three groups of ten is
  
29 19 29! 19! 29! 30!
= · = = .
9 9 9!20! 9!10! 20 · 9!9!10! 6(10!)3

   
20 15 10 20!
61. Solution 1. There are = ways total to visit four cities, each
5 5 5 5!5!5!5!
of them five times. Let’s determine the number of ways to do this if we both start
and end with a specific city, let’s call it city A. In this case, we are free to choose
the order in which we make the remaining 18 visits. Because three of those visits
will be
to city
A (and five to each other city, say, B, C, and D), this can be done
18 15 10 18!
in = ways. We can count the number of arrangements that
3 5 5 3!5!5!5!
start and end with B, start and end with C, or start and end with D the same way. So,
the total number of ways to visit the four cities while starting and ending with different
150 SOLUTIONS AND ANSWERS

cities is
20! 18! 18! · 19 · 20 18!
−4 = −4
5!5!5!5! 3!5!5!5! 5!5!5!5! 3!5!5!5!
18! · 19 18! · 4
= −
3!5!5!5! 3!5!5!5!
18! · 15
=
3!5!5!5!
18!
= .
2 · 4!5!5!

Solution 2. There are 4 ways to choose the city that will be visited first, and once it
has been chosen, there are 3 ways to choose the city that will be visited last. Then
out of the remaining 18 visits, the first city must be visited four more times, the last
city must also be visited
 four moretimes, and the other cities must be visited 5 times
18 14 10 18!
each, so there are = ways to arrange these 18 visits. Thus
4 4 5 4!4!5!5!
the total number of ways to visit the cities is
4 · 3 · 18! 18!
= .
4!4!5!5! 2 · 4!5!5!

63. Label the vertices as follows.

A C E

B D F

(a) There are three ways to choose a color for A, then two ways to choose a color for
B. After that, all colors are determined uniquely as C has to be the remaining
color, then D has to be different from B and C, then E different from C and D,
and, finally, F different from D and E. Thus there are only six ways to color the
vertices.
(b) There are four ways to choose a color for A, then three ways to choose a color
for B. After that, if we color the vertices in alphabetical order, each vertex has
two choices as it only has to be different from the previous two. Thus there are
4 · 3 · 24 = 192 ways to color the vertices.

65. Hint: use the Inclusion-Exclusion Principle to count the number of integers that are
divisible by 5 or 7. (This is similar to Example 11.8.)
Answer: 100 − (20 + 14 − 2) = 68.

67. Hint: use the Inclusion-Exclusion Principle to count the number of strings that do not
contain 4 or do not contain 7.
Answer: 105 − (95 + 95 − 85 ) = 105 − 2 · 95 + 85 = 14670.

69. Hint: use the Inclusion-Exclusion Principle to count the number of strings that miss at
least one letter.
Answer: 37 − (27 + 27 + 27 − 1 − 1 − 1) = 3(36 − 27 + 1) = 3 · 602 = 1806.
12. CALCULUS 151

12 Calculus
1. Solution 1. The derivative of a cubic polynomial is a quadratic polynomial which has
at most two real roots. However, the given curve has four maximum/minimum points
at which the derivative is equal to zero.

Solution 2. By the Fundamental Theorem of Algebra, a polynomial of degree n has


exactly n zeros (not all of which have to be real), counting with multiplicity. The
function represented by the given curve has five zeros, so cannot be a cubic polynomial.

3. Hint. Any cross-section of the ellipsoid that passes through the origin is an ellipse.

Proof. Without loss of generality, we can assume that a, b, and c are all positive.

Case 1. At least two of a, b, and c are equal. Without loss of generality we can assume
that a = b. Then the intersection of the xy-plane and the ellipsoid is a circle whose
x2 y2
equation is 2 + 2 = 1, z = 0.
a b
Case 2. The numbers a, b, and c are all distinct. Without loss of generality we can
assume that a > b > c. The intersection of the xy-plane and the ellipsoid is an ellipse
x2 y2
whose equation is 2 + 2 = 1, z = 0. The intersection of the zy-plane and the
a b
z2 y2
ellipsoid is an ellipse whose equation is 2 + 2 = 1, x = 0. Now rotate the xy-plane
c b
until it coincides with the zy-plane so that the y-axis is always in it. The intersection
of this rotating plane with the ellipsoid is always an ellipse. Moreover, one of its axes
is always b, and the other one is changing continuously from a > b to c < b. Because
of continuity, at some point the changing axis is equal to b.

5. Consider the graphs of f (x) = x2 + ax + 1 and g(x) = cos x. Both graphs pass through
the point (0, 1). The graph of g(x) = cos x has slope 0 at that point. If the slope of
f (x) = x2 + ax + 1 at (0, 1) is positive, then for some small negative values of x we will
have x2 + ax + 1 < cos x. If the slope of f (x) = x2 + ax + 1 at (0, 1) is negative, then
for some small positive values of x we will have x2 + ax + 1 < cos x. The only case in
which x2 + ax + 1 ≥ cos x for all real x is when the slope of f (x) = x2 + ax + 1 at
(0, 1) is 0. The derivative of f (x) is f 0 (x) = 2x + a, thus the slope at (0, 1) is f 0 (0) = a.
Therefore a = 0 is the only such value of a.

pos. slope neg. slope

slope 0

x
7. At x = 0 we have = arctan x = x.
x2 +1
152 SOLUTIONS AND ANSWERS

Let’s compare the derivatives of these functions for x > 0. The derivatives are:
0
1 − x2

x
2
= 2 ,
x +1 (x + 1)2
1 1 + x2
(arctan x)0 = 2 = 2 ,
x +1 (x + 1)2
(1 + x2 )2
(x)0 = 1 = 2 .
(x + 1)2
 0
x
We see that for all x > 0, < (arctan x)0 < (x)0 , therefore the curve y =
x2 + 1
x
lies below the curve y = arctan x which lies below the line y = x.
x2 + 1
9. We need the polynomial to pass through the given points, and have slope (which is
p0 (x) = 3ax2 +2bx+c) equal to 0 at both points. Thus we have the following equations.
The value at 0: d = 1.
The value at 1: a + b + c + d = 0.
The slope at 0: c = 0.
The slope at 1: 3a + 2b + c = 0.
Since d = 1 and c = 0, the second and fourth equations become a + b = −1 and
3 3
3a + 2b = 0. Then b = − a, and a − a = −1. This gives a = 2. Then b = −3.
2 2
So p(x) = 2x3 − 3x2 + 1.

11. Let the given line be tangent to the parabola at the point (a, a − 1). Then first, the
parabola passes through (a, a − 1), thus

a − 1 = ca2 .

Second, the line and the parabola have the same slope at this point:

1 = 2ca.
1
From the second equation we have c = . Substituting this for c in the first equation,
2a
we have
a2
a−1= .
2a
1
Solving for a, we have a = 2. Then c = .
4
13. Draw a picture so that you see what’s going on.
Let the slope of such a tangent line be m, then its equation is y = mx. Let (a, ma)
be the touching point. Since this point lies on the parabola, ma = a2 + 2. The slope
of the parabola at the touching point must be m, therefore
√ 2a = m. Substituting
√ this
into the above equation gives 2a2 = a2 +√2. Then a = ± √2, and m = ±2 2. Thus the
equations of the tangent lines are y = 2 2x and y = −2 2x.

15. Let point A (with positive x-coordinate) where the circle touches the parabola be
(a, a2 ), and the center B of the circle be (0, b). Then the distance between these points
is 1, thus
a2 + (b − a2 )2 = 1.
12. CALCULUS 153

y
y=x2

1
B
A
x

The slope of the parabola at the point (a, a2 ) is 2a (the derivative of x2 at x = a), then
1
the slope of AB is − (since AB and the parabola are orthogonal at (a, a2 )). Thus
2a
we have
b − a2 1
=− .
0−a 2a
1
This equation gives b − a2 =
, then from the first equation we have
2
1 3 1 3 1 5
a2 + = 1, so a2 = . Then b = a2 + = + = . So the center of the circle is at
 4 4 2 4 2 4
5
0, .
4

17. Hint. Use partial fraction decomposition. Recall that since x2 + x = x(x + 1), the
A B
partial fraction decomposition has the form + .
x x+1
Solution. Let’s find the partial fraction decomposition, i.e. A and B such that
1 A B
= + .
x2 + x x x+1

Multiplying both sides of this equation by x2 + x, we get 1 = A(x + 1) + Bx. Then


1 = (A + B)x + A. It follows that A + B = 0 and A = 1, then B = −1. Thus
1 1 1
f (x) = = − = x−1 − (x + 1)−1
x2
+x x x+1
f 0 (x) = −x−2 + (x + 1)−2
f 00 (x) = 2x−3 − 2(x + 1)−3
f 000 (x) = −2 · 3x−4 + 2 · 3(x + 1)−4
..
.
f (n) (x) = (−1)n n!x−n−1 − (−1)n n!(x + 1)−n−1

Note: the above formula can be proved by Mathematical Induction.

19. Since A and B are given, the length of AB is fixed. To maximize the area of 4ABC,
we have to maximize the height hc . To do this, the point C must lie on the tangent line
154 SOLUTIONS AND ANSWERS

parallel to the line AB. Thus the slope of the parabola at C must be equal to m. Then
m
the x-coordinate of C is (since the slope at point (x, x2 ) is 2x). The y-coordinate
2
m2
of C is then . It can be verified that this point is always between the intersection
4
points A and B.

A C x

21. Draw a picture to see the triangle and the regions.


Let m be the slope of the line with the required property. Since it passes through the
point (1, 1), its equation is y − 1 = m(x − 1). To find its x-intercept, we let y = 0 and
solve for x:

−1 = m(x − 1),
1 m−1
x=− +1= .
m m
To find the y-intercept, we let x = 0 and solve for y:

y − 1 = m(−1),
y = −m + 1.

The area of the triangle bounded by this line and the axes is

1 m−1 (m − 1)2
· (−m + 1) = − .
2 m 2m
The area of the region bounded by this line, the parabola y = x2 , and the y-axis is
Z 1 Z 1
2
(m(x − 1) + 1 − x )dx = (−x2 + mx − m + 1)dx
0 0
1
x3 mx2
 
= +− + (−m + 1)x
3 2 0
1 m
=− + + (−m + 1)
3 2
m 2
=− + .
2 3
12. CALCULUS 155

The triangle is divided by the parabola into two regions of equal area if and only if the
area of the above region is half of the area of the whole triangle, that is,

m 2 (m − 1)2
− + =− .
2 3 4m


1− 10
Solving this equation for m and disregarding the positive root gives m = .
3
Thus an equation of the line is

1− 10
y−1= (x − 1),
3

or, equivalently,
√ √
1− 10 10 + 2
y= x+ .
3 3

23. To find the intersection points of the line y = ax and the parabola y = x2 , we solve
ax = x2 . The roots are x = 0 and x = a, thus the intersection points are (0, 0) and
(a, a2 ).
Z a  2 a
x x3 a3 a3 a3
If a > 0, the area is (ax − x2 )dx = a − = − = . The area is
0 2 3 0 2 3 6
a3 √
= 1. Then a3 = 6, and a = 6.
3
equal to 1 when
6
Z 0
a3 √
(ax − x2 )dx = − , so a = − 6.
3
If a < 0, then the area is
a 6

25. Let the right intersection point have coordinates (a, c). Then c = 8a − 27a3 .

If the areas of the shaded regions are equal then the area of the region under the given
cubic curve from x = 0 to x = a is equal to the area of the rectangle with width a and
156 SOLUTIONS AND ANSWERS

height c = 8a − 27a3 . Thus we have


Z a
8x − 27x3 = a(8a − 27a3 )
0
 a
2 27 4
4x − x = 8a2 − 27a4
4 0
27
4a2 − a4 = 8a2 − 27a4
4
81 4
a = 4a2
4
81a4 = 16a2
81a2 = 16 (since a 6= 0)
r
16 4
a= = .
81 9

32 27 · 43 32 64 96 − 64 32
Then c = 8a − 27a3 = − = − = = .
9 93 9 27 27 27
27. Let the curve be given by y = f (x). Since it passes through (3, 2), f (3) = 2.
0 0
At a point P (a, f (a)), the
 tangent linehas slope f (a) and equation y−f (a) = f (a)(x−
f (a)
a). Its x-intercept is − 0 + a, 0 . The part of the tangent line that lies in the
f (a)
f (a)
first quadrant is bisected by P if and only if 2a = − 0 + a. Thus af 0 (a) = −f (a).
f (a)
Since this must be true for every point on the curve in the first quadrant, we have the
c
differential equation xf 0 (x) = −f (x). Any function of the form f (x) = is a solution
x
6
of this equation. Using the condition f (3) = 2, we find c = 6. So f (x) = satisfies
x
the required condition.
Z 1 p p Z 1p Z 1p
3 7 3 7
29. Observe that ( 1 − x7 − 1 − x3 )dx = 1 − x7 dx − 1 − x3 dx.
0 0 0
Z 1 p p
3 3
The integral 1 − x7 dx is equal to the area of the region bounded by y = 1 − x7 ,
0 Z 1p
7
the x-axis, and the y-axis. The integral 1 − x3 dx is equal to the area of the region
p 0
7
bounded by y = 1 − x3 , the x-axis, and the y-axis.
p p
1 − x3 can be rewritten as x7 + y 3 = 1 and
3 7
Equations y = 1 − x7 and y =
3 7
x + y = 1, respectively. It is easy to see that both curves pass through (1, 0) and
through (0, 1), and these two curves are symmetric about the line y = x. Thus the areas
of
Z 1the two regions described
Z 1 p above are equal, Z therefore the difference of the integrals
p 1 p p
3 7 3 7
1 − x7 dx and 1 − x3 dx is 0. Thus ( 1 − x7 − 1 − x3 )dx = 0.
0 0 0

31. Hint. Use areas.

hSolution.
π πi
Since arcsin(x) (defined on [−1, 1]) is the inverse function of sin(x) on
− , , their graphs are symmetric about the line y = x, thus the value of
2 2
12. CALCULUS 157

Z 1
arcsin(x)dx, the area of the region under the graph of arcsin(x) on [0, 1], is
0
equal to the area of the region between y = sin(x) and y = 1 from x = 0 to
π
x = . (Draw the graphs to see this!) The latter area can be calculated by
Z π2 2 π
2 π
(1 − sin(x))dx = (x + cos(x)) = − 1.
0 0 2
33. If the function a1 cos x + a2 cos(2x) + · · · + a30 cos(30x) takes on only positive values,
then its integral over any interval must be positive (because it is the area of the region
under the graph of the function). However,
Z 2π
(a1 cos x + a2 cos(2x) + · · · + a30 cos(30x))dx
0
 a2 a30  2π
= a1 sin x + sin(2x) + · · · + sin(30x) = 0.
2 30 0

34. Hint. Try the special cases k = 1 and k = 2 first, and then generalize.

35. Since f (0) = 0 and sin(0) = 0, |f (x)| < | sin(x)| for all x, and the slope of y = sin(x)
at (0, 0) is 1, we have |f 0 (0)| < 1.
Since |f 0 (0)| = |a1 + 2a2 + · · · + nan |, the required inequality follows.

36. Hint. Interpret the sum as a Riemann sum of a function. Then the limit as n approaches
infinity is the value of an integral.
1
37. Hint. Factor out and notice that 22n = 4n .
2
Solution. Observe that

X 1 1 1 1 1
= + 3 + 5 + 7 + ...
n=0
22n+1 2 2 2 2
 
1 1 1 1
= 1 + 2 + 4 + 6 + ...
2 2 2 2
 
1 1 1 1
= 1 + + 2 + 3 + ...
2 4 4 4
1 1
= ·
2 1 − 41
2
= .
3

39. This is a well-known theorem. It is easy to find proofs online, e.g. see wikipedia.
Z t Z t
41. The area of the region under the graph of f is f (x)dx, so we have f (x)dx = t3
0 0
for all t > 0. Differentiating both sides, we have f (t) = 3t2 . Thus f (x) = 3x2 .

43. The 5-dimensional volume of a 5-dimensional ball is proportional to the fourth power
of its radius. Suppose V = cr5 where c is a constant. Then the 3-dimensional volume
V cr5 r
of the boundary of this ball is S = V 0 = 5cr4 . Therefore = 4
= .
S 5cr 5
158 SOLUTIONS AND ANSWERS

13 Various problems
1. First notice that years 2008, 2012, 2016, . . ., 2048 are leap years, so there are 11 leap
years between 2005 and 2050. The other 34 years from 2006 to 2050 (including these)
are non-leap years. Since non-leap years contain 365 days and leap years contain 366
days, the number of days that pass between December 25, 2005 and December 25, 2050
is 34 · 365 + 11 · 366 ≡ 6 · 1 + 4 · 2 ≡ 14 ≡ 0 (mod 7), therefore December 25, 2025 is a
Sunday again.

3. Proof 1: In a reentrant knight’s tour black and white squares must alternate. However,
a 5 × 5 chessboard has 13 squares of one color and 12 squares of the other color, so it
is not possible to have a cycle in which the colors alternate.

Proof 2: Draw a graph representing legal moves of a knight. Look at the corner vertices.
They all have degree 2, thus, in order to visit the corner vertices, we must use both
edges at each corner vertex. Those eight edges form a cycle. It is not possible to
add more edges to this cycle, but the cycle misses many points. Therefore there is no
Hamilton cycle, and thus there is no reentrant tour.

1
5. Sketch. Calculate first few terms and notice that an = . Prove this formula by
n!
X∞ ∞
X 1
Mathematical Induction. Then an = = e.
n=0 n=0
n!

7. Solution 1. Consider non-negative and negative values of x separately.


Case I. If x ≥ 0, then |x| = x, and the inequality becomes |6 − 2x| + x ≤ 3.
Case Ia. If 6 − 2x ≥ 0, or x ≤ 3, then |6 − 2x| = 6 − 2x, and we have 6 − 2x + x ≤ 3.
This gives x ≥ 3. Together with the condition x ≤ 3, we get one root x = 3. This root
satisfies the condition x ≥ 0.
Case Ib. If 6 − 2x < 0, or x > 3, then |6 − 2x| = −6 + 2x, and we have −6 + 2x + x ≤ 3.
This gives x ≤ 3 which contradicts the condition x > 3. Thus we have no roots in this
case.
Case II. If x < 0, then |x| = −x, and the inequality becomes |6| + x ≤ 3, or 6 + x ≤ 3
since |6| = 6. Equivalently, x ≤ −3. All the values of x ≤ −3 satisfy the condition
x < 0.
Answer: x = 3 and x ≤ −3. In the interval notation, (−∞, −3] ∪ {3}.

Solution 2. Draw the graph of f (x) = |6 − |x| − x| + x.


13. VARIOUS PROBLEMS 159

6 6 6 6
y=6−|x| 3
y=6−|x|−x

6 3 3 −3 3
y=|6−|x|−x| y=|6−|x|−x|+x

We see that f (x) ≤ 3 when x = 3 and when x ≤ 3.

9. Below are some examples (but there are many others).

(n + 1)n2
 
11. Hint. Recall problems 33 and 34 in Chapter 3. Generalize to a (n+1)× +1
2
board colored with n colors. Then derive the desired result.

13. Suppose that the 9 bags contain different numbers of coins, and the total number of
coins is 40. Let a1 < a2 < · · · < a9 be the numbers of coins in the 9 bags. Then a1 ≥ 1,
a2 ≥ 2, . . . , a9 ≥ 9, and 40 = a1 + a2 + · · · + a9 ≥ 1 + 2 + · · · + 9 = 45. Since 40 < 45,
we get a contradiction, thus it is not possible for all bags to contain different numbers
of coins.

15. Solution 1. Let’s label the starting square (the lower-left corner) with S and both
squares to which the camel can get to in one move with 1. Then we label all the
squares to which the camel can get in two moves with 2.

2 2

2 2
1 1
2 2 2
1 1
S S 2 2

Next, we label all the squares to which the camel can get in three moves with 3. Since
it cannot get from any of these to the upper-right corner, it is not possible to get there
in four or fewer moves. However, it is possible for the camel to get to that corner in
five moves as is shown below.
160 SOLUTIONS AND ANSWERS

3 3 3 5
2 2 4
3 3 3 3 3
2 2
1 3 3 3
2 2 2 2
3 1 3 1
S 2 2 S

Sketch of Solution 2. First prove that an odd number of moves would be necessary to
get from the lower-left corner to the upper-right corner. Then only show the squares
to which the camel can get in 1 or 2 moves. Since from none of these it can get to the
upper-right corner, a total of three moves is not possible. Therefore, at least five moves
are needed. The last picture above shows that five moves are sufficient.
17. Hint. Consider the remainders of Fibonacci numbers upon division by 8.
19. Let ABC be a three-digit number such that B is the average of A and C. Then
A+C
B= , or equivalently, A + C = 2B. Thus A + C must be even, which means that
2
A and C must have the same parity (both even or both odd). There are 9 choices for
the digit A (since it can’t be 0). After we choose A, there are 5 choices for C (because
it must have the same parity as A, and there are 5 even digits and 5 odd digits, so
whatever the parity of A is, C has 5 choices). Then, once we have chosen both A and
A+C
C, the digit B is determined uniquely by B = . Thus there are 45 such numbers
2
total.
21. For convenience, let us label the columns a-d and the rows 1-4, similar to a chessboard.

Start
4

1
a b c d

We will determine all “good” and “bad” positions (a position is “good” if it is good
for us to go there on our turn, and it is “bad” if we do not want to go there on our
turn). We need to make sure that (1) from any bad position there is at least one move
to a good one (that’s where we will go on our turn), and (2) any move from a good
position leads to a bad one (that’s where our opponent will be forced to go on their
turn). Working backwards, we have: d1 is good; c1 and d2 are bad; d3 is good; c2, c3,
13. VARIOUS PROBLEMS 161

and d4 are bad; b1 is good; a1 and b2 are bad; c4 is good; b3 and b4 are bad; a2 is
good; a3 is bad; a4 is good. Since the starting position is good, we should choose to go
second. On each move, our opponent is forced to go to bad position, and then we will
have a way to go to a good one.
23. Answer: 8.

25. No. Let’s denote the three grasshoppers A, B, and C. There are six different orders
(ABC, ACB, BAC, BCA, CAB, and CBA). The diagram below shows which position
can change into which in one leap.

ABC BCA CAB

BAC ACB CBA

Notice that these six orders can be divided into two groups (the top row and the bottom
row) such that the groups must alternate with every leap of a grasshopper. Since 11 is
odd, their order after 11 leaps must be in a different group than the starting one. So
they cannot return to their original order after 11 leaps.
27. Sketch. Calculate the number of pairs of numbers that can be formed form 21 numbers.
Calculate the smallest and largest possible sum of two numbers from the given range
and thus determine the number of possible values of the sum. Observe that there
are more possible pairs than possible values of the sum and use Pigeonhole principle.
Finally, show that if different two pairs have the same sum, then they are disjoint.
7
X
29. If ai+1 − ai < 15 for all 1 ≤ i ≤ 7, then a8 − a1 = (ai+1 − ai ) ≤ 7 · 14 = 98 (because
i=1
all ai ’s are integers, so all differences are also integers). However, this is impossible
since a7 − a1 = 100 − 1 = 99.

30. Note. There are many variations of this problem. In some versions cameras are re-
stricted to the walls (edges of the polygon), or even to the corners (vertices of the
polygon). Some versions require only the edges to be guarded. There is a whole book
(Art Gallery Theorems and Algorithms, Joseph O’Rourke, Oxford University Press
1987) dedicated to this problem. There are also many references on the Internet.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy