Mathematical Olympiad Math Olympiad Tutorials
Mathematical Olympiad Math Olympiad Tutorials
Mathematical Olympiad Math Olympiad Tutorials
MathOlymp.com
Resources for mathematically gifted students
Algebra
Rearrangement Inequality This article by K. Wu, Andy Liu was first published in
"Mathematics Competitions" Vol. 8, No.1 (1995), pp. 53--60. This journal is
published by Australian Mathematics Trust. The article is reproduced here thanks
to the kind permission of the authors and the Editor of "Mathematics
Competitions" Warren Atkins.
Combinatorics
Interactive Graph Theory Tutorials By Chris K. Caldwell from the University of
Tenessee at Martin.
Permutations.
Friendship Theorem.
Numbers
Divisibility and primes
Euclidean algorithm
Euler's theorem
Representation of numbers
Bertrand's postulate.
Geometry
Ptolemy's inequality
Euler's theorem
Click to go back
MathOlymp.com
Resources for mathematically gifted students
Click to go back
Corollary 2.
Let a1 , a2 , . . . , an be positive numbers and (a01 , a02 , . . . , a0n ) be a permutation of (a1 , a2 , . . . , an ). Then
a01 a02
a0
+
+ + n n.
a1 a2
an
A 1935 K
urschak problem in Hungary asked for the proof of Corollary 2, and a 1940 Moscow
Olympiad problem asked for the proof of the special case (a01 , a02 , . . . , a0n ) = (a2 , a3 , . . . , an , a1 ).
We now illustrate the power of the Rearrangement Inequality by giving simple solutions to a
number of competition problems.
Example 1. (International Mathematical Olympiad, 1975)
Let x1 x2 xn and y1 y2 yn be real numbers. Let (z1 , z2 , , zn ) be a
permutation of (y1 , y2 , . . . , yn ). Prove that
(x1 y1 )2 + (x2 y2 )2 + + (xn yn )2 (x1 z1 )2 + (x2 z2 )2 + + (xn zn )2 .
Solution:
Note that we have y12 + y22 + + yn2 = z12 + z22 + + zn2 . After expansion and simplification, the
desired inequality is equivalent to
x1 y1 + x2 y2 + + xn yn x1 z1 + x2 z2 + + xn zn ,
which follows from the Rearrangement Inequality.
Example 2. (International Mathematical Olympiad, 1978)
Let a1 , a2 , . . . , an be distinct positive integers. Prove that
a1 a2
an
1 1
1
+ 2 ++ 2 + ++ .
2
1
2
n
1 2
n
Solution:
Let (a01 , a02 , . . . , a0n ) be the permutation of (a1 , a2 , . . . , an ) such that a01 a02 a0n . Then a0i i
for 1 i n. By the Rearrangement Inequality,
a1 a2
an
a01 a02
a0n
+
+
+
+
+
12 22
n2
12 2 2
n2
1
2
n
2 + 2 ++ 2
1
2
n
1 1
1
+ ++ .
1 2
n
Example 3. (International Mathematical Olympiad, 1964)
Let a, b and c be the sides of a triangle. Prove that
a2 (b + c a) + b2 (c + a b) + c2 (a + b c) 3abc.
Solution:
We may assume that a b c. We first prove that c(a + b c) b(c + a b) a(b + c a). Note
that c(a + b c) b(c + a b) = (b c)(b + c a) 0. The second inequality can be proved in the
same manner. By the Rearrangement Inequality, we have
a2 (b + c a) + b2 (c + a b) + c2 (a + b c) ba(b + c a) + cb(c + a b) + ac(a + b c),
a2 (b + c a) + b2 (c + a b) + c2 (a + b c) ca(b + c a) + ab(c + a b) + bc(a + b c).
Adding these two inequalities, the right side simplifies to 6abc. The desired inequality now follows.
Example 4. (International Mathematical Olympiad, 1983)
Let a, b and c be the sides of a triangle. Prove that a2 b(a b) + b2 c(b c) + c2 a(c a) 0.
Solution:
We may assume that a b, c. If a b c, we have a(b + c a) b(c + a b) c(a + b c) as in
Example 3. By the Rearrangement Inequality,
1
a(b + c a) +
c
1
a(b + c a) +
a
= a + b + c.
1
b(c + a b) +
a
1
b(c + a b) +
b
1
c(a + b c)
b
1
c(a + b c)
c
This simplifies to 1c a(b a) + a1 b(c b) + 1b c(a c) 0, which is equivalent to the desired inequality.
If a c b, then a(b + c a) c(a + b c) b(c + a b). All we have to do is interchange the
second and the third terms of the displayed lines above.
Simple as it sounds, the Rearrangement Inequality is a result of fundamental importance. We
shall derive from it many familiar and useful inequalities.
Example 5. The Arithmetic Mean Geometric Mean Inequality.
Let x1 , x2 , . . . , xn be positive numbers. Then
x1 + x2 + + xn
n x1 x2 xn ,
n
with equality if and only if x1 = x2 = = xn .
Proof:
x1
x1 x2
x1 x2 xn
Let G = n x1 x2 xn , a1 = , a2 =
, . . . , an =
= 1. By Corollary 2,
2
G
G
Gn
a1 a2
an
x1 x2
xn
n
+
++
=
+
++ ,
an a1
an1
G
G
G
which is equivalent to
x1 = x2 = = xn .
x1 + x2 + + xn
G. Equality holds if and only if a1 = a2 = = an , or
n
x1 x2 xn
1
x1
1
x2
n
++
1
xn
Proof:
Let G, a1 , a2 , . . . , an be as in Example 5. By Corollary 2,
n
a1 a2
an
G
G
G
+
++
=
+
++ ,
a2 a3
a1
x1 x2
xn
which is equivalent to
G
1
x1
1
x2
n
++
1
xn
,
n
n
with equality if and only if x1 = x2 = = xn .
Proof:
By Corollary 1, we have
x21 + x22 + + x2n
x21 + x22 + + x2n
2
2
x1 + x2 + + x2n
x1 x2 + x2 x3 + + xn x1 ,
x1 x3 + x2 x4 + + xn x2 ,
x1 xn + x2 x1 + + xn xn1 .
Adding these and x21 + x22 + + x2n = x21 + x22 + + x2n , we have
n(x21 + x22 + + x2n ) (x1 + x2 + + x2n )2 ,
which is equivalent to the desired result. Equality holds if and only if x1 = x2 = = xn .
Example 8. Cauchys Inequality.
Let a1 , a2 , . . . an , b1 , b2 , . . . , bn be real numbers. Then
(a1 b1 + a2 b2 + + an bn )2 (a21 + a22 + + a2n )(b21 + b22 + + b2n ),
with equality if and only if for some constant k, ai = kbi for 1 i n or bi = kai for 1 i n.
Proof:
If a1 q= a2 = = an = 0 or b1q= b2 = = bn = 0, the result is trivial. Otherwise, define
ai
S = a21 + a22 + + a2n and T = b21 + b22 + + b2n . Since both are non-zero, we may let xi =
S
bi
and xn+i =
for 1 i n. By Corollary 1,
T
a2 + a22 + + a2n b21 + b22 + + b2n
2 = 1
+
S2
T2
2
2
2
= x1 + x2 + + x2n
x1 xn+1 + x2 xn+2 + + xn x2n + xn+1 x1 + xn+2 x2 + + x2n xn
2(a1 b1 + a2 b2 + + an bn )
=
,
ST
which is equivalent to the desired result. Equality holds if and only if xi = xn+i for 1 i n, or
ai T = bi S for 1 i n.
We shall conclude this paper with two more examples whose solutions are left as exercises.
Example 9. (Chinese competition, 1984) Prove that
x21 x22
x2
+
+ + n x1 + x2 + + xn
x2 x3
x1
for all positive numbers x1 , x2 , . . . , xn .
Example 10. (Moscow Olympiad, 1963) Prove that
a
b
c
3
+
+
References:
1. G. Hardy, J. Littlewood and G. Polya, Inequalities, Cambridge University Press, Cambridge,
paperback edition, (1988) 260-299.
2. K. Wu, The Rearrangement Inequality, Chapter 8 in Lecture Notes in Mathematics Competitions and Enrichment for High Schools (in Chinese), ed. K. Wu et al., (1989) 8:1-8:25.
http://www.amt.canberra.edu.au/5/7/2005 12:19:18 PM
Similar Systems
Online Exercises
Graph drawing
J. Graph Algorithms & Applications
David Eppstein's graph theory publications
J. Spinrad research and problems on graph classes
Combinatorics. Tutorial 1:
Permutations
As of late, permutations find their way into math olympiads more and
more often. The latest example is the Balkan Mathematics Olympiad 2001
where the following problem was suggested.
A cube of dimensions 333 is divided into 27 unit cells, each of
dimensions 1 1 1. One of the cells is empty, and all others are
filled with unit cubes which are, at random, labelled 1,2,...,26.
A legal move consists of a move of any of the unit cubes to its
neighbouring empty cell. Does there exist a finite sequence of
legal moves after which the unit cubes labelled k and 27 k
exchange their positions for all k = 1, 2, ..., 13? (Two cells are
said to be neighbours if they share a common face.)
This tutorial was written in responce to this event.
We assume here that the reader is familiar with the concept of composition
of functions f and g, which is denoted here as f g. It is a well-known fact
that if f : A B is a function which is both one-to-one and onto then f
is invertible, i.e. there exists a function g : B A such that g f = idA
and f g = idB , where idA and idB are the identity mappings of A and B,
respectively. Note that we assume that in the composition f g the function
g acts first and f acts second: e.g., (f g)(b) = f (g(b)). There are, however,
many good books using the alternative convention, so it is always necessary
to check whether a particular author uses one or the other convention.
In what follows we will be concerned with invertible functions from a
finite set to itself. For convenience, we assume that the elements of the set
are the numbers 1, 2, . . . , n (the elements of any finite set can be labelled
with the first few integers, so this does not restrict generality).
Definition 1. Let n be a positive integer. A permutation of degree n is a
function f : {1, 2, . . . , n} {1, 2, . . . , n} which is one-to-one and onto.
n1
n
=
.
(1) (2) (3) (n 1) (n)
1 2 3 4 5 6 7
is the permutation of degree 7
For example =
2 5 3 1 7 6 4
which maps 1 to 2, 2 to 5, 3 to 3, 4 to 1, 5 to 7, 6 to 6, and 7 to 4. It is clear
that in the second row of such an array all the numbers of the top row must
appear exactly once, i.e. the second row is just a rearrangement of the top
row.
It is also clear that there are exactly n! permutations of degree n (if you
want to fill the bottom row of such an array, there are n ways to fill the first
position, n 1 ways to fill the second position (since we must not repeat
the first entry), etc., leading to a total of n(n 1) . . . 2 1 = n! different
possibilities).
=
1 2 3 4 5
4 6 1 3 8
1
=
6
=
6 7 8
5 7 2
1 2 3 4 5 6 7 8
2 4 5 6 1 8 3 7
1 2 3 4 5 6 7 8
2 4 5 6 1 8 3 7
2 3 4 5 6 7 8
,
3 8 5 4 2 1 7
2
.
=
1 2 3 4 5
2 4 5 6 1
1
=
6
6 7 8
8 3 7
1 2 3 4 5 6 7 8
4 6 1 3 8 5 7 2
2 3 4 5 6 7 8
.
8 2 5 7 1 3 4
All this is easily done at a glance and can be written down immediately;
BUT be careful to start with the right hand factor again!
Explanation: just read the array for from the bottom up: since (1) = 4,
we must have 1 (4) = 1, hence write 1 under the 4 in the array for 1 ,
since (2) = 6, we must have 1 (6) = 2, hence write 2 under the 6 in the
array for 1 , etc.
Similarly, we calculate
1 2 3 4 5 6 7 8
1
=
.
5 1 7 2 3 4 8 6
Simple algebra shows that the inverse of a product can be calculated from
the product of the inverses (but note how the order is reversed!):
()1 = 1 1 .
(To justify this, we need only check if the product of and 1 1 equals
the identity, and this is pure algebra: it follows from the associative law that
()( 1 1 ) = (() 1 ) 1 = ( 1 ) 1 = 1 = id.)
Definition 2. The set of all permutations of degree n, with the composition as the multiplication, is called the symmetric group of degree n, and is
denoted by Sn .
Cycles
is not a cycle (we have 1 7 4 7 11 7 1, but the other elements are not
all fixed (2 goes to 3, for example). However, this permutation and any
other permutation can be written as a product of disjoint cycles, simply
by chasing each of the elements. The obvious approach is to visualise what
the permutation does: (draw your picture here!)
From this it is evident that every permutation can be written as a product of disjoint cycles. Moreover, any such representation is unique up to the
order of the factors. We also note that disjoint cycles commute; e.g.
(1 2 3 4)(5 6 7) = (5 6 7)(1 2 3 4).
But we recall that in general multiplication of permutations is not commutative; in particular, if we multiply cycles which are not disjoint, we
have to watch their order; for example: (1 2)(1 3) = (1 3 2), whilst
(1 3)(1 2) = (1 2 3), and (1 3 2) 6= (1 2 3).
It is clear that if is a cycle of length k, then k = id, i.e. if this
permutation is repeated k times, we have the identity permutation. More
generally, we will now define the order of a permutation, and the decomposition into a product of disjoint cycles will allow us to calculate the order of
any permutation.
Definition 3. Let be a permutation. The smallest positive integer i such
that i = id is called the order of .
Example 2. The order of the cycle (3 2 6 4 1) is 5, as we noted before.
Example 3. The order of the permutation = (1 2)(3 4 5) is 2 3 = 6.
Indeed,
= (1 2)(3 4 5),
2 = (1 2)2 (3 4 5)2 = (3 5 4),
3 = (1 2)3 (3 4 5)3 = (1 2),
4 = (1 2)4 (3 4 5)4 = (3 4 5),
5 = (1 2)5 (3 4 5)5 = (1 2)(3 5 4),
6 = id.
Example 4. The order of the cycle (3 2 6 4 1) is 5, as we noted before.
Example 5. The order of the permutation = (1 2)(3 4 5 6) is 4. Indeed,
= (1 2)(3 4 5 6),
2 = (1 2)2 (3 4 5 6)2 = (3 5)(4 6),
3 = (1 2)3 (3 4 5 6)3 = (1 2)(3 6 5 4),
4 = id.
This suggests that the order of a product of disjoint cycles equals the
lcm of the lengths of these cycles. This can be formalised in the following
Theorem 1. Let be a permutation and = 1 2 r be the decomposition of into a product of disjoint cycles. Let k be the order of and
k1 , k2 , . . . , kr be the orders (lengths) of 1 , 2 , . . . , r , respectively. Then
k = lcm (k1 , k2 , . . . , kr ).
Proof. We first notice that im = id iff m is a multiple of ki . Then, since the
cycles i are disjoint, we know that they commute and hence
m = 1m 2m . . . rm .
The powers 1m , 2m , . . . , rm act on disjoint sets of indices and, if m = id,
it must be 1m = 2m = . . . = rm = id. Indeed, if say sm (i) = j with
i 6= j, then the product 1m 2m . . . rm cannot be equal to id because all
m
m
permutations 1m , . . . , s1
, s+1
, . . . , rm leave i and j invariant. Thus the
order of is a multiple of each of the k1 , k2 , . . . , kr and hence the multiple
of the least common multiple of them. On the other hand, it is clear that
lcm (k1 ,k2 ,...,kr ) = id, which proves the theorem.
Example 6. The order of = (1 2 3 4)(5 6 7)(8 9)(10 11 12)(13 14 15 16 17)
is 60.
6
(1)
(Dont ask how these products were found! The point is to check that all
these products are equal, and to note that there is nothing unique about
how one can write a permutation as product of transpositions.)
Definition 5. A permutation is called even if it can be written as a product
of an even number of transpositions. A permutation is called odd if it can
be written as a product of an odd number of transpositions.
An important point is that there is no permutation that is at the same
time even and oddthis justifies the use of the terminology.1 We will establish that by looking at the polynomial
Y
f (x1 , x2 , . . . , xn ) =
(xi xj ).
(2)
i<j
(3)
Proof. In the left-hand-side of (3), for any pair of indices i and j, we have
either xi xj or xj xi (but not both) wil be a factor. Thus the left-hand-side
can differ from the right-hand-side by its sign only. This proves (3).
We will write sign() = 1, if we have + in (3) and sign() = 1 otherwise. We notice that
sign( ) = sign()sign( ).
Indeed,
f (x (1) , x (2) , . . . , x (n) ) = sign()f (x (1) , x (2) , . . . , x (n) ) =
sign()sign( )f (x1 , x2 , . . . , xn ),
1
You may skip this proof for the first reading and go straight to Example 12.
(4)
(5)
(only one factor changes its sign), hence sign((i i+1)) = 1. Since
(i k+1) = (k k+1)(i k)(k k+1),
and due to (4), we see that sign((i k)) = 1 implies sign((i k+1)) = 1.
This means that by induction (5) can be extended to an arbitrary transposition . Hence (5) will be true for any odd permutation , i.e sign() = 1.
At the same time, it is clear that for every even permutation we will have
sign() = +1. This implies that there is no permutation which is both even
and odd.
Example 12. (1 2 3 4) is an odd permutation, because (1 2 3 4) = (1 4)(1 3)(1 2).
(1 2 3 4 5) is an even permutation, because (1 2 3 4 5) = (1 5)(1 4)(1 3)(1 2).
Example 13. Since id = (1 2)(1 2), the identity is even.
Theorem 3. A k-cycle is even if k is odd; a k-cycle is odd if k is even.
Proof. Immediately follows from (1).
1 2 3 4 5 6 7 8 9
Example 14. Let =
. Is even or odd?
4 3 2 5 1 6 9 8 7
First decompose into a product of cycles, then use the result above:
= (1 4 5)(2 3)(7 9) (= (1 5)(1 4)(2 3)(7 9)).
We have an even number (two) of odd cycles, it shows that is even.
Definition 6. We say that two permutations have the same parity, if they
are both odd or both even, and different parities, if one of them is odd and
another is even.
Theorem 4. In any symmetric grooup Sn
1. The product of two even permutations is even.
2. The product of two odd permutations is even.
3. The product of an even permutation and an odd one is odd.
4. A permutation and its inverse are of the same parities.
9
10
n n + 1 n + 2 ...
2n
1
3
...
2n
2n 1
1 2 3 4 5 6 7 8 9 10
=
2 4 6 8 10 1 3 5 7 9
1 2 4 8 5 10 9 7 3 6 .
=
=
1 2 3 4 5 6 7 8 9 10
=
4 8 1 5 9 2 6 10 3 7
1 4 5 9 3
2 8 10 7 6
11
Example 17. n = 4
1 2 3 4 5 6 7 8
=
=
2 4 6 8 1 3 5 7
1 2 4 8 7 5
3 6
The order of is 6.
We close this section with a few words about a game played with a
simple toy. This game seems to have been invented in the 1870s by the
famous puzzle-maker Sam Loyd. It caught on and became the rage in the
United States in the 1870s, and finally led to a discussion by W. Johnson in
the scholarly journal, the American Journal of Mathematics, in 1879. It is
often called the fifteen puzzle. Our discussion will be without full proofs.
Consider a toy made up of 16 squares, numbered from 1 to 15 inclusive
and with the lower right-hand corner blank.
1
10
11
12
13
14
15
The toy is constructed so that squares can be slid vertically and horizontally,
such moves being possible because of the presence of the blank square.
Start with the position shown and perform a sequence of slides in such
a way that, at the end, the lower right-hand square is again blank. Call
the new position realisable. Question: What are all possible realisable
positions?
What do we have here? After such a sequence of slides we have shuffled
about the numbers from 1 to 15; that is, we have effected a permutation of
the numbers from 1 to 15. To ask what positions are realisable is merely
to ask what permutations can be carried out. In other words, in S15 , the
symmetric group of degree 15, what elements can be reached via the toy?
For instance, can we get
13
12
15
14
10
11
12
a2
a3
a4
a5
a6
a7
a8
a9
a10
a11
a12
a13
a14
a15
a16
11
13
15
10
6
12
14
11
13
10
12
14
15
13 16
Theorem 7. If a position characterised by the permutation can be transformed by legal moves to the initial position, then there exist permutations
1 , 2 , . . . , m such that
id = 1 2 . . . m .
(6)
If the empty square was in the right bottom corner, then m is even and is
even.
Proof. As we have seen every legal move is equivalent to multiplying the
permutation corresponding to the existing position by a transposition (i 16).
Then (6) follows. In this case:
= m m1 . . . 2 1
hence the parity of is the same as that of m.
Let us colour the board in the chessboard pattern
Every move changes the colour of the empty square. Thus, if at the
beginning and at the end the empty square was black, then there was an
even number of moves made. Therefore, if initially the right bottom corner
was empty and we could transform this position to the initial position, then
an even number of moves was made, m is even, and is also even.
It can be shown that every position, with an even permutation can be
transformed to the initial positon but no easy proof is known.
14
Combinatorics. Tutorial 2:
Friendship Theorem
This wonderful theorem has a very simple commonsense formulation.
Namely, given a society in which any two people have exactly one friend in
common, there must be a host, who is everybodys friend. Of course, this
is a graph-theoretic theorem and in order to prove it we must express it in
graph-theoretic terms.
Theorem 1 (Friendship Theorem). Suppose that G is a graph such that,
if x and y are any two distinct vertices of G, then there is a unique vetex z
adjacent in G to both x and y. Then there is a vertex adjacent to all other
vertices.
From this, it immediately follows that the graph G is a windmill like
the one below:
y
z
u1
v1
u2
v2
us
vs
2
Thus, we see that the degree of x is not greater than the degree of y. But
the situation is symmetric, i.e. we can also prove that the degree of y is not
greater than the degree of x. Hence, these two degrees coincide.
Lemma 3. G is regular.
Proof. Let d(x) denote the degree of the vertex x. Suppose that G is not
regular and that there exist two vertices a and b such that d(a) 6= d(b).
Then a and b must be adjacent by Lemma 2. There is a unique common
neighbor c of a and b. Since either d(c) 6= d(a) or d(c) 6= d(b), or both,
we may assume that the former is true and d(c) 6= d(a). Now let x be any
other vertex. Then x is adjacent to one of a or b, for otherwise by Lemma 2
d(a) = d(x) = d(b), contrary to the assumption that d(a) 6= d(b). Similarly,
x is adjacent to either a or c. But x cannot be adjacent to both b and c, as a
is their unique common neighbor, hence x must be adjacent to a. This now
shows that all vertices of G are adjacent to a and G is not a counterexample.
Hence G is regular.
Let m be the degree of G.
Lemma 4. m is an even number.
Proof. Let v1 , v2 , . . . , vm be the vertices adjacent to v. Let us consider v1 .
Together with v it must have a vertex which is adjacent to both. Since
v1 , v2 , . . . , vm are all vertices adjacent to v, this third vertex must be among
v1 , v2 , . . . , vm . Let it be v2 . No other vertex among v1 , v2 , . . . , vm can be
adjacent to v1 or to v2 . Thus v1 and v2 form a pair. This way we can pair
off the vertices adjacent to v which implies that m is even. We show that
the neighborhood of every vertex v looks like a windmill.
Lemma 5. Let N be the number of vertices of G. Then N = m(m 1) + 1.
Proof. Let v be any vertex and v1 , v2 , . . . , vm be the vertices adjacent to v.
We know that the neighborhood of v looks like a windmill. Without loss
of generality we assume that the vertices are paired off so that v1 is adjacent
to v2 , v3 is adjacent to v4 and finally vm1 is adjacent to vm . Every vertex
different from v and v1 , v2 , . . . , vm must be adjacent to one of the vi since
it must have a common neighbor with v. Each vi will have exactly m 2
neighbors of this kind. In total we then have N = 1 + m + m(m 2) =
m(m 1) + 1 vertices.
v1
m-2 vertices
v2
m-2 vertices
v3
m-2 vertices
v4
v5
v
v6
v m-1
m-2 vertices
m-2 vertices
vm
Let us now note that m > 2, or else G is just a triangle which is not
a counterexample. Let p be any prime which divides m 1. Since m 1
is odd, p is also odd. In the following two lemmas we will consider the set
S of all cycles v0 , v1 , . . . , vp1 , v0 of length p with the fixed initial point v0 .
This means that the same cycle with two different initial vertices will be
considered as two different elements of S. Let us agree that if the cycle is
written as v0 , v1 , . . . , vp1 , v0 , then v0 is chosen as its initial point. Note that
we again do not require that all vertices in the cycle are different.
We shall compute the cardinality |S| of S in two ways.
Lemma 6. |S| is a multiple of p.
Proof. Every cycle of length p with the fixed initial point
v0 , v1 , . . . , vp1
gives us p 1 other cycles by changing the initial point of it: v1 , v2 , . . . , v0 ,
and v2 , v3 , . . . , v1 , and so on. No two of such sequences are the same, assuming the opposite will contradict to the primeness of p (see the solution
to Exercise 9 of the assignment Many faces of mathematical Induction).
Since in every cycle of length p we can choose p initial points, and hence get
p different elements of S, it is clear that |S| is divisible by p.
Proof of the Friendship Theorem. Now we will prove that |S| is NOT divisible by p which will give us a contradiction and the proof will be therefore
complete.
First, we will count the number of vertex sequences v0 , v1 , . . . , vp2 , such
that vi is adjacent to vi+1 for all i = 0, 1, . . . , p 2. There are two types
4
of such sequences: 1) those for which v0 = vp2 and 2) those for which
v0 6= vp2 . Let K1 and K2 be the number of sequences of the first and the
second type, respectively. Then K1 + K2 = N mp2 . Indeed, we can choose
v0 in N different ways, and having chosen v0 , v1 , . . . , vi , we can choose vi+1 in
m different ways. Now we will return to cycles with fixed initial vertices from
S. Each of them can be obtained from a sequence of one of the above types
by adding a vertex vp1 which is adjacent to v0 and vp2 and considering
v0 as the initial vertex of this cycle. If v0 = vp2 , then we can choose vp1
in m different ways, while if v0 6= vp2 , then such vp1 will be unique. Thus
|S| = mK1 + K2 . But now
|S| = (m 1)K1 + (K1 + K2 ) = (m 1)K1 + N mp2 N mp2
(mod p)
Introduction
0 r < a.
The number q is called the quotient and the number r is called the remainder. The notation r = b (mod a) is often used.
Example 1 35 = 3 11 + 2, 51 = (8) 7 + 5; so that 2 = 35 (mod 11)
and 5 = 51 (mod 7).
Suppose that there exists an integer with two essentially different prime
decompositions, then there will be a smallest such integer
n = p1 p2 . . . pr = q1 q2 . . . qs ,
(1)
where pi and qj are primes. By rearranging the order of the ps and the qs,
if necessary, we may assume that
p1 p2 . . . pr ,
q1 q2 . . . qs .
(2)
(3)
(4)
Since p1 < q1 , it follows from (4) that n0 is a positive integer, which is smaller
than n. Hence the prime decomposition for n0 must be unique and, apart
from the order of the factors, (3) and (4) coincide. From (3) we learn that
p1 is a factor of n0 and must appear as a factor in decomposition (4). Since
p1 < q1 qi , we see that p1 6= qi , i = 2, 3, . . . , s. Hence, it is a factor of q1 p1 ,
i.e., q1 p1 = p1 m or q1 = p1 (m + 1), which is impossible as q1 is prime and
q1 6= p1 . This contradiction completes the proof of the Fundamental Theorem
of Arithmetic.
Let x be a real number. Then it can be written in a unique way as z + e,
where z Z and 0 e < 1. Then, the following notation is used: z = bxc,
z + 1 = dxe, e = {x}. We will use here only the first function bxc, which is
called the integral part of x. Examples: b2.5c = 3, bc = 3, b5c = 5.
Theorem 3The smallest prime divisor of a composite number n is less than
or equal to b nc.
3
Proof:
We prove first that n has a divisor which is greater than 1 but less
As n is composite, then n = d1 d2 , d1 > 1 and d2 > 1. If d1 > n
than n.
and d2 > n, then
n = d1 d2 > ( n)2 = n,
ln x
= 1,
x
Theorem 6 (Dirichlets Theorem) If a and b are relatively prime positive integers (which means that they dont have common prime factors in
their prime factorisations), then there are infinitely many primes of the form
an + b, where n = 1, 2, . . ..
Theorem 7 (Bertrands Postulate, proved by Chebyschef) For every
positive integer n > 1 there is a prime p such that n < p < 2n.
(1)
where pi are distinct primes and i are positive integers. How can we find
all divisors of n? Let d be a divisor of n. Then n = dm, for some m, thus
n = dm = p1 1 p2 2 . . . pr r ,
Since the prime factorisation of n is unique, d cannot have in its prime
factorisation a prime which is not among the primes p1 , p2 , . . . , pr . Also, a
prime pi in the prime factorisation of d cannot have an exponent greater than
i . Therefore
d = p1 1 p2 2 . . . pr r ,
0 i i ,
i = 1, 2, . . . , r.
(2)
(3)
i i ,
i = 1, 2, . . . , r,
a = p1 1 p2 2 . . . pr r ,
gcd (a, b) = p1
r ,r )
. . . pmin(
,
r
(4)
and
max(1 ,1 ) max(2 ,2 )
p2
lcm (a, b) = p1
r ,r )
. . . pmax(
.
r
(5)
Moreover,
gcd (a, b) lcm (a, b) = a b.
(6)
Proof. Formulas (4) and (5) follow from our description of common divisors
and common multiples. To prove (6) we have to notice that min(i , i ) +
max(i , i ) = i + i .
We suspect (in fact it is an open question) that prime factorisation is
computationally difficult and we dont know easy algorithms for that but
fortunately the greatest common divisor gcd (a, b) of numbers a and b can be
found without knowing the prime factorisations for a and b. This algorithm
was known to Euclid and maybe even was discovered by him.
2
Theorem 3 (The Euclidean Algorithm). Let a and b be positive integers. We use the division algorithm several times to find:
a = q1 b + r1 ,
b = q2 r1 + r2 ,
r1 = q3 r2 + r3 ,
..
.
rs2 = qs rs1 + rs ,
rs1 = qs+1 rs .
0 < r1 < b,
0 < r2 < r1 ,
0 < r3 < r2 ,
0 < rs < rs1,
a
1
0
b
0
1
r1
1
q1
r2
.
q
1
+
q
q
2
1
2
..
.
rs
m
n
Then gcd (a, b) = rs = am + bn.
Proof. We will prove this by induction. Let the kth row of the table be
Rk = (uk , vk , wk ).
We assume that ui = avi +bwi for all i < k. This is certainly true for i = 1, 2.
Then by induction hypothesis
uk = uk2 qk uk1 = avk2 + bwk2 qk (avk1 + bwk1 ) =
a(vk2 qk vk1 ) + b(wk2 qk wk1 ) = avk + bwk .
Thus the statement ui = avi + bwi is true for all i. In particular, this is true
for the last row, which gives us rs = am + bn.
Example 1. Let a = 321, b = 843. Find the greatest common divisor
gcd (a, b), the least common multiple lcm (a, b), and a linear presentation
of the greatest common divisor in the form gcd (a, b) = ka + mb.
The Euclidean algorithm:
321
843
321
201
120
81
39
=
=
=
=
=
=
=
0 843 + 321
2 321 + 201
1 201 + 120
1 120 + 81
1 81 + 39
2 39 + 3
13 3 + 0,
4
1
0
1
2
3
5
8
21
321 843
= 107 843 =
3
0
1
0
1
1
2
3
8
obtaining the linear presentation gcd (321, 843) = 3 = (21) 321 + 8 843.
and
s = N (mod b),
(7)
Proof. Let us prove first, that there exists at most one integer N with the
conditions required. Assume, on the contrary, that for two integers N1 and
N2 we have 0 N1 < ab, 0 N2 < ab and
r = N1 (mod a) = N2 (mod a) and s = N1 (mod b) = N2 (mod b).
Let us assume that N1 > N2 . Then the number M = N1 N2 satisfies
0 M < ab and
0 = M (mod a) and 0 = M (mod b).
(8)
Eulers -function
Nij = bn + sj .
(1)
s = N (mod n),
1
2
2
3
10
11
= 80.
0 r1 < m, and b = q2 m + r2 ,
0 r2 < m.
(2)
Then clearly,
N = d0 + N1 b = d0 + d1 b + d2 b2 + + dn bn ,
is the representation required.
Finally, suppose that N has some other representation in this form also,
i.e.,
N = d0 + d1 b + d2 b2 + + dn bn = e0 + e1 b + e2 b2 + + en bn .
Then d0 = e0 = r as they are equal to the remainder of N on dividing by b.
Now the number
N1 =
N r
= d1 + d2 b + d3 b2 + + dn bn1 = e1 + e2 b + e3 b2 + + en bn1
b
(3)
to express (2). The digits di can be found by the repeated application of the
division algorithm as follows:
N = q1 b + d0 ,
q1 = q2 b + d1 ,
..
.
qn = 0 b + dn
(0 d0 < b)
(0 d1 < b)
(0 dn < b)
For example, the positional system with base 5 employ the digits 0, 1, 2, 3, 4
and we can write
1998(10) = 3 54 + 0 53 + 4 52 + 4 5 + 3 = 30443(5) .
But in the computers era it is the binary (or dyadic) system (base 2) that
emerged as the most important one. We have only two digits here 0 and
1 and a very simple multiplication table for them. But under the binary
system, the representations of numbers get longer. For example,
86(10) = 1 26 + 0 25 + 1 24 + 0 23 + 1 22 + 1 2 + 0 = 1010110(2). (4)
3
Leibniz (16461716) was one of the proponents of the binary system. According to Laplace: Leibniz saw in his binary arithmetic the image of creation. He imagined that Unity represented God, and zero the void; that the
Supreme Being drew all beings from the void, just as unity and zero express
all numbers in his system of numeration.
Let us look at the binary representation of a number from the information
point of view. Information is measured in bits. One bit is a unit of information expressed as a choice between two possibilities 0 and 1. The number
of binary digits in the binary representation of a number N is therefore the
number of bits we need to transmit N through an information channel (or
input into a computer). For example, the equation (4) shows that we need 7
bits to transmit or input the number 86.
Theorem 2. To input a number N by converting it into its binary representation we need blog2 Nc + 1 bits of information, where bxc denotes the
integer part of x.
Proof. Suppose that N has n binary digits in its binary representation. That
is
N = 2n1 + an2 2n2 + + a1 21 + a0 20 ,
ai {0, 1}.
Then 2n > N 2n1 or n > log2 N n 1, i.e., blog2 Nc = n 1 and thus
n = blog2 Nc + 1.
The negative powers of 10 are used to express those real numbers which are
not integers. The other bases can be also used. For example,
1
1
2
5
0
0
1
= 0.125(10) =
+ 2 + 3 = + 2 + 3 = 0.001(2)
8
10 10
10
2 2
2
1
= 0.142857142857 . . .(10) = 0.(142857)(10) = 0.001001 . . .(2) = 0.(001)(2)
7
The binary expansions of irrational numbers, such as
5 = 10.001111000110111 . . .(2) ,
are used sometimes in cryptography for simulating a random sequence
of
Introduction
a = qb + r
Then q = a/b and r = a ba/b.
Proof. We simply write
r
a
=q+
b
b
and since q is an integer and 0 r/b < 1 we see that q is the integer part of
a/b and r/b is the fractional part.
Exercise 1. x + x + 1/2 = 2x.
(2)
(the sum is nite of course). Suppose that a belongs to {1, 2, 3, . . . , n}, and
such that pj | a but pj+1 a. Then in the sum (2) a will be counted j times
and will contribute i towards t. This shows that t = s. Now (1) follows from
Lemma 1 since mj = n/pj .
2
(a) Let t be the largest integer such that pt 2n. Then for j > t
2n
n
2 j
= 0.
j
p
p
Hence
s=
t
2n
j=1
pj
n
2 j
p
t.
(a + b) =
n
n
k=0
ank bk .
(4)
n
2n1 .
(n + 1)/2
Proof.
2n
n
.
n/2
n
(a) From (5), deleting all terms except the two middle ones, we get
n
n
+
2n .
(n 1)/2
(n + 1)/2
The two binomial coecients on the left are equal and we get (a).
(b) If n is even, then it is pretty easy to prove that the middle binomial
coecient is the largest one. In (5) we have n + 1 summand but we
group the two ones together and we get n summands among which the
middle binomial coecient is the largest. Hence
n
n
n
n
= 2n ,
n/2
k
k=0
which proves (b).
where the product on the left has one factor for each prime p n.
Proof. The proof is by induction over n. For n = 2 we have 2 < 42 , which
is true. This provides a basis for the induction. Let us assume that the
statement is proved for all integers smaller than n. If n is even, then it is not
prime, hence by induction hypothesis
p=
p < 4n1 < 4n ,
pn
pn1
p=
ps+1
s+1
p<4
s+1<pn
n
using the induction hypothesis for n = s + 1 and Lemma 2(a). Now the
right-hand-side can be presented as
4s+1 2n1 = 22s+2 2n1 = 24s+2 = 42s+1 = 4n .
This proves the induction step and, hence, the theorem.
Proof of Bertrands Postulate. We will assume that there are no primes between n and 2n and obtain a contradiction.
We will obtain that, under this
assumption, the binomial coecient 2n
is
smaller
than it should be. Indeed,
n
in this case we have the following prime factorisation for it:
2n
=
p sp ,
n
pn
Let
us recap now that due to Corollary 1 psp 2n and that sp = 1 for
p > 2n. Hence
2n
p sp
p.
p 2n
p2n/3
We will estimate now these product using the inequality psp 2n for
the rst
product and Theorem 4 for the second one. We have no more that 2n/21
factors in the rst product (as 1 and even numbers are not primes), hence
2n
< (2n) 2n/21 42n/3 .
(6)
n
On the other hand, by Lemma 2(b)
4n
2n
22n
=
.
2n
2n
n
(7)
n
ln(2n)
2
or
8n ln 2 3 ln(2n) < 0.
(8)
7
inducton). Hence
(8) is not true for n = 2 = 128. Let us consider the
function f (x) = 8x ln 2 3 ln(2x) dened for x > 0. Its derivative is
2x ln 2 3
.
f (x) =
x
let us note that for x 8 this derivative is positive. Thus (8) is not true for
all n 128. We proved Bertrands postulate for n 128. For smaller n it
can be proved by inspection. I leave this to the reader.
Geometry Tutorial 1.
Ptolemys inequality
D
0
AC =
AB CD
.
BD
1
AB
BD
and hence
0 =
AC
CD
AC + C C =
Theorem 2 (Generalised Ptolemys inequality) Let A, B, C, D be arbitrary points in the plane, but not on a line. Then
AB CD + BC AD AC BD.
This inequality becomes equality if and only if the points A, B, C, D are concyclic and each of the two arcs determined by the points A, C contains one
of the two remaining points.
Proof: Consider an inversion i with pole D and any coefficient r > 0. Let
A0 , B 0 , C 0 be the images of A, B, C under this inversion respectively. Applying
the Triangle inequality for the points A0 , B 0 , C 0 , we get
A0 B 0 + B 0 C 0 A0 C 0 .
(1)
r2 AB
r2 BC
r2 AC
+
.
DA DB DB DC
DA DC
After multiplying both sides by DA DB DC, the latter becomes
AB CD + BC AD AC BD,
(2)
as desired. It is clear that (2) becomes equality, only when (1) becomes equality. This happens, when A0 , B 0 , C 0 are on the line with B 0 beeing between A0
and C 0 . Since the points are not on the same line, this means that before the
inversion they were on a circle with B and D on different arcs determined
by A and C.
Comment 1: Theorem 2 is clearly independent of whether or not the given
points lie in the same plane. It does not change in the slightest if they are
in three-dimensional space.
Comment 2: Theorem 2 is also true in some cases, when the given points
lie on the same line. This case can easily be sorted out but it is not of interest
to us.
3
Geometry Tutorial 2.
Eulers theorem
We shall prove in this section Eulers theorem that was offered in 1962 to
the participants of IMO and therefore introduced to the IMO sillabus forever.
We will prove the following lemma first and then derive Eulers theorem
and several other corollaries.
Lemma 1 A circle of radus r with center I is inside of a circle of radius R
with center O. Suppose A is an arbitrary point on the larger circle, AB and
AC are two chords of the larger circle which are tangent to thepsmaller one.
Then BC is tangent to the smaller circle if and only if IO = R(R 2r).
Proof. Let S be a point on the larger circle such that AS is the bisector of
BAC. Let us draw CI and CS.
6
B
A
B
A
A1