Now we consider the dihedral group $D_{2n}$, the group of symmetries of a regular $n$-gon, which is generated by $r,s$ with $r$ as before and $s = \begin{cases}
\begin{pmatrix}1 & n\end{pmatrix}\begin{pmatrix}2 & n-1\end{pmatrix} \cdots\begin{pmatrix} \frac{n}{2} & \frac{n}{2} + 1\end{pmatrix}, & \text{if $n$ is odd}, \\
\begin{pmatrix}
1
\end{pmatrix}\begin{pmatrix}2 & n\end{pmatrix} \begin{pmatrix}3 & n-1\end{pmatrix} \dots \begin{pmatrix} \frac{n+1}{2} & \frac{n+3}{2} \end{pmatrix}, & \text{if $n$ is even},
\end{cases}$if we label the vertices of the $n$-gon like in the figure below.
![[Drawing 2025-03-26 00.08.05.excalidraw]]
The rotations $r^k$ contribute the same terms as in the cyclic group case (see [[Cycle Index Polynomial of Cyclic Group]]) : $\frac{1}{2n} \sum_{d\mid n} \phi (n\text{/}d) z^{d}_{n\text{/}d}.$Reflections $r^k s$ behave differently depending on whether $n$ is even or odd:
• If n is **odd**, each reflection fixes one vertex and swaps the remaining (n-1)/2 pairs, contributing a term proportional to $z_1 z_2^{(n-1)/2}$.
• If n is **even**, half of the reflections swap $n/2$ pairs, contributing $z_2^{n/2}$, while the other half fix two opposite vertices and swap the remaining $(n-2)/2$ pairs, contributing $z_1^2 z_2^{(n-2)/2}$.
Combining these gives that the cycle index polynomial for $D_{2n}$ is given by
$Z_{D_{2n}}(z_1, \dots, z_n) = \begin{cases}
\frac{1}{2 n}\left(n z_1 z_2^{(n-1) / 2}+\sum_{d \mid n} \phi(d) z_d^{z / d}\right),&\text{if $n$ is odd,} \\
\frac{1}{2 n}\left(\frac{n}{2} z_1^2 z_2^{(n-2) / 2}+\frac{n}{2} z_2^{n / 2}+\sum_{d \mid n} \phi(d) z_d^{n / d}\right),&\text{if $n$ is even}.
\end{cases}$