what is the order of AB? Let $A$ and $B$ be any invertible $4 \times 4$ matrices with $0$ and $1$ everywhere, and let  $H=\{A^n| n \in \mathbf{Z}\}$, $N=\{A^nB^m | n,m\in \mathbf{Z} \}$


*

*are the subsets $H$ and $N$ subgroups of the general linear group $\text{GL}(n,\mathbf{R})$?

*what is the order of $AB$?


I wrote two matrices for  $A$ and $B$, and letting $n≤3$,and $m≤3$  so that  $H$ consists of $A$, square of $A$ and the cube of $A$. I found that  $PQ$ is not in $H$ for some  $P$ and $Q$ in $H$ , there I want to conclude that $H$ may not be a subgroup of $\text{GL}(n,\mathbf{R})$.
I request some help here. Can the order of $AB$ be written in terms of $n$ and $m$?
 A: To expand on Phira's comment, the notation $\{{\,A^n\mid n\in{\bf Z}\,\}}$ means the set that contains all of the following matrices: $\dots,A^{-3},A^{-2},A^{-1},A^0=I,A^1=A,A^2,A^3,\dots$ (and only those matrices). Have you learned about cyclic groups? 
As for $N$, you might try finding matrices $A,B$ that are simple enough that you can work out the general form of $A^n$ and of $B^m$ (and thus of $A^nB^m$), but complicated enough that $AB\ne BA$. Then you have a shot at proving $BA$ is not in $N$, which should answer your question. 
As for the order of $AB$, this hinges on the word "any". If it means you get to choose your favorite $A$ and $B$, well, then go ahead and choose them, and write down $AB$, and calculate a few powers of it, and see if you can come to any conclusion about it. If "any" means find an answer that works no matter what $A$ and $B$ are (subject only to their being $4\times4$ and invertible and zero-one), then I think a little experimentation with well-chosen examples will set you on the right path. 
