Permutation matrix
![]() | This article includes a list of general references, but it lacks sufficient corresponding inline citations. (August 2022) |
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 with all other entries 0. Such a matrix P, say of size n × n, can represent a permutation of n elements. Pre-multiplying an n-row matrix M by such a permutation matrix, forming PM, results in permuting the rows of M, while post-multiplying an n-column matrix M, forming MP, permutes the columns of M.
Every permutation matrix P is orthogonal, with its inverse equal to its transpose: (proved below). Indeed, permutation matrices can be characterized as the orthogonal matrices whose entries are all non-negative.[1] (Thinking geometrically, the only way to fit n orthogonal unit vectors into the nonnegative orthant of Euclidean n-space is to have each vector point forward along one of the coordinate axes, which can be done in n! ways.)
The two permutation/matrix correspondences
There are two different one-to-one correspondences between permutations and permutation matrices, one of which works along the rows of the matrix, the other along its columns. Here is an example, starting with a permutation π in two-line form at the upper left:
The row-based correspondence takes the permutation π to the matrix at the upper right. The first row of has its 1 in the third column because . More generally, we have where when and otherwise.
The column-based correspondence takes π to the matrix at the lower left. The first column of has its 1 in the third row because . More generally, we have where is 1 when and 0 otherwise. Since the two recipes differ only by swapping i with j, the matrix is the transpose of ; and, since is a permutation matrix, we have . Tracing the other two sides of the big square, we have and .[2]
These matrices permute rows or columns
Multiplying a matrix M by either or on either the left or the right will permute either the rows or columns of M by either π or π-1. The details are a bit tricky.
To begin with, when we permute the entries of a vector by some permutation π, we move the entry of the input vector into the slot of the output vector. Which entry then ends up in, say, the first slot of the output? Answer: The entry for which , and hence . Arguing similarly about each of the slots, we find that the output vector is
even though we are permuting by , not by . More generally, permuting by π the rows of an n-row matrix produces the matrix whose entry is . And permuting by π the columns of an n-column matrix produces the matrix whose entry is . (By the way, permuting the entries among the fixed slots in this way is using the alibi viewpoint. If we had instead permuted the labels of the slots while leaving the entries fixed, we would have been using the alias viewpoint, where those two viewpoints differ by yet another inversion of π.[3])
With that in mind, we can show that pre-multiplying an n-row matrix M by permutes the rows of M by π. By the rule for matrix multiplication, the entry of the product is given by
where when and otherwise. Since the only summand that survives is the one with , the sum simplifies to ; and that establishes our claim. Symmetrically, post-multiplying an n-column matrix M by permutes the columns of M by π, since the entry of the product is .
The other two options are pre-multiplying by or post-multiplying by , and they permute the rows or columns respectively by π-1, instead of by π.
The transpose is also the inverse
A related argument shows that, as we claimed at the outset, the transpose of any permutation matrix P also acts as its inverse, thus implying that P is invertible. If , then the entry of its transpose is . The entry of the product is then
Whenever , the term in this sum is the product of two different entries in the column of P; so all terms are 0, and the sum is 0. When , we are summing the squares of the entries in the row of P, so we get 1. The product is thus the identity matrix. A symmetric argument shows the same for , implying that P is invertible with .
Multiplying permutation matrices
Given two permutations of n elements 𝜎 and 𝜏, the product of the corresponding column-based permutation matrices Cσ and Cτ is given, as you might expect, by where the composed permutation applies first 𝜏 and then 𝜎, working from right to left: This follows because pre-multiplying some matrix by Cτ and then pre-multiplying the resulting product by Cσ gives the same result as pre-multiplying just once by the combined .
For the row-based matrices, there is a twist: The product of Rσ and Rτ is given by
with 𝜎 applied before 𝜏 in the composed permutation. This happens because we must post-multiply to avoid inversions under the row-based option, so we would post-multiply first by Rσ and then by Rτ.
Some people, when applying a function to an argument, write the function after the argument, rather than before it. When doing linear algebra, they work with linear spaces of row vectors, and they apply a linear map to an argument by using the map's matrix to post-multiply the argument's row vector. Often, they also use a left-to-right composition operator, which we here denote using a semicolon; so the composition is defined either by
or, more elegantly, by
with 𝜎 applied first. That notation gives us a simpler rule for multiplying row-based permutation matrices:
Matrix group
When π is the identity permutation, which has for all i, both Cπ and Rπ are the identity matrix.
The map C is a one-to-one correspondence between permutations and permutation matrices, and R is another such correspondence; since there are n! permutations, there are also n! permutation matrices. By the formulas above, those n × n permutation matrices form a group of order n! under matrix multiplication, with the identity matrix as its identity element; we denote that group . The group is a subgroup of the general linear group of invertible n × n matrices of real numbers. Indeed, for any field F, the group is also a subgroup of the group of invertible n × n matrices whose entries belong to F.
Let denote the symmetric group, or group of permutations, on {1,2,...,n} where the group operation is the standard, right-to-left composition ""; and let denote the opposite group, which uses the left-to-right composition "". The map that takes π to its column-based matrix is a faithful representation, and similarly for the map that takes π to .
Doubly stochastic matrices
Every permutation matrix is doubly stochastic. The set of all doubly stochastic matrices is called the Birkhoff polytope, and the permutation matrices play a special role in that polytope. The Birkhoff–von Neumann theorem says that every doubly stochastic real matrix is a convex combination of permutation matrices of the same order, with the permutation matrices being precisely the extreme points (the vertices) of the Birkhoff polytope. The Birkhoff polytope is thus the convex hull of the set of permutation matrices.[4]
Linear-algebraic properties
Every permutation matrix P is for a unique permutation and is also for a unique permutation , where . We can compute the linear-algebraic properties of P from some combinatorial properties that are shared by the permutations and .
A point is fixed by just when it is fixed by , and the trace of P is the number of fixed points. If the integer k is fixed, then the standard basis vector ek is an eigenvector of P.
To calculate the eigenvalues of P, write the permutation as a product of cycles, say, . For , let the length of the cycle be , and let be the set of complex solutions of , those solutions being the roots of unity. The union of the is then the set of eigenvalues of P. Since writing as a product of cycles would give the same number of cycles of the same lengths, analyzing would have given us the same result. The geometric multiplicity of any eigenvalue v is the number of i for which contains v.[5]
From group theory we know that any permutation may be written as a product of transpositions. Therefore, any permutation matrix factors as a product of row-switching elementary matrices, each of which has determinant −1. Thus, the determinant of the permutation matrix P is the sign of the permutaton , which is also the sign of .
Restricted forms
- Costas array, a permutation matrix in which the displacement vectors between the entries are all distinct
- n-queens puzzle, a permutation matrix in which there is at most one entry in each diagonal and antidiagonal
See also
References
- ^ Zavlanos, Michael M.; Pappas, George J. (November 2008). "A dynamical systems approach to weighted graph matching". Automatica. 44 (11): 2817–2824. doi:10.1016/j.automatica.2008.04.009. S2CID 834305. Retrieved 21 August 2022.
In particular, since permutation matrices are orthogonal matrices with nonnegative elements, we define two gradient flows in the space of orthogonal matrices... Lemma 5: Let denote the set of orthogonal matrices and denote the set of element-wise non-negative matrices. Then, , where is the set of permutation matrices.
- ^ Terminology is not standard. Most authors use just one of these correspondences, choosing which to be consistent with their other notation, so there is typically no need for two names.
- ^ Conway, John H.; Burgiel, Heidi; Goodman-Strauss, Chaim (2008). The Symmetries of Things. A K Peters. p. 179.
A permutation---say, of the names of a number of people---can be thought of as moving either the names or the people. The alias viewpoint regards the permutation as assigning a new name or alias to each person (from the Latin alias = otherwise). Alternatively, from the alibi viewoint we move the people to the places corresponding to their new names (from the Latin alibi = in another place.)
- ^ Brualdi (2006) p.19
- ^ J Najnudel, A Nikeghbali 2010 p.4
- Brualdi, Richard A. (2006). Combinatorial matrix classes. Encyclopedia of Mathematics and Its Applications. Vol. 108. Cambridge: Cambridge University Press. ISBN 0-521-86565-4. Zbl 1106.05001.
- Joseph, Najnudel; Ashkan, Nikeghbali (2010), The Distribution of Eigenvalues of Randomized Permutation Matrices, arXiv:1005.0402, Bibcode:2010arXiv1005.0402N