In mathematics, particularly in matrix theory, a permutation matrix is a square binary matrix that has exactly one entry of 1 1 1 in each row and each column and 0 0 0s elsewhere. Each such matrix, say P P P, represents a permutation of m m m elements and, when used to multiply another matrix, say A A A, results in permuting the rows (when pre-multiplying, to form P A PA PA) or columns (when post-multiplying, to form A P AP AP) of the matrix A A A.
Contents
1 Definition
Given a permutation
π
π
π of
m
m
m elements,
π
:
{
1
,
…
,
m
}
→
{
1
,
…
,
m
}
{\displaystyle \pi :\lbrace 1,\ldots ,m\rbrace \to \lbrace 1,\ldots ,m\rbrace }
π:{1,…,m}→{1,…,m}
represented in two-line form by
(
1
2
⋯
m
π
(
1
)
π
(
2
)
⋯
π
(
m
)
)
,
{\displaystyle {\begin{pmatrix}1&2&\cdots &m\\\pi (1)&\pi (2)&\cdots &\pi (m)\end{pmatrix}},}
(1π(1)2π(2)⋯⋯mπ(m)),
there are two natural ways to associate the permutation with a permutation matrix; namely, starting with the
m
×
m
m × m
m×m identity matrix,
I
m
I_m
Im, either permute the columns or permute the rows, according to
π
π
π. Both methods of defining permutation matrices appear in the literature and the properties expressed in one representation can be easily converted to the other representation. This article will primarily deal with just one of these representations and the other will only be mentioned when there is a difference to be aware of.
The
m
×
m
m × m
m×m permutation matrix
P
π
=
(
p
i
j
)
P_π = (p_{ij})
Pπ=(pij) obtained by permuting the columns of the identity matrix
I
m
I_m
Im, that is, for each
i
i
i,
p
i
j
=
1
p_{ij} = 1
pij=1 if
j
=
π
(
i
)
j = π(i)
j=π(i) and
p
i
j
=
0
p_{ij} = 0
pij=0 otherwise, will be referred to as the column representation in this article. Since the entries in row
i
i
i are all
0
0
0 except that a
1
1
1 appears in column
π
(
i
)
π(i)
π(i), we may write
P
π
=
[
e
π
(
1
)
e
π
(
2
)
⋮
e
π
(
m
)
]
,
{\displaystyle P_{\pi }={\begin{bmatrix}\mathbf {e} _{\pi (1)}\\\mathbf {e} _{\pi (2)}\\\vdots \\\mathbf {e} _{\pi (m)}\end{bmatrix}},}
Pπ=
eπ(1)eπ(2)⋮eπ(m)
,
where
e
j
e_j
ej, a standard basis vector, denotes a row vector of length
m
m
m with
1
1
1 in the
j
j
jth position and
0
0
0 in every other position.
For example, the permutation matrix
P
π
P_π
Pπ corresponding to the permutation
π
=
(
1
2
3
4
5
1
4
2
5
3
)
{\displaystyle \pi ={\begin{pmatrix}1&2&3&4&5\\1&4&2&5&3\end{pmatrix}}}
π=(1124324553) is
P
π
=
[
e
π
(
1
)
e
π
(
2
)
e
π
(
3
)
e
π
(
4
)
e
π
(
5
)
]
=
[
e
1
e
4
e
2
e
5
e
3
]
=
[
1
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
1
0
0
1
0
0
]
.
{\displaystyle P_{\pi }={\begin{bmatrix}\mathbf {e} _{\pi (1)}\\\mathbf {e} _{\pi (2)}\\\mathbf {e} _{\pi (3)}\\\mathbf {e} _{\pi (4)}\\\mathbf {e} _{\pi (5)}\end{bmatrix}}={\begin{bmatrix}\mathbf {e} _{1}\\\mathbf {e} _{4}\\\mathbf {e} _{2}\\\mathbf {e} _{5}\\\mathbf {e} _{3}\end{bmatrix}}={\begin{bmatrix}1&0&0&0&0\\0&0&0&1&0\\0&1&0&0&0\\0&0&0&0&1\\0&0&1&0&0\end{bmatrix}}.}
Pπ=
eπ(1)eπ(2)eπ(3)eπ(4)eπ(5)
=
e1e4e2e5e3
=
1000000100000010100000010
.
Observe that the
j
j
jth column of the
I
5
I_5
I5 identity matrix now appears as the
π
(
j
)
π(j)
π(j)th column of
P
π
P_π
Pπ.
The other representation, obtained by permuting the rows of the identity matrix I m I_m Im, that is, for each j , p i j = 1 j, p_{ij} = 1 j,pij=1 if i = π ( j ) i = π(j) i=π(j) and p i j = 0 p_{ij} = 0 pij=0 otherwise, will be referred to as the row representation.