Permutation
A permutation represents a particular way of arranging the elements in a set.
Formal definition
Let $S$ be a set.
$$ \sigma: S \to S $$
is a permutation of set $S$.
Example:
Set $\{1,2,3\}$ has six permutations:
$$ \begin{cases} \sigma_1(1)=1,\quad \sigma_1(2)=2,\quad \sigma_1(3)=3,\\ \sigma_2(1)=1,\quad \sigma_2(2)=3,\quad \sigma_2(3)=2,\\ \sigma_3(1)=2,\quad \sigma_3(2)=1,\quad \sigma_3(3)=3,\\ \sigma_4(1)=2,\quad \sigma_4(2)=3,\quad \sigma_4(3)=1,\\ \sigma_5(1)=3,\quad \sigma_5(2)=1,\quad \sigma_5(3)=2,\\ \sigma_6(1)=3,\quad \sigma_6(2)=2,\quad \sigma_6(3)=1. \end{cases} $$
Notation
In general, a permutation for set $S=\{s_1,s_2,\cdots,s_n\}$ can be noted:
$$ \sigma = \begin{pmatrix}
s_1 & s_2 & \cdots & s_n \\
\sigma_{s_1} & \sigma_{s_2} & \cdots & \sigma_{s_n}
\end{pmatrix}. $$
Example:
The permutations of $\{1,2,3\}$ are:
$$ \operatorname{Perm}(\{1,2,3\})= \left\{ \begin{pmatrix}1&2&3\\1&2&3\end{pmatrix}, \begin{pmatrix}1&2&3\\2&1&3\end{pmatrix}, \begin{pmatrix}1&2&3\\3&2&1\end{pmatrix}, \begin{pmatrix}1&2&3\\1&3&2\end{pmatrix}, \begin{pmatrix}1&2&3\\2&3&1\end{pmatrix}, \begin{pmatrix}1&2&3\\3&1&2\end{pmatrix} \right\}. $$
Properties
$n$ elements $\Rightarrow $ $n!$ permutations
For any set $S:|S|=n$:
$$ |\operatorname{Perm}(S)|=n! $$
Identity permutation: $\sigma_{id}(s)=s$
The identity permutationfor set $S=\{s_1,s_2,\cdots,s_n\}$
$$ \sigma_id =
\begin{pmatrix}
s_1 & s_2 & \cdots & s_n \\
{s_1} & {s_2} & \cdots & {s_n}
\end{pmatrix}. $$
Example:
The identity permutation for $\{1,2,3\}$ is
$$ \begin{pmatrix} 1&2&3 \\ 1&2&3 \end{pmatrix} $$
Inversion pairs
Let $A$ be a set and
$$ \sigma_1= \begin{pmatrix} a_1&a_2&\cdots$a_n \\ b_1&b_2&\cdots$b_n \end{pmatrix},\, a,b \in A $$
be one of its permutation.
$$\begin{gathered}
\forall a_i,a_j: i,j \in \{1,2,\cdots,n\}, \\
\exists b_p,b_q: p,q \in \{1,2,\cdot,n\} \Rightarrow b_p=a_i, b_q=a_j
\text{if } pj \\
\Rightarrow (p,q) \text{ is an} \textbf{inversion pair}
\end{gathered}$$
If a permutation contains $2n, n \in N$ inversion pairs, it is called an even permutation. Elsewise it is an odd permutation.
Example:
One permutation for $\{a,b,c\}$ is
$$ \begin{pmatrix} \\ a&b&c \\ b&c&a \end{pmatrix} $$
Here, the inversion pairs are $(1,3)$ and $(2,3)$
$\operatorname{sign}(\sigma)$
If permutation $\sigma$ contains m inversion pairs.
$$ \operatorname{sign}(\sigma) = (-1)^m $$
All even permutations have sign $+1$ and all odd ones sign $-1$.