# Finite $2$-group with derived subgroup of order 8 [duplicate]

Does there exist a finite non-abelian $2$-group $G$ such that $G^{\prime}\cong D_8$ or $G^{\prime}\cong Q_8$? By an easy inspection with GAP, I could not find any example!

Any answer or comment will be greatly appreciated!

## marked as duplicate by José Carlos Santos, steven gregory, Ethan Bolker, Rhys Steele, user284331Mar 27 '18 at 1:18

Suppose that $G$ is a group with a dihedral commutator subgroup $G'=D_{2n}$ for $n\ge3$. The subgroup $R$ of rotations is characteristic in $G'$, and therefore normal in $G$, so $G$ acts on $R$ by automorphisms. Since $R$ is cyclic, its automorphism group is abelian, and thus the kernel of this action must contain $G'$. In particular, $G'$ centralizes $R$, so $R\le Z(G')$. But we know that rotations are not centralized by reflections in dihedral groups, so this can't be true.
It also says that the derived subgroup of SL$_2(3)$ is $Q_8$, but SL$_2(3)$ is not a 2-group.