Open In App

Permutation Matrix

Last Updated : 20 Aug, 2024
Summarize
Comments
Improve
Suggest changes
Share
Like Article
Like
Report

Permutation Matrices stand out as a distinct and important element, mentioning the algebraic linear regression and integers in the combination. These matrices are composed of 0s and 1s and are more than just a special mathematical matrix. Knowing the permutation matrices provides the capability to instruct how the data can be affected and managed in particular mathematical systems.

This article, thus, introduces the Permutation Matrix with some practical applications and solved examples.

What is Permutation Matrix?

A permutation matrix is a special type of square binary matrix that represents a permutation of elements. It is constructed by rearranging the rows or columns of an identity matrix according to a specific permutation.

It is an n × n square matrix (where n is the number of elements being permuted) with the following distinct properties:

  • Binary Entries: A permutation matrix contains only two possible values: 0 and 1.
  • Exactly One 1 Per Row and Column: In a permutation matrix, each row and each column has exactly one entry that is 1, and all other entries are 0. This ensures that the matrix is both row and column orthogonal, meaning that the rows and columns are mutually perpendicular unit vectors.
  • Permutation Representation: The position of the 1s in the permutation matrix corresponds to the permutation of the elements. For example, if a matrix permutes the elements of a vector, the 1s in the matrix indicate where each element of the original vector should go in the new arrangement.

Example for Permutation Matrix

Consider the identity matrix I3:

I_3 = \begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix}

A permutation of the rows could be the order [2, 3, 1], which would result in the permutation matrix:

