# Counting the elements of a dihedral group $D_n$ of a $n$-sided regular polygon

For a $$n$$-sided regular polygon there are $$n-1$$ possible rotations: $$a,a^2,a^3,a^{n-1}$$, a 1 reflection $$b$$, 1 identity $$e=a^n=b^2$$. There are also 2(n-1) elements $$ab,a^2b,a^3b,...a^{n-1}b$$ and $$ba,ba^2,ba^3,...ba^{n-1}$$ (since rotation and reflections do not commute). Therefore, a dihedral group has $$(n-1)+1+1+2(n-1)=3n-1$$ elements!

Where is my counting wrong?

It is true that $$a$$ and $$b$$ do not commute, but that does not mean that the elements $$ba,ba^2,ba^3,...ba^{n-1}$$ are all distinct from the elements $$ab,a^2b,a^3b,...a^{n-1}b$$. Indeed, with the usual choice of generators for the dihedral group, we have $$ba=a^{n-1}b$$, and it follows that $$ba^r=a^{n-r}b$$ for all $$r$$ and so your last $$n-1$$ elements are all repeats of elements you already had.