Browse · MathNet
Print51st IMO Shortlisted Problems
counting and probability
Problem
On some planet, there are countries . Each country has a flag units wide and one unit high composed of fields of size , each field being either yellow or blue. No two countries have the same flag.
We say that a set of flags is diverse if these flags can be arranged into an square so that all fields on its main diagonal will have the same color. Determine the smallest positive integer such that among any distinct flags, there exist flags forming a diverse set.
We say that a set of flags is diverse if these flags can be arranged into an square so that all fields on its main diagonal will have the same color. Determine the smallest positive integer such that among any distinct flags, there exist flags forming a diverse set.
Solution
When speaking about the diagonal of a square, we will always mean the main diagonal.
Let be the smallest positive integer satisfying the problem condition. First, we show that . Consider the collection of all flags having yellow first squares and blue second ones. Obviously, both colors appear on the diagonal of each square formed by these flags.
We are left to show that , thus obtaining the desired answer. We start with establishing this statement for .
Suppose that we have 5 flags of length 4. We decompose each flag into two parts of 2 squares each; thereby, we denote each flag as , where the flags are its left and right parts, respectively. First, we make two easy observations on the flags which can be checked manually.
(i) For each , there exists only one flag (possibly ) such that and cannot form a square with monochrome diagonal (for part BB, that is YY, and for BY that is YB).
(ii) Let be three distinct elements; then two of them can form a square with yellow diagonal, and two of them can form a square with blue diagonal (for all parts but BB, a pair (BY, YB) fits for both statements, while for all parts but BY, these pairs are and ).
Now, let and be the numbers of distinct left and right parts of our 5 flags, respectively. The total number of flags is , hence one of the factors (say, ) should be at least 3. On the other hand, , so there are two flags with coinciding right part; let them be and ().
Next, since , there exist some flags and such that are distinct. Let be the remaining flag. By (i), one of the pairs (, ) and (, ) can form a square with monochrome diagonal; we can assume that , form a square with a blue diagonal. Finally, the right parts of two of the flags can also form a square with a blue diagonal by (ii). Putting these squares on the diagonal of a square, we find a desired arrangement of four flags.
We are ready to prove the problem statement by induction on ; actually, above we have proved the base case . For the induction step, assume that , consider any flags of length , and arrange them into a large flag of size . This flag contains a non-monochrome column since the flags are distinct; we may assume that this column is the first one. By the pigeonhole principle, this column contains at least squares of one color (say, blue). We call the flags with a blue first square good.
Consider all the good flags and remove the first square from each of them. We obtain at least flags of length ; by the induction hypothesis, of them can form a square with the monochrome diagonal. Now, returning the removed squares, we obtain a rectangle , and our aim is to supplement it on the top by one more flag.
If has a yellow diagonal, then we can take each flag with a yellow first square (it exists by a choice of the first column; moreover, it is not used in ). Conversely, if the diagonal of is blue then we can take any of the remaining good flags. So, in both cases we get a desired square.
---
Alternative solution.
We present a different proof of the estimate . We do not use the induction, involving Hall's lemma on matchings instead.
Consider arbitrary distinct flags and arrange them into a large flag. Construct two bipartite graphs and with the common set of vertices as follows. Let and be the set of columns and the set of flags under consideration, respectively. Next, let the edge appear in if the intersection of column and flag is yellow, and otherwise. Then we have to prove exactly that one of the graphs and contains a matching with all the vertices of involved.
Assume that these matchings do not exist. By Hall's lemma, it means that there exist two sets of columns such that and (in the left-hand sides, and denote respectively the sets of all vertices connected to and in the corresponding graphs). Our aim is to prove that this is impossible. Note that since .
First, suppose that , so there exists some . Note that each flag is connected to either in or in , hence . Hence we have ; this is impossible for .
So, we have . Let . From the construction of our graph, we have that all the flags in the set have blue squares in the columns of and yellow squares in the columns of . Hence the only undetermined positions in these flags are the remaining ones, so , or, denoting , . This is impossible since .
Let be the smallest positive integer satisfying the problem condition. First, we show that . Consider the collection of all flags having yellow first squares and blue second ones. Obviously, both colors appear on the diagonal of each square formed by these flags.
We are left to show that , thus obtaining the desired answer. We start with establishing this statement for .
Suppose that we have 5 flags of length 4. We decompose each flag into two parts of 2 squares each; thereby, we denote each flag as , where the flags are its left and right parts, respectively. First, we make two easy observations on the flags which can be checked manually.
(i) For each , there exists only one flag (possibly ) such that and cannot form a square with monochrome diagonal (for part BB, that is YY, and for BY that is YB).
(ii) Let be three distinct elements; then two of them can form a square with yellow diagonal, and two of them can form a square with blue diagonal (for all parts but BB, a pair (BY, YB) fits for both statements, while for all parts but BY, these pairs are and ).
Now, let and be the numbers of distinct left and right parts of our 5 flags, respectively. The total number of flags is , hence one of the factors (say, ) should be at least 3. On the other hand, , so there are two flags with coinciding right part; let them be and ().
Next, since , there exist some flags and such that are distinct. Let be the remaining flag. By (i), one of the pairs (, ) and (, ) can form a square with monochrome diagonal; we can assume that , form a square with a blue diagonal. Finally, the right parts of two of the flags can also form a square with a blue diagonal by (ii). Putting these squares on the diagonal of a square, we find a desired arrangement of four flags.
We are ready to prove the problem statement by induction on ; actually, above we have proved the base case . For the induction step, assume that , consider any flags of length , and arrange them into a large flag of size . This flag contains a non-monochrome column since the flags are distinct; we may assume that this column is the first one. By the pigeonhole principle, this column contains at least squares of one color (say, blue). We call the flags with a blue first square good.
Consider all the good flags and remove the first square from each of them. We obtain at least flags of length ; by the induction hypothesis, of them can form a square with the monochrome diagonal. Now, returning the removed squares, we obtain a rectangle , and our aim is to supplement it on the top by one more flag.
If has a yellow diagonal, then we can take each flag with a yellow first square (it exists by a choice of the first column; moreover, it is not used in ). Conversely, if the diagonal of is blue then we can take any of the remaining good flags. So, in both cases we get a desired square.
---
Alternative solution.
We present a different proof of the estimate . We do not use the induction, involving Hall's lemma on matchings instead.
Consider arbitrary distinct flags and arrange them into a large flag. Construct two bipartite graphs and with the common set of vertices as follows. Let and be the set of columns and the set of flags under consideration, respectively. Next, let the edge appear in if the intersection of column and flag is yellow, and otherwise. Then we have to prove exactly that one of the graphs and contains a matching with all the vertices of involved.
Assume that these matchings do not exist. By Hall's lemma, it means that there exist two sets of columns such that and (in the left-hand sides, and denote respectively the sets of all vertices connected to and in the corresponding graphs). Our aim is to prove that this is impossible. Note that since .
First, suppose that , so there exists some . Note that each flag is connected to either in or in , hence . Hence we have ; this is impossible for .
So, we have . Let . From the construction of our graph, we have that all the flags in the set have blue squares in the columns of and yellow squares in the columns of . Hence the only undetermined positions in these flags are the remaining ones, so , or, denoting , . This is impossible since .
Final answer
2^{N-2}+1
Techniques
Pigeonhole principleInduction / smoothingColoring schemes, extremal argumentsMatchings, Marriage Lemma, Tutte's theorem