A cake has the form of an n x n square composed of n2 unit squares. Strawberries lie on some of the unit squares so that each row or column contains exactly one strawberry; call this arrangement A. Let B be another such arrangement. Suppose that every grid rectangle with one vertex at the top left corner of the cake contains no fewer strawberries of arrangement B than of arrangement A. Prove that arrangement B can be obtained from A by performing a number of switches, defined as follows: A switch consists in selecting a grid rectangle with only two strawberries, situated at its top right corner and bottom left corner, and moving these two strawberries to the other two corners of that rectangle.
Problem
Source: IMO Shortlist 2006, Combinatorics 4, AIMO 2007, TST 4, P2
Tags: matrix, combinatorics, Partial Orders, IMO Shortlist
03.07.2007 16:55
Let's change the condition to an analogous one: every grid rectangle with one vertex at the bottom right corner contains no fewer strawberries from A than B. We must prove we bring A to B by some switches. Write P≤Q if every grid rectangle with one vertex at the bottom right corner contains no fewer strawberries from Q than P. Then B≤A. We prove that we can perform a switch such that A goes to C and B≤C and C<A. We cannot perform infinitely many switches and thus we will end up with the arrangement B of strawberries. Let's place x instead of a strawberry on arrangement A and an o instead of a strawberry on arrangement B. If x coincides with o we can remove the row and column containing them and reason by induction. Note that if we have a rectangle MNPQ with M the lower-left corner and x in M,P then we can perform a switch in this rectangle unless there exists a point K inside it (not on sides NP,PQ) such that the rectangle with one corner in K and one in the bottom-left corner contains the same number of x and o. Assume now that we cannot do any switch. We shall pick up a point K containing an x with the following property: the o in the row of K is to the left of x and every x or o found in the row below K. We prove that from each K we may find a point K′ with the same property above K. This will yield a contradiction, as we must stop. Note that to begin we just take the x in the bottom row. Let O be the lower-left corner. Pick up now such a point K. Assume there is an o in the point L to the right of K. Then the rectangle R cornered in O and with height n and ending in the column of L must contain the same number of x as o. It is easy to conclude from the property of K that there exists an o which is single in his row of rectangle R, and it is above K. Let it be the bottom one with this property. Say o is in point J. Then the x in its row is to the right of L. Say it is in point H. We cannot exchange K and H. This means we can find a point Z inside the rectangle cornered in K and H such that the rectangle cornered in O and Z contains an equal number of x and o. If this rectangle does not contain L we might again choose an o such that its row does not contain x and thus repeat the step, only this time we will go down a row. So we cannot repeat this step indefinitely. Thus we can assume that the rectangle cornered in O and Z contains L. Let's then take the subrectangle of it whose top row contains K. Start increasing the height of the rectangle. If we add an x and no o, then the position x will be the desired position above x. Thus we can add x and o or just an o. If we would add an o, we would contradict the assumption that B<A. Thus we add an x and an o or no x and no o. If we add no x and no o it means the x and o in this row are farther to the right. Then x is to the left of o otherwise we would not have B<A so we can take x as the position we seek. So we add x and o every time. This is possible of course only then the rectangle has n columns. But this is impossible, as the rectangle cornered in Z must have stricly less columns than the rectangle cornered in H, so less than n. Contradiction. QED
10.12.2007 04:18
Some background to this problem for those who are interested: This setup given the problems gives a partial order on the symmetric group Sn (the set of permutation of n elements). This is in fact a well known order called the Bruhat order, which can be defined in general for Coxeter groups. The problem, then, is equivalent to a classic criterion for comparing two permutations in the Bruhat order of the symmetric group. For more information, see Combinatorics of Coxeter Groups by Björner and Brenti (in particular, the criterion appears as Theorem 2.1.5)
10.12.2007 15:45
Someone's been doing his homework for Stanley's class . (Unlike me ... bother!)
25.10.2011 02:05
Sorry if this is just equivalent to the stuff above, but... Define the permutations σA and σB so that the strawberries in A lie in squares (i,σA(i)) and those in B lie in squares (i,σB(i)) (for 1≤i≤n). (We use the matrix convention here for coordinates. Edit for clarification: (x,y) is in the xth row and yth column, where (1,1) is the upper left corner.) Let [m]={1,2,…,m} for positive integers m. Noting that we can only perform finitely many operations on A (the first row can only be finitely operated on, so after the first has been used up the second can only be finitely operated on, etc.), consider the following algorithm: 1. If σA(i)≥σB(i) for 1≤i≤n, then σA=σB⟹A=B, so stop. Otherwise, take the smallest 1≤k≤n such that σB(k)>σA(k). 2. Because σB(k)>σA(k), the rectangle [k]×[σA(k)], which contains at least as many strawberries in B as in A, must contain some (j,σB(j)) (where 1≤j≤k−1) such that σB(j)≤σA(k)<σA(j) (by the minimality of k, σB(i)≤σA(i) for all 1≤i≤k−1, so we need at least one i to negate the effects of σB(k)>σA(k)). 3. We can now go back to step 1 with σA′=σA(jk), since each rectangle with a vertex at (1,1) contains at least as many strawberries in B as in A′. Indeed, suppose to the contrary that there exists a rectangle [u]×[v] that contains more strawberries in A′ than in B. Since we simply moved strawberries from (j,σA(j)),(k,σA(k)) to (j,σA(k)),(k,σA(j)), we cannot have u∉[j,k) or v∉[σA(k),σA(j))=[σA(k),σA′(k))=[σA′(j),σA(j)) or else A′ and A have the same number of strawberries in [u]×[v] (i.e. either neither exchange matters in the first place, or the exchanges cancel out), which is of course no more than the number B has. On the other hand, if j≤u<k and σA(k)≤v<σA(j), then by the minimality of k (for all 1≤r≤k−1, |A∩{r}×[v]|≤|B∩{r}×[v]| since σA(r)≥σB(r)) and the fact that σB(j)≤σA(k)=σA′(j)<σA(j)≤v, 0<|A′∩[u]×[v]|−|B∩[u]×[v]|=u∑r=1|A′∩{r}×[v]|−|B∩{r}×[v]|=|A′∩{j}×[v]|−|B∩{j}×[v]|+∑1≤r≠j≤u|A∩{r}×[v]|−|B∩{r}×[v]|≤|A′∩{j}×[v]|−|B∩{j}×[v]|=1−1=0,a contradiction. Because the algorithm cannot go on forever (as noted above, we can only perform finitely many operations on A), we're done.
31.12.2011 01:04
math154 wrote: the rectangle [k]\times[\sigma_A(k)], which contains at least as many strawberries in B as in A, must contain some (j,\sigma_B(j)) (where 1\le j\le k-1) such that \sigma_B(j)\le \sigma_A(k)<\sigma_A(j) (by the minimality of k, \sigma_B(i)\le \sigma_A(i) for all 1\le i\le k-1, so we need at least one i to negate the effects of \sigma_B(k)>\sigma_A(k)). It might just be me reading this incorrectly, but isn't σA(k)>σA(j) necessary for a switch to occur if k>j?
29.03.2017 22:28
I think this is slightly different: Let row number i counted from the bottom have height i. Given an arrangement C, we define the height of each column as the height of the row that the strawberry in that column lies in. For example, if strawberries cover the bottom left-top right diagonal, the columns read from left to right have heights 1,2,3,…,n respectively. If we label the columns from left to right as 1,2,3,…,n, we see that the allowed operation is equivalent to exchanging two columns, where the first one has lower height than the second, and such that there are no strawberries in the rectangled formed by the strawberries. We now show that you can place the columns in the correct place one by one: Take the first column in B, with height h. If the first column in A also has height h - then great, we can go on to the next column in B. If not, there is some column i>1 in A with height h. We want to move this to the first column by using the operation: If column i−1 in A has lower height than column i, we can just swap these two columns. If the height of i−1 is greater than that of i, we consider column i−2 (in A), and then i−3,i−4 and so on, until we find a column k<i with height smaller than i (why is this guaranteed to happen? ). Then we can just swap columns i and k since there are no strawberries inside the rectangle their strawberries form. Repeat until we have brought the column that was in position i to the first position. Now just apply the same algorithm to the second column in B, and so on, until we have made A into B.
21.09.2017 21:24
We proceed by induction on n, the base case n=1 being trivial. Call a rectangle good if it's top left vertex corresponds to the top left vertex of the cake, and say a cake X majorizes Y if every good rectangle in X has at least many strawberries as in Y. Let the strawberry in the first column of A have coordinate yA, and define yB similarly. Assuming that coordinates increase from left to right and from down to up, it is evident that yB≥yA, since otherwise the 1×yA good rectangle in B contains no strawberries while the one in A does. If yA=yB, we may simply remove the first column and row yA and finish by the inductive hypothesis in the remaining n−1×n−1 matrix. The premises still hold, as each row/column has exactly one strawberry and every good rectangle in B still majorizes its counterpart in A (the strawberry in the removed row/column is in both good rectangles or neither). Now assume yA<yB. Consider the rectangle with corners (1,yA),(n,yB) and the following algorithm: - Let (x,yC) be a strawberry such that yA<yC≤yB and x is minimal. - Perform a switch on (1,yA),(x,yC). Now the strawberry in the first column is at (1,yC). - Repeat in the rectangle with corners (1,yC),(n,yB). Clearly such a strawberry (x,yC) exists since there must be a strawberry in every row + well ordering principle. Furthermore, by minimality of x, there is no strawberry in the rectangle with corners (1,yA),(x,yC). Thus a switch is always possible. Finally, this algorithm clearly terminates, as {yC}i is an increasing sequence bounded by yB. We have shown that this algorithm successfully moves the strawberry in the first column to its desired location in B. Let A′ be the resulting cake after this algorithm. It remains to show that the matrix obtained by removing column 1 and row yB in A′ is majorized by its counterpart in B by the inductive hypothesis. Evidently, majorization is transitive. Thus, since B majorizes A after deletion, it suffices to show that A majorizes A′ after deletion. Indeed, note that the y coordinate of an arbitrary strawberry that undergoes a switch can only decrease in the new configuration, which can, in turn, only decrease the number of strawberries in each good rectangle. We may now conclude.
11.11.2017 23:37
I am not sure but I think that there exist a stronger problem.We have a matrix A n*n and we have 0,1,-1.We know that in every line and column is a uniquely 1,-1.A switch is defined as permutation of 2 lines or columns.Prove that we can make finitely switches such as we arrive at a matrix -A. Sorry for bad English.
12.11.2017 11:45
Solution : Consider the smallest (on inclusion) grid rectangle P with one vertex on the top left corner and such that the number of strawberries in P of B > then number of strawberries in P of A. So easy to check that there is a strawberrie in the bottom right vertex of P in B and no such strawberry in A. Now there exist and a unique switch of A such that a resulting matrix A′ will have a strawberry in the bottom right vertex of P. Not hard to check that A<A′≤B. So reapiting this procedure we finally will get matrix B. Done
13.11.2017 16:43
I think that in my proof we also need to use next Lemma : A cake has the form of an n x n square composed of n2 unit squares. Strawberries lie on some of the unit squares so that each row or column contains exactly one strawberry; call this arrangement A. A switch of type 1 consists in selecting a grid rectangle with only two strawberries, situated at its top right corner and bottom left corner, and moving these two strawberries to the other two corners of that rectangle. Also define a switch of type type 2 that consists in selecting a grid rectangle with two strawberries (maybe not unique), situated at its top right corner and bottom left corner, and moving these two strawberries to the other two corners of that rectangle. Then for any switch σ of type 2 there exist some switches σ1,…,σk of type 1 so that σ=σ1σ2…σk.
01.04.2018 06:44
Put A's and B's in an n×n table to represent the locations of the strawberries. Note that if a cell contains both A and B, we can remove the row and column it is in and induct down. Hence, suppose that every cell contains at most one letter. We will describe a series of switches that will bring the A in the first column to the B in the first column, after which we may remove these strawberries and their row and column and induct down. Number the rows and columns from 1 to n, with (1,1) at the top left corner. Suppose that the A and B in the first column are at (i,1) and (j,1). By plugging in a cell (x,y), we mean to check the condition that the rectangle with top left (1,1) and bottom right (x,y) has at least as many B's as A's. Plugging in (i,1), tells us that i>j. Define the shortcake zone of the cake as the cells (x,y) with j≤x<i. Let (p,q) be a cell labeled with an A in the shortcake zone with q minimal. Then, we claim that performing a switch on (i,1) and (p,q) preserves the condition in the problem statement. Notably, any such switch decreases the size of the shortcake zone, so we eventually get A and B to coincide, as desired. Now, let's prove the claim. Consider the function f:{1,2,…,n}2→Z≥0 with f(x,y) defined as the number of B's minus the number of A's in the rectangle with top left corner (1,1) and bottom right corner (x,y). Performing a switch on (u1,v1) and (u2,v2) with u1>u2 and v1<v2 decrements f(x,y) by 1 if u2≤x<u1 and v1≤y<v2 and does not change f(x,y) otherwise. The condition is equivalent to f(x,y)≥0 for all (x,y), so it suffices to show that f(x,y)≥1 for all i≤x<p and 1≤y<q. Suppose that f(x,y)=0 for some x,y in those intervals. In the first column of the rectangle with top left (1,1) and bottom right (x,y), there is one B. Hence, in order for f(x,y)=0, there must be some column in the rectangle with an A. This A cannot be in the shortcake zone, as that contradicts the minimality of q. Hence, there is at least one row above the shortcake zone. Now, let's check the condition for (i−1,y). We lose at least one B going from the (x,y) rectangle to the (i−1,y) rectangle, namely (i,1). But we only lose cells in a part of the shortcake zone which by assumption has no A's, so f(i−1,y)<0, contradiction. Hence, our algorithm works and we can match our strawberries.
23.04.2018 15:31
Please check my solution (This is most probably similar to the solution of Stens or G_U)
24.04.2019 05:01
First, we will represent each cake as a sequence of n numbers, such that the ith number represents the row in which the strawberry at column i is in. Let the sequences of A and B be SA and SB respectively. The precondition of the problem implies that the jth smallest number of the first i numbers in SA is no less than that in SB, for all 1≤i≤n and 1≤j≤i. Furthermore, a swap can be interpreted as interchanging two originally inverted elements of SA, as long as there exists no numbers between them which are numerically between them as well. This implies that we can swap two consecutive elements which are originally inverted - a move which we will refer to as bubbling. Finally, note that swapping preserves the precondition. Now, as the validity of the problem's statement only depends on the relative magnitudes of the numbers in the sequence, we can actually induct on n. Our base case of n=1 is trivial, so go immediately to the inductive step. Suppose that 1 is at position a1 in SA and b1 in SB. Now, by the precondition applied at i=a1, note that b1≤a1, so we can just bubble 1 up in SA to get it to the correct location. Now, as 1 is in the correct position after the bubbling, there is no need to move it anymore. Also, there are no remaining elements which define intervals which include 1, so we can effectively ignore it for the remaining swaps. Finally, note that if we ignore the 1 in both sequences, the remaining sequences of size n−1 still satisfy the precondition, so we can use the inductive hypothesis to swap the remaining elements to be in the same order as SB, as desired.
01.07.2021 15:23
Let the coordinate of the top left, top right, bottom left corner be (1,1),(1,n),(n,1) respectively. Let the coordinates of the strawberries in A be (1,a1),(2,a2),...,(n,an) and the coordinates of the strawberries in B be (1,b1),(2,b2),...,(n,bn). For any numbers x1,x2,...,xj and i≤j we let mini{x1,x2,...,xj} be the ith smallest number among them. Notice that mini{a1,...,aj}≥mini{b1,...,bj}(1)for all 1≤i≤j≤n. Otherwise we can pick the rectangle with opposite vertices (1,1),(j,mini{a1,...,aj}), it contains i strawberries in A but at most i−1 strawberries in B, contradiction. Moreover, notice that the switching condition just means switching am1,am2 where am1<am2 and m1>m2. We will prove by induction on n that every two permutations a1,...,an and b1,...,bn of a set {x1,...,xn} satisfying (1), will satisfy the condition stated, that is (b1,...,bn) can be obtained from (a1,...,an) through switching. Indeed, obviously a1≥b1. Let k be the smallest indices such that ak<bk. Now suppose ak is the pth smallest number among a1,...,ak. Let A1={mini{a1,...,ak}:i>p}and A2={mini{a1,...,ak}:i≤p}define B1,B2 similarly. Now, notice that bk∈B1, therefore by pigeonhole principle there exists some j such that aj∈A1 while bj∈B2. We swap ak and aj. Let the sequence be c1,...,cn. Claim. (1) still holds for the new sequence, that is mini{c1,...,cm}≥mini{b1,...,bm}for all 1≤i≤m≤n Proof. Notice that {c1,...,cm}={a1,...,am} unless k≤m<j. If k≤m<j then notice that aq≥bq for all 1≤q≤m, so it is obvious. ◼ Therefore, we can continue to carry out this procedure, it is easy to see that it must end, and in that situation, the two sequences must be equal, so we are done.
01.07.2021 18:17
Impose a coordinate system on the cake, with the top left corner square being (1,1), the bottom left being (1,n) and the top right being (n,1). Refer to a rectangle with one vertex at the top left corner and the bottom right corner at the bottom right corner of square (x,y) the "(x,y)-rectangle". Now consider the position of the strawberry in each column in A and B. Call a strawberry an "up-berry" if the position in B is higher than A, a "down-berry" if the position is lower, and a "stay-berry" if the position is the same. Now, I will present an algorithm for decreasing the number of down-berries, supposing that at least one exists. Suppose there exists some down-berry S (for strawberry) that is at (x,a) in A and (x,b) in B, with b>a. By considering the (x,a)-rectangle and the (x,a−1)-rectangle, it follows that there exists some up-berry to the left of S that goes from (x1,a1) in A and (x1,b1) for B, where a1≤b and b1≥a. If b1<a, by considering the (x,b1)-rectangle and (x,b1−1)-rectangle, it then follows that there exists some up-berry located in a column to the left of x1 that goes from (x2,a2) to (x2,b2) with a2≤b1 and b2>b1. Repeating this, we can come up with some sequence s1,s2,…,sk of up-berries (x1,a1)→(x1,b1),(x2,a2)→(x2,b2),…,(xk,ak)→(xk,bk)such that a1≤b,b1≥a,x1<x and for 1<n≤k, we have an≤bn−1, bn>bn−1, and xn<xn−1. Then we can perform the swapping operation on s1,s2, s2,s3, and so on until we swap sk−1 and sk. Then we swap sk and the down-berry S. By the inequality chain, all these operations are legal, and in the resulting cake s1,s2,…,sk remain up-berries whereas S becomes either an up-berry or a stay-berry. This concludes the algorithm. Now note that if there are no down-berries, there are clearly no up-berries either (since the sum of the "movements" up and down between A and B must be zero), so once we run the above algorithm enough times to arrive at no down-berries, there will be no up-berries either and we will have reached B from A. ◼ This writeup is kinda bad because I rushed it. I don't think all of my inequalities are right but I'm too lazy to check. Hopefully you get the idea.
19.04.2022 19:37
Mosquitall wrote: I think that in my proof we also need to use next Lemma : A cake has the form of an n x n square composed of n2 unit squares. Strawberries lie on some of the unit squares so that each row or column contains exactly one strawberry; call this arrangement A. A switch of type 1 consists in selecting a grid rectangle with only two strawberries, situated at its top right corner and bottom left corner, and moving these two strawberries to the other two corners of that rectangle. Also define a switch of type type 2 that consists in selecting a grid rectangle with two strawberries (maybe not unique), situated at its top right corner and bottom left corner, and moving these two strawberries to the other two corners of that rectangle. Then for any switch σ of type 2 there exist some switches σ1,…,σk of type 1 so that σ=σ1σ2…σk. After we have this we can put the strawberry in the first row in it's correct position and induct down.
01.06.2023 03:39
There is a bijection from strawberry arrangements to permutations of [n]. We biject in the following manner: Let σi be one more than the number of cake squares above the strawberry on the ith column from the left. For example, in the following arrangement, σ=(σ1,σ2,σ3,σ4) is (4,1,2,3). Call σ the characteristic permutation of the arrangement. Let σ(A),σ(B) denote the characteristic permutations of A and B, and let σi(A) be the ith term of that sequence. Let fC(x,y) where 1≤x,y≤n and C is a strawberry arrangement be the number of strawberries in the rectangle that is x long and y tall. We see that fC(x,y) is the number of values i≤x such that σi(C)≤y. Suppose for some i that M=max(σ1(A),σ2(A),…,σi(A))<max(σ1(B),σ2(B),…,σi(B))then fB(i,M)≤i−1 because there's at least one that's greater than M, and fA(i,M)=i. This is a contradiction since the x by y rectangle then contains less strawberries of B than A. Therefore, we have max(σ1(A),σ2(A),…,σi(A))≥max(σ1(B),σ2(B),…,σi(B))for all i. A switch is taking two indices i≤j such that ωi≥ωj and switching the values ωi and ωj. We claim that the above condition is sufficient to show that from ω(A) we can reach ω(B) from a series of such switches. We proceed by induction on n. Clearly, the result is true for n=1. If there exists i such that ωi(A)=ωi(B) then we can ignore the index i and subtract 1 from each index j>i and subtract 1 from each value x>ωi(A) and we are done by the induction hypothesis. Otherwise, there are no fixed points from ωi(A) to ωi(B). We have ω1(A)>ω1(B) so we can switch ω1(A) and ω1(B) in ω1(A). The condition is still fulfilled since ωi(A) only increases for i≥2 and there is a fixed point. We are done.