Let $G$ be a group such that for all $x\in G$ we have $x^2=e$. Show that if $G$ is finite then the order of $G$ is $2^n$.
Here is the solution I have seen in a book.
If G is finite, it can be considered as a vector space over the field $\Bbb{Z}/2\Bbb{Z}$, and then necessarily is finite dimensional, which gives $G$ as a vector space isomorphic to $(\Bbb{Z}/2\Bbb{Z})^n$.
I don't understand why $G$ can be considered as a vector space over the field $\Bbb{Z}/2\Bbb{Z}$. Can, someone, explain this? Please.
In order to show that $G$ is a vector space, first you must show that it is abelian. Assuming you have established this, then we can write the group operation additively, and if $g,h \in G$ then $g+h$ is the sum of the two "vectors" $g$ and $h$. The condition $g^2 = e$, translated into additive notation, becomes $g + g = 0$.
Now consider the field $F = \mathbb{Z}/2\mathbb{Z}$. This field contains two elements, $0$ and $1$, with the property that $1+1 = 0$.
We define multiplication of a scalar $a\in F$ by a "vector" $g \in G$ in the obvious way: $ag = 0$ if $a = 0$, and $ag = g$ if $a = 1$.
Now we just need to verify the vector space axioms. The first four, namely associativity and commutativity of addition, existence of an additive identity, and existence of additive inverses, are consequences of the fact that $G$ is an abelian group.
The remaining four are simple to check:
So the only remaining question is, what is the cardinality of $G$? Well, $G$ is finite dimensional, so it has some basis $\{g_1, g_2, \ldots, g_n\}$. Since $F$ has two elements, the set of all possible linear combinations $a_1 g_1 + \ldots + a_n g_n$ (where each $a_i \in F$) has cardinality $2^n$.
For completeness, here is a proof that the condition $x^2 = e$ for all $x \in G$ forces $G$ to be abelian. If $x,y \in G$, then $xyxy = (xy)(xy) = e$. Therefore, multiplying on the left by $x^{-1}$ and on the right by $y^{-1}$, we get $yx = x^{-1}y^{-1}$. Therefore, $xyx^{-1}y^{-1} = xyyx = x(yy)x = xex = xx = e$. Multiplying $xyx^{-1}y^{-1} = e$ on the right by $y$ and then by $x$ gives us $xy = yx$.