Download lesson 2: the inclusion-exclusion principle

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
LESSON 2:
THE INCLUSION-EXCLUSION PRINCIPLE
The inclusion-exclusion principle (also known as the sieve principle) is an extended
version of the rule of the sum. It states that, for two (finite) sets, A and B, the
number of elements in the union of the two sets is the sum of the elements in each
set, respectively, minus the number of elements that are in both:
|A ∪ B| = |A| + |B| − |A ∩ B|.
Similarly, for three sets A, B and C, we have:
|A ∪ B ∪ C| = |A| + |B| + |C| − |A ∩ B| − |A ∩ C| − |B ∩ C| + |A ∩ B ∩ C|.
For the general case of the principle, let A1 , A2 , ... , An be finite sets. Then
n
n
X
X
[ X
Ai =
|Ai ∩ Aj ∩ Ak | − · · · +
|A
|
−
|A
∩
A
|
+
i
i
j
i=1
i=1
1≤i<j≤n
1≤i<j<k≤n
+ (−1)n−1 |A1 ∩ · · · ∩ An | .
The name comes from the idea that the principle is based on over-generous inclusion, followed by compensating exclusion.
Examples:
1. How many bit strings of length 8 either start with 1 or end with the two bits 00?
Solution: Let A be the set of the strings starting with the digit 1, and B the set of
the strings ending with 00. Then |A ∪ B| = |A| + |B| − |A ∩ B| = 27 + 26 − 25 = 160.
2. How many positive integers not exceeding 2001 are multiple of 3 or 4 but not
5? (AMC 12, 2001)
(A) 768
(B) 801
(C) 934
(D) 1067
(E) 1167
Solution: Let A be the set of the multiples of 3 not exceeding 2001, B the set of
the multiples of 4 not exceeding 2001, and C the set of the numbers not divisible by 5 and not exceeding 2001. Then the question is to find |(A ∪ B) ∩ C| =
|(A ∩ C) ∪ (B ∩ C)| = |A ∩ C| + |B ∩ C| − |A ∩ B ∩ C|. We also have that if X ⊂ Y ,
then |Y \ X| = |Y | − |X|. This follows from the rule of the sum applied to the
disjoints sets X, Y \ X. Indeed, Y = X ∪ (Y \ X), therefore |Y | = |X| + |Y \ X|
1
and the desired formula follows.
It is easy to see that A = {3, 6, ..., 2001} has |A| = 667, B = {4, 8, ..., 2000} has
|B| = 500, and C = {1, 2, ..., 2001} \ {5, 10, ..., 2000} has |C| = 2001 − 400 = 1601.
A ∩ C will consist of the multiples of 3 that are not multiples of 5, that is of
the multiples of 3 that are not multiples of 15. We will count the multiples of
15 not exceeding 2001 and will subtract their number from |A|. The multiples of
15 not exceeding 2001 are 15, 30, ..., 1995 (i.e. 1995 : 15 = 133 numbers), therefore |A ∩ C| = 667 − 133 = 534. Similarly, to compute |B ∩ C|, we need to
subtract from |B| the number of the numbers that are multiples of 20 and do
not exceed 2001. These numbers are 20, 40,..., 2000 (100 numbers), therefore
|B ∩ C| = |B| − 100 = 400.
To compute |A ∩ B ∩ C| we need to subtract from |A ∩ B| = 166, the number of the
numbers not exceeding 2001 that are multiples of 60. There are 33 such numbers,
so |A ∩ B ∩ C| = 166 − 33 = 133.
Then |(A ∪ B) ∩ C| = 534 + 400 − 133 = 801.
3. Each of the 2001 students at a high school studies either Spanish or French, and
some study both. The number of those studying Spanish is between 80 percent
and 85 percent of the school population, and the number of those studying French
is between 30 percent and 40 percent. Let m be the smallest number of students
that could study both languages, and let M be the largest number of students that
could study both languages. Find M − m. (AIME 2001)
Solution: Let S and F be the set of the students of the school that studying Spa|S|
85
80
≤
≤
nish and French, respectively. Then |S ∪ F | = 2001. Moreover,
100
2001
100
30
|F |
40
and
≤
≤
. From here we find that |S| ∈ {1601, 1602, ..., 1700} and
100
2001
100
|F | ∈ {601, 602, ..., 800}. Then |S∩F | = |S|+|F |−|S∪F | is maximum when |S| and
|F | are both maximum, therefore M = 1700+800−2001 = 499. Similarly, |S ∩F | is
minimum when |S| and |F | are minimum. In this case m = 1601+601−2001 = 201.
Then M − m = 499 − 201 = 298. (AIME 2001).
4. In the small hamlet of Abaze, two base systems are in common use. Also,
everyone speaks the truth. One resident said: ”26 people use my base, base 10,
and only 22 people speak base 14.” Another said, ”Of the 25 residents, 13 are
bilingual and 1 can not use either base.” How many residents are there? (Use base
10, please!) [AHSME Dropped problem]
(A) 15
(B) 25
(C) 27
(D) 35
(E) 36
Solution: Denote by a the index of the base of the first resident. Then let us
2
translate into base 10 what the first resident said: ”2a + 6 people use my base,
base a, and only 2a + 2 people speak base a + 4.” (Note that the fact that he
said he was using base 10 is irrelevant: in each base, the expression of the index of the base is 10 (”one-zero”).) Now, the first resident said, in his base, that
there were 26 people speaking his base. The second resident said there were 25
residents all together in Abaze, therefore it is clear that the second resident uses
another base than the first resident. We know that the other base is a + 4. Let
us translate into base 10 what the second resident said: ”Of the 2(a + 4) + 5
residents, (a + 4) + 3 are bilingual and 1 can’t use any base.” We will use inclusionexclusion. Denote by A and B the set of the residents of Abaze using base a and
base a + 4, respectively. Then the residents that do use one base or the other has
|A ∪ B| = 2(a + 4) + 5 − 1 = 2a + 12 elements (remember, one resident does not
use any base). |A| = 2a + 6, |B| = 2a + 2, |A ∩ B| = (a + 4) + 3 = a + 7. Writing
inclusion-exclusion: |A∪B| = |A|+|B|−|A∩B|, we obtain the following equation:
2a+12 = (2a+6)+(2a+2)−(a+7). We obtain a = 11, so there are 2(a+4)+5 = 35
residents in this hamlet.
5. Each unit square of a 3-by-3 unit-square grid is to be colored either blue or
red. For each square, either color is equally likely to be used. The probability of
m
obtaining a grid that does not have a 2-by-2 red square is , where m and n are
n
relatively prime positive integers. Find m + n.
Solution: Since each of the 9 unit squares of the 3-by-3 square can take one of
two colors, in total there are 29 different ways of coloring the 3-by-3 square. Let
us count now the colorings that form a 2-by-2 red square. This red square can
be formed in the upper left, upper right, bottom left or bottom right corner of
the 3-by-3 square. Let A, B, C, D be, respectively, the sets of the four types of
colorings listed above that produce a 2-by-2 red square. Since the other 5 squares
of the 3-by-3 square can have any color, we have |A| = |B| = |C| = |D| = 25 .
These sets are however not disjoint, so we must apply inclusion-exclusion:
|A ∪ B ∪ C ∪ D| = |A| + |B| + |C| + |D| − |A ∩ B| − |A ∩ C| − |A ∩ D| − |B ∩ C| − |B ∩
D|−|C ∩D|+|A∩B ∩C|+|A∩B ∩D|+|A∩C ∩D|+|B ∩C ∩D|−|A∩B ∩C ∩D|.
As A∩B represents the set of the colorings having the first two rows red (and the 3
squares of the lowest row free to take any of the two colors), we have |A ∩ B| = 23 .
Similarly, |A ∩ C| = 23 , |B ∩ D| = 23 and |C ∩ D| = 23 . We have a different situation for A ∩ D and B ∩ C: if two opposing 2-by-2 squares are red, this
leaves uncertain only the colors of the two remaining 1-by-1 corners, therefore
|A ∩ D| = |B ∩ C| = 22 . The intersections of 3 of the sets leaves undecided only
the color of one corner square, therefore each of these intersections has 2 elements.
Finally, the intersection of all the four sets contains only the square completely
colored in red, that is, one element. We obtain:
3
|A ∪ B ∪ C ∪ D| = 4 · 25 − (4 · 23 + 2 · 22 ) + 4 · 2 − 1 = 95.
So from the 512 possible colorings, 512 − 95 = 417 do not contain any 2-by-2 red
417
square, so the probability of not having a 2-by-2 red square is
.
512
As 417 and 512 are relatively prime, we find m = 417, n = 512, and m + n = 929.
6. Let A1 , A2 , A3 , . . . , A12 be the vertices of a regular dodecagon. How many distinct squares in the plane of the dodecagon have at least two vertices in the set
{A1 , A2 , A3 , . . . , A12 } ?
Solution: Consider every possible pair of vertices of the dodecagon. The choice of
such pairs can be made in 66 ways. Indeed, choose the first point (12 ways), then
choose the second point (11 ways). But any unordered pair {A, B} of vertices has
been chosen twice (first A, then B, or first B, then A), so we must divide 12 · 11
by 2. Therefore we have 66 pairs of vertices.
Two vertices, A, B of the dodecagon can be vertices of 3 possible squares: one
in which A and B are diagonally opposite vertices of the square, and two ways
in which AB is a side of the square, the square being constructed on one or the
other side of the line AB. So it seems we have 66 × 3 = 198 squares that have at
least two vertices in the set of the vertices of the dodecagon. But this overcounts,
as it is possible for a square to contain more then two vertices of the dodecagon,
that square being then counted several times, once for each pair of vertices of the
dodecagon. Now, if 3 vertices, A, B, C, of the dodecagon are vertices of a square,
then they are consecutive vertices of the square and therefore ^ABC is a rightangle, and AB = BC. This means that AC is a diameter in the circumcircle of
the dodecagon, and B is the midpoint of one of the arcs AC. Then the forth
vertex of the square is the midpoint of the other arc AC, hence all the 4 vertices
of the square must be vertices of the dodecagon. Moreover, the 4 vertices can be:
{A1 , A4 , A7 , A10 }, or {A2 , A5 , A8 , A11 }, or {A3 , A6 , A9 , A12 }. Each of these squares
was counted 6 times, once for each side and diagonal. In order to avoid overcounting, we need to count these 3 squares only once, so we must subtract from the
total we have found (198), 5 times the number of the overcounted squares: we get
198 − 5 · 3 = 183 squares.
Practice problems
1. Every student in the senior class is taking history or science and 85 of them are
taking both. If there are 106 seniors taking history and 109 seniors taking science,
how many students are in the senior class?
Solution: Let A be the set of the students of the senior class that take history, and
4
B the set of those taking science. The number of the students in the senior class
is |A ∪ B| = |A| + |B| − |A ∩ B| = 106 + 109 − 85 = 130.
2. Find, with justification, the number of positive integers less than or equal to
1000 that are divisible by 3, 5, or 11.
Solution: Let A, B, C be the set of the numbers less than or equal to 1000 that are
divisible by 3, 5 and 11, respectively. Then the question translates to computing
|A∪B∪C|. We shall apply inclusion-exclusion. The number of elements for each set
is easy to compute: A = {3, 6, ..., 999} has 333 elements, B = {5, 10, ..., 1000} has
200 elements, and C = {11, 22, ..., 990} has 90 elements, A∩B = {15, 30, ...990} has
66 elements, A ∩ C = {33, 66, ..., 990} has 30 elements, B ∩ C = {55, 110, ..., 990}
has 18 elements, and A ∩ B ∩ C = {165, 330, 495, 660, 825, 990} has 6 elements.
Applying inclusion exclusion, |A ∪ B ∪ C| = 333 + 200 + 90 − 66 − 30 − 18 + 6 = 515.
3. At an international conference of 120 people, 75 speak English, 60 speak Spanish, and 45 speak French (and everyone present speaks at least one of the three
languages).
a) What is the maximum possible number of these people who can speak only
one language? In this case, how many speak only English, how many speak only
Spanish, and how many speak only French, and how many speak all three?
b) What is the maximum number of people who speak only French? In this case,
what can be said about the number of people who speak only Spanish and the
number who speak only English?
c) What is the maximum number of people who speak only English? In this case,
what can be said about the number of people who speak only Spanish and the
number of people who speak only French?
Solution: a) In the Venn diagram above, A, B, C represent the numbers of people
that speak only English, only Spanish, and only French, respectively, X is the
number of people that speak only English and Spanish, Y is the number of people
that speak only English and French, Z is the number of people speaking Spanish
5
and French, but not English. Finally, M is the number of people speaking all three
languages. Then we have: A+B +C +X +Y +Z +M = 120, A+X +M +Y = 75,
B + Z + M + X = 60, and C + Z + M + Y = 45. By adding these last three
relations and denoting A + B + C = α, X + Y + Z = β, we get α + 2β + 3M = 180.
As α + β + M = 120, we get β + 2M = 60, hence M ≤ 30. We prove that M = 30
is indeed the maximum value. If M = 30, then β = 0 and X = Y = Z = 0, then
A = 45, B = 30, C = 15. This configuration satisfies all the requirements, hence
M = 30 is the desired maximum.
b) We want the maximum value of C. As C + Z + M + Y = 45, we get C ≤ 45.
If C = 45, then Y = Z = M = 0, hence A = 75 − X, B = 60 − X. Plugging into
A + B + C + X + Y + Z + M = 120 yields X = 60, then A = 15, B = 0. This
configuration satisfies all the requirements, hence C = 45 is the desired maximum.
c) We want the maximum value of A. As A + X + M + Y = 75, we get A ≤ 75.
If A = 75, then X = Y = M = 0, hence B = 60 − Z, C = 45 − Z. Plugging into
A + B + C + X + Y + Z + M = 120 yield Z = 60, then B = 0, but C = −15! So
clearly the desired maximum is not 75.
In order to find it, notice that by adding A+X +M +Y = 75, B +Z +M +X = 60,
and subtracting A + B + C + X + Y + Z + M = 120 we get M + X − C = 15, hence
M + X ≥ 15. Then, from A + X + M + Y = 75 follows that A ≤ 60. If A = 60,
we must have: M + X = 15, Y = 0, C = 0, M + Z = 45 = B + Z. Plugging
X = 15 − M , Z = 45 − M , B = M into A + B + C + X + Y + Z + M = 120
yields 0 = 0. Therefore we can yake M = 0, getting X = 15, Z = 45, B = 0. This
configuration satisfies all the requirements, hence A = 60 is the desired maximum.
4. In a student campus having 420 residents, everybody speaks at least one of the
three languages - French, English and Spanish. The number of people who speak
French is 200, the number of people who speak English is 300 and the number of
people who speak Spanish is 400.
a) What is the minimum possible number of students who speak all the three languages?
b) If the number of students who speak all the three languages is 100, what is the
number of students who speak exactly one language?
c) What is the maximum possible number of students who speak all the three languages? In this case, how many speak only English, how many speak only Spanish,
and how many speak only French?
6
Solution: a) In the Venn diagram above, A, B, C represent the numbers of students
that only speak French, English and Spanish, respectively, X is the number of students that speak French and English but not Spanish, Y is the number of students
that speak French and Spanish but not English, Z is the number of students speaking English and Spanish, but not French. Finally, M is the number of students
speaking all three languages. Then we have: A + B + C + X + Y + Z + M = 420,
A + X + M + Y = 200, B + Z + M + X = 300, and C + Z + M + Y = 400. By
adding these last three relations and denoting A + B + C = α, X + Y + Z = β,
we get α + 2β + 3M = 900. As α + β + M = 420, we get β + 2M = 480, hence
M − α = 60. As α ≥ 0, we get M ≥ 60. We prove that M = 60 is indeed the
minimum value. If M = 60, then A = B = C = 0 and X + Y + Z = β = 360 hence
Z = A + M + (X + Y + Z) − 200 = 220. Similarly, we get Y = 120 and X = 20.
This configuration satisfies all the requirements.
b) If M = 100, then from M − α = 60 we get α = A + B + C = 40 represents the
number of people who speak exactly one language.
c) From β + 2M = 480 we get that M ≤ 240. On the other hand, from A + X +
M + Y = 200 we get M ≤ 200. In case M = 200 we obtain A = X = Y = 0,
hence B + Z = 100, C + Z = 200. Substituting B = 100 − Z, C = 200 − Z into
A + B + C + X + Y + Z + M = 420 yields Z = 80, hence B = 20, C = 120.
5. The Alpine Club consisting of n members organizes four mountain expeditions
for its members. Let E1 , E2 , E3 , E4 be the four teams participating in these
expeditions. How many ways are there to form those teams, given that E1 ∩E2 6= ∅,
E2 ∩ E3 6= ∅, E3 ∩ E4 6= ∅ ?
Austrian-Polish Mathematics Competition, 1995
Solution: By the principle of inclusion and exclusion, we get the desired total by
counting the number of formations without any constraints, then for each constraint subtracting the number of formations that fail to meet that contraint, then
adding for each pair of constraints the number of formations that fail to meet both
constraints, then subtracting the number that fail all three constraints.
7
Since each person can choose whether or not to be on each team, there are 16n
formations in total. Suppose one constraint fails, say E1 ∩ E2 = ∅. Then each
person only has 12 choices, since four choices involve joining both E1 and E2 . If
E1 ∩ E2 and E3 ∩ E4 are both empty, each person has only 9 choices, while if either
of the other pairs fail, each person has 10 choices. Finally, if all three constraints
fail, each person has 8 choices. Hence the number of acceptable formations is
16n − 3 · 12n + 9n + 2 · 10n − 8n .
8
EVALUATE, THEN GIVE AN EXAMPLE
Another useful method of answering questions concerning a minimal or a maximal
value of something is evaluate, then give an example. For a maximum, ”evaluate”
means ”show that the maximum can not exceed M ”. The second part of the proof
requires to give an example where this value M is attained. The difficulty often
consists in guessing the value of M . Quite often we find ourselves confronted with
the following dilemma: the ”best” M for which we have found an example is not
the same as the ”best” M for which we have an estimation: there is a gap between
the two numbers. Should we try to improve our estimation, maybe using different
arguments, or should we keep trying to find better examples? Unfortunately, there
is no magical solution to this dilemma...
Examples:
1. What is the maximum number of distinct positive integers whose sum is 2011?
Solution: First we prove that this maximum can not exceed 62 (”evaluate”).
Suppose it was possible to have more then 62 distinct positive integers adding up
63 · 64
= 2016 > 2011,
to 2011. Then their sum would be at least 1 + 2 + ... + 63 =
2
contradiction. Thus we have proven that there can be at most 62 numbers.
The second part of the proof consists in providing an example in order to prove
that there are 62 distinct positive integers whose sum is 2011.
Consider the numbers 1, 2, ..., 61 and 120. The sum of these 62 distinct positive
61 · 62
+ 120 = 2011.
integers is
2
(the example given above is by no means the only available one; any other such
example is equally good)
2. What is the maximum number of rooks that can be positioned on a chessboard
such that no two rooks attack each other?
The same question for queens, bishops, kings and knights.
Solution:
(a) rooks
We can not have two rooks on the same row, therefore we can have at most 8 rooks
(the ”evaluation” part).
Placing 8 rooks on a diagonal of the square provides an example of how we can
place 8 rooks on the board such that no rooks attack each other. We have proven
that the desired maximum is 8.
9
(b) queens
We can not have two queens on the same row, therefore we can have at most 8
queens (the ”evaluation” part).
Finding a layout with 8 queens such that no two of them attack each other is a
little bit more difficult to construct.
Denote the rows of the chessboard by 1,2,...,8 and the columns by letters from a to
h. Then one possible example with 8 queens on a chessboard with no two queens
attacking each other is to place them in: a2, b4, c6, d8, e3, f1, g7, and h5.
Essentially there are 12 such examples. See http://en.wikipedia.org/wiki/8 queens
(c) bishops
evaluation: Consider the diagonal joining the bottom-left corner and the upperright corner of the square and all the ”shorter diagonal lines” parallel to this one.
There are 15 such diagonals, two of which passing only through one single unit
square (the unit squares in the upper-left and bottom-right corners). These 15
lines cover all the unit squares, hence we can not place more than 15 bishops on
the board. But the two diagonals that pass only through the corner squares are
opposite corners of the board, so we can not place a bishop on both these squares.
This means that we can not have more then 14 non-attacking bishops on the board.
An example with 14 bishops: place a bishop on each square of the lowest row, then
a bishop on each of the squares of the top row with the exception of the two corners.
(d) kings
Divide the board in 16 2 × 2 squares. Two kings can not be placed in the same
2 × 2 square, therefore we can have at most 16 kings. On the other hand, placing a
king in the upper-left corner of each of the 16 2 × 2 squares constitutes an example
of how one can place 16 non-attacking kings on a chessboard.
In conclusion, the desired maximum is 16.
(e) knights
For the example part, note that each knight changes the color of its square when it
moves. Placing 32 knight on the 32 white squares is an example of 32 non-attacking
knights.
In order to prove that one can not put more, notice that in any 2 × 4 rectangle
you can place at most 4 non-attacking knights. (One can pair up the 8 fields of
such a rectangle in pairs such that if one places knights in the two fields that form
a pair, the knights will attack each other.) As one can cover the chessboard with
8 such rectangles, one can not place more than 32 non-attacking knights on the
chessboard.
3. Determine the greatest number of figures congruent to
that can be
placed in a 7 × 7 grid (without overlapping) such that each figure covers exactly 4
10
unit squares.
Solution: Number the rows and the columns from 1 to 7, then color the squares
situated on even rows and even columns. Nine squares will be colored. Each tile
placed on the board, whatever its position, will cover exactly one colored square,
therefore we can have at most 9 tiles on the board. On the other hand, it is possible
to place 9 tiles on the board: you can place 3 on the first two rows, another 3 on
the next two rows, and 3 more on the following two rows (the last row, and some
isolated other squares remain uncovered). The desired maximum is 9.
Remark: The more frequently used coloring schemes (chessboard, stripes) will fail
to provide a justification of the fact that more than 9 is impossible.
4. A beetle sits on each square of a 9 × 9 board. At a signal each beetle crawls
diagonally onto a neighboring square. Then it may happen that several beetles
will sit on the same square and none on others. Find the minimal possible number
of free squares.
Solution: Color the columns alternately black and white (”stripes”). We get 45
black and 36 white squares. Every beetle changes the color of its square each time
it crawls. Hence at least 9 black squares remain empty. An example with exactly
9 squares remaining unoccupied is easy to construct.
(Hint: Make 2 × 36 of the beetles swap places according to the pattern shown in
the figure after problem 8.)
11
5. Determine the maximal number of figures
that can be placed in a 6 × 6
grid without overlapping.
Solution: The answer is 4. An obvious example: place two neighboring crosses
so that they cover entirely the second row, then two other crosses that cover row
number 5.
Now, for the evaluation part, note that when placed on the grid, any cross occupies
3 squares of a certain row. This row can not be the first or the last row. Moreover,
if we place two crosses on the same row, there is no place on the previous and on
the next row to place a cross with 3 squares there. So we can place at most 2
crosses on lines 2+3, and at most 2 crosses on rows 4+5. Therefore the maximum
number of crosses can not exceed 4.
Alternatively, for the evaluation part, notice that the corners can not be covered,
and, from the other 4 squares situated on the side, at most 2 can be covered. Therefore we have at least 12 uncovered squares, hence at most 24 covered squares. It
follows that we can use at most 4 crosses.
6. Consider a row of 2n squares colored alternately black and white. A legal move
consists of choosing a contiguous set of squares (one or more squares but they must
be next to each other, no gaps are allowed) and inverting their colors. What is the
minimum number of moves necessary to make the row entirely one color?
Solution: We shall prove that the minimum number of moves is n. It is clear
that in n moves one can make all the squares have a single color (just change the
color of a single black square at a time). In order to prove it is not possible to
obtain a single colored row in less than n moves, notice that if one changes, by a
move, the color of the square no. k, then by the same move he also changes the
color of square no. k − 1, unless the selection of the squares to operate on stops
right there, between squares k − 1 and k. But, initially, squares k − 1 and k have
different colors, and need to have, at the end, the same color, therefore there must
be a move that stops right between k − 1 and k. (This move might operate on
either square k − 1, or square k, but not on both.) There are 2n squares, therefore
2n − 1 ”separators” between two neighboring squares. Each move goes from one
separating place to another (ore uses one or both ends of the row), therefore each
move uses at most 2 separating places. Therefore, we need at least n moves to use
up all the 2n − 1 separating places.
7. Consider an 8 × 8 board. What is the minimum number of
a) 1 × 1 squares,
12
b) 1 × 2 rectangles,
that need to be painted black such that any 2 × 2 square contains at least one
painted 1 × 1 square?
Solution: a) Obviously 16. Divide the board in 16 disjoint 2 × 2 squares. One
needs to paint black at least one unit square from each of these 2 × 2 squares; on
the other hand, painting black all the squares on even rows and even columns is a
valid example of 16 black unit squares that intersect any 2 × 2 square.
b) Consider the 3 non-touching 2 × 2 squares on the top 2 rows, 3 non-touching
2 × 2 squares on the 2 rows in the middle, and 3 non-touching 2 × 2 squares on the
bottom 2 rows. Each of these 9 squares has to contain at least one black square.
On the other hand, the 2 × 1 rectangles intersecting these 9 squares are distinct,
hence we need to paint black at least 9 2 × 1 rectangles.
An example with 9 such rectangles is given below.
8. Consider an 8 × 8 chessboard. In some of the unit squares a diagonal is drawn
such that any two of these diagonals do not have any common points. What is the
maximum number of diagonals that can be drawn?
Solution: Consider the 9 × 9 grid made of the vertices of the unit squares. Color
these vertices by stripes, alternately with red and black, starting with a red stripe.
Any diagonal joins vertices of different color. As there are 36 black vertices and 45
red ones, there can be at most 36 diagonals.
An example with 36 non-intersecting diagonals: number the columns from 1 trough
9, and rows by letters from A trough I. Join vertices A1, A2, A3, A4, A5, A6, A7,
A8, B1, C1, D1, E1, F1, G1, H1 with the vertex situated diagonally to the right
and upwards. This describes an ”L-shape” of 15 diagonals. We continue with these
”L-shapes”. The next one will consist of 11 diagonals, then follows an ”L-shape”
with 7 diagonals and finally one with 3 diagonals. In total, 36 diagonals.
13
9. Consider a 5 × 5 square divided into 25 unit squares. What is the maximum
number of unit squares that can be painted black such that each 2 × 2 square
contains at most two black unit squares? [Moscow Olympiad 1996-7]
Solution: We have an easy example with 15 blacks: simply color the squares in
rows no. 1, 3 and 5.
We prove that if one colors more than 15 squares in black, then there will always be
a 2 × 2 square containing more then two black unit squares. Suppose there are at
least 16 black squares. Grouping the 16 squares on the first 4 rows and 4 columns,
into four 2 × 2 squares, we have that at most 8 of these 16 squares are black (at
most 2 in each of the four squares). Then at least 8 of the remaining 9 squares
have to be black. Considering two cases, when the square on the fifth row and
fifth column is black, and white respectively, we arrive quickly to a contradiction
in both cases.
10. If we write the numbers 1, 2, . . . , n in some order, we will get an n-chain. For
example, one possible 11-chain is 3764581121910. What is the smallest n with
n > 1 such that there exists an n-chain that is a palindrome? (A number is a
palindrome if it may be read the same way in either direction.) [Chech Olympiad,
2012]
Solution: An example of a palindromic 19-chain is 9|18|7|16|5|14|3|12|1|10|11|2|13|4|15|6|17|8|19.
For 1 < n. We will show that 19 is the smallest possible value of n.
First note that only one digit can appear in a palindromic chain for an odd number
of times (namely the middle one). Clearly, for 1 < n ≤ 9 this condition cannot be
satisfied. Similarly, for 10 ≤ n < 19 both digits 0 and 9 appear exactly once, thus
such an n-chain cannot be a palindrome.
14
Practice problems:
1. Determine the largest positive integer n for which there exist n positive integers
greater than 2 such that the sum of any three of them is a prime number.
Solution: Among the n numbers we can neither have three that give the same
remainder when divided by 3, nor three that give three different remainders when
divided by three, or else their sum would be a multiple of 3, larger than 3, hence
not a prime. Therefore the maximum value of n is at most 4 (we can have at most
two types of numbers and at most two of each type).
An example for n = 4: take 3, 5, 11, 15.
2. Each of the unit squares of an n × n square is colored with red, yellow or green.
Find the smallest value of n such that, for every possible coloring, there exist a row
and a column with at least three unit squares of the same color (the same color on
both the row and on the column).
Solution: The desired minimum is 7.
For n = 7, as 49 = 3 · 16 + 1, we have at least 17 unit squares of the same color
(pigeonhole principle for the 3 colors), say red. As 17 = 7 · 2 + 3, there exist a row
and a column with at least 3 red unit squares (pigeonhole principle for the 7 rows
and for the 7 columns). Hence, for n = 7, for any coloring, there exist a row and
a column with at least three unit squares of the same color.
For n = 6, it is possible, for some colorings, not to have both rows and columns with
three squares of the same color on them. Simply color the square (i, j), i, j = 1, 6
with red if i + j ≡ 0 (mod 3), yellow if i + j ≡ 1 (mod 3), and green is i + j ≡ 2
(mod 3). On each row and column there are exactly two squares of the same color,
hence n = 6 is not suitable.
Is this solution complete? Isn’t something missing there?
This solution deliberately contains a typical mistake:
In order to prove that the minimum suitable value is M it is not enough to prove
that M is suitable and M −1 is not. It is possible that M −2 or some other smaller
value is suitable again.
To complete the proof of the problem above, notice that for n < 6 we can extract
from the example given for n = 6 an n × n ”sub-square” which will obviously
provide a convenient example for the fact that any n < 6 is not suitable.
15