Example

Let g : {1, 2, 3, 4} -> {1, 2, 3, 4} be the permutation with

g(1) = 2, g(2) = 3, g(3) = 1, g(4) = 4,

and let h : {1, 2, 3, 4} -> {1, 2, 3, 4} be the permutation with

h(1) = 1, h(2) = 3, h(3) = 4, h(4) = 2.

Then gh is the permutation with

gh(1) = g(1) = 2, gh(2) = g(3) = 1, gh(3) = g(4) = 4, gh(4) = g(2) = 3,

(so h is applied first), whereas hg is the permutation

hg(1) = h(2) = 3, hg(2) = h(3) = 4, hg(3) = h(1) = 1, hg(4) = h(4) = 2.

In particular, gh and hg are not the same. The official terminology is that g and h do not commute.

The inverse of g is the map that sends 1 to 3, 2 to 1, 3 to 2, 4 to 4.

We will shortly describe notations for permutations that are more convenient for our purposes: matrix notation, list notation and disjoint cycles notation.