P = \begin{pmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ 1 & 0 & 0 \end{pmatrix}

Mathematical Representation of Permutation Matrix

The mathematical representation of a permutation matrix is a technique to perform the permutation of the elements in the given set. Like, we have a permutation σ of the set {1, 2, 3, . . . , n}.

The permutation matrix P whose corresponding permutation is written like that is an n × n matrix defined with the given details:

P_{ij} = \begin{cases} 1 & \text{ } j = \sigma(i) \\ 0 & \text{}j \neq \sigma(i) \\ \end{cases}

This statement ensures each row is linked directly to each column, and vice versa. Each column does not know details about other than a particular row that contains one, whereas the remaining part of the column is 0.

The number of lines cannot be higher than one and the number of columns cannot be greater than two 1's at the same time. Each row of the P-permutation matrix refers to one and only nonzero entry and thus all the remaining entries are 0. Thus a permutation matrix acts on the permutation σ by element rearrangement.

How a Permutation Matrix Works?

When a permutation matrix P multiplies a vector v, the result is a vector whose elements have been rearranged according to the permutation defined by P.

For example, if v = \begin{pmatrix} a \\ b \\ c \end{pmatrix}​​, then multiplying by the permutation matrix P from above:

Pv = \begin{pmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ 1 & 0 & 0 \end{pmatrix} \begin{pmatrix} a \\ b \\ c \end{pmatrix} = \begin{pmatrix} b \\ c \\ a \end{pmatrix}

Properties of Permutation Matrix

Permutation matrices have several important properties that make them useful in various mathematical and computational applications. Here are some key properties of permutation matrices:

  • Permutation matrices are orthogonal matrices, which stands for the fact that the transpose of a permutation matrix is also its inverse: P^T P = P P^T = I, where PT is the transpose of P, and I is the identity matrix.
  • Based on whether the permutation is even or odd, the determinant of the matrix is either 1 or -1 .
    • For an instance, -1 or +1 is called the 'sign' of a permutation, where the negative or positive sign correlates to an odd or even permutation, respectively.
      • If the permutation is even, that is, it can be obtained by swapping even number of times along rows or columns, then it has determinant 1.
      • The permutation is an odd one if (and only if) we must perform an odd amount of row and column swaps to reach it. In this case, the determinant is -1: \text{det}(P) = \pm 1
  • The inverse of a permutation matrix is the transposed form of itself: P^{-1} = P^T. Since permutation matrices are orthogonal, this property follows directly from their orthogonality.
  • Permutation matrices are the only translated elements that preserve Euclidean norm. That is, the Euclidean norm of v, i.e., the length of v, remains the same: \|P \mathbf{v}\| = \|\mathbf{v}\|.
  • Composition of two permutation matrices are isomorphic with a permutation matrix. That is, the product of the permutation matrices P and Q is a permutation matrix PQ which represents the sum of the two permutations.
  • The permutation matrix contains the property that the set which made up of many 1's from the rows and the columns must be only one set. Each row has one and only one 1 in it and the rest are 0. The fact is shown by the final sentence that the equality of the rows and columns entries with 1 is a direct consequence of the condition of the statement \sum_{j=1}^n P_{ij} = 1 \quad for all i and \sum_{i=1}^n P_{ij} = 1 \quad for all j.

Applications of Permutation Matrix

The permutation matrices are given a wide array of possible applications in various fields, such as numerical linear algebra for they can reorder the rows and columns of the tables, and maintain the structure. In the following, there are several noteworthy applications:

  • Numerical Linear Algebra: Permutation matrix are commonly used to quickly and easily overcome the zeros and other non-standard ties that arise when one reorders rows or columns.
  • Graph Theory: The algorithm is a special form of isomorphism which is expressed in graph theory as the permutation matrix. Moreover, two adjacency matrices can be mutually exchanged which might result in the fact that these two are isomorphic, i.e. they have the same components but they are shown in different ways (labeling of vertices).
  • Combinatorial Optimization: There are permutation matrices that are randomly generated and then they can be applied to the combinatorial optimization problems like the traveling salesman problem and the assignment problem.
  • Cryptography: Permutation matrices are cryptographically used to rearrange the data in a safe way. They ensure that the order of data items is changed in a way that is difficult to anticipate without the knowledge of the permutation matrix used.
  • Parallel Computing: The so-called permutation matrices are used to break down data onto multiple processors in a balanced way so that each processor stays virtually even with the others.

Constructing a Permutation Matrix

To construct a permutation matrix for a given permutation of a set, follow these steps:

  1. Identify the Permutation: First, determine the permutation σ of the set {1, 2, . . . , n}. The permutation σ is the correspondence of the elements of the set, which may be given as a list or sequence.
  2. Initialize the Matrix: Draw an n × n matrix containing zero elements. This will be the matrix in which you place ones based on the permutation.
  3. Place the 1s According to the Permutation: For each element i in the set {1, 2, . . . , n}.
    • Look for the spot σ(i) where i is depicted with the permutation.
    • Put a '1' in the location (i, σ(i)) at the matrix.

Example of Constructing Permutation Matrix

Now, we take up a permutation of set {1, 2, 3}, σ = (2, 3, 1), and we wish to make a permutation matrix for it.

Step 1. Identify the Permutation

σ maps 1 to 2, 2 to 3, and 3 to 1.

Step 2. Initialize the Matrix

Initially, get a matrix 3x3 filled with zeros: \begin{pmatrix} 0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{pmatrix}

Step 3. Place the 1s

For i = 1, σ(1) = 2. Put 1 in position (1, 2):

\begin{pmatrix} 0 & 1 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{pmatrix}

For i = 2, σ(2) = 3. Put 1 in position (2, 3):

\begin{pmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ 0 & 0 & 0 \end{pmatrix}

For i = 3, σ(3) = 1. Place 1 in position (3, 1):

\begin{pmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ 1 & 0 & 0 \end{pmatrix}

The resulting permutation matrix P for the permutation σ = (2, 3, 1) is:

P = \begin{pmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ 1 & 0 & 0 \end{pmatrix}

This matrix is an effective way to represent the permutation and can be applied to vector or matrix accordingly.

Solved Problems on Permutation Matrix

Problem 1: Check whether that the given matrix is a permutation matrix:

P = \begin{pmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ 1 & 0 & 0 \end{pmatrix}

Solution:

Confirm it is a permutation matrix by looking for the properties specified below.

  • Every one of the lines should be marked by the presence of the ones.
  • Every line should be unique since each one of the rows is a permutation of other rows.

For matrix P:

Rows:

  • Row 1: [0, 1, 0] - includes only 1 but no other entries.
  • Row 2: [0, 0, 1] - includes only 1 but no other entries.
  • Row 3: [1, 0, 0] - includes only 1 but no other entries.

Columns:

  • Column 1: [0, 0, 1] - contains exactly one 1.
  • Column 2: [1, 0, 0] - contains exactly one 1.
  • Column 3: [0, 1, 0] - contains exactly one 1.

Since P meets both criteria, so it is a permutation matrix.

Problem 2: Find the permutation matrix for the permutation σ = (3, 1, 2) of the set {1, 2, 3}.

Solution:

Now, we take up a permutation of set {1, 2, 3}, σ = (3, 1, 2), and we wish to make a permutation matrix for it.

Step 1. Identify the Permutation

σ maps 1 to 3, 2 to 1, and 3 to 2.

Step 2. Initialize the Matrix

Initially, get a matrix 3x3 filled with zeros: \begin{pmatrix} 0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{pmatrix}

Step 3. Place the 1s

For i = 1, σ(1) = 3. Put 1 in position (1, 3):

\begin{pmatrix} 0 & 0 & 1 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{pmatrix}

For i = 2, σ(2) = 1. Put 1 in position (2, 1):

\begin{pmatrix} 0 & 0 & 1 \\ 1 & 0 & 0 \\ 0 & 0 & 0 \end{pmatrix}

For i = 3, σ(3) = 2. Place 1 in position (3, 2):

\begin{pmatrix} 0 & 0 & 1 \\ 1 & 0 & 0 \\ 0 & 1 & 0 \end{pmatrix}

The resulting permutation matrix P for the permutation σ = (2, 3, 1) is:

\begin{pmatrix} 0 & 0 & 1 \\ 1 & 0 & 0 \\ 0 & 1 & 0 \end{pmatrix}

Problem 3: Apply the permutation matrix P to the vector v = (3, 5, 7), given below is the permutation matrix:

P = \begin{pmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ 1 & 0 & 0 \end{pmatrix}

Solution:

In order to apply P to v, we need to perform the matrix-vector multiplication Pv.

P \mathbf{v} = \begin{pmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ 1 & 0 & 0 \end{pmatrix}

P \mathbf{v} = \begin{pmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ 1 & 0 & 0 \end{pmatrix} \begin{pmatrix} 3 \\ 5 \\ 7 \end{pmatrix} = \begin{pmatrix} 5 \\ 7 \\ 3 \end{pmatrix}

Thus, the result of applying P to v is (5, 7, 3).

Problem 4: Given below the permutation matrix:

P = \begin{pmatrix} 0 & 0 & 1 & 0 \\ 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \end{pmatrix}

Determine the corresponding permutation of the set {1, 2, 3, 4}.

Solution:

To find the permutation firstly find the position of each 1 in the matrix. Each row of the permutation matrix (P) represents the image of the position of the corresponding element.

  • Row 1: The 1 falls into column 3. Thus, 1 goes to 3..
  • Row 2: The 1 is located in column 1. Therefore, 2 is sent to 1.
  • Row 3: The 1 is in the column 2. Furthermore, 3 maps to 2.
  • Row 4: The 1 falls into column 4, thus, 4 goes to 4.

Finally, the permutation matrix shows the permutation σ = (3, 1, 2, 4). In the case, the permutation orders the set {1, 2, 3, 4} in such a way that 1 is matched with 3, 2 is paired with 1, 3 goes to 2, and 4 is still 4.

Conclusion

Permutation matrices are basic as well as applied tools in the areas of linear algebra and serving as a handy representation of permutations that are of a finite set. Their unique structure is such that each row and column has exactly one element of 1, because of which they are able to switch the elements by multiplying with other matrices or vectors, effectively. Along with properties such as orthogonality, sparsity, and invertibility, which they possess and are used in numerical linear algebra, graph theory, optimization, cryptography, and data processing, their diversity and prominence further come to light.

Read More,


Next Article

Similar Reads