Mathwords logoMathwords

Permutation Matrix — Definition, Formula & Examples

A permutation matrix is a square matrix obtained by rearranging the rows (or columns) of the identity matrix. Each row and each column contains exactly one entry equal to 1, with all other entries equal to 0.

A permutation matrix PP of order nn is an n×nn \times n matrix in which every row and every column has precisely one nonzero entry, that entry being 1. Equivalently, PP is obtained from InI_n by applying a permutation σ\sigma of {1,2,,n}\{1, 2, \dots, n\} to its rows. Permutation matrices are orthogonal: P1=PTP^{-1} = P^T, and det(P)=±1\det(P) = \pm 1.

How It Works

Multiplying a matrix AA on the left by a permutation matrix PP rearranges the rows of AA. Multiplying on the right by PP rearranges the columns instead. Because PP is orthogonal, its inverse is simply its transpose, so undoing the permutation costs nothing extra. Permutation matrices appear prominently in LU decomposition with partial pivoting, where the factorization takes the form PA=LUPA = LU.

Worked Example

Problem: Let P=(010001100)P = \begin{pmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ 1 & 0 & 0 \end{pmatrix} and A=(257349)A = \begin{pmatrix} 2 & 5 \\ 7 & 3 \\ 4 & 9 \end{pmatrix}. Compute PAPA.
Identify the row permutation: Row 1 of PP has its 1 in column 2, row 2 in column 3, and row 3 in column 1. So PP sends row 2 of AA to row 1, row 3 to row 2, and row 1 to row 3.
Multiply: Apply the permutation to the rows of AA.
PA=(010001100)(257349)=(734925)PA = \begin{pmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ 1 & 0 & 0 \end{pmatrix} \begin{pmatrix} 2 & 5 \\ 7 & 3 \\ 4 & 9 \end{pmatrix} = \begin{pmatrix} 7 & 3 \\ 4 & 9 \\ 2 & 5 \end{pmatrix}
Answer: PA=(734925)PA = \begin{pmatrix} 7 & 3 \\ 4 & 9 \\ 2 & 5 \end{pmatrix}. The rows of AA have been cyclically shifted upward.

Why It Matters

Permutation matrices are central to numerical linear algebra. In Gaussian elimination with partial pivoting, the algorithm records row swaps as a permutation matrix PP so the factorization PA=LUPA = LU remains stable. They also encode symmetries in group theory and combinatorics.

Common Mistakes

Mistake: Confusing left-multiplication and right-multiplication by a permutation matrix.
Correction: PAPA permutes the rows of AA, while APAP permutes the columns. The effects are different, so the side of multiplication matters.