\documentclass[11pt]{article}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{latexsym}
\usepackage{verbatim}
\usepackage{cancel}
\usepackage[pdftex]{graphicx}
\usepackage{url}
\usepackage[table]{xcolor}
\usepackage{multicol}
\usepackage[all,arc]{xy}
\usepackage{color, colortbl}
\usepackage{mathrsfs}
\usepackage{hhline}
\usepackage{hyperref}
\hypersetup{colorlinks=true}
\setlength{\oddsidemargin}{.25in}
\setlength{\evensidemargin}{.25in}
\setlength{\textwidth}{6in}
\setlength{\topmargin}{-0.4in}
\setlength{\textheight}{8.5in}

\newcolumntype{x}[1]{>{\centering\arraybackslash}p{#1}}
\usepackage{tikz}
\newcommand\diag[4]{%
  \multicolumn{1}{p{#2}|}{\hskip-\tabcolsep
  $\vcenter{\begin{tikzpicture}[baseline=0,anchor=south west,inner sep=#1]
  \path[use as bounding box] (0,0) rectangle (#2+2\tabcolsep,\baselineskip);
  \node[minimum width={#2+2\tabcolsep-\pgflinewidth},
        minimum  height=\baselineskip+\extrarowheight-\pgflinewidth] (box) {};
  \draw[line cap=round] (box.north west) -- (box.south east);
  \node[anchor=south west] at (box.south west) {#3};
  \node[anchor=north east] at (box.north east) {#4};
 \end{tikzpicture}}$\hskip-\tabcolsep}}

\input{preamble.tex}

\begin{document}

\lecture{5: Burnside's Lemma and the P\'olya Enumeration Theorem}{Weeks 8-9}


We finished our M\"obius function analysis with a question about seashell necklaces:

\begin{quest}
Over the weekend, you collected a stack of seashells from the seashore.  Some of them are tan and some are black; you have tons of each color.  

You want to arrange them in a necklace!  You consider two necklaces to be the same if one can be rotated so that it is the other (you don't allow flips, though, because then your seashells would be backwards.)  For example, here are all of the distinct necklaces you can make with four shells:
\begin{center}
\includegraphics[width=3in]{seashell.pdf}
\end{center}

How many different necklaces on $n$ shells can you make, for any $n$?
\end{quest}


We answered this problem by performing M\"obius inversion on the divisor poset; however, at the time, many of you noted that there seemed to be a different connection to group theory here, and in specific to the idea of \textbf{groups} and \textbf{group actions}!  Many of you have seen some of these ideas before (the idea of a group, if nothing else, is something you've likely seen in Math 8!)  However, it may have been a while, so we review these ideas here:

\section{Groups and Group Actions}

\subsection{Groups: Basic Definitions}

\begin{defn}
A \textbf{group} is a set $G$ along with some operation $\cdot$ that takes in two elements and outputs another element of our group, such that we satisfy the following properties:
\begin{itemize}
\item \textbf{Identity}: there is a unique identity element $e \in G$ such that for any other $g \in G$, we have $e \cdot g = g \cdot e = g$.  

In other words, combining any group element $g$ with the identity via our group operation does not change $g$!  You know many objects like this: if we work with the real numbers $\mathbb{R}$ and think of addition as our group operation, then 0 is our identity, as $0+x = x$ for any $x$.  Similarly, if we consider the real numbers again but take our operation to be multiplication, then 1 is our identity, as $1 \cdot x = x$ for any $x$.

\item \textbf{Inverses}: for any $g \in G$, there is a unique $g^{-1}$ such that $g \cdot g^{-1} = g^{-1} g = e$. 

In other words, if we start at any group element $g$, we can always find something to combine with $g$ using our group operation to get back to the identity!  Again, you know several objects like this: with $\mathbb{R}$ and addition, the inverse of any number $x$ is just its negative $-x$, while if we consider the set of nonzero real numbers and multiplication, the inverse for any $x$ is just $1/x$.

\item \textbf{Associativity}: for any three $a,b,c \in G$, $a \cdot (b \cdot c) = (a \cdot b) \cdot c.$  

In other words, the order in which we group combinations together doesn't matter, as long as the sequence that we have those objects grouped together in does not change!  I.e.\ we can combine $a$ with $b \cdot c$, or first find $a \cdot b$ and then combine that with $c$.  Again, most of the natural operations you're familiar with (addition, multiplication) are associative: it is perhaps more interesting to point out some things that are nonassociative.  For example, exponentiation is a nonassociative operation:  $2^{\left(3^4\right)} = 2^{81} \approx 2.41 \cdot 10^{24} $, while $(2^3)^4 = 8^4 = 4096$.
\end{itemize}
\end{defn}
It bears noting that this does not say that $a\cdot b = b \cdot a$: that is a different property, called \textbf{commutativity}, and is not a property that groups need to have (as we will show in the examples!)  Groups that are commutative are called \textbf{abelian groups}, after the mathematician Niels Henrik Abel.  

We list a number of examples of groups, as well as some nonexamples.  Here, we don't give formal proofs that any of these objects are groups; instead, we list them rapid-fire to give you a list of examples to think about in your head!  (If you're interested, you can prove that any of these objects satisfy the claimed properties, though!)
\begin{exmp}
As noted above, the real numbers with respect to addition, which we denote as $\langle \mathbb{R}, +\rangle$, is a group: it has the identity 0, any element $x$ has an inverse $-x$, and it satisfies associativity.
\end{exmp}

\begin{nonexmp}
The real numbers with respect to multiplication, which we denote as $\langle \mathbb{R}, \cdot\rangle$, is \textbf{not} a group: the element $0 \in \mathbb{R}$ has no inverse, as there is nothing we can multiply 0 by to get to 1!
\end{nonexmp}

\begin{exmp}
The nonzero real numbers with respect to multiplication, which we denote as $\langle \mathbb{R}^\times, \cdot\rangle$, is a group!  The identity in this group is 1, every element $x$ has an inverse $1/x$ such that $x \cdot (1/x) = 1$, and this group satisfies associativity.
\end{exmp}

\begin{exmp}
The integers with respect to addition, $\langle \mathbb{Z}, +\rangle$ form a group!
\end{exmp}

\begin{nonexmp}
The integers with respect to multiplication, $\langle \mathbb{Z}, \cdot \rangle$ do not form a group: for example, there is no integer we can multiply 2 by to get to 1.
\end{nonexmp}

\begin{nonexmp}
The natural numbers $\mathbb{N}$  are not a group with respect to either addition or multiplication.  For example: in addition, there is no element $-1 \in \mathbb{N}$ that we can add to 1 to get to 0, and in multiplication there is no natural number we can multiply 2 by to get to 1.
\end{nonexmp}

\begin{exmp} 
$GL_n(\mathbb{R})$, the collection of all $n \times n$ invertible real-valued matrices, is a group under the operation of matrix multiplication.  Notice that this group is an example of a \textbf{nonabelian} group, as there are many matrices for which $AB \neq BA$: consider $\begin{bmatrix} 0 & 1\\ 0 & 0 \end{bmatrix} \cdot \begin{bmatrix} 1 & 0\\ 0 & 0 \end{bmatrix} = \begin{bmatrix} 0 & 0\\ 0 & 0 \end{bmatrix}$ versus $\begin{bmatrix} 1 & 0\\ 0 & 0 \end{bmatrix} \cdot \begin{bmatrix} 0 & 1\\ 0 & 0 \end{bmatrix} = \begin{bmatrix} 0 & 1\\ 0 & 0 \end{bmatrix}$.
\end{exmp}

\begin{exmp} 
$SL_n(\mathbb{R})$, the collection of all $n \times n$ invertible real-valued matrices with determinant 1, is also a group under the operation of matrix multiplication; this is because the property of being determinant 1 is preserved under taking inverses and multiplication for matrices.
\end{exmp}

These examples are all great, but they're not really what I'm interested in for this class.  Instead, I want to focus on examples of \textbf{finite} groups!  In the next section, we study examples of these groups in more depth than above, and explain more about why they form a group.
\subsection{Finite Groups}

\begin{defn}
The object $\langle \mathbb{Z}/n\mathbb{Z}, +, \cdot\rangle$ is defined as follows:
\begin{itemize}
\item Your set is the numbers $\{0,1,2,\ldots n-1\}$.
\item Your addition operation is the operation ``addition mod n,'' defined as follows: we say that $a + b \equiv c \mod n$ if the two integers $a+b$ and $c$ differ by a multiple of $n$.

For example, suppose that $n = 3.$  Then $1+1 \equiv 2 \mod 3$, and $2+ 2 \equiv 1 \mod 3$.  
\item Similarly, our multiplication operation is the operation ``multiplication mod n,'' written $a \cdot b \equiv c \mod n$, and holds whenever $a+b$ and $c$ differ by a multiple of $n$.

For example, if $n = 7$, then $2 \cdot 3 \equiv 6 \mod 7$, $4 \cdot 4 \equiv 2 \mod 7$, and $6 \cdot 4 \equiv 3 \mod 7$.
\end{itemize}
This is a commutative group!
\end{defn}


This is not the only way in which modular arithmetic can make a group:

\begin{exmp} 
$(\mathbb{Z} / p\mathbb{Z})^\times = \{1, \ldots p-1\}$ is a commutative group with respect to the operation of multiplication mod $p$, if and only if $p$ is a prime.  (If you haven't proven this before; do it at home, or email me!)
\end{exmp}

There are other finite groups beyond those made out of modular arithmetic!  In particular, there are several notable examples of \textbf{noncommutative} groups: we describe some of those here.

\begin{exmp}
The \textbf{symmetric group} $S_n$ is the collection of all of the permutations on the set $\{1, \ldots n\}$, where our group operation is composition.  In case you haven't seen this before:
\begin{itemize}
\item A \textbf{permutation} of a set is just a bijective function on that set.  For example, one bijection on the set $\{1,2,3\}$ could be the map $f$ that sends $1$ to $2$, $2$ to $1$, and $3$ to $3$.
\item One way that people often denote functions and bijections is via ``arrow'' notation: i.e.\ to describe the map $f$ that we gave above, we could write
\begin{align*} 
f:\begin{gathered}\xymatrix{
1 \ar[rd] & 2 \ar[ld] & 3 \ar[d] \\
1 & 2 & 3
}
\end{gathered}
\end{align*}
\item This, however, is not the most space-friendly way to write out a permutation.  A much more condensed way to write down a permutation is using something called \textbf{cycle notation}.  In particular: suppose that we want to denote the permutation that sends $a_1 \to a_2$, $a_2 \to a_3$, \ldots $a_{n-1} \to a_n$, $a_n \to a_1$, and does not change any of the other elements (i.e.\ keeps them all the same.)  In this case, we would denote this permutation using cycle notation as the permutation
\begin{align*}
(a_1a_2a_3\ldots a_n).
\end{align*}
\end{itemize}
To illustrate this notation, we describe all of the six possible permutations on $\{1,2,3\}$ using both the arrow and the cycle notations:
\begin{alignat*}{3}
id:\left(\begin{gathered}\xymatrix{
1 \ar[d] & 2 \ar[d] & 3 \ar[d] \\
1 & 2 & 3
}
\end{gathered}\right) &
\quad(12):\left(\begin{gathered}\xymatrix{
1 \ar[rd] & 2 \ar[ld] & 3 \ar[d] \\
1 & 2 & 3
}
\end{gathered}\right) &
\quad (13):\left(\begin{gathered}\xymatrix{
1 \ar[rrd] & 2 \ar[d] & 3 \ar[lld] \\
1 & 2 & 3
}
\end{gathered}\right)\\
(23):\left(\begin{gathered}\xymatrix{
1 \ar[d] & 2 \ar[rd] & 3 \ar[ld] \\
1 & 2 & 3
}
\end{gathered}\right) &
\quad(123):\left(\begin{gathered}\xymatrix{
1 \ar[rd] & 2 \ar[rd] & 3 \ar[lld] \\
1 & 2 & 3
}
\end{gathered}\right) &
\quad (132):\left(\begin{gathered}\xymatrix{
1 \ar[rrd] & 2 \ar[ld] & 3 \ar[ld] \\
1 & 2 & 3
}
\end{gathered}\right)\\
\end{alignat*}

It's worth noting that some permutations need to be represented with multiple cycles.  For example,
\begin{align*}
\quad (143)(25)&= \left(\begin{gathered}\xymatrix{
1 \ar[rrrd] & 2 \ar[rrrd] & 3 \ar[lld] & 4 \ar[ld] & 5 \ar[llld] \\
1 & 2 & 3 & 4 & 5
}
\end{gathered}\right),\\
\end{align*}
because $1$ maps to 4, 4 maps to 3, and 3 maps to 1, giving us $(143)$, and 2 maps to 5 maps to 2, giving us $(25)$.

Because the composition of any two bijections is still a bijection, we have in particular that the composition of any two permutations is another permutation: so our group operation does indeed combine group elements into new group elements.  

Composing any map $f$ with the identity map $id(x) = x$ does not change the map $f$, so $id(x)$ is an identity element. 

Associativity is doable to check: take any three bijections $f: C \to D, g: B \to C , h: A \to B$.  We want to check that $(f \circ g) \circ h: A \to D$ is the same map as $f \circ (g \circ h): A \to D$.  To do this, it suffices to show that they send the same elements to the same places, as this is exactly what it means for two functions to be equal.  Take any $a \in A$, and notice that
\begin{align*}
((f \circ g) \circ h)(a) = (f \circ g)(h(a)) &= f(g(h(a)))\\
(f \circ (g \circ h))(a) = (f(g(h(a)))) &= f(g(h(a))).\\
\end{align*}
So we satisfy associativity!

Finally, to see that we have inverses, notice that any bijection $f: X \to Y$ has an inverse function $f^{-1}Y \to X$ defined by 
\begin{align*}
f^{-1}(y) = \textrm{ the unique }x \textrm{ such that }f(x) = y.
\end{align*}
Notice that $f^{-1} \circ f (x) = x$ for any $x$: in other words, their composition is the identity!  Therefore, any bijection has an inverse, and thus $S_n$ is a group.
\end{exmp}

While the above work certainly shows that $S_n$ is a group, it may not do a great job of giving us a feel for how to combine its elements.  To do this, let's demonstrate a small yet useful property about $S_n$:
\begin{defn}
A permutation $\sigma \in S_n$ is called a \textbf{transposition} if we can write $\sigma = (ab)$, for two distinct values $a, b \in \{1,\ldots n\}$.
\end{defn}
\begin{claim}
We can write any $\sigma \in S_n$ as a product of transpositions.  
\end{claim}
\begin{proof}
To illustrate what our claim is, let's work it out for all of the elements of $S_3$.  We first note that $(12), (13)$ and $(23)$ are all trivially covered by this proposition, as they are themselves transpositions; as well, we can ``trivially'' write $id$ as the product $(12)(12)$, amongst other things, as
\begin{align*}
id:\left(\begin{gathered}\xymatrix{
1 \ar[d] & 2 \ar[d] & 3 \ar[d] \\
1 & 2 & 3
}
\end{gathered}\right) \quad =
\quad(12)(12):\left(\begin{gathered}\xymatrix{
1 \ar[rd] & 2 \ar[ld] & 3 \ar[d] \\
1 \ar[rd] & 2 \ar[ld] & 3 \ar[d] \\
1 & 2 & 3
}
\end{gathered}\right),
\end{align*}
because both maps send $1$ to $1$, $2$ to $2$, and $3$ to $3$ (just follow the arrows!)

To work this out for $(123)$ and $(132)$ takes not much more work.  Simply notice that to do the permutation $(123)$, we could start with the swap $1$ and $2$, to get $1$ to map to the right thing; from there, we currently have $2\to 1$ and $3\to 3$, when we want $ 2\to 3$ and $3 \to 1$.  Swapping $1$ and $3$ fixes these issues, and gives us the swap we want!  Because function compositions are read right-to-left (because in $f(g(x))$, you apply $g$ to $x$ before applying $f$!), we would write this as $(13)(12)$: and indeed, we can check that

\begin{align*}
\quad(123)=\left(\begin{gathered}\xymatrix{
1 \ar[rd] & 2 \ar[rd] & 3 \ar[lld] \\
1 & 2 & 3
}
\end{gathered}\right)=
(13)(12)=\left(\begin{gathered}\xymatrix{
1 \ar[rd] & 2 \ar[ld] & 3 \ar[d] \\
1 \ar[rrd]& 2 \ar[d] & 3\ar[lld]\\
1 & 2 & 3\\
}
\end{gathered}\right).\\
\end{align*}

Using similar logic, we can see that $(132)$ can be written as $(12)(13)$:
\begin{align*}
\quad (132):\left(\begin{gathered}\xymatrix{
1 \ar[rrd] & 2 \ar[ld] & 3 \ar[ld] \\
1 & 2 & 3
}
\end{gathered}\right)=
(12)(13)=\left(\begin{gathered}\xymatrix{
1 \ar[rrd]& 2 \ar[d] & 3\ar[lld]\\
1 \ar[rd] & 2 \ar[ld] & 3 \ar[d] \\
1 & 2 & 3\\
}
\end{gathered}\right).\\
\end{align*}

This hopefully gives us a bit more of a feel for what we're doing here!  Just to illustrate a tricker case, however, let's try a longer permutation: what about $\sigma = (12345) \in S_5$?  Well: let's use similar logic to our earlier cases.  We know that $\sigma$ sends $1 \to 2$; so we can start with $(12)$ as our first transposition.  Now 1's going to the right place!  If we consider 2, it's currently going to 1, when it should be going to $3$.  Therefore, if we follow up our first switch with $(13)$, it will send 2 to 3, while not changing where 1 maps to (as we didn't touch its target from the first step, 2!)  

This process continues: 3 is mapping to 1 now, and it should map to 4; so we should apply $(14)$.  Then, 4 is mapping to 1, and it should map to 5; so we apply (15).  Now we have 5 mapping to 1, which is correct; in other words, all of our elements are mapping to the right place!  This is easily verified with a quick diagram:
\begin{align*}
\quad (12345)&= \left(\begin{gathered}\xymatrix{
1 \ar[rd] & 2 \ar[rd] & 3 \ar[rd] & 4 \ar[rd] & 5 \ar[lllld] \\
1 & 2 & 3 & 4 & 5
}
\end{gathered}\right)\\
(15)(14)(13)(12)&=\left(\begin{gathered}\xymatrix{
1 \ar[rd] & 2 \ar[ld] & 3 \ar[d] & 4 \ar[d] & 5 \ar[d] \\
1 \ar[rrd] & 2 \ar[d] & 3 \ar[lld] & 4 \ar[d] & 5 \ar[d] \\
1 \ar[rrrd] & 2 \ar[d] & 3 \ar[d] & 4 \ar[llld] & 5 \ar[d] \\
1 \ar[rrrrd] & 2 \ar[d] & 3 \ar[d] & 4 \ar[d] & 5 \ar[lllld] \\
1 & 2 & 3 &4 &5\\
}
\end{gathered}\right).\\
\end{align*}

In general, suppose we have any cycle $(a_1 a_2 \ldots a_n)$.  I claim that we can write this cycle as the product
\begin{align*}
(a_1 a_2 \ldots a_n) = (a_1a_n)\ldots(a_1a_4)(a_1a_3)(a_1a_2);
\end{align*}
we prove this by induction.  Our base case, when $n=2$, is trivially true: so we move to our inductive step.  Assume that our case holds for length-$n$ cycles, and consider a cycle $(a_1 a_2 \ldots a_na_{n+1})$ of length $n+1$.  

So: consider the product $(a_1a_{n+1}) (a_1a_n)\ldots(a_1a_4)(a_1a_3)(a_1a_2)$.  We want to show that this permutation is precisely the cycle $(a_1 a_2 \ldots a_na_{n+1})$ .  

By induction, we know our product of transpositions is equal to $(a_1a_{n+1})(a_1 a_2 \ldots a_n) $.  Consider where this permutation sends elements:
\begin{itemize}
\item If we look at any of the elements $a_k \in \{a_1, \ldots a_{n-1}\}$, each $a_k$ gets sent to $a_{k+1}$ by the cycle $(a_1 a_2 \ldots a_n) $; because none of the elements $a_2, \ldots a_n$ are in the transposition $(a_1a_{n+1})$, it does not interact further with any of these elements.
\item If we look at $a_{n}$, it is sent to $a_1$ by the cycle $(a_1 a_2 \ldots a_n)$; because $a_1$ is then sent to $a_{n+1}$ by the transposition $(a_1a_{n+1})$, in total we have that $a_n$ is sent to $a_{n+1}$.
\item Finally, $a_{n+1}$ is not touched by the cycle $(a_1 a_2 \ldots a_n)$, and is then sent to $a_1$ by the transposition $(a_1a_{n+1})$.
\end{itemize}
In total, we have that each $a_k$ is sent to $a_{k+1}$, with the exception of $a_{n+1}$, which is sent to $a_1$.  In other words, our product of transpositions is precisely $(a_1 a_2 \ldots a_na_{n+1})$ , as claimed.

Via cycle notation, we can write any permutation as some product of cycles: applying this result to each cycle in turn lets us write each permutation as a product of cycles, as claimed.
\end{proof}

It bears noting that a given permutation can be written as a product of transpositions in multiple ways: for example,
\begin{align*}
(123) = (13)(12) = (12)(23) = (12)(12)(12)(23),
\end{align*}
for example.  However, you can prove that the \textbf{parity} of the number of transpositions needed to write any permutation is invariant:
\begin{thm}
Take any permutation $\pi \in S_n$.  Suppose that you can write $\pi$ as a product of transpositions in two different ways; one that uses $s$ transpositions, and another that uses $t$.  Then either $s,t$ are both odd, or $s,t$ are both even.
\end{thm}
We leave this theorem for you to prove if you haven't seen it before!

Not all finite groups are as algebraic as $S_n$!  Our last example, for instance, is beautifully geometric in nature:

\begin{exmp}
Consider a regular $n$-gon.  There are a number of geometric transformations, or \textbf{similarities}, that we can apply that send this $n$-gon to ``itself'' without stretching or tearing the shape:\ i.e. there are several rotations and reflections that when applied to a $n$-gon do not change the $n$-gon.  For example, given a square, we can rotate the plane by $0^\circ, 90^\circ, 180^\circ,$ or $270^\circ$, or flip over one of the horizontal, vertical, top-left/bottom-right, or the top-right/bottom-left axes:
\begin{center}
\includegraphics[width=4in]{math137b_s2014_d4group.pdf}
\end{center}

Given two such transformations $f, g$, we can compose them to get a new transformation $f \circ g$.  Notice that because these two transformations each individually send the $n$-gon to itself, their composition also sends the $n$-gon to itself!  Therefore composition is a well-defined operation that we can use to combine two transformations.
\begin{center}
\includegraphics[width=4.5in]{math137b_s2014_d4groupcomp.pdf}
\end{center}

Notice that the trivial rotation by $0^\circ$, when composed with any other map, does not change that map: so, under the operation of composition, rotation by $0^\circ$ is an \textbf{identity}!  Similarly, notice that performing the same flip twice in a row returns us back to the identity, so every flip has an \textbf{inverse} given by itself! (I.e. if $f$ is a flip, $f \circ f = id$: i.e. $f  = f^{-1}$.)  As well, if we rotate by $k$ degrees, rotating by $360-k$ degrees results in a total rotation by $360$: i.e.\ rotation by $0^\circ$.  So all rotations have inverses as well!

Finally, notice that because function composition is associative (as shown above!), this operation is \textbf{associative} as well.  Consequently, the collection of all symmetries of a regular $n$-gon forms a group under the operation of function composition!
\end{exmp}

We call this last group $D_{2n}$, because it is the group of \textbf{order}\footnote{The \textbf{order} of a group is the number of elements in that group!} $2n$.  Algebraists will usually use this terminology; geometers, however, will often write the same group as $D_n$, as they care about they object whose symmetries we are studying (a $n$-gon) more than the number of symmetries themselves $(2n)$.


One particularly useful kind of group here is the idea of a \textbf{subgroup}:
\subsection{Subgroups and Cosets}

\begin{defn}
Take any group  $\langle G, \cdot \rangle$, and a subset $H \subseteq G$.  We say that $H$ is a \textbf{subgroup} of $G$ if the following three properties hold:
\begin{enumerate}
\item \textbf{Closure}: For any two elements $h_1, h_2 \in H$, $h_1 \cdot h_2$ is also in $H$.
\item \textbf{Identity}: The identity $id$ of $G$ is in $H$.
\item \textbf{Inverses}: If $h_1 \in H$, then $h_1^{-1}$ is also in $H$.
\end{enumerate}

Notice that any subgroup of a group is a group in its own right!  This is because the associativity property is ``inherited'' from the larger group, and we've already checked all of the other properties for being a group.
\end{defn}
\begin{exmps}
The set of even numbers is a subgroup of the integers under addition!  This is because $0$ is an even number (identity), the sum of any two even numbers is even (closure), and the additive inverse of any even number is also even (inverses.)

Conversely, the set of all odd numbers is not a subgroup of the integers under addition: because 0 is not odd, this subset does not satisfy the identity property!

The set of all powers of 2, $\{2^n ~|~ n \in \mathbb{Z}\}$ is a subgroup of the nonzero real numbers under multiplication!  This is because $1 = 2^0$ (identity,) $2^n \times 2^m = 2^{n+m}$ (closure), and $2^n \cdot 2^{-n} = 2^0 = 1$ (inverses) all hold for this subgroup.

Conversely, the set of all even integers is not a subgroup of the nonzero reals under multiplication, as there is no multiplicative inverse for 2 in this set!

The set of all rotations, along with the identity is a subgroup of the group $D_{2n}$ of symmetries of a $n$-gon: to see this, notice that we have the identity by definition, the inverse of rotating by $\theta$ is another rotation (by $2\pi- \theta$), and the composition of two rotations (by $\theta, \varphi$) is just the rotation given by summing their angles $(\theta + \varphi$.)
\end{exmps}

Given the idea of a subgroup, a natural extension of this idea is the concept of \textbf{cosets}:

\begin{defn}
Suppose that $\langle G, \cdot\rangle$ is a group, $s \in G$ is some element of $G$, and $H$ is a subgroup of $G$.  We define the \textbf{left coset} of $H$ corresponding to $s$ as the set
\begin{align*}
Hs = \{sh ~|~ h \in H\}.
\end{align*}
We will often omit the ``left'' part of this definition and simply call these objects cosets.  
\end{defn}

\begin{exmp}
Consider the group $G = \langle \mathbb{Z}, +\rangle$.  One subgroup of this group is the collection of all multiples of $5$: i.e.\
\begin{align*}
H = \{\ldots -15, -10, -5, 0, 5,10,15 \ldots\}
\end{align*}
This subgroup has several left cosets:
\begin{itemize}
\item $s = 0$: this forms the coset
\begin{align*}
0+H =\{\ldots -15, -10, -5, 0, 5,10,15 \ldots\},
\end{align*}
which is just $H$ itself.
\item $s = 1$: this forms the coset
\begin{align*}
1+H = \{\ldots -14, -9, -4, 1, 6,11,16 \ldots\}.
\end{align*}
\item $s = 2$: this forms the coset
\begin{align*}
2+H = \{\ldots -13, -8, -3, 2, 7,12,17 \ldots\}.
\end{align*}
\item $s = 3$: this forms the coset
\begin{align*}
3+H = \{\ldots -12, -7, -2, 3, 8,13,18 \ldots\}.
\end{align*}
\item $s = 4$: this forms the coset
\begin{align*}
4+H = \{\ldots -11, -6, -1, 4, 9,14,19 \ldots\}.
\end{align*}
\end{itemize}

Notice that this collection of cosets above is indeed the collection of \textbf{all} of the possible cosets of $H$ within $G$: if we take any other element in $\mathbb{Z}$, like say 13, we'll get one of the five cosets above: i.e.
\begin{align*}
13+H = \{\ldots -2, 3, 8, 13, 18 \ldots\} = 3+H.
\end{align*}
In general, $H+x = H+y$ for any $x \equiv y \mod 5$.
\end{exmp}

\begin{exmp}
Consider the group $G = \langle (\mathbb{Z} / 7 \mathbb{Z})^\times, \cdot \rangle$, i.e.\ the nonzero integers mod 7 with respect to the multiplication operation.  This has the set
\begin{align*}
H = \{1, 6\}
\end{align*}
as a subgroup (check this if you don't see why!)

This group has the following cosets:
\begin{itemize}
\item $s = 1$, which creates the cosets $H \cdot 1 = H$,
\item $s = 2$, which creates the coset
\begin{align*}
2 \cdot H = \{ 2, 5\}.
\end{align*}
\item $s = 3$, which creates the coset
\begin{align*}
3 \cdot H = \{ 3, 4\}.
\end{align*}
\item $s = 4$, which creates the coset
\begin{align*}
4 \cdot H = \{ 4, 3\}.
\end{align*}
Notice that this coset is the same as $H \cdot 3$.
 \item $s = 5$, which creates the coset
\begin{align*}
5 \cdot H = \{ 5, 2\}.
\end{align*}
Notice that this coset is the same as $H \cdot 2$.
\item $s = 6$, which creates the coset
\begin{align*}
6 \cdot H = \{ 6, 1\}.
\end{align*}
Notice that this coset is the same as $H$.
\end{itemize}

So, in total we have three distinct cosets!
\end{exmp}

\begin{exmp}
Consider the group $S_3$.  This group has the subgroup
\begin{align*}
H = \{id, (123), (132)\}
\end{align*}
as a subgroup.  This subgroup has two possible distinct cosets:
\begin{itemize}
\item $id \cdot H=  (123) \cdot H=  (132)\cdot H$ are all the same coset, which is just $H$.
\item $(12) \cdot H =  (13)\cdot H = (23) \cdot H= \{(12), (13), (23)\}$.
\end{itemize}
\end{exmp}

Cosets have a number of remarkably useful properties:
\begin{thm}
Take any finite group $\langle G, \cdot \rangle$ and any subgroup $H$.
\begin{enumerate}
\item For any $s \in G$, the left coset $sH$ is equal to $H$ if and only if $s \in H$.
\item Two cosets $sH, tH$ are either completely identical or completely disjoint.
\item The various possible cosets of $H$ \textbf{partition} $G$ into a collection of disjoint subsets.  (In particular, this proves that the number of elements in $H$ must divide the number of elements in $G$.)
\item All cosets of $H$ are the same size: i.e. $|sH| = |H|$ for any $s \in G$.
\item If there are $k$ distinct cosets of $H$, then $k|H| = |G|$.
\end{enumerate}
\end{thm}
\begin{proof}
Take any group $\langle G, \cdot \rangle$ and any subgroup $H$.  We prove these properties in order.  

\begin{enumerate}
\item Take any $s \in G$.  If $s \in H$, then because $H$ is a subgroup we have that $s^{-1}$ is in $H$, and therefore that for any $h \in H$ we have $s^{-1}h$ in $H$.  Consequently, every member of $H$ is in $sH$.  As well, any member of $sH$ is a product of two elements of $H$; therefore by closure, $sH$ is a subset of $H$.  Therefore we have proven that $Hs = H$, as claimed.

Conversely, when $s \notin H$, we want to show that $sH \neq H$.  But this is trivial: because $H$ contains the identity, we know that $s = s \cdot id \in sH$, but $s \notin H$; so these are different sets.

\item  Take any two cosets $sH, tH$.  If they are not completely disjoint, then there is some element they share in common: in other words, there is some $h_1, h_2 \in H$ such that $sh_1  = t h_2$.  But this means that $t^{-1}s =  h_1 h_2^{-1}, s^{-1}t = h_1h_2^{-1}$, and therefore that $t^{-1}s, s^{-1}t$ are elements in $H$.  

So, take any $th_3 \in tH$.  We can write $th_3 = t (t^{-1}s)(t^{-1}s)^{-1} h_3 = s (t^{-1}s)^{-1}h_3;$ i.e. $th_3$ is an element of the form $s \cdot$ something in $H$!  So $tH \subseteq sH$.  

Similarly, for any $sh_3 \in sH$, we can write $sh_3 = s (s^{-1}t)(s^{-1}t)^{-1} h_3 = t (s^{-1}t)^{-1} h_3$; i.e. $sh_3$ is of the form $t \cdot$ something in $H$!  So $sH \subseteq tH$ as well, and we've proven our claim.

\item  Simply notice that for any element $g \in G$, $gH$ contains $g$; this is because the identity is in $H$, and therefore that $g \cdot id = g \in gH$.  But this means that every element is in some coset: if we combine this with (2), we have that every element is in exactly one coset.  But this is what it means to be a partition!

\item On one hand, we know that $sH = \{sh ~|~ h \in H\}$ means that we cannot have more elements in $sH$ than we have in $H$, because we only get one element in $Hs$ for each element of $H$.  But if we ever had $sh_1  = sh_2 $, we could multiply by $s^{-1}$ on the left to get $h_1 = h_2$: consequently, we can conclude that we have exactly as many elements in $sH$ as we do in $H$!

\item By point 3, the cosets of $H$ partition $G$: that is, if we add up the sizes of all of our cosets, we will get the size of $G$.  On the other hand, by point 4, all of these cosets are the same size; so the number of elements in all of our cosets is just $k|H|$.  So we've proven our claim!
\end{enumerate}
\end{proof}

Point 5 has a very famous corollary, in the form of Lagrange's theorem:
\begin{thm}
(Lagrange.)  Let $\langle G, \cdot \rangle$ be a finite group, and $H$ be any subgroup of $G$. Then the order of $H$ divides the order of $G$.
\end{thm}



\subsection{Group Actions}

Several of the groups we defined in these notes --- $S_n, D_{2n}$ --- are interesting because they are groups defined by how they \textbf{act} on some outside object.  For example, elements of $S_n$ are permutations of the set $\{1,2,\ldots n\}$; that is, they are defined by how they shuffle the elements of a set around.  Similarly, elements of $D_{2n}$ are symmetries of a $n$-gon; that is, they are defined by how they move the vertices of some $n$-sided shape around!  This motivates us to introduce the idea of a \textbf{group action}:


\begin{defn}
A \textbf{group action} of a group $\langle G, \cdot \rangle$ on a set $X$ is any map $\star: G \times X \to X$ that satisfies the following two properties:
\begin{enumerate}
\item \textbf{Identity}: If $e$ is the identity in $G$, then for any $x \in X$, we have $e \star x = x.$
\item \textbf{Compatible with the group operation}:  For any two elements $g, h \in G$ and any element $x \in X$, we have $g \star (h \star x) = (g \cdot h) \star x$.  
\end{enumerate}
The idea with this second operation is that it says that it doesn't matter whether we apply $g, h$ one-by-one using $\star$ to $x$, or if we combine them first in $G$ with $\cdot$ and then apply the result to $x$.  In both cases we get the same thing!
\end{defn}

We list several useful examples of group actions:

\begin{exmp}
Take the group $S_n$, and consider the following action of this group on the set $\{1,2,\ldots n\}$: for any $\sigma \in S_n, k \in \{1, \ldots n\}$, set $\sigma \star k = \sigma(k)$.  For example, if $\sigma = (123)$ and $k=2$, we would say $\sigma(2) = 3$.

This is a group action!  To see this, we just check our definition:
\begin{enumerate}
\item \textbf{Identity}: The identity of $S_n$ is just the identity map $id$ on $\{1, \ldots n\}$.  Therefore, for any $k \in \{1, \ldots n\}$ we have $id \star k = id(k) = k$: so we satisfy the identity property!
\item \textbf{Compatible with the group operation}:  Take any two permutations $\sigma, \varphi \in S_n$, and any $k \in \{1, \ldots n\}$.  Notice that $( \sigma \circ \varphi) \star(k) = \sigma(\varphi(k))$, and $\sigma \star (\varphi \star k) = \sigma \star (\varphi(k)) = \sigma(\varphi(k))$ is just the same thing; therefore we are compatible with our group's operation! 
\end{enumerate}
\end{exmp}


\begin{exmp}
Take the group $D_{2n}$, and consider the following way in which it acts on the set of vertices $\{v_1, \ldots v_n\}$, listed in order, of a $n$-gon: if $f$ is a symmetry of our $n$-gon, then we say that $f \star v_k$ is just $f(v_k)$.  In other words, our action sends $v_k$ to whatever vertex $f$ maps $v_k$ to.  Show that this is a group action of $D_{2n}$ on $\{v_1, \ldots v_n\}$.

This is a group action!  To see this, we just check our definition:
\begin{enumerate}
\item \textbf{Identity}: The identity of $D_{2n}$ is just the identity map $id$ on $\{v_1, \ldots v_n\}$.  Therefore, for any $k \in \{v_1, \ldots v_n\}$ we have $id \star k = id(k) = k$: so we satisfy the identity property!
\item \textbf{Compatible with the group operation}:  Take any two symmetries $f, g \in S_n$, and any $v_i \in \{v_1, \ldots v_n\}$.  Notice that $( f \circ g) \star(v_i) = f(g(v_i))$, and $f \star (g \star v_i) = f \star (g(v_i)) = f(g(v_i))$ is just the same thing; therefore we are compatible with our group's operation! 
\end{enumerate}
\end{exmp}

\begin{exmp}
For any group $\langle G, \cdot\rangle$, consider the following way in which $G$ could act on \textbf{itself}: for any $g \in G, h \in G$, set $g \star h = g \cdot h$. This is a group action of $G$ on $G$:

\begin{enumerate}
\item \textbf{Identity}: Suppose that the identity of $G$ is $e$.  Then, for any $g \in G,$ we have $e \star g = e \cdot g = g$; so we satisfy the identity property!
\item \textbf{Compatible with the group operation}:  Take any two elements $g, h \in G$, and any $k \in G$.  Notice that $( g \cdot h) \star(k) =g \cdot h \cdot k$, and $g \star (h \star k) = g \star (h \cdot k) = g \cdot h \cdot k$ is just the same thing; therefore we are compatible with our group's operation! 
\end{enumerate}
\end{exmp}



\section{Burnside's Lemma and Necklace Problems}

\subsection{Orbits, Stabilizers, and Fixed Points}
It might seem like we've introduced an awful lot of notation for a relatively simple necklace problem; but if you look at the machinery we've assembled, it's all actually pretty natural.  In our necklace problem, we have the following:
\begin{itemize}
\item A set given by all of the $2^n$ necklaces in two colors on $n$ shells.
\item A way for the group of rotational symmetries on a $n$-gon to \textbf{act} on this set; given any necklace, we act on it by a rotation by rotating that necklace!
\end{itemize}
From here, we want to know what are all of the elements that are ``distinct'' under these rotations.  To make this more formal, consider the following definitions:
\begin{defn}
Suppose that $X$ is a set and $G$ is a group that acts on $X$ by some operation $\star$.  For any $x \in X$, make the following definitions:
\begin{itemize}
\item The \textbf{orbit} of $x$, denoted $Orb(x)$, is the collection of all elements in $X$ that can be reached by starting at $x$ and multiplying $x$ by an appropriate element: that is,
\begin{align*}
Orb(x) = \{g \star x ~|~ g \in G\}.
\end{align*}
\item The \textbf{stabilizer} of $x$, denoted $Stab(x)$, is the collection of all elements in $G$ that ``don't move'' $x$: that is,
\begin{align*}
Stab(x) = \{g \in G ~|~ g \star x = x\}.
\end{align*}
\item The \textbf{fixed points} of an element $g$, denoted $Fix(g)$ for any $g \in G$, is the collection of all of the elements of $x$ ``unmoved'' by $G$: that is,
\begin{align*}
Fix(g) = \{ x \in X ~|~ g \star x = x \}.
\end{align*}
\end{itemize}
\end{defn}
Notice the following properties:
\begin{prop}
Take any group $G$ acting on a set $X$.  Then the sets $Orb(x)$ partition the set $X$; that is, every element of $X$ is in some set $Orb(x)$, and for any $x, y \in X$, the sets $Orb(x), Orb(y)$ are either completely disjoint or identical.
\end{prop}
\begin{proof}
The first property is easy to check.  Let $e$ denote the identity of our group $G$; then, for any $x \in X$, we have $e \star x = x$ by definition.  But this means that $x \in Orb(x)$; so every $x \in X$ is in one of these sets.

For the second property:\ take any two sets $Orb(x), Orb(y)$.  We claim that these two sets are either disjoint or identical; to prove this, we can simply look at the case where they are not disjoint and prove that they must be identical.  

Let $z \in X$ be an element in both $Orb(x), Orb(y)$; then there are group elements $g_1, g_2 \in G$ with $g_1 \star x = g_2 \star y = z.$  By compatibility, we can see that
\begin{align*}
x = e \star x = (g_1^{-1} \cdot g_1) \star x = g_1^{-1} \star (g_1 \star x) = g_1^{-1} \star (g_2 \star y) = (g_1^{-1} \cdot g_2) \star y,
\end{align*}
and therefore that $x \in Orb(y)$.  But this in particular means that for any $h \in G$, we have
\begin{align*}
h \star x =  (h \cdot g^{-1} \cdot g_2) \star y;
\end{align*}
i.e. \textbf{any} element in $Orb(x)$ is in $Orb(y)$!  Similarly, we can solve for $y$ in terms of $x$ to get that for any $h \in G$,
\begin{align*}
(h \cdot g_2^{-1}\cdot  g_1) \star x = h \star y,
\end{align*}
and can similarly conclude that \textbf{any} element in $Orb(y)$ is in $Orb(x)$.
\end{proof}

\begin{prop}
Take any group $G$ acting on a set $X$.  For any $x \in X$, the set $Stab(x)$ is a subgroup of $G$.
\end{prop}
\begin{proof}
To check that a subset of a group is a subgroup, we just need to check three things:
\begin{itemize}
\item \textbf{Identity}: We need that the identity $e$ of our group is in $Stab(x)$.  This is by definition; for any $x \in X$, $e \cdot x = x$, and therefore $e \in Stab(x)$.
\item \textbf{Closure}: For any $g, h \in Stab(x)$, we need $g \cdot h \in Stab(x)$. This is by compatibility; if $g, h \in Stab(x)$, then $g \star x = h \star x = x$, and therefore $(g \cdot h) \star x = g \star (h \star x) = g \star x = x$.
\item \textbf{Inverses}: For any $g \in Stab(x)$, we need $g^{-1} \in Stab(x)$.  This is also by compatibility; if $g \in Stab(x)$, then $g \star x = x$, and therefore $ g^{-1} \star x = (g^{-1} \cdot g) \star x = e \star x = x$, so $g^{-1}$ is also in $Stab(x)$.
\end{itemize}
\end{proof} 


In this sense, our necklace problem is a specific instance of the following problem: given a group $G$ acting on a set $X$, how many \textbf{different} orbits are there?  (I.e. how many ``different'' necklaces are there, given that an orbit of a necklace is just all of the things equivalent to that necklace under rotation?)

We answer this with the last two bits of algebra needed to solve our problem: the \textbf{Orbit-Stabilizer Theorem} and \textbf{Burnside's Lemma}!
\subsection{Theorems!}
\begin{thm}
(Orbit-Stabilizer Theorem.)  Let $G$ be a finite group that acts on a set $X$, and take any element $x \in X$.  Then
\begin{align*}
|G| = |Orb(x)| \cdot |Stab(x)|.
\end{align*}
\end{thm}
\begin{proof}
Let $G/Stab(x)$ denote the collection of all of the cosets of the subgroup $Stab(x)$ in $G$. For each coset $K$ of $Stab(x)$, pick an ``representative'' element $g \in K$ in that coset; then we can write $K = g \cdot Stab(x)$ (this is because $K, g \cdot Stab(x)$ are two cosets that both contain $g$, and therefore must be equal by our results earlier.)  This makes it easier to work with our cosets!


Consider the following function $f: G/Stab(x) \to Orb(x)$: for any coset $g \cdot Stab(x)$ with representative $g$, define 
\begin{align*}
f(g \cdot Stab(x)) = g \star x.
\end{align*}

I claim that $f$ is a bijection.  To see this, we just check injectivity and surjectivity: 
\begin{itemize}
\item \textbf{Injectivity}: Suppose that $g\cdot Stab(x), h \cdot Stab(x)$ are two cosets that get mapped to the same element; then $g \star x = h \star x$.  But this means that $(g^{-1} \cdot h) \star x = (g^{-1} \cdot g) x = e \star x = x$; i.e. that $g^{-1} \cdot h \in Stab(x)$.  But this means that $g \cdot g^{-1} \cdot h  = h \in g Stab(x)$; that is, that $g \cdot Stab(x), h \cdot Stab(x)$ are not disjoint!  Therefore they are the same.  Consequently, we've proved injectivity, as we've shown that the only way for two cosets to map to the same element is if those two cosets were identical.
\item \textbf{Surjectivity}: Take any $h \star x \in Orb(x)$.  Because the cosets of $Stab(x)$ partition $G$, there is some coset $g \cdot Stab(x)$ with $h \in g \cdot Stab(x)$.

But this just means that $h = g \cdot k$ for some $k \in Stab(x)$; consequently, we have that $h \star x = (g \cdot k)\star x = g \star ( k \star x) = g \star x = f(g \cdot Stab(x))$.  So we map to $h \star x$, and are therefore surjective!
\end{itemize}
Therefore, we have that the number of cosets of $Stab(x)$ is the same size as the number of elements in $Orb(x)$.  But by our work earlier, we know that the number of cosets is just $|G|/|Stab(x)|$; combining gives us
\begin{align*}
|G| = |Orb(x)| \cdot |Stab(x)|,
\end{align*}
as claimed.
\end{proof}



\begin{thm}
(Burnside's\footnote{Often known as the Cauchy-Frobenius lemma, or ``the lemma that is not Burnside's,'' as Burnside did not prove this result; he simply cited it and attributed it to Frobenius in a book he wrote on finite groups.  History!} Lemma.)  Let $G$ be a finite group acting on a set $X$.  Let $k$ denote the number of distinct orbits of elements of $X$ under this action, and let $\Omega_1, \ldots \Omega_k$ denote these $k$ different orbits.   Then
\begin{align*}
k|G|  = \sum_{g \in G} |Fix(g)|.
\end{align*}
\end{thm}
\begin{proof}
Consider the set $S$ of all pairs $(g,x)$ where $g$ fixes $x$: that is,
\begin{align*}
S = \{ (g,x) ~|~ g \star x = x\}.
\end{align*} 

If we group pairs $(g,x)$ by their first element, we can see that for a fixed $g \in G$ the number of pairs $(g,x)$ with $g \star x = x$ is just the number of elements $x \in X$ that are fixed by $G$: that is, we have
\begin{align*}
|S| = \sum_{g \in G} |\{ x ~|~ g \star x = x\}| = \sum_{g \in G} |Fix(g)|.
\end{align*}

On the other hand, if we group pairs $(g,x)$ by their second element, we can see that for a fixed $x \in X$ the number of pairs $(g,x)$ where $g \star x = x$ is just the number of elements $g \in G$ that fix $x$: that is,
\begin{align*}
|S| = \sum_{x \in X} |Stab(x)|.
\end{align*}
If we split $X$ apart into its $k$ disjoint orbits $\Omega_1, \ldots \Omega_k$, we have
\begin{align*}
|S| = \sum_{i=1}^k \sum_{x \in \Omega_i} |Stab(x)|.
\end{align*}
By the orbit-stabilizer result earlier, we know that $|Stab(x)| = \frac{|G|}{|\Omega_i|}$, for any $x$ in the orbit $\Omega_i$; so we actually have
\begin{align*}
|S| = \sum_{i=1}^k \sum_{x \in \Omega_i} \frac{|G|}{|\Omega_i|} = |G| \sum_{i=1}^k \sum_{x \in \Omega_i} \frac{1}{|\Omega_i|}.
\end{align*}
But, for any $\Omega_i$, the sum
\begin{align*}
 \sum_{x \in \Omega_i} \frac{1}{|\Omega_i|} = 1,
\end{align*}
as we're just adding up the quantity $\frac{1}{|\Omega_i|}$ a total of $|\Omega_i|$-many times!  So we actually have
\begin{align*}
|S| =  |G| \sum_{i=1}^k 1 = k|G|.
\end{align*}

Combining this with our first result, we have
\begin{align*}
k|G|  = \sum_{g \in G} |Fix(g)|,
\end{align*}
as claimed.

\end{proof}




\subsection{Applications}

We start by using this machinery to solve our necklace problem:

\begin{quest}
Take any prime number $n$.  Suppose we look at the set $X$ of all $2^n$ necklaces on $n$ shells, where each shell is either black or white; denote this collection as the set
\begin{align*}
X = \{ (s_1, \ldots s_n) ~|~ s_i \in \{W, B\} \}.
\end{align*}  
Let the group $\langle \mathbb{Z}/n\mathbb{Z}, + \rangle$ act on this set by saying that for any $a \in \mathbb{Z}/n\mathbb{Z}$, we have
\begin{align*}
a \star (s_1, \ldots s_n) = (s_{1+a}, s_{2+a}, \ldots s_{n+a}),
\end{align*}
where the arithmetic in the subscripts above is calculated mod $n$.  (So, for example, $1 \star (s_1, s_2, s_3)$ would be $(s_2, s_3, s_1)$.)

How many necklaces are distinct under this action; in other words, how many different orbits exist for this group action?
\end{quest}
\begin{answer}
By Burnside's lemma, we have
\begin{align*}
k|G|  = \sum_{g \in G} |Fix(g)|,
\end{align*}
where $k$ is the number of orbits (i.e. what we want to find,) and $|G| = |\mathbb{Z}/n\mathbb{Z}| = n$.  So it suffices to understand the sets $|Fix(g)|$, for all $g \in G$.

Notice that necklaces in $X$ come in two different kinds:
\begin{itemize}
\item Some necklaces --- specifically, two necklaces, the all-white and all-black necklaces --- have all of their shells the same color.  These necklaces are fixed by every element of $G$, as they are the same under any rotation.
\item Other necklaces have shells of different colors.  I claim that these necklaces are not fixed by any element of $G$ other than the identity element (i.e. 0)  To see why, take any necklace $(s_1, \ldots s_n)$, and any element $a \neq 0 \in \mathbb{Z}/n\mathbb{Z}$ such that $a \star (s_1, \ldots s_n) = (s_1, \ldots s_n)$.

Then, for any $k$, we have 
\begin{align*}
(s_1, \ldots s_n) = a \star (s_1, \ldots s_n) &= a \star a \star (s_1, \ldots s_n) \\
&= a \star a \star a \star (s_1, \ldots s_n) \\
& \ldots \\
&= \overbrace{a \star a \star \ldots \star a}^{k \textrm{ times}} \star (s_1, \ldots s_n) \\
&= (\overbrace{a + a + \ldots + a}^{k \textrm{ times}})\star (s_1, \ldots s_n)\\
&= (k\cdot a) \star(s_1, \ldots s_n).\\
\end{align*}

But $n$ is a prime number, and $a \neq 0$; so, in the \textbf{multiplicative} group $\langle (\mathbb{Z}/n\mathbb{Z})^\times, \cdot\rangle$, $a$ has an inverse element; call it $a^{-1} \in \mathbb{Z}/n\mathbb{Z})^\times$.  Then, for any $b \in \mathbb{Z}/\mathbb{Z}$, if we let $k = ba^{-1}$, we have 
\begin{align*}
(s_1, \ldots s_n) &= (ba^{-1} a) \star(s_1, \ldots s_n)\\
&= (b) \star(s_1, \ldots s_n)\\
&= \star(s_{1+b}, \ldots s_{n+b}).\\
\end{align*}
In other words, we have $s_1 = s_{1+b}$ for any $b$; i.e. every shell in our necklace is the same!
\end{itemize}

This means that the $ |Fix(g)|$ sets come in two different kinds:
\begin{itemize}
\item $g = 0$.  The identity fixes every element in $X$ by assumption; so $|Fix(0)| = 2^n$, the set of all of our necklaces.
\item $g \neq 0$.  Then, as shown above, there are only two necklaces that $g$ fixes; so $|Fix(g)| = 2$.
\end{itemize}

Therefore,

\begin{align*}
kn = \sum_{g \in G} |Fix(g)| = |Fix(0)| + \sum_{g \neq 0 \in \mathbb{Z}/n\mathbb{Z}} |Fix(g)| = 2^n +  \sum_{g \neq 0 \in \mathbb{Z}/n\mathbb{Z}}  2 = 2^n + 2(n-1),
\end{align*}
and therefore that the number of distinct orbits is
\begin{align*}
\frac{2^n + 2(n-1)}{n}.
\end{align*}
Success!
\end{answer}



We turn here to a problem you will likely remember from our  first class:
\begin{quest}
Suppose that you have a set of $n$ different postcards, out of which you want to choose $k$.  In how many ways can you do this, if you don't care about the order in which you picked your cards?
\end{quest}
\begin{answer}
So, on one hand, we already know the answer here: it's $\binom{n}{k}$.  To show this at the time, though, we had to do something fairly odd with equivalence classes (or indeed when we studied this again with generating functions, we had to find some recurrence relations!)  Some people asked at the time if there was a connection here between our answer and the idea of ``quotient groups,'' and at the time I said that something close to that held; what I meant at the time was ``use Burnside's lemma,'' and that's what we'll do here!

Specifically: let's unimaginatively label our $n$ postcards $\{1,2,\ldots n\}$  Let $X$ consist of all of the ways to order our set of $n$ postcards; there are $n!$ elements in $X$, as we've proven in many ways in this class.

To select $k$ postcards, then, we can simply choose any ordering from $X$ and take the first $k$ postcards in that ordering!  So the elements of $X$ correspond to way to pick out $k$ postcards, where we care about the ordering of what we choose and what we do not choose.  How can we get from here to our desired counting problem, where we don't care about the ordering of what we choose or the ordering of what we don't choose?

We start, as always, with a few definitions.  Given two groups $G, H$, define their \textbf{direct product} as follows:
\begin{defn}
Given two groups $\langle G, \cdot\rangle$, $\langle H, \cdot \rangle$ we define their \textbf{direct product} $\langle G \times H, $ as follows:
\begin{itemize}
\item The set: $G \times H = \{ (g,h) ~|~ g \in G, h \in H\}$.
\item The operation: for any $(g_1, h_1), (g_2,h_2) \in G \times H$, set $(g_1, h_1) \cdot (g_2, h_2) = (g_1 \cdot g_2, h_1 \cdot h_2)$, where the operations inside the parentheses come from the original groups $G, H$.
\end{itemize}
It's not hard to check that this satisfies the properties of being a group; do so if you're curious!
\end{defn} 

For this problem, I specifically want to consider the cartesian product $G = S_k \times S_{n-k}$; that is, the group of all permutation $(\sigma, \pi)$, where $\sigma \in S_k$, $\pi \in S_{n-k}$.  This group acts on our set $X$ of postcard-orderings as follows: for any postcard ordering $P = (p_1, \ldots p_n) \in X$, define $(\sigma, \pi) \star P$ as the ordering given by using $\sigma$ to permute the first $k$ postcards, and using $\pi$ to permute the remaining $n-k$ postcards.  In symbols, we write this as
\begin{align*}
(\sigma, \pi) \star (p_1, p_2, \ldots p_k, p_{k+1}, \ldots p_n) = (p_{\sigma(1)}, p_{\sigma(2)}, \ldots p_{\sigma(k)}, p_{k + \pi(1)}, p_{k + \pi(2)}, \ldots p_{k + \pi(n-k)}).
\end{align*}

We like this group action because it captures exactly what we meant by ``we don't care about the ordering:'' given any two orderings $P_1, P_2 \in X$, we consider $P_1, P_2$ to be the ``same'' ways to pick out $k$ postcards if they have the same first $k$ elements in some order: in other words, we consider $P_1$ and $P_2$ to be the same if there is some reorderings $(\sigma, \pi)$ of $P_1$'s cards that yields $P_2$!

So, our problem is now a Burnside's lemma problem: we have a set $X$ and a group $G$ acting on $X$, and we want to count the number of elements that are distinct under action by $G$; i.e. the number of distinct orbits of $X$ under this group action.  Therefore, it suffices to understand the fixed points of our group elements under our group action!  This is pretty simple:
\begin{itemize}
\item The identity, as always, fixes everything: so $|Fix(id)| = n!$, the number of elements in $X$.
\item Any other group element, however, fixes nothing!  This is not hard to see; take any pair of permutations $(\sigma, \pi) \neq (id, id)$.  One of $\sigma, \pi$ must not be the identity; therefore, when it acts on any ordered set of postcards, it will shuffle those cards around (and in particular send that ordered set to something different!)  So $|Fix(g)| = 0$ for any non-identity element $g$.
\end{itemize}

Applying Burnside's lemma gives us the following: the number of distinct orbits of $X$ under action by $G$, i.e. the number of ways to choose $k$ cards out of $n$ without caring about the order, is just
\begin{align*}
\frac{1}{|G|}\sum_{g \in G} |Fix(g)| &= \frac{1}{|S_k \times S_{n-k}|}\left( |Fix(0)| + \sum_{g \neq 0 \in \mathbb{Z}/n\mathbb{Z}} |Fix(g)|\right)\\
 &= \frac{1}{k!(n-k)!}\cdot \left(n! + \sum_{g \neq 0 \in \mathbb{Z}/n\mathbb{Z}} 0 \right)\\
  &= \frac{n!}{k!(n-k)!}.
\end{align*}
So we've answered our question.
\end{answer}

We close by studying one last example of Burnside's lemma: counting chords!
\begin{quest}
Consider the standard Western musical scale of tones, where we consider two tones to be equivalent if they differ by an octave: that is, consider the tones
\begin{align*}
C, D\flat, D, E^\flat, E, F, G^\flat, G, A^\flat, A, B^\flat, B
\end{align*}
arranged in a circle as follows:
\begin{center}
\begin{tikzpicture}[scale=1.75,cap=round,>=latex]
        % draw the coordinates

        % draw the unit circle
        \draw[thick] (0cm,0cm) circle(1cm);

        \foreach \x in {0,30,...,360} {
                \filldraw[black] (\x:1cm) circle(0.8pt);
        }
        \draw ( 90:1.25cm) node[fill=white] {$C$};
        \draw ( 60:1.25cm) node[fill=white] {$D^\flat$};
        \draw ( 30:1.25cm) node[fill=white] {$D$};
        \draw (  0:1.25cm) node[fill=white] {$E^\flat$};        
        \draw (330:1.25cm) node[fill=white] {$E$};
        \draw (300:1.25cm) node[fill=white] {$F$};
        \draw (270:1.25cm) node[fill=white] {$G^\flat$};
        \draw (240:1.25cm) node[fill=white] {$G$};
        \draw (210:1.25cm) node[fill=white] {$A^\flat$};
        \draw (180:1.25cm) node[fill=white] {$A$};
        \draw (150:1.25cm) node[fill=white] {$B^\flat$};
        \draw (120:1.25cm) node[fill=white] {$B$};
\end{tikzpicture} \end{center}
We can identify these tones with the group $\mathbb{Z}/12\mathbb{Z}$ as follows:
\begin{center}
\begin{tikzpicture}[scale=3,cap=round,>=latex]
        % draw the coordinates

        % draw the unit circle
        \draw[thick] (0cm,0cm) circle(1cm);

        \foreach \x in {0,30,...,360} {
                \filldraw[black] (\x:1cm) circle(0.8pt);
        }
        \draw ( 90:1.25cm) node[fill=white] {$0 = C$};
        \draw ( 60:1.25cm) node[fill=white] {$1 = D^\flat$};
        \draw ( 30:1.25cm) node[fill=white] {$2 = D$};
        \draw (  0:1.25cm) node[fill=white] {$3 = E^\flat$};        
        \draw (330:1.25cm) node[fill=white] {$4 = E$};
        \draw (300:1.25cm) node[fill=white] {$5 = F$};
        \draw (270:1.25cm) node[fill=white] {$6 = G^\flat$};
        \draw (240:1.25cm) node[fill=white] {$7 = G$};
        \draw (210:1.25cm) node[fill=white] {$8 = A^\flat$};
        \draw (180:1.25cm) node[fill=white] {$9 = A$};
        \draw (150:1.25cm) node[fill=white] {$10 = B^\flat$};
        \draw (120:1.25cm) node[fill=white] {$11 = B$};
\end{tikzpicture} \end{center}

A \textbf{triad} in this sense is any chord (i.e. subset of our tones) made out of three distinct tones; i.e. it is any ordered triple of three distinct elements of $\mathbb{Z}/12\mathbb{Z}$.  In music, we often consider two triples to be ``equivalent'' if one can be translated (musically, the word here is \textbf{transposed}) to become another; i.e. we consider
\begin{align*}
(C, E, G) = (0, 4, 7) \textrm{ and } (F, A, C) = (5, 9, 0) = (0+5, 4+5, 7+5) \mod 12
\end{align*}
to be ``equivalent'' because if we are only capable of discerning relative pitch, the spaces between these notes are all equal!

Similarly, we often consider two triples to be equivalent if the tones of one can be permuted to become the notes of the other: i.e. we consider
\begin{align*}
(C, E, G) = (0, 4, 7) \textrm{ and } (G, C, E) = (7, 4, 0)
\end{align*}
to be equivalent because if all three tones are sounded simultaneously these two chords are indistinguishable.  (Musically, such chords are said to be \textbf{inversions} of each other.)
 
How many distinct musical triads are there, given that we consider two triads to be equivalent if one can be transformed into the other under translation and permutation?
\end{quest}
\begin{answer}
If we phrase this as a Burnside's lemma-styled problem, the answer here is relatively easy to determine!

Let $X$ be the set of all unordered distinct triples of elements from $\mathbb{Z}/12\mathbb{Z}$.  It is not hard to see that $|X| = \binom{12}{3}$, as we are just considering all of the ways to pick out three tones from a set of 12 tones without caring about the ordering.

This is almost an answer to our question: it counts all of the triads up to inversions (i.e. permutations.)  So, to finish our problem, we just need to deal with translation as well!

To do this, we simply consider the group action of $G = \mathbb{Z}/12\mathbb{Z}$ on our set of triples, where for any $k, a,b,c \in \mathbb{Z}/12\mathbb{Z}$, we have
\begin{align*}
k \star \{a,b,c\} = \{a+k, b+k, c+k \},
\end{align*}
where our addition is done mod 12.

This is a group action; moreover, we consider two triads in $X$ equivalent if and only if one can be translated into the other via our group action, so determining the number of distinct orbits here will answer our question about the number of different triads!

As before, we consider the elements of our group case-by-case:
\begin{itemize}
\item As always, the identity $0 \in \mathbb{Z}/12\mathbb{Z}$ fixes everything, so we have $|Fix(0)| = |X| = \binom{12}{3}$.
\item If we consider translation by 4, we have that $\{a,b,c\}$ is a fixed point if and only if
\begin{align*}
4 \star \{a,b,c\} = \{a+4, b+4, c+4\} = \{a,b,c\}.
\end{align*}
In particular, this forces our set to be of the form $\{a, a+4, a+8\}$ after some thought, and implies that there are precisely four such triples -- $\{0,4,8\}, \{1, 5, 9\} \{2, 6, 10\}, \{3,7, 11\}$.  So $|Fix(4)| = 4$.
\item By completely identical reasoning, $|Fix(8)| = 4$ as well!
\item For any other translation, I claim that there are no fixed points.  In fact, we can prove a stronger claim:
\begin{lem}
Suppose that we are working in a $d$-tone system (i.e. in $\mathbb{Z}/d\mathbb{Z}$,) and studying $n$-tuples of tones.


Suppose that $A = \{a_1, \ldots a_n\}$ is an unordered $n$-tuple of tones, and $k \in \mathbb{Z}/d\mathbb{Z}$ is such that $k \star A = A$.  Then $k \cdot n$ is a multiple of $d$.
\end{lem}
\begin{proof}
If $k \star A = A$, then if $a_i \in A$, we must have that $a_i+k$ is in $k \star A$, and therefore in $A$ itself.  Repeating this logic tells us that $a_i + mk \in A$ for any $m$, provided that (as always) we do our arithmetic mod $d$.  Notice that we get precisely $d/gcd(k, d)$-many distinct elements via this operation, as we get a repeat precisely when $mk$ is a multiple of $d$ for the first time.

Take any $a_1 \in A$, and let $A_1 = \{a_1  + mk ~|~ m \in \mathbb{N}\}$.  If $A_1$ is all of $A$, stop; otherwise, there is some other $a_2$ still in $A$ not in $A_1$.  Define $A_2 = \{a_2 + mk ~|~ m \in \mathbb{N}\}$.  Notice that $A_1, A_2$ have no elements in common, as $a_1 + mk = a_2 + m'k \Rightarrow a_1 + (m-m')k = a_2$, and we would have then had $a_2$ in $A_1$.  

Repeat this process until we can't go any further.  This gives us a bunch of sets $A_1, \ldots A_l$, each of size $d/gcd(d, k)$.  


Because we have $n$ elements in $A$, we must also have $n$ elements in $k \star A$; therefore we have
\begin{align*}
l \cdot \frac{d}{gcd(d, k)} = n \Rightarrow l \cdot d \cdot \frac{k}{gcd(d, k)} = kn.
\end{align*}
$\frac{k}{gcd(d, k)}$ is always an integer, as it is $k$ divided by some of its factors; so the LHS above is two integers times $d$.  Therefore the RHS is a multiple of $d$, and we've proven our claim!
\end{proof}

Therefore, in any $d$-tone system where we're picking out $n$-tuples of tones, the only value $k$ in $\mathbb{Z}/d\mathbb{Z}$ where we can possibly have fixed points are when $kn$ is a multiple of $d$.  In particular, for our problem here, we are considering $n=3$-tuples of tones; so the only possible fixed points are when $3k$ is a multiple of 12; i.e. when $k = 0, 4, 8$!  So no other group elements have fixed points in this problem; i.e. $|Fix(g)| = 0$ for $g \neq 0, 4, 8$.
\end{itemize}

Therefore, by Burnside's lemma, the number of distinct orbits (i.e. number of distinct triads) is
\begin{align*}
\frac{1}{|G|}\sum_{g \in G} |Fix(g)| &= \frac{1}{12}\left( |Fix(0)| + |Fix(4)| + |Fix(8)|\right) = \frac{\binom{12}{3} + 4 + 4}{12} = \frac{228}{12} = 19.
\end{align*}

(Similar methods can enumerate all of the different 4-tuples of tones, or in general all of the $n$-tuples for any $n$; try it if you're interested!)
\end{answer}

\end{document}