We write $1$ or $-1$ on each unit square of a $2007 \times 2007$ board. Find the number of writings such that for every square on the board the absolute value of the sum of numbers on the square is less then or equal to $1$.
Problem
Source: turkey 2007 TST
Tags: linear algebra, matrix, LaTeX, induction, absolute value, combinatorics proposed, combinatorics
20.04.2007 09:55
The absolute value of the sum of numbers on the square??? What do you mean?
20.04.2007 11:50
i think s/he means the sum of the numbers on each square that can be formed using the unit squares.
21.04.2007 23:53
nayel is right.if somebody posts a solution i will be happy.
22.04.2007 02:30
Solution outline. First of all, we can number them like a checkerboard, so that gives us two solutions. Now suppose it is not a checkerboard, then there are two squares, say (m, n) (row m, column n) and (m, n+1), such that they have the same number. But considering the 2x2 square formed by these two squares and (m+1, n) and (m+1, n+1), we know that (m+1, n) and (m+1, n+1) must both be -1 times the number in (m, n) and (m, n+1). Proceeding this way, we have that (k, n) has the same number as (m, n) iff $k \equiv m \mod 2$, and same with (k, n+1) and (m, n+1). Notice then that if two vertically adjacent squares were of the same color, we would have the same pattern going horizontally, which is impossible. Hence every column has alternating 1's and -1's. Now consider the first row, which uniquely determines the rest of the grid. Note that any big square with odd side length that contains some squares in the first row will have a sum equal to the sum of the numbers in the first row which it contains. Thus any odd block of squares from the first row sums to 1 or -1. This condition gives us something which can be calculated in various ways... I believe that one way you can do it is to equate it with twice the number of subsets of 1003, giving us $2^{1004}$.
22.04.2007 20:11
i dont think that all first rows satisfies conditions.(for example if first row is all 1 look at the top 3x3 squares.)
24.01.2013 17:35
Let S be set of 2007x2007 boards satisfying problem 's conditions, $S_{c} = \{ A \in S \mid $ no column of A contains adjacent and equal elements $\}$ and $S_{r} = \{ A \in S \mid $ no row of A contains adjacent and equal elements $\}$ Lemma 1: There is no index i such that $ a_{1i} = a_{1(i+1)} = a_{1(i+2)}$ or $a_{i1} = a_{(i+1)1} = a_{(i+2)1}$ Proof: If such index exist, we could find a 3x3 square where absolute value of the sum of elements is greater than 1 Lemma 2: There are no indices (i, j) such that $a_{1i} = a_{1(i+1)}$ and $a_{j1} = a_{(j+1)1}$ Proof: We could prove that if such i,j exists, then there is conflict in term of value in 2x2 square whose top left corner is at (i,j) Lemma 3: For any 2007x2007 board in S, then no column or no row contains adjacent numbers who are equal to each other Proof: Lemma 2 yields that the first column or the first row does not contain adjacent and equal numbers. Then, using the remark that sum of 4 numbers in any 2x2 square is zero, we could prove the lemma 3. Lemma 4: Let $W = \{(w_{1}, w_{2},\dots, w_{2007}) \mid w_{i} \in \{-1, 1\}$ and no three consecutive elements are equal $\}$. Then we have $\left|{S_{c}}\right| = \left|{W}\right| = \left|{S_{r}}\right|$ Proof: Consider the mapping $ (w_{1}, w_{2},\ldots, w_{2007}) \to \begin{pmatrix} w_{1} & -w_{1} & \cdots & -w_{1} & w_{1} \\ w_{2} & -w_{2} & \cdots & -w_{2} & w_{2} \\ \vdots & \vdots & \ddots & \vdots & \vdots\\ w_{2007} & -w_{2007} & \cdots & -w_{2007} & w_{2007} \\ \end{pmatrix} $ this mapping is a bejection from W to $S_{r}$ .... From those lemmas we have $S = S_{c} \cup S_{r}$ and notice that $\left|{S_{c} \cap S_{r}}\right| = 2$ , we have $\left|{S}\right| = \left|{S_{c}}\right| + \left|{S_{r}}\right| - 2 = 2\left|{W}\right| - 2 $ To compute $\left|{W}\right|$, i think we could find recurrence relation...
24.01.2013 18:47
Your post is close to illegible. Please unitalicize it and see LaTeX:LaTeX on AoPS to learn the basic LaTeX necessary to make your mathematical symbols legible. It should take you about 10 minutes.
25.01.2013 17:33
@JBL: I updated my post with correct LATEX. Being a senior coder, learning LATEX is not a big deal to me^^
27.01.2013 12:09
I think this argument works: We construct the square starting from the column furthest to the left. As has been described already, we can never have 3 of the same together since this would force, for example: +++ - - - +++ which is an invalid 3*3 square. Also, if, in the first column there are 2 adjacent +'s, or 2 adjacent -'s, the first column uniquely determines the rest of the square (this has been described somewhere above), and every second column is the same. For this reason, the number of +'s and the number of -'s must differ by 1 in the first column, since otherwise the entire square will sum to something greater than 1, or smaller than -1 (if n=2k+1, we have k+1 copies of the first column, and k of the second column. If the first column sums to x, the second column sums to -x, so the total sum is (k+1)x-kx=x, so x=1). For any n=2k+1 square grid, start with the first column, with arrangement ++--++--++--.... --+ (it might end on a - instead, depending on n, but the idea is to alternate 2 +'s, 2-'s, and so on). Note that this arrangement will have exactly one more + than -, so we call it a 'positive' arrangement. Define a 'swap' to be a swapping of 2 different, adjacent symbols. There are k possible swaps. We make a new first column by carrying out any combination of swaps, giving 2^k arrangements (it's not difficult to check these will all be 'valid' arrangements, i.e. no sequence of odd length sums to something with absolute value >1). We prove by induction that these are all the possible positive arrangments beginning with a +: For k=0, we have just +. Assume for k=m. For k=m+1, we have all the previous sequences, and we can add either +- or -+ (not -- or ++ as it would no longer be positive) to the end of each sequence. But these are exactly the sequences we get by adding +- (if the sequence for k=m ended in +), and allowing the swap of the last 2 symbols, so we're done. Now, except the arrangement '+-+-+-+-.....-+', each of the 2^k arrangments can be flipped to give another arrangement that we haven't yet counted - it can't have been counted already, since if it isn't '+-+-...-+' it must have a ++ somewhere. Numbering squares from the left, the ++ must start on an odd square. If we flip any sequence however, it must start on an even square, so the two sequences can't possibly be the same. So this gives us 2(2^k -1) arrangments not including '+-+-....-+', which we deal with separately. Note that '+-+-...-+' as a first column does not uniquely determine the rest of the grid, since the next column could be either '-+-+...+-' or '+-+-....-+'. If however, the top row is also decided, it will be determined uniquely since each column must be of the form '+-+-...-+' or '-+-+....+-', and since the top row decides what each column starts with, there is no choice left. But number of ways to make the top row is exactly the number of ways to choose the first column since we have the same restrictions, which is just 2(2^k -1)+1 (we include '+-+-...-+'). Adding the 2 together, we get 2*2(2^k -1) +1=2^(k+2)-3. Now, each positive arrangement has an equivalent negative arrangement, so we just multiply this by 2. So I get 2^1006 - 6, since k=2003.
28.01.2013 18:46
Thanks, mto, this is much clearer. Yes, it's easy to compute $|W|$ using recurrences: let $a_n$ be the number of length-$n$ sequences of $1$s and $-1$s and no three consecutive terms equal ending in two equal values, and let $b_n$ be the number of such sequences not ending in two equal values. Then $a_{n + 1} = b_n$ and $b_{n + 1} = a_n + b_n$ with initial values $b_1 = 2$, $a_1 = 0$, whence $a_n$ and $b_n$ and also their sum are twice Fibonacci numbers. Unfortunately, though, this is wrong: for example, if the first row begins $(1, 1, -1, 1, 1)$ then the upper-left $5 \times 5$ square will have sum $3$. In other words, your Lemma 4 is wrong, since not every $w$ corresponds to a matrix with the desired properties.
03.07.2019 18:28
probability1.01 wrote: Solution outline. First of all, we can number them like a checkerboard, so that gives us two solutions. Now suppose it is not a checkerboard, then there are two squares, say (m, n) (row m, column n) and (m, n+1), such that they have the same number. But considering the 2x2 square formed by these two squares and (m+1, n) and (m+1, n+1), we know that (m+1, n) and (m+1, n+1) must both be -1 times the number in (m, n) and (m, n+1). Proceeding this way, we have that (k, n) has the same number as (m, n) iff $k \equiv m \mod 2$, and same with (k, n+1) and (m, n+1). Notice then that if two vertically adjacent squares were of the same color, we would have the same pattern going horizontally, which is impossible. Hence every column has alternating 1's and -1's. Now consider the first row, which uniquely determines the rest of the grid. Note that any big square with odd side length that contains some squares in the first row will have a sum equal to the sum of the numbers in the first row which it contains. Thus any odd block of squares from the first row sums to 1 or -1. This condition gives us something which can be calculated in various ways... I believe that one way you can do it is to equate it with twice the number of subsets of 1003, giving us $2^{1004}$. Actually, it's the first row AND column that determine the whole board. The first column is uniquelly determined if you put $1,1$ or $-1,-1$ into the corner, but you have a few degrees of freedom otherwise. EDIT: I just figured out that the table is completely determined by the first row except when you have one of these two patterns: \begin{align*} & +1, -1, +1, -1, +1, \cdots \\ & -1, +1, -1, +1, -1, \cdots \end{align*} I. e. you just keep switching the signs. You need an additional square (or maybe more?) in this case. EDIT 2: At least one of the first row and column must have one of the patterns mentioned above, one can easily derive a contradiction otherwise.