What is the number of subgroups of index $2$ in $(\mathbb{Z}/2\mathbb{Z})^3$? 
What is the number of subgroups of index $2$ in $(\mathbb{Z}/2\mathbb{Z})^3$?

I know that a subgroup of index $2$ in $(\mathbb{Z}/2\mathbb{Z})^3$ is isomorphic to $(\mathbb{Z}/2\mathbb{Z})^2$ because of the order of its elements, but I cannot say what is the number of this subgroups.
Also, is it possible to generalise this to the number of subgroups of index $2$ of $(\mathbb{Z}/2\mathbb{Z})^n$?
 A: If you pick two distinct non-identity elements they are going to generate such a subgroup.
So the answer is $\binom{7}{2}$.
But wait ! Each subgroup can be generated in three ways like this.
Hence the answer is $\binom{7}{2}/3 = 7$
If you want to generalize it to $\mathbb Z_2^n$ you can use linear algebra. Notice that the map that sends each subspace of dimension $n-1$ to its orthogonal complement under the obvious inner product is a bijection between dimension $n-1$ subspaces and dimension $1$ subspaces (to prove bijectivity you can use the $e_i$ vectors, and see here)
Hence there are $2^n-1$ subgroups of index $2$.
A: Any subgroup of index $2$ is normal, so your question is equivalent to "how many surjective homomorphisms are there from $(\mathbb{Z/2Z})^3$ to $\mathbb{Z/2Z}$?". So let's answer that question.
Consider the obvious $3$-element generating set (basis) for $(\mathbb{Z/2Z})^3$. Every homomorphism is defined entirely by where the elements of this set are sent to, which gives $2^3$ homomorphisms (a power of $2$ as each element has two possible images). However, we must exclude the situation where every generator is sent to the identity (as the homomorphism must be surjective), which gives $2^3-1=7$ surjective homomorphisms. Hence, there are $7$ subgroups of index $2$.
Generalising to $(\mathbb{Z/2Z})^n$: bases now have size $n$ which each basis element still has two possible images, hence we get $2^n$ homomorphisms $(\mathbb{Z/2Z})^n\rightarrow \mathbb{Z/2Z}$, so $2^n-1$ surjective homomorphisms/subgroups of index $2$.
