Problem 364: (1997 AIME, 8)
How many different $4\times 4$ arrays whose entries are all 1's and -1's have the property that the sum of the entries in each row is 0 and the sum of the entries in each column is 0?
- Each row and each column has two $1$'s and two $-1$'s. Choose the two $1$-columns of the first row: $6$ ways; by symmetry assume columns $1,2$.
- The other three rows need column counts $1,1,2,2$. If one of them is $\{1,2\}$, the other two are $\{3,4\}$, giving $3$ arrangements. Otherwise one row is $\{3,4\}$ ($3$ choices) and the other two each take one of columns $1,2$ and one of $3,4$ ($4$ ways): $12$. (Three mixed rows would give columns $3,4$ only $3$ entries.) So $15$ per first row.
- $6\cdot15=90$. The answer is $\boxed{090}$.
How many different $4\times 4$ arrays whose entries are all 0's, 1's and 2's have the property that the sum of the entries in each row is 2 and the sum of the entries in each column is 2?