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?

  • $\begingroup$ 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? $\endgroup$ – abiessu Oct 25 '13 at 21:07
  • $\begingroup$ 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 $\endgroup$ – user103260 Oct 25 '13 at 21:18
  • $\begingroup$ I was providing a hint as to what to consider. Andre's answer covers more than what I was hinting at. $\endgroup$ – 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}$.

Now fill in the last row to make all column sums odd. There is a unique way to do this.

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.

  • $\begingroup$ awesome answer nicolas one more thing, though, i was reading your answer to some earlier question math.stackexchange.com/questions/329932/… what did u mean by parity check over there? $\endgroup$ – user103260 Oct 25 '13 at 21:46
  • $\begingroup$ 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$. $\endgroup$ – André Nicolas Oct 25 '13 at 22:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.