# Determine the number of possible for the following table

If we put numbers 1 and -1 in the squares such that the sum of any row is zero. Also the sum of any column is zero. Now determine the number of possible for the table.

-

Both $+1$ and $-1$ occur twice in each row and column. There are $\binom42=6$ different arrangements for the first row. Without loss of generality, we can assume that the first row is $+1,+1,-1,-1$ and multiply the result by $6$ in the end. Then there's one more $+1$ in the first column. Without loss of generality, we can assume it's in the second row and multiply the result by $3$ in the end. Now we've fixed:

+ + - -
+
-
-


Now placing another $+1$ in the second row and column determines the remaining entries, whereas placing a $-1$ there leaves two choices for the row in which to place the remaining $+1$ in the second column and two choices for the column in which to place the remaining $+1$ in the second row. Thus the total number of possibilities is $6\cdot3\cdot(1+2\cdot2)=90$, and indeed searching OEIS for $2,90$ yields OEIS sequence A058527, the "number of $2n\times2n$ $0$–$1$ matrices with $n$ ones in each row and each column".

-
is there a nice proof for the general case of $2n \times 2n$ matrices in the special case where the row and column sums are zero? – Vincent Tjeng Mar 2 '13 at 2:31
@Vincent: A proof of what? Do you mean a closed form? I doubt that one is known; usually such formulas are noted in the OEIS entries; the OEIS entry in this case says that the terms were computed using dynamic programming. – joriki Mar 2 '13 at 2:40
I was hoping for a closed form, but it looks like there isn't any. However, is there an explanation on how the OEIS sequence is calculated? I have been taking a look at some of the papers linked and so far have not been able to find an exact result for the calculation of sequence. – Vincent Tjeng Mar 2 '13 at 2:56
@Vincent: Did you follow the McKay link in the OEIS entry? It leads to some Maple code. If you have further questions, you could contact one of the people who supplied the terms for the entry; their email addresses are listed. – joriki Mar 2 '13 at 10:27
thank you, I'll take a look at that in detail and contact those people who supplied the terms. – Vincent Tjeng Mar 2 '13 at 10:55