TITLE: Question about the number of elements of order 2 in $D_n$
QUESTION [5 upvotes]: $$\text{Given}\;\; D_n = \{ a^ib^j \mid \text{ order}(a)=n, \text{ order}(b)=2, a^ib = ba^{-i}  \}$$ $$\text{ how many elements does $D_n$ contain that have order $2$ ?}$$

My answer would be:
We can write any element as $a^ib^j$. If $j$ is odd, then we can write it as $a^ij$, whereas if $j$ is even, then $b$ just cancels out.
So to count:

$b$ is one element of order $2$.
If $j$ is odd we have $a^ib$.  $(a^ib)^2= a^i(ba^i)b = a^i a^{-i} bb = e$. So all elements of the form $a^ib$ have order $2$. These are $n$ elements.
If $j$ is even we can write the remaining elements as follows: $a^i$ . This element has order $2$ only if $i=n/2$. This can only be true if $n$ is even.

So my final answer would be  $n+1$ if $n$ is odd, $n+2$ if $n$ is even... Do you think this is correct? Can I improve this somewhere?
Thanks !

REPLY [2 votes]: As pointed out in vadim123's comment, you have included $b$ twice, since $a^ib=b$ when $i=n$ (or equivalently when $i=0$).  Otherwise, your analysis is correct.  Thinking geometrically, $D_n$ has $n$ reflections, each of order $2.$  If the $180^\circ$ rotation is an element of the group, which it is when $n$ is even, that makes an additional element of order $2.$
Added: The $n$ reflection axes of the regular $n$-gon join the vertices to the centers of the opposite edges when $n$ is odd, and join either opposite vertices or centers of opposite edges when $n$ is even.  The $180^\circ$ rotation is an element of the group only when there is a vertex diametrically opposite each vertex, which only happens for $n$ even.