Number of distinct grids formed Let $n$ be a positive integer and let $\mathcal{G}_n$ be an $n\times n $ grid with the number $1$ written in each of its squares. In each step we multiply all entries of a row or column is multiplied by $-1$. Determine the number of distinct grids that can be formed after doing finite number of steps on $\mathcal{G}_n$. 
For $n=2$, I have got $8$ choices. Am I correct in it? In general I have no idea. Please help.
 A: Hint: If we think of the $n\times n$ grid as an $n\times n$ matrix with all entries equal to $1$, then we can view a step of scaling a row (resp. column) by multiplying on the left (resp. right) by a diagonal $n\times n$ matrix with exactly one $-1$ on the diagonal (and all other diagonal entries equal to $1$).
$2\times 2$ solution:
Following the hint, we can view $\mathcal{G}_2=\begin{bmatrix}1&1\\1&1\end{bmatrix}$ represent our grid. Then the grid $G$ where we scale, say, the first row by $-1$ can be represented as follows:
$$G=\begin{bmatrix}-1&-1\\1&1\end{bmatrix}=\begin{bmatrix}-1&0\\0&1\end{bmatrix}\mathcal{G}_2.$$
Similarly, if we then scaled the 2nd row of $G$ to get a new grid $H$, we would have
$$H=\begin{bmatrix}1&0\\0&-1\end{bmatrix}G=\begin{bmatrix}-1&0\\0&-1\end{bmatrix}\mathcal{G_2}.$$ In this way, we see any sequence of steps of scaling rows by $-1$ gives a matrix of the form $X\mathcal{G}_2$, where $X$ is of the form $$\tag{$\star$}\begin{bmatrix}\pm1&0\\0&\pm1\end{bmatrix}.$$ Likewise, scaling columns yields a matrix of the form $\mathcal G_2X$. By associativity of matrix multiplication, it doesn't matter the order of scaling rows or columns, so in general any sequence of steps yields a matrix of the form $X\mathcal G_2 Y$, where $X$ and $Y$ are of the form ($\star$). So we see there are at most $2^2*2^2$ possible grids (not illuminating in this case, but it is a reduction for $n>2$).
However, it may be the case that we can have $X_1,X_2,Y_1,Y_2$ such that $X_1\mathcal{G}_2Y_1=X_2\mathcal{G}_2Y_2$. Multiplying by inverses, this is equivalent to $X_1X_2\mathcal G_2 Y_2Y_1=\mathcal{G}_2$. So the question reduces to when $X\mathcal G_2 Y=\mathcal G_2$.
Well, let $X=\begin{bmatrix}a&0\\0&b\end{bmatrix}$ and $Y=\begin{bmatrix}c&0\\0&d\end{bmatrix}$ satisfy $X\mathcal G_2 Y=\mathcal G_2$. Then $$\mathcal G_2=X\mathcal G_2 Y=\begin{bmatrix}ac&ad\\bc&bd\end{bmatrix},$$
so $ac=ad=bc=bd=1$.  Since $a,b,c,d=\pm 1$, we must have $a=b=c=d=1$ or $a=b=c=d=-1$.
Therefore, we see that all grids are of the form $X\mathcal G_2Y$, and $(-X)\mathcal G_2(-Y)=X\mathcal G_2 Y$. Therefore, we see that there are $\frac{2^2*2^2}{2}=8$ possible grids.
