In mathematics, particularly in matrix theory, a permutation matrix is a square binary matrix that has exactly one entry of 1 in each row and each column and 0s elsewhere. Each such matrix, say P, represents a permutation of m elements and, when used to multiply another matrix, say A, results in permuting the rows (when pre-multiplying, i.e., PA) or columns (when post-multiplying, AP) of the matrix A.
Given a permutation π of m elements,
represented in two-line form by
there are two natural ways to associate the permutation with a permutation matrix; namely, starting with the m × m identity matrix, 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 permutation matrix Pπ = (pij) obtained by permuting the columns of the identity matrix Im, that is, for each i, pij = 1 if j = π(i) and 0 otherwise, will be referred to as the column representation in this article. Since the entries in row i are all 0 except that a 1 appears in column π(i), we may write
where , a standard basis vector, denotes a row vector of length m with 1 in the jth position and 0 in every other position.