Maths Olympiad Prep

Library / /44 of 86

Combinatorics Difficulty 6.8 National Olympiad Prove it United States

Problem:

Consider a rectangular array of single digits di,jd_{i, j} with 10 rows and 7 columns, such that di+1,jdi,jd_{i+1, j}-d_{i, j} is always 1 or -9 for all 1i91 \leq i \leq 9 and all 1j71 \leq j \leq 7, as in the example below. For 1i101 \leq i \leq 10, let mim_{i} be the median of di,1,,di,7d_{i, 1}, \ldots, d_{i, 7}. Determine the least and greatest possible values of the mean of m1,m2,,m10m_{1}, m_{2}, \ldots, m_{10}.

Example:

di,1d_{i, 1}di,2d_{i, 2}di,3d_{i, 3}di,4d_{i, 4}di,5d_{i, 5}di,6d_{i, 6}di,7d_{i, 7}mim_{i}
i=1i=12759586median is 6
i=2i=23860697median is 6
i=3i=34971708median is 7
i=4i=45082819median is 5
i=5i=56193920median is 3
i=6i=67204031median is 2
i=7i=78315142median is 3
i=8i=89426253median is 4
i=9i=90537364median is 4
i=10i=101648475median is 5

Solutions — 2

Solution 1

Solution:

Note that rearranging the columns does not change the medians, hence we may sort the first row, so that d1,1d1,2d1,7d_{1,1} \leq d_{1,2} \leq \ldots \leq d_{1,7}. The calculations are much simplified if we subtract i1i-1 from each row. In other words, we put Di,j=di,j(i1)D_{i, j}=d_{i, j}-(i-1). This subtracts i1i-1 from the median mim_{i} as well - that is if MiM_{i} is the median of Di,jD_{i, j}'s, then Mi=mi(i1)M_{i}=m_{i}-(i-1). Thus the sum of the MiM_{i}'s is equal to the sum of the mim_{i}'s minus 0+1+2++9=450+1+2+\ldots+9=45. We shall show that sum of MiM_{i}'s is 0, so that the sum of the mim_{i}'s is 45 and the average is always 4.5.

Note that since D1,1D1,2D1,7D_{1,1} \leq D_{1,2} \leq \ldots \leq D_{1,7} the entry D1,4D_{1,4} is a median. The fourth column will continue to contain a median until di,7=0d_{i, 7}=0 (at which point the third column will contain a median), that is 10D1,710-D_{1,7} times (note that d1,7=D1,7d_{1,7}=D_{1,7}). The sum of those medians is then equal D1,4(10D1,7)D_{1,4}(10-D_{1,7}). After that, median moves to the third column and stays there until di,6=0d_{i, 6}=0 (this may be no time at all, if d1,6=d1,7d_{1,6}=d_{1,7}, but that will not affect the calculation). The contribution of those medians is D1,3(D1,7D1,6)D_{1,3}(D_{1,7}-D_{1,6}). Continuing this way we see that the medians in the second column contribute D1,2(D1,6D1,5)D_{1,2}(D_{1,6}-D_{1,5}) and ones in the first column D1,1(D1,5D1,4)D_{1,1}(D_{1,5}-D_{1,4}). A median then moves to the seventh column, but by that point its value has dropped, Di,7=D1,710D_{i, 7}=D_{1,7}-10. The contribution of those medians is then (D1,710)(D1,4D1,3)(D_{1,7}-10)(D_{1,4}-D_{1,3}). Similarly for those in sixth and fifth columns we get (D1,610)(D1,3D1,2)(D_{1,6}-10)(D_{1,3}-D_{1,2}) and (D1,510)(D1,2D1,1)(D_{1,5}-10)(D_{1,2}-D_{1,1}). Finally the median moves to the fourth column again, staying there remaining D1,1D_{1,1} times, contributing (D1,410)D1,1(D_{1,4}-10) D_{1,1}. Overall, the sum of all medians is thus
D1,4(10D1,7)+D1,3(D1,7D1,6)+D1,2(D1,6D1,5)+D1,1(D1,5D1,4)+(D1,710)(D1,4D1,3)+(D1,610)(D1,3D1,2)+(D1,510)(D1,2D1,1)+(D1,410)D1,1. \begin{array}{r} D_{1,4}(10-D_{1,7})+D_{1,3}(D_{1,7}-D_{1,6})+D_{1,2}(D_{1,6}-D_{1,5})+ \\ D_{1,1}(D_{1,5}-D_{1,4})+(D_{1,7}-10)(D_{1,4}-D_{1,3})+(D_{1,6}-10)(D_{1,3}-D_{1,2}) \\ +(D_{1,5}-10)(D_{1,2}-D_{1,1})+(D_{1,4}-10) D_{1,1} . \end{array}
It is fairly easy to see that this expression is in fact equal to 0 (for example, by considering the linear and quadratic terms separately). This means that the sum of new medians MiM_{i} is zero, and the sum of the original mim_{i}'s is 45, as wanted.

Solution 2

Solution:

We will prove a stronger claim: for all aa, the number of mim_{i}'s equal to aa equals the number of mim_{i}'s equal to 9a9-a. (By a pairing argument, this implies that the average of the mim_{i}'s is 9/29 / 2.) Indeed, for 1j101 \leq j \leq 10 let Mi,jM_{i, j} denote the jjth smallest entry in row ii of the table (so that mi=Mi,4m_{i}=M_{i, 4}); we will show that for all aa and jj, the number of Mi,jM_{i, j}'s equal to aa equals the number of Mi,8jM_{i, 8-j}'s equal to 9a9-a.

Henceforth, all row-indices are to be interpreted modulo 10, and "between" is meant in the inclusive sense.

It follows from the defining property of the table that for all ii between 1 and 10, all aa between 0 and 9, and all kk between 0 and aa, the number of kk's in row ii equals the number of k+ak+a's in row i+ai+a. Replacing aa by 9a9-a, and summing over all kk between 0 and aa, we find that the number of entries between 0 and aa in row ii equals the number of entries between 9a9-a and 9 in row i+9ai+9-a. Hence for all jj, the number of entries between 0 and aa in row ii is greater than or equal to jj if and only if the number of entries between 9a9-a and 9 in row i+9ai+9-a is greater than or equal to jj. But this means that the jj smallest entries in row ii are all between 0 and aa if and only if the jj largest entries in row i+9ai+9-a are all between 9a9-a and 9. That is, Mi,jaM_{i, j} \leq a if and only if Mi+9a,8j9aM_{i+9-a, 8-j} \geq 9-a. Replacing aa by a1a-1, we see also that Mi,ja1M_{i, j} \leq a-1 if and only if Mi+10a,8j10aM_{i+10-a, 8-j} \geq 10-a. Combining the last two facts, we conclude that Mi,j=aM_{i, j}=a if and only if Mi+10a,8j=9aM_{i+10-a, 8-j}=9-a. Summing over ii (and noting that i+10ai+10-a varies over 0,1,,9mod100,1, \ldots, 9 \bmod 10 as ii does), we see that the number of ii's with Mi,j=aM_{i, j}=a equals the number of ii's with Mi,8j=9aM_{i, 8-j}=9-a, as was claimed above.

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.