The following question is from Serge Lang's Undergraduate Algebra. I have trouble in finishing part a and understanding part b.
Let $S, T$ be sets and let $M(S,T)$ denote the set of all mappings of $S$ into $T$. Let $G$ be a finite group operating on $S$. For each map $f:S \rightarrow T$ and $x \in G$ define the map $\pi_xf:S \rightarrow T$ by $$ (\pi_xf)(s)=f(x^{-1}s).$$ a) Prove that $x\mapsto \pi_x$ is an operation of $G$ on $M(S,T)$.
b) Assume that $S,T$ are finite. Let $n(x)$ denote the number of orbits of the cyclic group $\langle x \rangle$ on $S$. Prove that the number of orbits of $G$ in $M(S,T)$ is equal to $$\frac{1}{|G|}\sum_{x \in G}|T|^{n(x)}.$$
For part (a), I check the two conditions.
1) For all $f \in M(S,T),$ take any $s \in S$, $\pi_ef(s) = f(e^{-1}s) = f(s).$
2) This is my problem. I want to show $\pi_{gh}f(s)=\pi_g(\pi_hf)(s)$. But I get $$\pi_{gh}f(s) = f(h^{-1}g^{-1}s)$$ $$\pi_g(\pi_hf)(s) = f(g^{-1}h^{-1}s)$$ What happen?
For part b, I have no clue at all. I would be thankful if you can tell me your thoughts.
Thanks in advance.
(a) $$ \begin{align} (\pi_{gh} f)(s) &= f\bigl( (gh)^{-1} s \bigr) \\ &= f( h^{-1} g^{-1} s ) \\ &= (\pi_h f)( g^{-1} s ) \\ &= \bigl(\pi_g (\pi_h f) \bigr)( s ) \end{align} $$
(b) Apply Burnside's Lemma (actually due to Frobenius) to the action of $G$ on $Y = M(S,T)$: $$ \bigl| Y / G \bigr| = \frac{1}{|G|} \sum_{g \in G} \bigl| Y^{g} \bigr|. $$ Now, for any $g \in G$, it remains to be seen that the fixed set $\bigl| Y^g \bigr| = |T|^{n(g)}$. For any $s \in S$, put $s' = gs$, then $(\pi_g f)(s') = f(g^{-1}s') = f(s) \in T$ for any function $f$. If $f \in Y^g$ (i.e., it's fixed by the action of $g$), then$\pi_g f = f$. Combined with the previous calculation, this shows that $f(s') = f(s)$. In fact, $f$ is now constant on the entire orbit: $$ f(s) = f(gs) = f(g^2 s) = \cdots = f(g^{k-1} s). $$ Choosing such a function amounts to choosing one element $t = f(s) \in T$ for each such orbit, and the number of these orbits is $n(g)$.