Skip to content
Tutorials Center
My learning

Topics

Lesson 9 of 37 · Groups and Subgroups

Dihedral Groups

Build the dihedral group D_n of rotations and reflections of a regular n-gon, find its order 2n, relations and center, and compute with it in Python.

Symmetry was the original motivation for group theory. A symmetry of a shape is a rigid motion that maps the shape onto itself. The set of all symmetries, with composition ("do one, then the other"), is a group. For regular polygons these groups are called dihedral groups.

Symmetries of a regular n-gon

Take a regular polygon with n sides (n ≥ 3), vertices numbered 0, 1, ..., n-1 around the shape. Two kinds of motion preserve it:

  • Rotations by multiples of 360°/n about the center: r⁰ = e (do nothing), r, r², ..., rⁿ⁻¹.
  • Reflections across n lines of symmetry. Call one reflection s.

Every symmetry is one of the n rotations or the n reflections s, sr, sr², ..., srⁿ⁻¹, so the dihedral group D_n has order 2n. (Some books write D₂ₙ for the same group; we use D_n for the n-gon.)

The generators satisfy these relations:

rⁿ = e, s² = e, s r s⁻¹ = r⁻¹ (equivalently srs = r⁻¹).

The last relation says reflecting, rotating and reflecting back rotates the other way. It shows that D_n is non-abelian for n ≥ 3: sr = r⁻¹s ≠ rs because r² ≠ e.

Implementing D_n

Represent each symmetry as a pair (k, f) meaning "apply a reflection first if f = 1, then rotate by k steps". A simple model uses permutations of the vertices.

Python Build D_n as permutations of vertices

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The program generates the group from the two generators by repeatedly composing until no new elements appear, which is exactly the definition of ⟨r, s⟩.

The center and element orders

Python Orders of elements and the center of D_6

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The center of D_n is trivial when n is odd and has two elements (e and the half-turn r^(n/2)) when n is even.

Small cases

Group Order Notes
D₃ 6 symmetries of a triangle; isomorphic to S₃
D₄ 8 symmetries of a square; 4 rotations, 4 reflections
D₅ 10 pentagon
D₆ 12 hexagon

D₃ is the smallest non-abelian group: every permutation of the three vertices of a triangle is a symmetry of the triangle, so D₃ ≅ S₃. For n = 4 the group is a proper subgroup of S₄ (order 24).

flowchart LR
    e["e"] -->|"r"| r["r"] -->|"r"| r2["r²"] -->|"r"| r3["r³ = r⁻¹ (n = 4)"]
    s["s"] -.->|"s r s = r⁻¹"| r

Rotations form a cyclic subgroup ⟨r⟩ of order n; reflections flip the direction of rotation.

When you multiply in D_n, use the rule s r = r⁻¹ s to move every s to the right. Any product then reduces to the form rᵃ or rᵃs.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. What is the order of the dihedral group of a regular hexagon (D₆ in our notation)?

    6 rotations plus 6 reflections give order 2n = 12.
  2. 2. Which relation holds in D_n?

    Conjugating a rotation by a reflection reverses it.
  3. 3. Which dihedral group is isomorphic to S₃?

    A triangle's six symmetries are all the permutations of its three vertices.
  4. 4. How large is the center of D_5?

    For odd n only the identity commutes with every element.

Summary

  • D_n consists of n rotations and n reflections, so |D_n| = 2n.
  • It is generated by r and s with rⁿ = e, s² = e, srs = r⁻¹.
  • It is non-abelian for n ≥ 3; D₃ ≅ S₃.
  • The center is trivial for odd n and has two elements for even n.

Next: Cyclic Groups