Why composition in $S_3$ is not commutative
The family of all the permutations of a set $X$, denoted by $S_X$, is called the symmetric group on $X$. When $X = \{1, 2, \dots , n\}$, $S_X$ is usually denoted by $S_n$, and it is called the symmetric group on $n$ letters. Notice that composition in $S_3$ is not commutative.
Why is composition in $S_3$ not commutative?
$\endgroup$ 55 Answers
$\begingroup$Suppose \begin{align} f(1) & = 2 \\ f(2) & = 1 \\ f(3) & = 3 \end{align} and \begin{align} g(1) & = 1 \\ g(2) & = 3 \\ g(3) & = 2 \end{align}
Then $f(g(1))=2$ and $g(f(1))=3$. So $f\circ g\ne g\circ f$.
$\endgroup$ 0 $\begingroup$Here's a sledgehammer answer without computation. By the classification of finite abelian groups, every abelian group with six elements is isomorphic to $\mathbb{Z} / 6\mathbb{Z}$. But $S_3 \not\cong \mathbb{Z} / 6\mathbb{Z}$ since each element of $S_3$ has order 1, 2, or 3 (depending on its cycle type).
$\endgroup$ $\begingroup$Considering @anon's comment, we have the following presentation for $S_3$: $$S_3=\langle a,b\mid a^2=b^3=(ab)^2=1\rangle$$ So we have $abab=(ab)^2=1$, and if $ab$ wants to be equal with $ba$ so we have $$1=abab=a(ba)b=a(ab)b=a^2b^2=b^2$$ but $b^3=1,~~ \gcd(3,2)=1$ so...
$\endgroup$ 3 $\begingroup$$S_3$ is the symmetry group of an equilateral triangle. The symmetries are:
I. Do nothing
A. Rotate 120 degrees counterclockwise
B. Rotate 240 degrees counterclockwise
X. Flip about the symmetry axis through the upper vertex
Y. Flip about the symmetry axis through the lower left-hand vertex
Z. Flip about the symmetry axis through the lower right-hand vertexYou can easily check that if you perform first A and then X it is not the same as first X and then A.
$\endgroup$ $\begingroup$This is a little more complicated than trying a few permutations and finding a pair that does not commute, but it is an opportunity to mention a useful fact about conjugate permutations.
Notice that if we know a permutation $\tau$ then it is easy to compute $\varphi \circ \tau \circ \varphi^{-1}$. Indeed, if $\tau$ maps $a$ to $b$, then $\varphi \circ \tau \circ \varphi^{-1}$ maps $\varphi(a)$ to $\varphi(b)$. $$\varphi(a) \overset{\varphi^{-1}}\mapsto a \overset{\tau}\mapsto b \overset{\varphi}\mapsto \varphi(b)$$
So if we take a permutation $\tau$ written in cycle notation, to compute the permutation $\varphi \circ \tau \circ \varphi^{-1}$ we simply replace $a$ by $\phi(a)$ for each $a$.
For example if $\tau=(123)$ and $\varphi=(12)$, then $\varphi\tau\varphi^{-1} = (213)$.
Another example: For $\tau=(12)$ and $\varphi=(123)$ we get $\varphi\tau\varphi^{-1} = (23)$.
And how is this related to commutativity? Just notice that $$\varphi \circ \tau = \tau \circ \varphi \qquad \Leftrightarrow \qquad \varphi \circ \tau \circ \varphi^{-1} = \tau.$$ The above example is an example of permutations $\varphi$, $\tau$ such that this equality does not hold. (And you can easily find other examples.)
Perhaps I should mention that some books compose the permutations exactly in the opposite order.
$\endgroup$