Girish Mahajan (Editor)

Permutation matrix

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit

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.

Contents

Definition

Given a permutation π of m elements,

π : { 1 , , m } { 1 , , m }

represented in two-line form by

( 1 2 m π ( 1 ) π ( 2 ) π ( m ) ) ,

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 the rows of Im 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

P π = [ e π ( 1 ) e π ( 2 ) e π ( m ) ] ,

where e j , a standard basis vector, denotes a row vector of length m with 1 in the jth position and 0 in every other position.

For example, the permutation matrix Pπ corresponding to the permutation : π = ( 1 2 3 4 5 1 4 2 5 3 ) , 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 ] .

Observe that the jth column of the I5 identity matrix now appears as the π(j)th column of Pπ.

The other representation, obtained by permuting the rows of the identity matrix Im, that is, for each j, pij = 1 if i = π(j) and 0 otherwise, will be referred to as the row representation.

Properties

The column representation of a permutation matrix is used throughout this section, except when otherwise indicated.

Multiplying P π times a column vector g will permute the rows of the vector:

P π g = [ e π ( 1 ) e π ( 2 ) e π ( n ) ] [ g 1 g 2 g n ] = [ g π ( 1 ) g π ( 2 ) g π ( n ) ] .

Repeated use of this result shows that if M is an appropriately sized matrix, the product, P π M is just a permutation of the rows of M. However, observing that

P π e k T = e π 1 ( k ) T

for each k shows that the permutation of the rows is given by π−1. ( M T is the transpose of matrix M.)

As permutation matrices are orthogonal matrices (i.e., P π P π T = I ), the inverse matrix exists and can be written as

P π 1 = P π 1 = P π T .

Multiplying a row vector h times P π will permute the columns of the vector:

h P π = [ h 1 h 2 h n ] [ e π ( 1 ) e π ( 2 ) e π ( n ) ] = [ h π 1 ( 1 ) h π 1 ( 2 ) h π 1 ( n ) ]

Again, repeated application of this result shows that post-multiplying a matrix M by the permutation matrix Pπ, that is, M Pπ, results in permuting the columns of M. Notice also that

e k P π = e π ( k ) .

Given two permutations π and σ of m elements, the corresponding permutation matrices Pπ and Pσ acting on column vectors are composed with

P σ P π g = P π σ g .

The same matrices acting on row vectors (that is, post-multiplication) compose according to the same rule

h P σ P π = h P π σ .

To be clear, the above formulas use the prefix notation for permutation composition, that is,

π σ ( k ) = π ( σ ( k ) ) .

Let Q π be the permutation matrix corresponding to π in its row representation. The properties of this representation can be determined from those of the column representation since Q π = P π T = P π 1 . In particular,

Q π e k T = P π 1 e k T = e ( π 1 ) 1 ( k ) T = e π ( k ) T .

From this it follows that

Q σ Q π g = Q σ π g .

Similarly,

h Q σ Q π = h Q σ π .

Matrix group

If (1) denotes the identity permutation, then P(1) is the identity matrix.

Let Sn denote the symmetric group, or group of permutations, on {1,2,...,n}. Since there are n! permutations, there are n! permutation matrices. By the formulas above, the n × n permutation matrices form a group under matrix multiplication with the identity matrix as the identity element.

The map SnA ⊂ GL(n, Z2) is a faithful representation. Thus, |A| = n!.

Doubly stochastic matrices

A permutation matrix is itself a doubly stochastic matrix, but it also plays a special role in the theory of these matrices. The Birkhoff–von Neumann theorem says that every doubly stochastic real matrix is a convex combination of permutation matrices of the same order and the permutation matrices are precisely the extreme points of the set of doubly stochastic matrices. That is, the Birkhoff polytope, the set of doubly stochastic matrices, is the convex hull of the set of permutation matrices.

Linear algebraic properties

The trace of a permutation matrix is the number of fixed points of the permutation. If the permutation has fixed points, so it can be written in cycle form as π = (a1)(a2)...(ak where σ has no fixed points, then ea1,ea2,...,eak are eigenvectors of the permutation matrix.

To calculate the eigenvalues of a permutation matrix P σ , write σ as a product of cycles, say, σ = C 1 C 2 C t . Let the corresponding lengths of these cycles be l 1 , l 2 . . . l t , and let R i ( 1 i t ) be the set of complex solutions of x l i = 1 . The union of all R i s is the set of eigenvalues of the corresponding permutation matrix. The geometric multiplicity of each eigenvalue equals the number of R i s that contain it.

From group theory we know that any permutation may be written as a product of transpositions. Therefore, any permutation matrix P factors as a product of row-interchanging elementary matrices, each having determinant −1. Thus the determinant of a permutation matrix P is just the signature of the corresponding permutation.

Permutation of rows and columns

When a permutation matrix P is multiplied from the left with a matrix M (PM) it will permute the rows of M (here the elements of a column vector),
when P is multiplied from the right with M (MP) it will permute the columns of M (here the elements of a row vector):

Permutations of rows and columns are for example reflections (see below) and cyclic permutations (see cyclic permutation matrix).

Permutation of rows

The permutation matrix Pπ corresponding to the permutation : π = ( 1 2 3 4 5 1 4 2 5 3 ) , 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 ] .

Given a vector g,

P π g = [ e π ( 1 ) e π ( 2 ) e π ( 3 ) e π ( 4 ) e π ( 5 ) ] [ g 1 g 2 g 3 g 4 g 5 ] = [ g 1 g 4 g 2 g 5 g 3 ] .

Explanation

A permutation matrix will always be in the form

[ e a 1 e a 2 e a j ]

where eai represents the ith basis vector (as a row) for Rj, and where

[ 1 2 j a 1 a 2 a j ]

is the permutation form of the permutation matrix.

Now, in performing matrix multiplication, one essentially forms the dot product of each row of the first matrix with each column of the second. In this instance, we will be forming the dot product of each row of this matrix with the vector of elements we want to permute. That is, for example, v= (g0,...,g5)T,

eai·v=gai

So, the product of the permutation matrix with the vector v above, will be a vector in the form (ga1, ga2, ..., gaj), and that this then is a permutation of v since we have said that the permutation form is

( 1 2 j a 1 a 2 a j ) .

So, permutation matrices do indeed permute the order of elements in vectors multiplied with them.

References

Permutation matrix Wikipedia


Similar Topics