Olym Math

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 73
At a glance
Powered by AI
The text discusses using invariants to simplify difficult math problems. Invariants are properties that remain unchanged even as other properties change. Examples given are parity, divisibility, and symmetry.

Examples of invariants discussed include parity, divisibility, and symmetry. Specific examples provided are that the sum of positive integers will have the same parity no matter the signs between them, and that the number of spots on each side of a domino chain must be paired.

Gaussian pairing is used to find the sum of the first 100 positive integers by writing the sum as two equal expressions - the numbers added normally and paired from both ends. This allows finding the sum by calculating 100*101/2.

MATHEMATICS

OLYMPIAD
PROBLEM SOLVING
Julian Arif

0856 94218828

1 Invariants
An invariant is some aspect of a problemtypically a numerical quantitythat
does not change, even if many other properties do change. You can use often
use invariants to simplify difcult problems. Some examples of invariants are
parity, divisibility, and symmetry.
Example 1.1 Two diametrically opposite corners of a chess board are deleted. Is
it possible to tile the remaining 62 squares with 31 dominos?
Solution: No. Each domino covers one red square and one black square. But
diametrically opposite corners are of the same color, so such a tiling is
impossible.
Example 1.2 The numbers 1, 2, . . . , 10 are written in a row. Show that no
matter what choice of sign is put in between them, the sum will never be 0.
Solution: The sum 1 + 2 + + 10 = 55, an odd integer. Since parity is not
aected by the choice of sign, for any choice of sign 1 2 10 will never
be even, so in particular it will never be 0.
Example 1.3 All the dominos in a set are laid out in a chain according to the
rules of the game. If one end of the chain is a 6, what is at the other end?
Solution: At the other end there must also be a 6. Each number of spots must
occur in a pair, so that we may put them end to end. Since there are eight 6s,
this last 6 pairs of with the one at the beginning of the chain.
Example 1.4 Let a1, a2, . . . , an represent an arbitrary arrangement of the
numbers 1, 2, 3, . . . , n. Prove that, if n is odd, then the product
(a1 1)(a2 2)(a3 3) (an n)
is even.
Solution: Consider the sum of the terms:
(a1 1) + (a2 2) + (an n) = (a1 + a2 + an) (1 + 2 + + n)
= (1 + 2 + + n) (1 + 2 + + n)
= 0.
Thus, the sum of the terms is zero no matter what the arrangement. A sum of an
odd number of integers which equals zero (an even number) must contain one
even number, and any product that contains one even number is even.

Mathematics Olympiad Notes

Example 1.5 (Gaussian Pairing) Find the sum of the first 100 positive integers.
Solution:
S = 1 + 2 + 3 + + 98 + 99 + 100
S = 100 + 99 + 98 + + 3 + 2 + 1 2S = 100 101
Thus, S = 50 101 = 5050.
Example 1.6 Let d(n) denote the number of divisors of a positive integer n. Show
that d(n) is odd if and only if n is a perfect square.
Solution: The symmetry here is that we can always pair a divisor d of n with n/d.
For example, if n = 28, it is natural to pair the divisor 2 with the divisor 14. Thus,
as
we go through the list of divisors of n, each divisor will have a unique partner,
unless
Example 1.8 At first, a room is empty.
1999 Each minute, either one person enters
1000 or
two people leave. After exactly 3
minutes, could the room contain 3
+2
people?
Solution: If there are n people in the room, after one minute, there will be either
n + 1 or n 2 people. The dierence between these two possible outcomes is 3.
After two minutes, there will be either n 1, n + 2, or n 4 people. These
possible values dier from one another by multiples of 3. Continuing for longer
times, we see that at any fixed time t, the possible values for the population of
1999
the room dier from one another by multiples of 3. After 3
minutes, one
1999
possible population is 3
(this population occurs if one person entered each
minute). This is a multiple of 3, so all the possible populations of the room at this
1000
time must also be a multiple of 3. Thus, 3
+ 2 is not a possible population
1999
after 3
minutes.
Example 1.9 A rectangle is tiled with smaller rectangles, each of which has at
least one side of integral length. Prove that the tiled rectangle must also have at
least one side of integral length.
Solution: Note: there are at least fourteen di erent solutions of this problem,
several of which use invariants in dierent ways. See Stan Wagon, Fourteen
proofs of a result about tiling a rectangle, American Mathematical Monthly,
94:601617, 1987 for an account of these solutions.
For ease of discussion and notation, lets call the property of having at least one
integral side good. We must show that the large rectangle is good. Start by
orienting the large rectangle so that the lower-left corner is a lattice point. A
lattice point (m, n) on the plane is one having integer coordinates. Next, we
make the following key observation: If the rectangle werent good, then it would
have only one
lattice point corner. But if the rectangle is good, then it will have either two lattice
point corners (if one dimension is an integer), or four lattice point corners (if both
length and width are integers).

Thus, the rectangle is good if and only if the number of corner lattice points is
even. Well count lattice point corners, and try to show that the number of lattice
point corners of the big rectangle must be even.
Consider the corners of a small rectangle. It may have zero lattice point corners,
or two lattice point corners, or four lattice point corners, but it can not have just
one

or three, because each small rectangle is good (i.e. has at least one integerlength side). Thus, if we count the number of corner lattice points on each small
rectangle and add them up, the sum, which we call S, must be even.
Note, however, that we have overcounted some of the lattice pointsin
particular, we have overcounted any lattice points that occur as the corner of
more than one rectangle. We make the following observations:

We will only count a corner lattice point once, twice, or four timesnever
three times.

The only corner lattice points that are counted exactly once are the corners
of the large rectangle.

Let a denote the number of corner lattice points that we count exactly once (i.e.
the corner lattice points of the large rectangle), let b denote the number of
corner lattice points that we count exactly twice, and let c denote the number of
corner lattice points that we count exactly four times. Then we have:
S = a + 2b + 4c,
so
a = S 2b 4c.
Since S, 2b, and 4c are all even, a is even as well. Thus, the large rectangle has
an even number of corner lattice points, so it must have two or four corner lattice
points. Thus, the large rectangle has at least one side of integral length.

