Solution (source code)

= Solution

The singleton orbits are exactly $X^G$. Every other orbit represented by $x$ has size $|G|/|G_x|$ by the <orbit-stabilizer theorem>. Partitioning $X$ into its <orbits of a group action> therefore gives
$$
|X|=|X^G|+\sum_x\frac{|G|}{|G_x|}.
$$

For the second identity, count
$$
Z=\{(g,x)\in G\times X:g\cdot x=x\}
$$
in two ways. Holding $g$ fixed gives
$$
|Z|=\sum_{g\in G}|X^g|.
$$
Holding $x$ fixed gives $|Z|=\sum_{x\in X}|G_x|$. Each orbit contributes $|G|/|G_x|$ points, each with stabilizer size $|G_x|$, and hence contributes $|G|$. Thus $|Z|=|G|\,|X/G|$, proving <Burnside lemma>:
$$
\boxed{|X/G|=\frac1{|G|}\sum_{g\in G}|X^g|}.
$$