# Combinatorics-Find number of ways we can select cells from a nXn grid such that the number of cells selected from each row and column is odd

Find number of ways we can select cells from a nXn grid such that the number of cells selected from each row and column is odd.

Any hints?

• Consider the odd squares first: $1\times 1,3\times 3,\dots$. What other $m\times n$ arrangements are possible? What about considering row and column counts as pairs plus one? – abiessu Oct 25 '13 at 21:07
• i guess you didnt get the question, we have to select cells in the grid,which can be interspaced randomly, we dont have to select square/rectangles from the grid. take it like this: u have to fill ones in the cells of the grid such that the sum of each row and column should be odd – user103260 Oct 25 '13 at 21:18
• I was providing a hint as to what to consider. Andre's answer covers more than what I was hinting at. – abiessu Oct 25 '13 at 21:56

Fill in the first $n-1$ rows (almost) arbitrarily with $0$'s and/or $1$'s, the only condition being that each row sum is odd. There are $2^{n-1}$ ways to do it for each row, for a total of $(2^{n-1})^{n-1}=2^{(n-1)^2}$.
Finally, argue that the last row sum is odd. There are two cases, $n$ odd and $n$ even. If $n$ is odd, the total number of $1$'s is odd, because each column sum is odd. Since the sum of the first $n-1$ rows is even, the last row sum is odd.
If $n$ is even, then the total is even, but the sum of the first $n-1$ rows is odd, so again the the last row sum is odd.
• That used a different and somewhat more convoluted argument, in which one needed to check whether the bit in the bottom left corner that makes the last row sum even is the same as the one that makes the last column sum odd. The technical advantage is that we do not have to prove there are $2^{n-1}$ ways to select an odd number in each row. But that's not much of an advantage, since it is a standard fact that we get quickly from the binomial expansions of $(1+1)^n$ and $(1-1)^n$. – André Nicolas Oct 25 '13 at 22:02