2 Arithmetic Ratios
Example 2.1 (2000 AMC 10 #8) At Olympic High School, 2/5 of the freshmen
and 4/5 of the sophomores took the AMC 10. The number of freshmen and
sophomore contestants was the same. Which of the following must be true?
(A) There are five times as many sophomores as freshmen.
(B) There are twice as many sophomores as freshmen.
(C) There are as many sophomores as freshmen.
(D) There are twice as many freshmen as sophomores.
(E) There are five times as many freshmen as sophomores.
Solution: Lets arbitrarily assume that there are 100 freshmen in the school.
Then 40 freshmen and 40 sophomores took the exam. Thus, there are 50
sophomores in the school, so the answer is (D). Note: it was convenient to
assign a specific value for the number of freshmen, but it is not necessary. We
could let F denote the number of freshmen and conclude, using the same
technique as above, that there are F/2 sophomores. We chose to use 100 for
the number of freshmen because it simplifies the situation.
Example 2.2 (2004 AMC 10A #17 and 2004 AMC 12A #15) Brenda and Sally run
in opposite directions on a circular track, starting at diametrically opposite points.
Each girl runs at a constant speed. They first meet after Brenda has run 100
meters. They next meet after Sally has run 150 meters past their first meeting
point. What is the length of the track in meters?
(A) 250

(B) 300

(C) 350

(D) 400

Solution: The fundamental relationship involved in this problem is


rate=

distance
time

First we must define some notation. Let

L be the length of the track.

RS be the rate at which Sally runs.

RB be the rate at which Brenda runs.

T1 be the time it takes them to first meet.

T2 be the time after they first meet until they meet again.

(E) 500

Solution. They start at opposite sides of the track and run in opposite directions,
so they first meet when their combined distance run is L/2. We are told that
Brenda has run 100 meters during this time T1, so
100 = T1 RB .
When they meet again they have together run the full length, L, of the track since
their first meeting. Since their speeds are constant and they ran together L/2 in time
T1, we have T2 = 2T1. Sally has run 150 meters during the time T2, so

L = T2 RS + T2 RB = 150 + 2T1 RB = 150 + 2 100 = 350 meters.


Example 2.3 (2002 AMC 10B #21 and 2002 AMC 12B #17) Andys lawn has twice
as much area as Beths lawn and three times as much area as Carlos lawn. Carlos
lawn mower cuts half as fast as Beths mower and one third as fast as Andys
mower. They all start to mow their lawns at the same time. Who will finish first?

(A) Andy

(D) Andy and Carlos tie for first.

(B) Beth
(C) Carlos

(E) They all tie.

Solution. This is also a rate problem, so we begin with some notation. Let

Aa, Ra, Ta be the area, rate, and time for Andy.

Ab, Rb, Tb be the area, rate, and time for Beth.

Ac, Rc, Tc be the area, rate, and time for Carlos.

Then Ab = Aa/2, Ac = Aa/3, Rb = 2Rc, and Ra = 3Rc. To solve the problem, we


must express the times for each worker using a common base. Here, we will use
the fraction Aa/Rc, but any combination of A/R is possible. We obtain:

Ta =

1 Aa
3 Rc

Tb =

1 Aa
4 Rc

Tc =

1 Aa
3 Rc

Thus, Beth finishes first.

Example 2.5 (1983 AHSME #7) Alice sells an item at $10 less than the list price
and receives 10% of her selling price as her commission. Bob sells the same

item at $20 less than the list price and receives 20% of his selling price as his
commission. If they both get the same commission, then the list price is
(A) $20

(B) $30

(C) $50

(D) $70

(E) $100

Solution. Let p denote the list price of the item (in dollars). Alices commission is
0.10 (p 10),
and Bobs commission is
0.20 (p 20).
Thus,
0.10 (p 10) = 0.20 (p 20),
so
p = 30.

3 Algebraic Manipulation
3

Example 3.1 If x + y = xy = 3, find x + y .


Solution: One way to solve this problem would be to solve the system
x + y = xy = 3
3

for x and y, and then substitute the resulting values into the expression x +y . This
technique would certainly work, but would be time-consuming, messy, and probably
error-prone. Instead, well use algebra to construct a more elegant solution. Since
3
3
2
2
our goal is to find x + y , well start by trying to find x + y . We have:

=
=
=
=

(x + y)
2
2
x + 2xy + y
2
2
x +y +23
2
2
x + y + 6.

Thus, x + y = 3 6 = 3. Next, we obtain:


33 =
=
=
=

(x + y)(x + y )
3
3
2
2
3
x + y + x y + xy + y
3
3
x + y + xy(x + y)
3
3
x + y + 3 3.

Finally, we conclude that


3

x + y = 3 3 3 3 = 0.

Useful Lemmas
2
2
2
(x + y) = x + 2xy + y
2

(x y) = x 2xy + y

(x + y) = x + 3x y + 3xy + y = x + y + 3xy(x + y)

(x y) = x 3x y + 3xy y = x y 3xy(x y)

x y = (x + y)(x y)

x y = (x y)(x
integers n

x + y = (x + y)(x
x y + x y xy
+ y ) for all positive
odd integers n (the terms of the second factor alternate in sign)

(x + y + z) = x + y + z + 2xy + 2xz + 2yz

(x + y + z + w) = x + y + z + w + 2xy + 2xz + 2xw + 2yz + 2yw + 2zw

(x y) + 4xy = (x + y)

n1

n1

+x

n2

n3 2

n2

n2

n3 2

n2

y+x

y + + xy

+y

n1

) for all positive

n1

3.2 Single-variable Equations


Example 3.3 Solve the equation |x 3|

(x28x+15)/(x2)

= 1.

Solution: If
b

a = 1,
0

the either a = 1 or b = 0. Note that 0 is undefined, so we cannot have a = b = 0.


Thus, we start by setting |x 3| = 1. This implies
x = 4 or x = 2.
2

We discard x = 2 as the exponent is undefined at x = 2. Next, we set x 8x+15


= 0, which implies
x = 5 or x = 3.
0

We discard x = 3 since this would give 0 . Thus, the only solutions are x = 4 and
x = 5.
Example 3.4 Solve 9 + x

= 10x .

Solution: First, we rewrite the equation as


4

10x

+ 9 = (x

+ 9 = 0.

Observe that
4

x
Thus the solutions are

10x

9)(x

1
x = 3 , 1.

1).

Example 3.5 Solve


(x 5)(x 7)(x + 6)(x + 4) = 504.
Solution: Reorder the factors and multiply to obtain
2

(x5)(x7)(x+ 6)(x+ 4) = (x5)(x+ 4)(x7)(x+ 6) = (x x20)(x x42).


2

Set y = x x. Then:
(y 20)(y 42) =
2

y 62y + 336 =

504
(y 6)(y 56) = 0.

Thus we obtain y = 6, 56, so


2

x x=6

and

Solving both quadratics, we obtain

x x = 56.

x = 2, 4, 7, 8.
4

Example 3.6 Solve 12x 56x + 89x 56x + 12 = 0.


Solution: Reordering, we obtain:
4
3
2
12x + 12 56(x + x) + 89x
x2 12(x2 + x2 ) 56(x + x) + 89

= 0
= 0

2
12(x + x ) 56(x + x ) + 89 = 0.

Next, we set u = x + 1/x. Then


2

u 2 = x + 1/x ,
Using this, we obtain
2

so u = 5/2, 13/6. Thus,


and

12(u 2) 56u + 89 = 0,
x+ 1 = 5
2
x

x + 1 = 13 .
x
6
Finally, solving both equations above, we conclude that
x = 1/2, 2, 2/3, 3/2.

3.2 Systems of Equations


Example 3.13 Solve the system of equations
x+y+u
y+u+v
u+v+x

= 4,
= 5,
= 0,

v+x+y

= 8.

Solution: Adding all the equations and dividing by 3, we obtain


x + y + u + v = 3.
This implies that
4+v
5 + x
0+y
8 + u

= 3,
= 3,
= 3,
= 3.

Thus
x = 2, y = 3, u = 5, v = 7.
Example 3.14 Solve the system
(x + y)(x + z) = 30,
(y + z)(y + x) = 15,
(z + x)(z + y) = 18.
Solution: Set u = y + z, v = z + x, w = x + y. Then the system becomes
vw = 30
wu = 15 uv
= 18.
Multiplying these equations we obtain
2 2 2

u v w = 8100,
which we solve to obtain uvw = 90. Next, we solve for u, v, and w to obtain u =
3, v = 6, w = 5, or u = 3, v = 6, w = 5. Then we have:
y+z
z+x

= 3
= 6

x+y

= 5.

Thus we conclude that


x = 4, y = 1, z = 2 or x = 4, y = 1, z = 2.

4 Polynomials
Theorem 4.1 The Division Algorithm for polynomials. If the polynomial p(x) is
divided by d(x) then there exist polynomials q(x), r(x) such that
p(x) = d(x)q(x) + r(x)
and 0 degree(r(x)) < degree(d(x)).
We can find the quotient q(x) and the remainder r(x) by performing ordinary long
5
4
2
division with polynomials. For example, if x + x + 1 is divided by x + 1 we obtain
5

x + x + 1 = (x + x x 1)(x + 1) + x + 2,
3

so the quotient is q(x) = x + x x 1 and the remainder is r(x) = x + 2.


Theorem 4.2 The Remainder Theorem for polynomials. If the polynomial p(x) is
divided by x a, then the remainder will be p(a).
Proof. By the Division Algorithm for polynomials, we know that
p(x) = (x a)q(x) + r.
Note that the remainder r(x) = r is a constant (degree 0) since the degree of x
a is equal to 1. Substituting x = a, we obtain
p(a) = (a a)q(a) + r = 0 + r = r.
Theorem 4.3 The Factor Theorem for polynomials. The polynomial p(x) is divisible by x a if and only if p(a) = 0.
Proof. The remainder r is equal to p(a), so p(x) is divisible by x a if and only if
p(a) = 0.
5

Example 4.1 Find the remainder when (x + 3) + (x + 2) + (5x + 9)


by x + 2.
5

Solution: Let p(x) be the polynomial (x+3) +(x+2) +(5x+9)

1997

is divided

1997

. The remainder

upon dividing P (x) by x + 2 = x (2) is p(2) = 0.


Example 4.2 A polynomial p(x) leaves remainder 2 upon division by x 1 and
remainder 4 upon division by x + 2. Find the remainder when this polynomial is
2

divided by x + x 2.
Solution: There exist polynomials q 1(x) and q2(x) such that p(x) = q1(x)(x 1) 2
and p(x) = q2(x)(x + 2) 4. Thus
p(1) = 2 and p(2) = 4.

Since
2

x + x 2 = (x 1)(x + 2)
2

is a polynomial of degree 2, the remainder r(x) upon dividing p(x) by x + x 1 is


of degree 1 or less, so r(x) = ax + b for some constants a and b which we must
determine. By the Division Algorithm for polynomials,
2

p(x) = q(x)(x + x 1) + ax + b.
Thus, we have
2 = p(1) = a + b
and
4 = p(2) = 2a + b.
We solve this system to obtain a = 2/3 and b = 8/3. The desired remainder is thus

r(x) = 3x 3.
4

Example 4.3 Let f(x) = x + x + x + x + 1. Find the remainder when f(x ) is


divided by f(x).
5

Solution: Observe that f(x)(x 1) = x 1 and


5

f(x ) = x

20

+x

15

+x

10

+ x + 1 = (x

20

1) + (x

15

1) + (x

10

1) + (x 1) + 5.
5

Each of the summands in parentheses is divisible by x 1 and by f(x). The


remainder is thus 5.
Example 4.4 If p(x) is a cubic polynomial with p(1) = 1, p(2) = 2, p(3) = 3, p(4) =
5, find p(6).
Solution: Let
g(x) = p(x) x.
Observe that g(x) is a polynomial of degree 3 and that
g(1) = g(2) = g(3) = 0.
Thus
g(x) = c(x 1)(x 2)(x 3)
for some constant c that we must determine. Now,
g(4) = c(4 1)(4 2)(4 3) = 6c
and
g(4) = p(4) 4 = 1,

so
c = 1/6.
Finally,
p(6) = g(6) + 6 =

(6 1)(6 2)(6 3)

+6=
16. 6
Theorem 4.4 The Rational Roots (Zeros) Test: Suppose that a 0, a1, . . . , an are
integers with an 6= 0. If p/q is a rational root (zero) of
n

n1

p(x) = anx + an1x

+ + a1x + a0,

then p divides a0 and q divides a1.


Next, we will consider the relationship between the zeros of a polynomial and
the coecients of the polynomial.
Quadratic polynomials. Well begin with the case of a quadratic (monic) polyno2
mial. Suppose that the zeros of the quadratic polynomial x + a1x + a0 are r and
s. Then we can write the polynomial as
2

x + a1x + a0 = (x r)(x s)
2
= x (r + s)x + rs.
Equating terms, we obtain
a1 = (r + s) and a0 = rs.
Thus, we conclude the following:

a1 = (sum of the zeros)

a0 = +(product of the zeros)


3

Cubic Polynomials. Suppose that the zeros of the cubic polynomial x + a2x +
a1x + a0 are q, r, s. Then we can factor the cubic polynomial as
3

x + a2x + a1x + a0 = (x q)(x r)(x s)


3
2
= x (q + r + s)x + (qr + qs + rs)x qrs.
Equating terms, we obtain
a2 = (q + r + s), a1 = qr + qs + rs, a0 = qrs.
Thus, we conclude the following:

a2 = (sum of the zeros)

a1 = +(sum of all products of two dierent zeros)

a0 = (product of the zeros)

In general, we have the following. Suppose that


r1, r2, . . . , rn
are the roots of the monic degree-n polynomial
n

n1

x + an1x

n2

+ an2x

+ + a1x + a0 = 0.

Then, for k = 1, 2, . . . n,
ak = (1)

nk

(sum of all products of n k dierent zeros).

Example 4.5 (1983 AIME) What is the product of the real roots of the equation
x 2 + 18x + 30 = 2 x 2 + 18x + 45?
Solution: The only obstacle to an immediate solution of this problem is the
presence of the square root. Thus, a natural technique is to substitute

y = x2 + 18x + 45.
Note that if x is real, then y must be non-negative (i.e. y 0). Then the equation
becomes:
2

y 15

= 2y

(y 5)(y + 3)

= 0.

Thus, y = 5 or y = 3. We reject y = 3 since y 0. Substituting y = 5, we obtain


2

x + 18x + 20 = 0.
The product of the roots of this quadratic polynomial is 20.
Example 4.6 (1984 USAMO) The product of two of the four zeros of the quartic
equation
4
3
2
x 18x + kx + 200x 1984 = 0
is 32. Find k.

Solution: Let the zeros of the quartic be a, b, c, d. Then we have:


a + b + c + d = 18
ab + ac + ad + bc + bd + cd = k
abc + abd + acd + bcd =
abcd =

200
1994.

Without loss of generality, let ab = 32. Substituting this into abcd = 1984, we
obtain cd = 62. Then the equations become:
a+b+c+d
30 + ac + ad + bc + bd

= 18
= k

32c 32d + 62a + 62b

= 200

Recall that we need to compute k, not the values a, b, c, d. Note that if we could
compute ac + ad + bc + bd, then we could compute k. We see that ac + ad + bc
+ bd factors as
ac + ad + bc + bd = a(c + d) + b(c + d) = (a + b)(c + d).
Further,
32c 32d + 62a + 62b = 32(c + d) + 62(a + b).
Next, let u = a + b and v = c + d. Then we have:
u + v = 18 62u
32v = 200.
Solving, we obtain u = 4 and v = 18, so
k = 30 + 4 14 = 86.

5 Functions and Binary Operations

Definition 5.1 A binary operation on a set of numbers is a way to take two of the
numbers and produce a third.
Often, a binary operation in a mathematics competition problem will be
expressed using some unusual symbol, such as or . The result of the
operation after it is applied to the numbers a and b would typically be written as
(a, b) or ab, or (a, b) or ab.
Definition 5.2 A function f is a means of associating each element of one set,
called the domain of f, with exactly one element of a second set, called the
range of f.

Definition 5.3 The floor function f(x) = bxc is defined to be the greatest integer
less than or equal to x.
For example, b3.7c = 3, b2c = 2, b2.4c = 3.
Definition 5.4 The ceiling function f(x) = dxe is defined to be the smallest integer
greater than or equal to x.
For example, d3.1e = 4, d1.2e = 1.
Example 5.1 (1993 AHSME #4) Define the operation by
xy = 4x 3y + xy
for all real numbers x and y. For how many real numbers y does 12 = 3y?
(A) 0 (B) 1 (C) 3 (D) 4 (E) more than 4
Solution:
12 = 3y
= 433y+3y
= 12.
Thus, the equation is true for any real number y.
Example 5.2 (1996 AHSME #14) The function E(n) is defined for each positive
integer n to be the sum of the even digits of n. For example, E(5681) = 6 + 8 =
14. What is the value of

E(1) + E(2) + + E(100)?


(A) 200

(B) 300

(C) 400

(D) 900

(E) 2250

Solution: Rater than determine the values of E(n) individually, observe that the
numbers
00, 01, 02, . . . , 99
contain an equal number of each of the digits 0, 1, . . . , 9. There are a total of
2100 = 200 of these digits, so there are 200/10 = 20 of each digit. Thus,
E(0) + E(1) + E(2) + + E(99) = 20(0 + 2 + 4 + 6 + 8) = 400.
Since E(0) = 0 and E(100) = 0, the required sum is also 400.

6 Combinatorics: The Product and Sum Rules


6.1 The Product Rule
Theorem 6.1 The Product Rule. Suppose that an experiment E can be performed in k stages: E1 first, E2 second, . . . , E k last. Suppose moreover that E i
can be done in ni diferent ways, and that the number of ways of performing E i is
not influenced by any predecessors E 1, E2, . . . , Ei1. Then E1 and E2 and . . .
and Ek can occur simultaneously in n1n2 nk ways.
Example 6.1 In a group of 8 men and 9 women we can pick one man and one
woman in 8 9 = 72 ways. Notice that we are choosing two persons.
Example 6.2 A red die and a blue die are tossed. In how many ways can they land?

Solution: If we view the outcomes as an ordered pair (r, b) then by the


multiplication principle we have the 6 6 = 36 possible outcomes
(1, 1) (1, 2) (1, 3) (1, 4) (1, 5) (1, 6)
(2, 1) (2, 2) (2, 3) (2, 4) (2, 5) (2, 6)
(3, 1) (3, 2) (3, 3) (3, 4) (3, 5) (3, 6)
(4, 1) (4, 2) (4, 3) (4, 4) (4, 5) (4, 6)
(5, 1) (5, 2) (5, 3) (5, 4) (5, 5) (5, 6)
(6, 1) (6, 2) (6, 3) (6, 4) (6, 5) (6, 6)
The red die can land in any of 6 ways,
6
and the blue die may land in any of 6 ways
6 6.
Example 6.3 A multiple-choice test consists of 20 questions, each one with 4 choices.
There are 4 ways of answering the first question, 4 ways of answering the second
20
question, etc. Thus, there are 4 = 1099511627776 ways of answering the exam.

Example 6.4 There are 9 10 10 = 900 positive 3-digit integers:


100, 101, 102, . . . , 998, 999.
Since the leftmost integer cannot be 0, there are only 9 choices {1, 2, 3, 4, 5, 6,
7, 8, 9} for it,
9
.
There are 10 choices for the second digit
9 10 ,

and 10 choices for the last digit


9 10 10 .
Example 6.5 There are 9 10 5 = 450 even positive 3-digit integers:
100, 102, 104, . . . , 996, 998.
Since the leftmost integer cannot be 0, there are only 9 choices {1, 2, 3, 4, 5, 6,
7, 8, 9} for it,
9
.
There are 10 choices for the second digit
9 10 .
Since the integer must be even, the last digit must be one of the 5 choices {0, 2, 4, 6, 8}

9 10 5 .
Definition 6.1 A palindromic integer or palindrome is a positive integer whose
dec-imal expansion is symmetric and that is not divisible by 10. In other words,
one reads the same integer backwards or forwards.
Note: A palindrome in common parlance, is a word or phrase that reads the same
backwards to forwards. The Philadelphia street name Camac is a palindrome. So
are the phrases (if we ignore punctuation) (a) A man, a plan, a canal, Panama!
(b) Sit on a potato pan!, Otis. (c) Able was I ere I saw Elba. This last one is
attributed to Napoleon, though it is doubtful that he knew enough English to form
it.

Example 6.6 The following integers are all palindromes:


1, 8, 11, 99, 101, 131, 999, 1234321, 9987899.
Example 6.7 How many palindromes are there of 5 digits?
Solution: There are 9 ways of choosing the leftmost digit.
9

Once the leftmost digit is chosen, the last digit must be identical to it, so we have
9

1.

There are 10 choices for the second digit from the left
9 10

1.

Once this digit is chosen, the second digit from the right must be identical to it,
so we have only 1 choice for it,
9 10 1
1.
Finally, there are 10 choices for the third digit from the right,
9 10 10 1 1 ,
which give us 900 palindromes of 5-digits.
Example 6.8 How many palindromes of 5 digits are even?
Solution: A five digit even palindrome has the form ABCBA, where A belongs to
{2, 4, 6, 8}, and B, C belong to {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}. Thus there are 4
choices for the first digit, 10 for the second, and 10 for the third. Once these
digits are chosen, the palindrome is completely determined. Therefore, there are
4 10 10 = 400 even palindromes of 5 digits.
Example 6.9 How many positive divisors does 300 have?
2 2

a b c

Solution: We have 300 = 3 2 5 . Thus every factor of 300 is of the form 3 2 5 ,


where 0 a 1, 0 b 2, and 0 c 2. Thus there are 2 choices for a, 3 for b
and 3 for c. This gives 2 3 3 = 18 positive divisors.
n

We now prove that if a set A has n elements, then it has 2 subsets. To motivate
the proof, consider the set {a, b, c}. To each element we attach a binary code of
length 3. We write 0 if a particular element is not in the set and 1 if it is. We then
have the following associations:
000,

{a, b} 110,

{a} 100,

{a, c} 101,

{b} 010,
{c} 001,

{b, c} 011,
{a, b, c} 111.

Thus there is a one-to-one correspondence between the subsets of a finite


set of 3 elements and binary sequences of length 3.
Theorem 6.2 Cardinality of the Power Set. Let A be a finite set with |A| card (A) = n.
n
Then A has 2 subsets.
Proof. We attach a binary code to each element of the subset, 1 if the element is
in the subset and 0 if the element is not in the subset. The total number of
n
subsets is the total number of such binary codes, and there are 2 in number.

6.2 The Sum Rule


Theorem 6.3 The Sum Rule. Let E 1, E2, . . . , Ek, be pairwise mutually exclusive
events. If Ei can occur in ni ways, then either E1 or E2 or, . . . , or Ek can occur in
n1 + n2 + nk
ways.
Remark. Notice that the or here is exclusive.
Example 6.10 In a group of 8 men and 9 women we can pick one man or one
woman in 8 + 9 = 17 ways. Notice that we are choosing one person.
Example 6.11 There are five Golden retrievers, six Irish setters, and eight Poodles at
the pound. How many ways can two dogs be chosen if they are not the same kind?

Solution: We choose: a Golden retriever and an Irish setter or a Golden retriever


and a Poodle or an Irish setter and a Poodle.
One Golden retriever and one Irish setter can be chosen in 56 = 30 ways; one
Golden retriever and one Poodle can be chosen in 5 8 = 40 ways; one Irish
setter and one Poodle can be chosen in 68 = 48 ways. By the sum rule, there
are 30+40+48 = 118 combinations.
Example 6.12 There were a total of 1890 digits used in writing all of the page
numbers in a book. How many pages does the book have?
Solution: A total of
1 9 + 2 90 = 189
digits are used to write pages 1 to 99, inclusive. We have of 1890 189 = 1701
digits left, which is enough for 1701/3 = 567 extra pages (starting from page
100). The book has 99 + 567 = 666 pages.
Example 6.13 How many 4-digit integers can be formed with the set of digits {0,
1, 2, 3, 4, 5} such that no digit is repeated and the resulting integer is a multi-ple
of 3?
Solution: The integers desired have the form D 1D2D3D4 with D1 6= 0. Under the
stipulated constraints, we must have
D1 + D2 + D3 + D4 {6, 9, 12}.
We thus consider three cases.

Case I: D1+D2+D3+D4 = 6. Here we have {D1, D2, D3, D4} = {0, 1, 2, 3, 4}, D1 6=
0. There are then 3 choices for D 1. After D1 is chosen, D2 can be chosen in 3
ways, D3 in 2 ways, and D1 in 1 way. There are thus 3 3 2 1 = 3 3! = 18
integers satisfying case I.
Case II: D1 +D2 +D3 +D4 = 9. Here we have {D1, D2, D3, D4} = {0, 2, 3, 4}, D 1 6=
0 or {D1, D2, D3, D4} = {0, 1, 3, 5}, D1 6= 0. Like before, there are 3 3! = 18
numbers in each possibility, thus we have 2 18 = 36 numbers in case II.
Case III: D1+D2+D3+D4 = 12. Here we have {D1, D2, D3, D4} = {0, 3, 4, 5}, D1 6= 0 or
{D1, D2, D3, D4 } = {1, 2, 4, 5}. In the first possibility there are 33! = 18 numbers, and in
the second there are 4! = 24. Thus we have 18 + 24 = 42 numbers in case III.

The desired number is thus 18 + 36 + 42 = 96.

7 Combinatorics: The Inclusion-Exclusion Principle


In this section we investigate a tool for counting unions of events. It is known as
The Principle of Inclusion-Exclusion or Sylvester-Poincare Principle. We use
card (X) or |X| to denote the cardinality, or size, of the set X. We will use that fact
that if X and Y are disjoint sets, then card (X Y ) = card (X) + card (Y ).
Theorem 7.1 Two set Inclusion-Exclusion.
card (A B) = card (A) + card (B) card (A B)
Proof 1. We have
A B = (A \ B) (B \ A) (A B),
and this last expression is a union of disjoint sets. Hence
card (A B) = card (A \ B) + card (B \ A) + card (A B) .
But
A \ B = A \ (A B) = card (A \ B) = card (A) card (A B) ,
B \ A = B \ (A B) = card (B \ A) = card (B) card (A B) ,
which proves the result.
Proof 2. Construct a Venn diagram, and mark by R 1 the number of elements
which are simultaneously in both sets (i.e., in A B), by R 2 the number of
elements which are in A but not in B (i.e., in A \ B), and by R 3 the number of
elements which are B but not in A (i.e., in B \ A). We have R 2 + R3 R1 = card (A
B), which illustrates the theorem.
Example 7.1 Of 40 people, 28 swim and 16 run. It is also known that 10 both
swim and run. How many among the 40 neither swim nor run?
Solution: Let A denote the set of swimmers and B the set of runners. Then
card (A B) = card (A) + card (B) card (A B) = 28 + 16 10 = 34,
meaning that there are 34 people that either swim or run (or possibly both).
There-fore the number of people that neither swim nor run is 40 34 = 6.
Example 7.2 How many integers between 1 and 1000, inclusive, do not share a
common factor with 1000?

3 3

Solution: Observe that 1000 = 2 5 , and thus from the 1000 integers we must weed
out those that have a factor of 2 or of 5 in their prime factorization. If A 2 denotes the
set of those integers divisible by 2 in the interval [1, 1000] then clearly

1000
2c = 500. Similarly, if A5 denotes the set of those integers divisible
1000
1000 c = 100. This
by 5 then card (A5) = b 5 c = 200. Also card (A2 A5) = b 10
means that there are card (A 2 A5) =500 + 200 100 = 600 integers in the interval
[1, 1000] sharing at least a factor with 1000, thus there are 1000 600 = 400
integers in [1, 1000] that do not share a factor prime factor with 1000.
card (A2) = b

We now deduce a formula for counting the number of elements of a union of


three events.
Theorem 7.2 Three set Inclusion-Exclusion. Let A, B, C be events of the same
sample space . Then
card (A B C) =

card (A) + card (B) + card (C)


card (A B) card (B C) card (C

A) + card (A B C)
Proof 1. Using the associativity and distributivity of unions of sets, we see that
card (A B C) = card (A (B C))
= card (A) + card (B C) card (A (B C))
= card (A) + card (B C) card ((A B) (A C))
= card (A) + card (B) + card (C) card (B C) card (A B)
card (A C)
+ card ((A B) (A C))
= card (A) + card (B) + card (C) card (B C)
(card (A B) + card (A C) card (A B C))
= card (A) + card (B) + card (C)
card (A B) card (B C) card (C A)
+ card (A B C) .
This gives the Inclusion-Exclusion Formula for three sets.
Proof 2. Construct a Venn Diagram.
Example 7.3 How many integers between 1 and 600 inclusive are not divisible
by 3, 5, or 7?
Solution: Let Ak denote the set of integers between 1 and 600 which are divisible
by k. Then

card (A3)
card (A5)

600
3c = 200,

600
5c = 120,

card (A7)
card (A15)
card (A21)
card (A35)
card (A105)

600

600
600
600

7c = 85,

15c = 40
21c = 28
35c = 17

600
105c = 5

By Inclusion-Exclusion there are 200 + 120 + 85 40 28 17 + 5 = 325


integers between 1 and 600 divisible by at least one of 3, 5, or 7. Those not
divisible by these numbers are a total of 600 325 = 275.
Example 7.4 In a group of 30 people, 8 speak English, 12 speak Spanish and 10
speak French. It is known that 5 speak English and Spanish, 5 Spanish and
French, and 7 English and French. The number of people speaking all three
languages is 3. How many do not speak any of these languages?
Solution: Let A be the set of all English speakers, B the set of Spanish speakers
and C the set of French speakers in our group. Construct a Venn diagram. In the
intersection of all three we put 8. In the region common to A and B which is not
filled up we put 5 2 = 3. In the region common to A and C which is not already
filled up we put 5 3 = 2. In the region common to B and C which is not already
filled up, we put 7 3 = 4. In the remaining part of A we put 8 2 3 2 = 1, in
the remaining part of B we put 12 4 3 2 = 3, and in the remaining part of C
we put 10 2 3 4 = 1. Each of the mutually disjoint regions comprise a total
of 1 + 2 + 3 + 4 + 1 + 2 + 3 = 16 persons. Those outside these three sets are
then 3016=14

8 Combinatorics: Permutations and Combinations


8.1 Permutations without Repetitions
Definition 8.1 We define the symbol ! (factorial), as follows: 0! = 1, and for
integers n 1,
n! = 1 2 3 n.
n! is read n factorial.
Example 8.1 We have
1!

= 1,

2! = 1 2 = 2,
3! = 1 2 3 = 6,
4! = 1 2 3 4 = 24,
5!

= 1 2 3 4 5 = 120.

Example 8.2 We have


7!
+ 2)!

4! (n

n! (n
2)!
(n + 1)!

=
=

7 6 5 4! = 210, 4!

(n + 2)(n + 1)n!

= (n + 2)(n + 1), n!

(n 2)!

(n + 1)(n)(n 1)(n 2)!

(n + 1)(n)(n 1)

Definition 8.2 Let x1, x2, . . . , xn be n distinct objects. A permutation of these


objects is simply a rearrangement of them.
Example 8.3 There are 24 permutations of the letters in M AT H, namely
M AT H MAHT M T AH M T HA
AM T H AMHT
AT M H AT HM
T AM H T AHM T M AH T M HA
HAT M HAM T
HT AM HT M A

M HT A
AHT M
T HM A
HMT A

M HAT
AHM T
T HAM
HM AT

Theorem 8.1 Permutations. Let x1, x2, . . . , xn be n distinct objects. Then there
are n! permutations of them.
Proof. The first position can be chosen in n ways, the second object in n 1
ways, the third in n 2, etc. This gives
n(n 1)(n 2) 2 1 = n!.

Example 8.4 The number of permutations of the letters of the word RET ICULA
is 8! = 40320.
Example 8.5 A bookshelf contains 5 German books, 7 Spanish books and 8
French books. Each book is dierent from one another.
(a) How many dierent arrangements can be made of these books?
(b) How many dierent arrangements can be made of these books if books of
each language must be next to each other?
(c) How many dierent arrangements can be made of these books if all the
French books must be next to each other?
(d) How many dierent arrangements can be made of these books if no two
French books can be next to each other?
Solution:
(a) We are permuting 5 + 7 + 8 = 20 objects. Thus the number of arrangements
sought is 20! = 2432902008176640000.
(b) Glue the books by language, this will assure that books of the same language
are together. We permute the 3 languages in 3! ways. We permute the German
books in 5! ways, the Spanish books in 7! ways and the French books in 8!
ways. Hence the total number of ways is 3!5!7!8! = 146313216000.
(c) Align the German books and the Spanish books first. Putting these 5 + 7 = 12
books creates 12 + 1 = 13 spaces (we count the space before the first book, the
spaces between books and the space after the last book). To assure that all the

French books are next each other, we glue them together and put them in
one of these spaces. Now, the French books can be permuted in 8! ways
and the non-French books can be permuted in 12! ways. Thus the total
number of permutations is
(13)8!12! = 251073478656000.
(d) Align the German books and the Spanish books first. Putting these 5 + 7 = 12
books creates 12 + 1 = 13 spaces (we count the space before the first book, the
spaces between books and the space after the last book). To assure that no two
French books are next to each other, we put them into these spaces. The first
French book can be put into any of 13 spaces, the second into any of 12, etc., the
eighth French book can be put into any 6 spaces. Now, the non-French books can
be permuted in 12! ways. Thus the total number of permutations is

(13)(12)(11)(10)(9)(8)(7)(6)12!,
which is 24856274386944000.

8.2 Permutations with Repetitions


We now consider permutations with repeated objects.
Example 8.6 In how many ways may the letters of the word
M ASSACHU SET T S
be permuted?
Solution: We put subscripts on the repeats forming
M A1S1S2A2CHUS3ET1T2S4.
There are now 13 distinguishable objects, which can be permuted in 13!
dierent ways. For each of these 13! permutations, A1A2 can be permuted in 2!
ways, S1S2S3S4 can be permuted in 4! ways, and T 1T2 can be permuted in 2!
ways. Thus the over count 13! is corrected by the total actual count

2!4!2!

13!

= 64864800.

In general, we may prove the following theorem.

Theorem 8.2 Permutations with Repetitions. Let there be k types of objects: n 1 of


type 1; n2 of type 2; etc. Then the number of ways in which these n 1 + n2 +
+ nk objects can be rearranged is
(n1 + n2 + + nk)!.
n1!n2! nk!
Example 8.7 In how many ways may we permute the letters of the word M ASSACHU SET
T S in such a way that M ASS is always together, in this order?

Solution: The particle M ASS can be considered as one block and the 9 letters
A, C, H, U, S, E, T, T, S. In A, C, H, U, S, E, T, T, S there are four Ss and two T s
and so the total number of permutations sought is

2!2!

10!

= 907200.

Example 8.8 In how many ways may we write the number 9 as the sum of three
positive integer summands? Here order counts, so, for example, 1 + 7 + 1 is to
be regarded dierent from 7 + 1 + 1.
Solution: We first look for answers with
a + b + c = 9, 1 a b c 7

and we find the permutations of each triplet. We have


(a, b, c) Number of permutations
(1, 1, 7) 3!
=3
2!
(1, 2, 6) 3! = 6
(1, 3, 5) 3! = 6
(1, 4, 4) 3!
=3
2!
(2, 2, 5) 3!
=3
2!
(2, 3, 4) 3! = 6
3!
(3, 3, 3) 3! = 1
Thus the number desired is
3 + 6 + 6 + 3 + 3 + 6 + 1 = 28.
Example 8.9 In how many ways can the letters of the word MURMUR be arranged without letting two letters which are alike come together?
Solution: If we started with, say , MU then the R could be arranged as follows:
M

,
R ,

R .

In the first case there are 2! = 2 ways of putting the remaining M and U. In the
second case, there are 2! = 2 ways, and in the third case there is only 1! = 1
way. Thus, starting the word with MU gives 2 + 2 + 1 = 5 possible arrangements.
In the general case, we can choose the first letter of the word in 3 ways, and the
second in 2 ways. Thus the number of arrangements sought is 3 2 5 = 30.
8.3 Combinations without Repetitions
Definition 8.3 Let n, k be non-negative integers with 0 k n. The symbol

(read n choose k) is defined


and denoted by
!
=
2 3 k
k!(n k)!
( 1) 1(
.
k =
n n
n
n
n 2)
(n k + 1)

n
k

Remark. Observe that in the last fraction, there are k factors in both the numerator
and denominator. Also, observe the boundary conditions
= 1,
n 1 = n.
0 =
n
1 =
n
n
n
n

Example 8.10 We have


6

= 1 2 3 = 20,
6 5 4

2
11

= 55,
11 10

7
12

2 3 4 5 6 7 = 792,
12 11 10 9 8 7 6

109 =
110

110,

0
110

= 1,

1
110

= 110.

Remark. Since n (n k) = k, we have, for any integers n, k such that 0 k n,


k)!

the symmetry identity


k

= k!(n

(n

k)!(n

! (n

k))!

n k .
n

This can be interpreted as follows: if there are n di erent tickets in a hat, choosing k
of them out of the hat is the same as choosing n k of them to remain in the hat.
Example 8.11

9
11
5
12

2
11

= 7
12

= 55,
= 792.

Definition 8.4 Suppose that we have n distinguishable objects. A k-combination


is a selection of k, (0 k n) objects from the n made without regards to order.
Example 8.12 The 2-combinations from the list {X, Y, Z, W } are
XY, XZ, XW, Y Z, Y W, W Z.
Example 8.13 The 3-combinations from the list {X, Y, Z, W } are
XY Z, XY W, XZW, Y W Z.
Theorem 8.3 Combinations. Let there be n distinguishable objects, and let k be
an integer such that 0 k n. Then the numbers of k-combinations of these n

n
objects is k .
Proof. Pick any of the k objects. This can be done in n(n 1)(n 2) (n k +
1) ways, since there are n ways of choosing the first, n 1 ways of choosing the
second, etc. This particular choice of k objects can be permuted in k! ways.
Hence the total number of k-combinations is
( 1)(

nn

k!

2)

(n

Example 8.14 From a group of 10 people,


10

k + 1)

we can choose a committee of 4 in

4 = 210 ways.
Example 8.15 In a group of 2 camels, 3 goats, and 10 sheep in how many ways
can we choose a committee of 6 animals if
(a) there are no constraints in species?
(b) the two camels must be included?
(c) the two camels must be excluded?
(d) there must be at least 3 sheep?
(e) there must be at most 2 sheep?
(f) Joe Camel, Billy Goat and Samuel Sheep hate each other and they will not
work in the same group. How many compatible committees are there?
Solution:
(a) There are 2 + 3 + 10 = 15 animals and we must choose 6. Thus, there are
6 = 5005
15
possible committees.
(b) Since the 2 camels are included, we must choose 6 2 = 4 more animals
from a list of 15 2 = 13 animals, so there are
13
= 715
4
possible committees.

(c) Since the 2 camels must be excluded, we must choose 6 animals from a list of
15 2 = 13, so there are
13

= 1716

possible committees.
(d) If k sheep are chosen from the 10 sheep, 6 k animals must be chosen from the remaining 5
animals, so there are
3
3 +
4 2 +
5 1 +
6 0 = 4770
10
5
10
5
10 5
10 5
possible committees.
(e) First observe that there cannot be 0 sheep, since that would mean choosing 6 other animals.
Hence, there must be either 1 or 2 sheep, and so 3 or 4 of the
other animals. The total number is thus
2

10

10

= 235.

(f) A compatible group will either exclude all these three animals or include exactly one of them.
This can be done in
6+

12

12

= 3300

ways.
Example 8.16 Consider the set of 5-digit positive integers written in decimal no-tation.
(a) How many are there?
(b) How many do not have a 9 in their decimal representation?
(c) How many have at least one 9 in their decimal representation?
(d) How many have exactly one 9?
(e) How many have exactly two 9s?
(f) How many have exactly three 9s?
(g) How many have exactly four 9s?
(h) How many have exactly five 9s?
(i) How many have neither an 8 nor a 9 in their decimal representation?
(j) How many have neither a 7, nor an 8, nor a 9 in their decimal representation?

(k) How many have either a 7, an 8, or a 9 in their decimal representation?


Solution:
(a) There are 9 possible choices for the first digit and 10 possible choices for
4

the remaining digits. The number of choices is thus 9 10 = 90000.


(b) There are 8 possible choices for the first digit and 9 possible choices for the
4

remaining digits. The number of choices is thus 8 9 = 52488.


(c) The diference 90000 52488 = 37512.
(d) We condition on the first digit. If the first digit is a 9 then the other four
4
remaining digits must be dierent from 9, giving 9 = 6561 such numbers. If
the first digit is not a 9, then there are 8 choices for this first digit. Also, we
4
3
have 1 = 4 ways of choosing were the 9 will be, and we have 9 ways of
3
filling the 3 remaining spots. Thus in this case there are 8 4 9 = 23328
such numbers. In total there are 6561 + 23328 = 29889 five-digit positive
integers with exactly one 9 in their decimal representation.
(e) We condition on the first digit. If the first digit is a 9 then one of the remaining
4
four must be a 9, and the choice of place can be accomplished in 1 = 4 ways.
3
The other three remaining digits must be di erent from 9, giving 4 9 = 2916
such numbers. If the first digit is not a 9, then there are 8 choices for this first
4
digit. Also, we have 2 = 6 ways of choosing were the two 9s will be, and we
2
have 9 ways of filling the two remaining spots. Thus in this case there are
2
869 = 3888 such numbers. Altogether there are 2916+3888 = 6804 five-digit
positive integers with exactly two 9s in their decimal representation.

(f) Again we condition on the first digit. If the first digit is a 9 then two of the
4

remaining four must be 9s, and the choice of place can be accomplished in 2
2
= 6 ways. The other two remaining digits must be di erent from 9, giving 6 9
= 486 such numbers. If the first digit is not a 9, then there are 8 choices for this
4
first digit. Also, we have 3 = 4 ways of choosing were the three 9s will be, and
we have 9 ways of filling the remaining spot. Thus in this case there
are 8 4 9 = 288 such numbers. Altogether there are 486 + 288 = 774 fivedigit positive integers with exactly three 9s in their decimal representation.

(g) If the first digit is a 9 then three of the remaining four must be 9s, and the
4
choice of place can be accomplished in 3 = 4 ways. The other remaining digit
must be dierent from 9, giving 4 9 = 36 such numbers. If the first digit is not a
4
9, then there are 8 choices for this first digit. Also, we have 4 = 4 ways of
choosing were the four 9s will be, thus filling all the spots. Thus in this case
there are 8 1 = 8 such numbers. Altogether there are 36 + 8 = 44 five-digit
positive integers with exactly three 9s in their decimal representation.
(h) There is obviously only 1 such positive integer.
Remark. Observe that 37512 = 29889 + 6804 + 774 + 44 + 1.

(i) We have 7 choices for the first digit and 8 choices for the remaining 4 digits,
4

giving 7 8 = 28672 such integers.


(j) We have 6 choices for the first digit and 7 choices for the remaining 4 digits,
4

giving 6 7 = 14406 such integers.


(k) We use inclusion-exclusion. The desired number is 90000 85854 = 4146.
8.4 Combinations with Repetitions
Theorem 8.4 Theorem (DeMoivre). Let n be a positive integer. The number of
positive integer solutions to
x1 + x2 + + xr = n
is

1
1.

Proof. Write n as
n = 1 + 1 + + 1 + 1,
where there are n 1s and n 1 plus signs. To decompose n in r summands we
need to choose r 1 plus signs from the n 1, which proves the theorem.
Example 8.17 In how many ways may we write the number 9 as the sum of
three positive integer summands? Here order counts, so, for example, 1 + 7 + 1
is to be regarded dierent from 7 + 1 + 1.
Solution: We are seeking integral solutions to
a + b + c = 9, a > 0, b > 0, c > 0.
The number of solutions is thus

1 =
9
1

2 = 28.

Example 8.18 In how many ways can 100 be written as the sum of four positive
integer summands?
Solution: We want the number of positive integer solutions to
a + b + c + d = 100,
which is

99
3

= 156849.

Corollary 8.5 Let n be a positive integer. The number of non-negative integer


solutions to
y1 + y2 + + yr = n
is
n+r1 .

r1
Proof. Set xr 1 = yr. Then xr 1. The equation
x1 1 + x2 1 + + xr 1 = n
is equivalent to
x1 + x2 + + xr = n + r,
which has
n+r1r
1
solutions.
Example 8.19 Find the number of quadruples (a, b, c, d) of integers satisfying
a + b + c + d = 100, a 30, b > 21, c 1, d 1.
0

Solution: Set a + 29 = a, b + 20 = b. Then we want the number of positive integer


solutions to
0
0
a + 29 + b + 21 + c + d = 100,
or
0
0
a + b + c + d = 50.
This number is
3 = 18424.
49

Example 8.20 There are five people in a lift of a building having eight floors. In
how many ways can they choose their floor for exiting the lift?
Solution: Let xi be the number of people that floor i receives. We are looking for
non-negative solutions of the equation
x1 + x2 + + x8 = 5.
Setting yi = xi + 1, then
x1 + x2 + + x8 = 5 = (y1 1) + (y2 1) + + (y8 1) = 5 =
y1 + y2 + + y8 = 13,

so the number sought is the number of positive solutions


to y1 + y2 + + y8 = 13,
which is

12

= 792.

Example 8.21 Find the number of quadruples (a, b, c, d) of non-negative


integers which satisfy the inequality
a + b + c + d 2001.
Solution: The number of non-negative solutions to a
+ b + c + d 2001

is equal to the number of solutions to


a + b + c + d + f = 2001
where f is a non-negative integer. This number is the same as the number of
positive integer solutions to
a1 1 + b1 1 + c1 1 + d1 1 + f1 1 = 2001,
2005

which is
4 .
Example 8.22 How many integral solutions to the equation
a + b + c + d = 100,
are there given the following constraints:
1 a 10, b 0, c 2, 20 d 30?
Solution: We use Inclusion-Exclusion. There are

80
3

= 82160 integral solutions to

a + b + c + d = 100, a 1, b 0, c 2, d 20.
Let A be the set of solutions with
a 11, b 0, c 2, d 20
and B be the set of solutions with
a 1, b 0, c 2, d 31.
Then card (A) =

70

3 , card (B)
card (A B) =

69
3

, card (A B) =

3+

70

69

59

59

and so

= 74625.

The total number of solutions to


a + b + c + d = 100
with
1 a 10, b 0, c 2, 20 d 30
is thus

80

70

69

59

= 7535.

10

Probability

Definition 10.1 The probability that an event occurs is defined as


P = The number of distinct ways that the event can occur .

The total number of all possible outcomes


Example 10.1 The probability of randomly drawing a face card from a deck of 52

12
ordinary playing cards is

52.

Example 10.2 Find the probability that when two cards are randomly drawn,
with-out replacing the first card, at least one of the cards is a face card.
Solution: We must consider the following three cases separately:

Case 1: The first card is a face card and the second card is not a face card.
This can happen in 12 40 dierent ways.
Case 2: The first card is a not a face card and the second card is a face
card. This can happen in 40 12 dierent ways.
Case 3: Both cards are face cards. This can happen in 12 11 di erent ways.

Thus, the total number of ways in which at least one of the cards can be a face
card is 12 40 + 40 12 + 12 11 = 1092. The total number of ways to draw two
cards (without replacing the first) is 52 51. Thus, the probability that at least
one of the cards is a face card is
1092
7
P = 52 51 = 17 .
Theorem 10.1 We can obtain some basic results about probabilities directly from
the definition. Let P (A) denote the probability that event A occurs.

0 P (A) 1.

The probability that A does not occur is 1 P (A).

P (A B) is the probability that event A OR event B occurs. P (A B) is the


probability that event A AND event B both occur. If A and B are two events,
then
P (A B) = P (A) + P (B) P (A B).

If A and B are two independent events (i.e. events which do not a ect each
others outcomes), then
P (A B) = P (A) P (B).

Example 10.3 Find the probability that a king or a heart is drawn when choosing
one card from an ordinary deck of 52 cards.
Solution:
P (heart or king) = P (heart) + P (king) P (heart and king)

4
1
52 + 52 52
16
=
52
4
= 13 .
=

13

Example 10.4 (2003 AMC 10B #21) A bag contains two red beads and two
green beads. Reach into the bag and pull out a bead, replacing it with a red
bead regardless of the color. What is the probability that all the beads are red
after three such replacements?
(A) 1/8

(B) 5/32

(C) 9/32

(D) 3/8

(E) 7/16

Solution: For all the beads to be red after three replacements, two of the three
beads chosen must have been green. Thus, the selections must have been one
of the following:
Case 1: red, green, green. The probability of this case is

1 1
1
2 2 4 = 16 .

Case 2: green, red, green. The probability of this case is

3 1
3
2 4 4 = 32 .

Case 3: green, green, red. The probability of this case is

1
1
2 2 1 = 8.

Thus, the desired probability is

1
3 1
9
16 + 32 + 8 = 32 .
Example 10.5 (2004 AMC 10A #10) Coin A is flipped three times and coin B is
flipped four times. What is the probability that the number of heads obtained
from flipping the two fair coins is the same?

(A) 19/128

(B) 23/128

(C) 1/4

(D) 35/128

(E) 1/2

Solution: The number of coins on both heads could be 0, 1, 2, or 3. The


probability that we obtain 0 heads with both coins is
1

2 2 = 2
The probability that we obtain exactly 1 head with both coins is
3
3 12 4

12

= 12 12

The probability that we obtain exactly 2 heads with both coins is


3
3 12 6

12

= 18 12

The probability that we obtain exactly 3 head with both coins is


1

2 4 2 =4
Thus, the desired probability is
(1 + 12 + 18 + 4) 12

= 128

35

Example 10.6 The Monty Hall Problem. Consider the following game. Three boxes
are marked A, B, and C, and one of them contains $1,000,000. You choose box C.
Im going to help you out now. I tell you that box A does not contain the money. Now,
you decide whether you want to change and choose box B, or keep box
C.
Solution: At first glance, you might say that the money is equally likely to be in box B
or C, so changing doesnt help at all. However, consider the probability of winning
this game. If you never change, the only way that you win is if you choose the right
box first, a 1/3 chance. If you change instead, you will always win if you pick a
wrong box first, because after I expose one wrong box, the other unchosen box is a
winner. Since you have a 2/3 chance of picking the wrong box initially, you have a
2/3 chance of winning if you accept the o er to switch boxes.

11

Statistics

Most of the AMC statistics problems involve the concepts of mean (average),
median, and mode.
Definition 11.1 The (arithmetic) mean of a collection of n numbers a 1, a2, . . . , an
is
a +a + +a
n.n
mean = 1 2

Definition 11.2 Consider the collection of numbers {a 1, a2, . . . , an }, with a1 a2


an. The median of the collection is the middle term of the collection when
n is odd and is the average of the two middle terms when n is even.
Definition 11.3 The mode of a collection of n numbers a 1, a2, . . . , an is the
term(s) that occur most frequently.
Definition 11.4 The range of a collection of n integers a 1, a2, . . . , an is the dierence between the largest and smallest integers.
Example 11.1 (1991 AHSME #16) One hundred students at Century High
School participated in the AMC 12 last year, and their mean score was 100. The
number of non-seniors taking the AMC 12 was 50% more than the number of
seniors, and the mean score of the seniors was 50% higher than that of nonseniors. What was the mean score of the seniors?
(A) 100

(B) 112.5

(C) 120

(D) 125

(E) 150

Solution: Let S denote the number of seniors that participated in the contest.
Then the number of non-seniors that participated in the contest is 1.5S, and
S + 1.5S = 100, so S = 40.
Thus there are 40 seniors and 60 non-seniors that participated in the contest.
2
Let M be the mean of the seniors. Then the mean of the non-seniors is 3 M. The
sum of the seniors scores is 40M and the sum of the non-seniors scores is 60
2
3 M = 40M. Thus, we obtain
100 = 40M + 40M ,

so

100

M = 125.
5

Example 11.2 (2004 AMC 12A #10) The sum of 49 consecutive integers is 7 .
What is their median?

(A) 7

(B) 7

(C) 7

(D) 7

(E) 7

Solution. Since the integers are consecutive, the mean and the median are the
same with value
median = mean =

75

75

=
49 72

= 73.

Example 11.3 (2000 AMC 12 #9) Mrs. Walter gave an exam in a mathematics
class of five students. She entered the scores in random order onto a
spreadsheet, which recalculated the class average after each score was
entered. Mrs. Walter noticed that after each score was entered, the average was
always an integer. The scores (listed in ascending order) were 71, 76, 80, 82,
and 91. What was the last score Mrs. Walter entered?
(A) 71

(B) 76

(C) 80

(D) 82

(E) 91

Solution: Since the average of the first two scores entered is an integer, the first two
scores entered must both be even or both be odd. If they were the two odd scores, then
their sum would be 71 + 91 = 162. Since 162 is divisible by 3, the third score added
would also have to be divisible by 3 so that the average of the first three scores is an
integer. However, none of the remaining scores (76, 80, and 82) is divisible by 3, so the
first two scores that she entered could not have been the odd scores.

Thus, the first two scores entered must have both been even. Since
76 + 80 = 156 and 80 + 82 = 162
are both divisible by 3, but none of 71, 91, and 82 is divisible by 3, the first pair
chosen could not have been 76 and 80 or 80 and 82. Thus, the first two scores
entered must have been 76 and 82. Since 76 + 82 = 158 has a remainder of 2
when divided by 3, the third score entered must have a remainder of 1 when
divided by 3. Of those remaining, only 91 has this property. So the first three
scores entered must have been 76, 82, and 91. Since the sum of 76, 82, and 91
is odd, the fourth score entered must also be odd. Thus, the fourth score
entered was 71 and the last score entered was 80.

12

Sequences and Series

Definition 12.1 A sequence of numbers is a function that assigns to each positive


integer a distinct number. The number assigned by the sequence to the integer n is
commonly denoted using a subscript, such as a n. These numbers are called the
terms of the sequence. You should think of a sequence as a list of numbers.

Example 12.1 Consider the sequence of numbers


1, 4, 7, . . . .
We have a1 = 1, a2 = 4, a3 = 7, and in general (assuming that the pattern
continues), an = 3n 2.
There are two special types of sequences that arise frequently on the AMC
competi-tions.
Definition 12.2 An arithmetic sequence (also called an arithmetic progression)
{an} is defined by
an = a + (n 1)d
for some constants a and d 6= 0. The number a is the first term of the sequence
and the number d is the common dierence between terms.
Example 12.2 The sequence
1, 4, 7, . . .
that we considered previously is an arithmetic sequence with first term a = 1 and
common dierence d = 3.
Theorem 12.1 If {an} is an arithmetic sequence with first term a and common
dierence d, then
n

a1 + a2 + a3 + + an = 2 (a1 + an).

Definition 12.3 A geometric sequence {an} is defined by


an = a r

n1

where a is a constant and r is a constant not equal to 0 or 1. The number a is the


first term of the sequence and the number r is the common ratio between terms.

Example 12.3 The sequence


2, 6, 18, . . .
is a geometric sequence with first term a = 2 and common ratio r = 3.

Theorem 12.2 If {an} is a geometric sequence with first term a and common ratio
r, then
1r

a +a + +a =a
1

1r

Proof. Let Sn denote the sum of the first n terms. Then:

Sn =

a1 + a2 + a3 + + an
2

n1

= a + ar + ar + + ar
2
3
n
rSn = ar + ar + ar + + ar
n

Sn rSn = a ar .
Definition 12.4 A recursively-defined sequence is one in which the n-th term a n is
defined in terms of the previous terms a1, a2, . . . , an1.
Example 12.4 The Fibonacci sequence is an example of a recursively-defined
se-quence:
fn = fn1 + fn2, f1 = 0, f2 = 1.
The first few terms of the Fibonacci sequence are 0,1,1,2,3,5,8,13,....
Example 12.5 (2002 AMC 12B #13) The sum of 18 consecutive positive integers
is a perfect square. What is the smallest possible value of this sum?
(A) 169

(B) 225

(C) 289

(D) 361

(E) 441

Solution: Let a denote the first term of the sequence. The sequence is an
arithmetic sequence with d = 1, and the sum is

18

2a + (a + 17) = 9(2a + 17).

For the sum to be a perfect square, the term 2a + 17 must be a perfect square.
This first occurs when a = 4, which gives the sum 225.
Example 12.6 (1981 AHSME #14) In a geometric sequence of real numbers, the
sum of the first two terms is 7 and the sum of the first six terms is 91. What is
the sum of the first four terms?
(A) 28

(B) 32

(C) 35

(D) 49

(E) 84

Solution: Let a denote the first term of the sequence and let r denote the common
ratio. We have
2
4
7 = a + ar and 91 = 7(1 + r + r ).

Thus r = 3 and the sum of the first four terms is 28.


Example 12.7 (2004 AMC 10A #24) Let a1, a2, . . . be a sequence with the
following properties:

a1 = 1, and

a2n = n an for any positive integer n.


What is the value of a2100 ?

(A) 1

99

(B) 2

(C) 2

100

(D) 2

4950

Solution: Computing the first few terms, we obtain:


a2 =

a21 = 1 a1 = 1 = 2

a22 = a4 = a22 = 2 a2 = 2 = 2
1+2
a23 = a8 = a24 = 4 a4 = 8 = 2
a24 =

a16 = a28 = 8 a8 = 64 = 2

In general, we observe that

a2n = 21+2++(n1) = 2(n1)n/2.


Thus, a2100 = 2

4950

1+2+3

(E) 29999

13

Prime Factorization

Definition 13.1 A natural number greater than 1 is said to be prime if its only
natural number divisors are 1 and itself. Natural numbers greater than 1 that are
not prime are composite.
Theorem 13.1 The Fundamental Theorem of Arithmetic. Every natural number,
other than 1, can be factored into a product of primes in only one way, apart
from the order of the factors.
Example 13.1 Find positive integers x and y that satisfy both
xy = 40 and 31 = 2x + 3y.
3

Solution: Since 40 has the unique factorization 40 = 2 5, there are only 8 possibilities for the pair (x, y). These are (1, 40), (2, 20), (4, 10), (8, 5), (5, 8), (10, 4), (20, 2),
(40, 1). Only (x, y) = (8, 5) additionally satisfies 31 = 2x + 3y.
Example 13.2 (1998 AHSME #6) Suppose that 1998 is written as a product of two
positive integers whose dierence is as small as possible. What is this di erence?

(A) 8

(B) 15

(C) 17

(D) 47

(E) 93
3

Solution: The prime decomposition of 1998 is 1998 = 2 3 37. The factorization


of 1998 into two positive integers whose di erence is as small as possible is
1998 = 3754 and the dierence is 54 37 = 17.
Example 13.3 (2005 AMC 10A #15) How many positive cubes divide 3! 5! 7!?
(A) 2

(B) 3

(C) 4
8

(D) 5
4

(E) 6

Solution: We have 3! 5! 7! = 2 3 5 7. There are 6 distinct cubes that


divide 3! 5! 7!.
Example 13.4 (2001 AMC 12 #21) The product of four positive integers a, b, c, d
is 8! and they satisfy the equations
ab + a + b = 524
bc + b + c = 146
cd + c + d = 104.
What is a d?

(A) 4

(B) 6

(C) 8

(D) 10

(E) 12

Solution: We can rewrite the given equations as


2

ab + a + b + 1 = 525 = (a + 1)(b + 1) = 3 5 7
2
bc + b + c + 1 = 147 = (b + 1)(c + 1) = 3 7
cd + c + d + 1 = 105 = (c + 1)(d + 1) = 3 5 7.
2

Since (a + 1)(b + 1) has a factor of 5 = 25, but (b + 1)(c + 1) has no factor of 5,


(a + 1) must be divisible by 25. Similarly, (d + 1) must be divisible by 5. Since (b
2
+ 1)(c + 1) = 3 7 , either (b + 1) = 7 and (c + 1) = 3 7 or (b + 1) = 3 7 and (c +
1) = 7. If (b + 1) = 7, then (a + 1) = 3 25 = 75, but 8! is not divisible by 75. Thus,
(b + 1) = 3 7 and (c + 1) = 7. Thus a = 24, b = 20, c = 6, and d = 14, so a d =
10.
Example 13.5 Find the smallest positive integer n such that n/2 is a perfect
square, n/3 is a perfect cube, and n/5 is a perfect fifth power.
Solution: Since n is divisible by 2, 3, and 5, we may assume that it has the form
a b c
n = 2 3 5 . Then
n/2 = 2

a1 b c

3 5

a b1 c

n/3 = 2 3

a b c1

n/5 = 2 3 5

Since n/2 must be a perfect square, a 1, b, and c must all be even. Since n/3
is a perfect cube, a, b 1, and c must all be multiples of 3. Since n/5 is a perfect
fifth power, a, b, and c 1 must all be multiples of 5. The smallest values that
15 10 6
satisfy these conditions are a = 15, b = 10, and c = 6. Thus, n = 2 3 5 is the
smallest such positive integer.
Example 13.6 Show that log10 2 is irrational.
Solution: If log10 2 is rational, then there exist integers r, s such that
r

log 2 = .
10
s

Then
10

r/s

= 2,

so
r

10 = 2 ,

or
r r

52 =2 ,
which contradicts the FTA. Thus, log10 2 is irrational.
8

Example 13.7 Find all positive integers n such that 2 +2

11

+2 is a perfect square.

Solution: Suppose that k is an integer such that


2

11

k =2 +2

+ 2 = 2304 + 2 = 48 + 2 .

Then
n

k 48 = (k 48)(k + 48) = 2 .
By the FTA,
s

k 48 = 2 and k + 48 = 2 ,
where s + t = n. But then
t

2 2 = 48 (48) = 96 = 3 2 ,
so
s

2 (2

ts

1) = 3 2 .

By the FTA, s = 5 and t s = 2, so s + t = n = 12. Thus, the only natural number


8
11
n
n such that 2 + 2 + 2 is a perfect square is n = 12.

14

Number Bases
14.1

The Decimal (Base-10) Scale.

Any natural number n can be written in the form


k

n = a010 + a110

k1

+ a210

k2

+ + ak110 + ak

where 1 a0 9, 0 aj 9, j 1. This is the decimal, or base-10 representation


of n. For example
4

65789 = 6 10 + 5 10 + 7 10 + 8 10 + 9.
Example 14.1 Find a reduced fraction equivalent to the repeating decimal 0.123
= 0.123123123 . . . .
Solution: Let N = 0.123123123 . . . . Then 1000N = 123.123123123 . . . . Hence
1000N N = 123, so
N=

123

999 = 333

41

Example 14.2 What are all the two-digit positive integers in which the di erence
between the integer and the product of its two digits is 12?
Solution: Let such an integer be 10a+b, where a, b are digits. Solving 10a+bab
= 12 for a, we obtain
2 .
a = 12 b = 1 +
10 b
10 b
Since a is an integer, 10 b must be a positive integer that divides 2. This gives
b = 8, a = 2 or b = 9, a = 3. Thus, 28 and 39 are the only such integers.
Example 14.3 Find all the integers with initial digit 6 such that if this initial integer
is suppressed, the resulting number is 1/25 of the original number.
n

Solution: Let x be the integer sought. Then x = 6 10 + y where y is a positive


integer. The given condition stipulates that

y = 25 (6 10 + y) ,
that is,
y=

10

n
n2
4 = 25 10 .

This requires n 2, whence y = 25, 250, 2500, 25000, etc.. Therefore x = 625, 6250, 62500,
625000, etc..
Example 14.4 (1986 IMO) Find all natural numbers x such that the product of
2

their digits (in decimal notation) equals x 10x 22.

Solution: Let x have the form


2

x = a0 + a110 + a210 + + an10 , ak 9, an 6= 0.


Let P (x) be the product of the digits of x,
2

P (x) = x 10x 22.


Now
n

P (x) = a0a1 an 9 an < 10 an x,


where
strict inequality occurs when x has more than one digit. This means that
2
x 10x 222 x which implies that x < 13, so x has one digit or x = 10, 11 or
12. Since x 10x 22
= x has no integral solutions, x cannot have
one digit. If
2
2
x = 10, P (x) = 0, but x 10x 22 6= 0. If x = 11, P (x) = 1, but x 10x 22 6=
1. The only solution is thus x = 12.
Example 14.5 (1987 AIME) An ordered pair (m, n) of non-negative integers is
called simple if the addition m + n requires no carrying. Find the number of
simple ordered pairs of non-negative integers that add to 1492.
Solution: Observe that there are d+ 1 solutions to x+y = d, where x, y are
positive integers and d is a single-digit integer. These are
(0 + d), (1 + d 1), (2 + d 2), . . . , (d + 0)
Since there is no carrying, we search for the numbers of solutions of this form to
x + y = 1, u + v = 4, s + t = 9, and a + b = 2. Since each separate solution may
combine with any other, the total number of simple pairs is
(1 + 1)(4 + 1)(9 + 1)(2 + 1) = 300.
Example 14.6 (1992 AIME) For how many pairs of consecutive integers in
{1000, 1001, . . . , 2000}
is no carrying required when the two integers are added?
Solution: Other than 2000, a number on this list has the form n = 1000 + 100a +
10b + c, where a, b, c are digits. If there is no carrying in adding n and n + 1
then n has the form
1999, 1000 + 100a + 10b + 9, 1000 + 100a + 99, 1000 + 100a + 10b + c
3

with 0 a, b, c 4, i.e., five possible digits. There are 5 = 125 integers of the
2
form 1000 + 100a + 10b + c, 0 a, b, c 4, 5 = 25 integers of the form 1000 +
100a + 10b + 9, 0 a, b 4, and 5 integers of the form 1000 + 100a + 99, 0 a
4. The total of integers sought is thus 125 + 25 + 5 + 1 = 156.

Example 14.7 (1992 AIME) Let S be the set of all rational numbers r, 0 < r < 1,
that have a repeating decimal expansion of the form
0.abcabcabc . . . = 0.abc,
where the digits a, b, c are not necessarily distinct. To write the elements of S as
fractions in lowest terms, how many dierent numerators are required?

abc

Solution: Observe that 0.abcabcabc . . . = 999


, and that 999 = 33 37. If abc is
neither divisible by 3 nor by 37, the fraction is already in lowest terms. By
Inclusion-Exclusion there are

999

999 999
3 + 37

999
3 37 = 648

s+
such fractions. Also, fractions of the form 37 where s is divisible by 3 but not by
37 are in S. There are 12 fractions of this kind (with s = 3, 6, 9, 12, . . . , 36). We
l

do not consider fractions of the form 3t , t 3 with l divisible by 37 but not by 3,

because these fractions are > 1 and hence not in S. The total number of distinct
numerators in the set of reduced fractions is thus 640 + 12 = 660.

14.2 Non-decimal Scales


Given any positive integer r > 1, we can express any number x in base r. If n is a
positive integer, and r > 1 is an integer, then n has the base-r representation
2

n = a0 + a1r + a2r + + akr , 0 at r 1, ak 6= 0, r n < r

k+1

We use the convention that we shall refer to a decimal number (i.e. a base-10 number)
without referring to its base, and to a base-r number by using the subindex r.

Definition 14.1 We will refer to the base-2 representation of a number as the binary form of the number. We will refer to the base-3 representation of a number
as the ternary form of the number.
Example 14.8 Express the decimal number 5213 in base-7.
5

Solution: Observe that 5213 < 7 . We thus want to find 0 a0, . . . , a4 6, a4 6= 0


such that
4
3
2
5213 = a47 + a37 + a27 + a17 + a0.
4

Dividing by 7 , we obtain 2+ proper fraction = a 4+ proper fraction. This means


that a4 = 2. Thus
4

5213 = 2 7 + a37 + a27 + a17 + a0 = 4802 + a37 + a27 + a17 + a0.

Thus,
3

411 = a37 + a27 + a17 + a0.


3

Dividing by 7 , we obtain 1+ proper fraction = a3+ proper fraction, and so a3 = 1.


Continuing in this way we find that
4

5213 = 2 7 + 1 7 + 1 7 + 2 7 + 5 = 211257.
Example 14.9 Rewrite the base-6 number 3425 6 in base 8.
Solution: First, we rewrite the base-6 number 3425 6 in base-10 representation:
3

34256 = 3 6 + 4 6 + 2 6 + 5
= 809.
2

Since 8 = 64 and 8 = 512, we obtain:


34256 =

809
3

= 1 8 + +4 8 + 5 8 + 3
=

14538.

Example 14.10 Write 5627 in base-5.


2

Solution: 5627 = 5 7 + 6 7 + 2 = in decimal scale, so the problem reduces to


convert 289 to base-five:
3

289 = 2 5 + 1 5 + 2 5 + 4,
so
5627 = 289 = 21245.
Example 14.11 (1981 AHSME #16) The base-3 representation of x is
121122111222111122223.
What is the first digit (on the left) of the base-9 representation of x?
(A) 1

(B) 2

(C) 3

(D) 4

(E) 5

Solution: Since 9 = 3 , we will group the base-3 digits in pairs, starting from the
right. Then
x = (12)(11)(22)(11)(12)(22)(11)(11)(22)(22)3
18

16

14

12

= (1 3 + 2) 3 + (1 3 + 1) 3 + (2 3 + 2) 3 + (1 3 + 1) 3
10
8
6
4
+(1 3 + 2) 3 + (2 3 + 2) 3 + (1 3 + 1) 3 + (1 3 + 1) 3
2
+(2 3 + 2) 3 + (2 3 + 2)
8
7
6
5
4
3
2
1
= 59 +49 +89 +49 +59 +49 +49 +89 +8
=

54845844889.

Example 14.12 (1986 AIME) The increasing sequence


1, 3, 4, 9, 10, 12, 13, . . .
consists of all those positive integers which are powers of 3 or sums of distinct
powers or 3. Find the hundredth term of the sequence.
Solution: If the terms of the sequence are written in base-three, they comprise
the positive integers which do not contain the digit 2. Thus the terms of the
sequence in ascending order are
13, 103, 113, 1003, 1013, 1103, 1113, . . .
In the binary scale these numbers are, of course, the ascending natural
numbers 1, 2, 3, 4, . . .. Therefore to obtain the 100th term of the sequence we
write 100 in binary and then translate this into ternary: 100 = 1100100 2 and
6
5
2
11001003 = 3 + 3 + 3 = 981.

15

Modular Arithmetic

Definition 15.1 Given a positive integer n, we say that the integer a is equal to
the integer b modulo n, written
a b mod n
if n divides a b. Equivalently, a b mod n if b is the remainder that results
when a is divided by n.
For example,
37 2 mod 5 and 9 1 mod 4.
Note also that
11 4

mod 3

since 11 4 = 15 is divisible by 3.
Since n|(a b) implies that there is an integer k such that nk = a b, we deduce
that a b mod n if and only if there is an integer k such that a = b + nk.
Theorem 15.1 Let n 2 be an integer. If x y mod n and u v mod n then
ax + bu ay + bv mod n.

Proof. Since n|(x y) and n |(u v), there are integers s and t such that ns = x
y and nt = u v. This implies that
a(x y) + b(u v) = n(as + bt),
which in turn implies that
n|(ax + bu ay bv).
Thus
ax + bu ay + bv mod n.

Corollary 15.2 Let n 2 be an integer. If x y mod n and u v mod n then


xu yv

Proof. Let a = u, b = y in Theorem 15.1.

mod n.

Corollary 15.3 Let n > 1 be an integer, x y mod n and j a positive integer. Then
j

x y mod n.
Proof. Use Corollary 15.2 repeatedly with u = x, v = y.
Corollary 15.4 Let n > 1 be an integer, x y mod n. If f is a polynomial with
integral coecients then f(x) f(y) mod n.
Example 15.1 Find the units digit of 7
Solution: To find the units digit of 7

100

100

, we must find 7

72 1
3

74

100
7

Thus, the units digit of 7

100

100

modulo 10.

mod 10
2

77
mod 10
7
mod 10
22
(7 )
mod 10
2
(1) mod 10
1 mod 10
4 25
(7 )
mod 10
25
1
mod 10
1 mod 10.

is 1.

Example 15.2 Find the remainder when 6

1987

is divided by 37.

Solution: 6 1 mod 37. Thus


1987

1986

2 993

6
66
6(6 )
and the remainder sought is 31.

6(1)

993

6 31 mod 37

Example 15.3 Find the remainder when


12233 455679 + 87653

is divided by 4.
Solution:12233 = 12200 + 32 + 1 1 mod 4. Similarly, 455679 = 455600 + 76 + 3
3, 87653 = 87600 + 52 + 1 1 mod 4. Thus
3

12233 455679 + 87653 1 3 + 1 4 0 mod 4.

This means that 12233 455679 + 87653 is divisible by 4.


Example 15.4 Prove that 7 divides 3

2n+1

n+2

+2

for all natural numbers n.

Solution: Observe that


3

2n+1

39 32

mod 7

and
2

n+2

42

mod 7

. Hence
2n+1

3
for all natural numbers n.

+2

n+2

72 0

mod 7,
32

Example 15.5 Prove the following result of Euler: 641|(2 + 1).


4
4
7
5 + 1 = 2 + 5 . Hence 2 5 1 mod 641 and
4
4
7
7
Solution: Observe that 641 = 2
5 2

mod 641. Now, 2 5 1 mod 641 yields


4

28

7 4

5 2 = (5 2 ) (1) 1 mod 641.


This last congruence and
4

5 2

yield

2 2
32
which means that 641|(2 + 1).
Example 15.6 Prove that 7|(2222

28

5555

mod 641

mod 641,

+ 5555

2222

).
5

Solution: 2222 3 mod 7, 5555 4 mod 7 and 3 5 mod 7. Now

22225555 + 55552222 35555 + 42222 (35)1111 + (42)1111 51111 51111 0


Example 15.7 Find the units digit of 7

77

mod 7.

find 7 77 mod 10. Now, 7 2


1 mod 10, and so 7 3 7 2 7
Solution: We must
7
4
22

2
7
7
3 mod 10 and 7
(7 )
1 mod 10. Also, 7
1 mod 4 and so 7
(7 ) 7 3 mod 4, which means that there is an integer t such that 7 = 3 + 4t.
Upon assembling all this,

77

4t+3

7 7
Thus the last digit is 3.

4t

(7 ) 7 1 3 3 mod 10.
n

Example 15.8 Find infinitely many integers n such that 2 + 27 is divisible by 7.

Solution:
Observe that 2 2, 2 4, 2 1, 2 3k
2, 2 4, 2 1 mod 7 and so
3k
2 1 mod 3 for all positive integers k. Hence 2 + 27 1 + 27 0 mod 7 for
all positive integers k. This produces the infinitely many values sought.
k

Example 15.9 Prove that 2 5, k = 0, 1, 2, . . . never leaves remainder 1 when


divided by 7.
1

Solution: 2 2, 2 4, 2 1 mod 7, and this cycle of three repeats. Thus 2 5


can leave only remainders 3, 4, or 6 upon division by 7.
Example 15.10 (1994 AIME) The increasing sequence
3, 15, 24, 48, . . . ,
consists of those positive multiples of 3 that are one less than a perfect square.
What is the remainder when the 1994-th term of the sequence is divided by 1000?
2

Solution: The sequence consists of numbers n 1 such that


2

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


Since 3 is prime, this implies that
3 | (n 1) or 3 | (n + 1).
Thus,
n = 3k + 1 or n = 3k 1,
where k = 1, 2, 3, . . .. The sequence
3k + 1, k = 1, 2, . . .
produces the terms
2

n 1 = (3k + 1) 1 = 15, 48, . . . ,


which are the terms at even places of the sequence of 3, 15, 24, 48, . . .. The sequence

3k 1, k = 1, 2, . . .
produces the terms
2

n 1 = (3k 1) 1 = 3, 24, . . . ,
which are the terms at odd places of the sequence 3, 15, 24, 48, . . .. We must
find the 997th term of the sequence 3k + 1, k = 1, 2, . . .. Thus, the term sought
2
2
2
is (3(997) + 1) 1 (3(3) + 1) 1 8 1 63 mod 1000. The remainder
sought is thus 63.
Example 15.11 Find the remainder when 3

2006

is divided by 8.

Solution: Since 3 = 9, we have 3 1 mod 8. This implies that

32006

1003

32
1003

mod 8

1
mod 8
1 mod 8.
Thus, the remainder is 1.
Example 15.12 Find the remainder when 3

2006

is divided by 11.

Solution: First, note that 3 = 243 1 mod 11. Thus


2006

2005

35

401

1401
3

mod 11
3 mod 11

3 mod 11

mod 11.

Thus, the remainder is 3.


Example 15.13 (1999 AHSME #25) There are unique integers a 2, a3, a4, a5, a6,
a7 such that

a 2 a 3 a 4 a 5 a 6 a 7
7 = 2! + 3! + 4! + 5! + 6! + 7! ,

where 0 ai i for i = 2, 3, 4, 5, 6, 7. What is a2 + a3 + a4 + a5 + a6 + a7?


(A) 8

(B) 9

(C) 10

(D) 11

(E) 12

Solution: First, multiply both sides of the equation by 7! to clear the denominators:
5 6! = a2(7 6 5 4 3) + a3(7 6 5 4) + a4(7 6 5) + a5(7 6) + a6 +a7.

Consider this equation modulo 7. We obtain


a7 5 6! mod 7 2

mod 7.

Since 0 a7 > 7, we conclude that a7 = 2. Next, consider the equation modulo 6.


We obtain a6 = 4. Continuing, we obtain a 5 = 0 and a4 = a3 = a2 = 1. Thus, a2 +
a3 + a4 + a5 + a6 + a7 = 9.
Example 15.14 Prove that a sum of two squares of integers leaves remainder 0,
1 or 2 when divided by 4.

Solution: An integer is either even (of the form 2k) or odd (of the form 2k + 1).
We have
2

(2k) =
2
(2k + 1) =

4(k ),
2
4(k + k) + 1.

Thus squares leave remainder 0 or 1 when divided by 4 and hence their sum
leave remainder 0, 1, or 2.
Example 15.15 Prove that 2003 is not the sum of two squares by proving that
the sum of any two squares cannot leave remainder 3 upon division by 4.
Solution: 2003 leaves remainder 3 upon division by 4. But we know from
example 15.14 that sums of squares do not leave remainder 3 upon division by
4, so it is impossible to write 2003 as the sum of squares.

16

Integer Division Results

Using modular arithmetic, we obtain the following techniques for determining


certain integer factors of numbers.
Theorem 16.1 Theorem: Integer Division Results. Let n be a positive integer.
Then:

n is divisible by 2 if and only if the units digit of n is even.

n is divisible by 3 if and only if the sum of its digits is divisible by 3.

n is divisible by 5 if and only if the units digit of n is a 0 or a 5.

n is divisible by 7 if and only if 7 divides the integer that results from first
truncating n by removing its units digit, and then subtracting twice the value
of this digit from the truncated integer.

n is divisible by 9 if and only if the sum of its digits is divisible by 9.

n is divisible by 11 if and only if the alternating (by positive and negative


signs) sum of its digits is divisible by 11.

Proof.

The division results by 2 and 5 should be clear.

Lets consider the situation of division by 3. Suppose that the positive


integer n is written in its decimal expansion as
k

n = ak 10 + ak110

k1

+ + a2 10 + a1 10 + a0.
j

Since 10 1 mod 3, for any positive integer j we have 10 1 1 mod 3.


Thus,
n (ak + ak1 + + a2 + a1 + a0) mod 3.
So the remainder when n is divisible by 3 is the same as the remainder when the
sum of the digits is divisible by 3. This remainder is 0 if and only if 3 divides n.
j

Since 10 1 mod 9, and 10 1 1 mod 9, the proof for divisibility by 9 is


analogous to the proof for divisibility by 3.

The divisibility by 11 result follows from the observation that


10 1

mod 11,

so for any positive integer j, we have


j

10 (1)

mod 11.

Finally, well consider the divisibility by 7 results. First, we can show that the
result is always true provided that it is true for all integers with at most 6
digits, i.e. when
5

n = a5 10 + a4 10 + a3 10 + a2 10 + a1 10 + a0.
2

Then we note that since 10 3 mod 7, we have 10 2 mod 7, 10 6


4
5
mod 7, 10 4 mod 7, and 10 5 mod 7. Now suppose that n b mod 7,
where 0 b 6. Then
n b (5a5 + 4a4 + 3a3 + 2a2 + 3a1 + a0) mod 7,
so that
a0 (b (5a5 + 4a4 + 3a3 + 2a2 + 3a1)) mod 7.
Now consider the reduced number, which has the form
4

n1 = a5 10 + a4 10 + a3 10 + a2 10 + a1 2a0.
To see that 7 also divides n1 if and only if b = 0, note that
n1 (4a5 + 6a4 + 2a3 + 3a2 + a1) mod 7
(4a5 + 6a4 + 2a3 + 3a2 + a1 2b + 2(5a5 + 4a4 + 6a3 + 2a2 + 3a1) mod 7
14a5 + 14a4 + 14a3 + 7a2 + 7a1 2b mod 7

2b mod 7.

Now, 7 divides n if and only if b = 0. But b = 0 if and only if 2b = 0, which


implies that 7 divides n if and only if 7 divides n1.
As an example of this result, consider the integer n = 2233. The reduced
integer is
n1 = 223 2 3 = 217,
and the reduced integer for 217 is
n2 = 21 2 7 = 7.
Since 7 divides 7, 7 also divides 217, which implies that 7 also divides 2233.

17

The Pigeonhole Principle

Theorem 17.1 The Pigeonhole Principle. If n + 1 objects (e.g. pigeons) are to be


placed in n boxes (e.g. pigeonholes), then there must be at least one box that
contains more than one of the objects.
Note: This apparently trivial principle is very powerful. For example, it can be
used to prove that in any group of 13 people, there are always two who have
their birthday on the same month, and if the average human head has two
million hairs, there are at least three people in NYC with the same number of
hairs on their head. The Pigeonhole Principle is frequently useful for problems in
which we need to determine a minimal number of objects to ensure that some
integral number property is satisfied.
Theorem 17.2 The Extended Pigeonhole Principle. If more than mk objects are
to be placed in k boxes, then at least one of the boxes must contain at least m+
1 objects.
Example 17.1 Suppose that we draw cards consecutively and without
replacement from a 52 card deck. How many do we need to draw to ensure that
there will be a pair?
Solution: We can consider as boxes (the pigeonholes) the possible values of the
cards (the pigeons). Then there are 13 boxes, 10 of which represent the cards
numbered 1 (or Ace) through 10, and three additional boxes representing Jacks,
Queens, and Kings. In order to guarantee that one box contains more than one
card, we must draw 13 + 1 = 14 total cards.
Example 17.2 Prove that among any set of 51 positive integers less than 100,
there is a pair whose sum is 100.
Solution: Let a1, a2, . . . , a51 denote these 51 positive integers. Let S1 = {1, 99},

S2 = {2, 98}, S3 = {3, 97}, . . . , S k = {k, 100 k}, . . . , S 49 = {49, 51}, S50 = {50}.
Let S1, S2, . . . , S50 be the pigeonholes, and a1, a2, . . . , a51 the pigeons. Since
there are 51 pigeons and 50 pigeonholes, there must be at least one pigeonhole
with more than one pigeon. Thus, there must be at least one S i with two
numbers in it. Their sum is 100.
Example 17.3 Show that amongst any seven distinct positive integers not
exceeding 126, one can find two of them, say a and b, which satisfy
b < a 2b.

Solution: Split the numbers {1, 2, 3, . . . , 126} into the six sets
{1, 2}, {3, 4, 5, 6}, {7, 8, . . . , 13, 14}, {15, 16, . . . , 29, 30},
{31, 32, . . . , 61, 62} and {63, 64, . . . , 126}.
By the Pigeonhole Principle, two of the seven numbers must lie in one of the six
sets, and obviously, any such two will satisfy the stated inequality.
Example 17.4 Show that amongst any 55 integers from
{1, 2, . . . , 100},
two must dier by 10.
Solution: First observe that if we choose n + 1 integers from any string of 2n
consecutive integers, there will always be some two that di er by n. This is
because we can pair the 2n consecutive integers
{a + 1, a + 2, a + 3, . . . , a + 2n}
into the n pairs
{a + 1, a + n + 1}, {a + 2, a + n + 2}, . . . , {a + n, a + 2n},
and if n + 1 integers are chosen from this, there must be two that belong to the
same group.
So now group the one hundred integers as follows:
{1, 2, . . . 20}, {21, 22, . . . , 40},
{41, 42, . . . , 60}, {61, 62, . . . , 80}
and
{81, 82, . . . , 100}.
If we select fifty five integers, we must perforce choose eleven from some group.
From that group, by the above observation (let n = 10), there must be two that
dier by 10.
Example 17.5 (1978 Putnam) Let A be any set of twenty integers chosen from
the arithmetic progression 1, 4, . . . , 100. Prove that there must be two distinct
integers in A whose sum is 104.
Solution: We partition the thirty four elements of this progression into nineteen
groups
{1}, {52}, {4, 100}, {7, 97}, {10, 94}, . . . , {49, 55}.
Since we are choosing twenty integers and we have nineteen sets, by the
Pigeonhole Principle there must be two integers that belong to one of the pairs,
which add to 104.

Example 17.6 (1964 IMO) Seventeen people correspond by mail with one another
each one with all the rest. In their letters only three di erent topics are discussed.
Each pair of correspondents deals with only one of these topics. Prove that there at
least three people who write to each other about the same topic.
Solution: Choose a particular person of the group, say Charlie. He corresponds with
sixteen others. By the Pigeonhole Principle, Charlie must write to at least six of the
people of one topic, say topic I. If any pair of these six people corresponds on topic
I, then Charlie and this pair do the trick, and we are done. Otherwise, these six
correspond amongst themselves only on topics II or III. Choose a particular person
from this group of six, say Eric. By the Pigeonhole Principle, there must be three of
the five remaining that correspond with Eric in one of the topics, say topic II. If
amongst these three there is a pair that corresponds with each other on topic II,
then Eric and this pair correspond on topic II, and we are done. Otherwise, these
three people only correspond with one another on topic III, and we are done again.

Example 17.7 Given any set of ten natural numbers between 1 and 99 inclusive,
prove that there are two disjoint nonempty subsets of the set with equal sums of
their elements.
10

Solution: There are 2 1 = 1023 non-empty subsets that one can form with a given 10element set. To each of these subsets we associate the sum of its elements. The
maximum value that any such sum can achieve is 90 + 91 + + 99 = 945 < 1023.
Therefore, there must be at least two dierent subsets S, T that have the same element
sum. Then S \ (S T ) and T \ (S T ) also have the same element sum.

Example 17.8 Given any 9 integers whose prime factors lie in the set {3, 7, 11}
prove that there must be two whose product is a square.
Solution: For an integer to be a square, all the exponents of its prime factorization must
a b c
be even. Any integer in the given set has a prime factorization of the form 3 7 11 . Now
each triplet (a, b, c) has one of the following 8 parity patterns: (even, even, even),
(even, even, odd), (even, odd, even), (even, odd, odd), (odd, even, even), (odd, even,
odd), (odd, odd, even), (odd, odd, odd). In a group of 9 such integers, there must be
two with the same parity patterns in the exponents. Take these two. Their product is a
square, since the sum of each corresponding exponent will be even.

Definition 17.1 A lattice point (m, n) on the plane is one having integer coordinates.

Definition 17.2 The midpoint of the line joining (x, y) to (x1, y1) is the point

x + x1 , y + y1

Example 17.9 Five lattice points are chosen at random. Prove that one can
always find two so that the midpoint of the line joining them is also a lattice point.
Solution: There are four parity patterns: (even, even), (even, odd), (odd, odd),
(odd, even). By the Pigeonhole Principle among five lattice points there must be
two having the same parity pattern. Choose these two. It is clear that their
midpoint is an integer.
Example 17.10 Prove that among n + 1 integers, there are always two whose
dif-ference is always divisible by n.
Solution: There are n possible dierent remainders when an integer is divided by
n, so among n + 1 dierent integers there must be two integers in the group
leaving the same remainder, and their dierence is divisible by n.

You might also like