Question-
Consider an N ×N grid in which very cell has either +1 or −1. We call such a grid a Binary grid. The Row-Product of any row is defined to be the product of all elements in that single row. Similarly, the Column Product of a column is defined to be the product of all elements in that single column. An N ×N Binary grid is called a Magical Grid if exactly one of the N Row-Products is −1, and exactly one of the N Column-Products is −1. That is, the other N−1 Row-Products should all be +1, and the other N−1 Column-Products should all be +1. Find the number of Magical Grids of size N × N.(I am only interested in the case N=3,4,5).
My attempt- I really haven't figured out a way of attacking the problem but here are a few deductions that I have made:
The number of $-1$s in only one row will be odd. Same goes for columns.
I could potentially break down the problem into sub-cases, finding the number of magical grids for only one $-1$, then two $-1$s but that will take a very long time, and very inelegant.
Could anyone give any leads?
Here is another way of looking at the problem-
Step-1
Decide the row and the column whose row/column product you want to make $-1$.The rows can be selected in $n$ ways and for each row selected, the column can be selected in $n$ ways: $n^2$ ways in total.
Step-2
Now fill the remaining $(n-1)^2$ cells (none of which belong to your previously selected row or column) randomly. This can be done in $2^{(n-1)^2}$ ways.
Step-3
Now we fill the cells of our selected row and column. Note that after step 2, we end up with a $N \times N$ grid where all the Row and column products are known. Start filling the rows of the grid which only lack one cell. Since all the other elements of that row and the product are known, we can uniquely determine the sign of the number that is to be inserted. Proceed the same with columns and you have finished your cell. In step 3, we do not have any choice and by the end of step 2, in order to have a valid magical grid,we simply fill the grid as per the requirements. In other words, there is only one 1 way of completing Step 3.
By Fundamental Principle of Counting-
Total number of magical grids- $n^2\times 2^{(n-1)^2}$