Skip to main content

Subsection 5.3.2 Permutation matrices

fit width

Recall that we already discussed permutation in Subsection 4.4.4 in the setting of column pivoting when computing the QR factorization.

Definition 5.3.2.1.

Given

p=(π0πn1),p=⎜ ⎜π0πn1⎟ ⎟,

where {π0,π1,,πn1}{π0,π1,,πn1} is a permutation (rearrangement) of the integers {0,1,,n1},{0,1,,n1}, we define the permutation matrix P(p)P(p) by

P(p)=(eTπ0eTπn1).P(p)=⎜ ⎜eTπ0eTπn1⎟ ⎟.
Homework 5.3.2.1.

Let

p=(π0πn1) and x=(χ0χn1).p=⎜ ⎜π0πn1⎟ ⎟ and x=⎜ ⎜χ0χn1⎟ ⎟.

Evaluate P(p)x.P(p)x.

Solution
\begin{equation*} \begin{array}{l} P( p ) x \\ ~~~=~~~~ \lt \mbox{ definition } \gt \\ \left( \begin{array}{c} e_{\pi_0}^T \\ \vdots \\ e_{\pi_{n-1}}^T \end{array} \right) x \\ ~~~=~~~~ \lt \mbox{ matrix-vector multiplication by rows } \gt \\ \left( \begin{array}{c} e_{\pi_0}^Tx \\ \vdots \\ e_{\pi_{n-1}}^Tx \end{array} \right) \\ ~~~=~~~~ \lt e_j^T x = x_j \gt \\ \left( \begin{array}{c} \chi_{\pi_0} \\ \vdots \\ \chi_{\pi_{n-1}} \end{array} \right) \end{array} \end{equation*}

The last homework shows that applying P(p)P(p) to a vector xx rearranges the elements of that vector according to the permutation indicated by the vector p.p.

Homework 5.3.2.2.

Let

p=(π0πn1) and A=(˜aT0˜aTn1).

Evaluate P(p)A.

Solution
\begin{equation*} \begin{array}{l} P( p ) A \\ ~~~=~~~~ \lt \mbox{ definition } \gt \\ \left( \begin{array}{c} e_{\pi_0}^T \\ \vdots \\ e_{\pi_{n-1}}^T \end{array} \right) A \\ ~~~=~~~~ \lt \mbox{ matrix-matrix multiplication by rows } \gt \\ \left( \begin{array}{c} e_{\pi_0}^TA \\ \vdots \\ e_{\pi_{n-1}}^TA \end{array} \right) \\ ~~~=~~~~ \lt e_j^T A = \widetilde a_j^T \gt \\ \left( \begin{array}{c} \widetilde a_{\pi_0}^T \\ \vdots \\ \widetilde a_{\pi_{n-1}}^T \end{array} \right) \end{array} \end{equation*}

The last homework shows that applying P(p) to a matrix A rearranges the rows of that matrix according to the permutation indicated by the vector p.

Homework 5.3.2.3.

Let

p=(π0πn1) and A=(a0an1).

Evaluate AP(p)T.

Solution
\begin{equation*} \begin{array}{l} A P( p )^T \\ ~~~=~~~~ \lt \mbox{ definition } \gt \\ A \left( \begin{array}{c} e_{\pi_0}^T \\ \vdots \\ e_{\pi_{n-1}}^T \end{array} \right)^T \\ ~~~=~~~~ \lt \mbox{ transpose } P( p ) \gt \\ A \left( \begin{array}{c c c} e_{\pi_0} \amp \cdots \amp e_{\pi_{n-1}} \end{array} \right) \\ ~~~=~~~~ \lt \mbox{ matrix-matrix multiplication by columns } \gt \\ \left( \begin{array}{c c c} A e_{\pi_0} \amp \cdots \amp A e_{\pi_{n-1}} \end{array} \right) \\ ~~~=~~~~ \lt A e_j = a_j \gt \\ \left( \begin{array}{c c c} a_{\pi_0} \amp \cdots \amp a_{\pi_{n-1}} \end{array} \right) \end{array} \end{equation*}

The last homework shows that applying P(p)T from the right to a matrix A rearranges the columns of that matrix according to the permutation indicated by the vector p.

Homework 5.3.2.4.

Evaluate P(p)P(p)T.

Answer

\(P( p ) P( p )^T = I \)

Solution
\begin{equation*} \begin{array}{l} P P( p )^T \\ ~~~=~~~~ \lt \mbox{ definition } \gt \\ \left( \begin{array}{c} e_{\pi_0}^T \\ \vdots \\ e_{\pi_{n-1}}^T \end{array} \right) \left( \begin{array}{c} e_{\pi_0}^T \\ \vdots \\ e_{\pi_{n-1}}^T \end{array} \right)^T \\ ~~~=~~~~ \lt \mbox{ transpose } P( p ) \gt \\ \left( \begin{array}{c} e_{\pi_0}^T \\ \vdots \\ e_{\pi_{n-1}}^T \end{array} \right) \left( \begin{array}{c c c} e_{\pi_0} \amp \cdots \amp e_{\pi_{n-1}} \end{array} \right) \\ ~~~=~~~~ \lt \mbox{ evaluate } \gt \\ \left( \begin{array}{c c c c} e_{\pi_0}^T e_{\pi_0} \amp e_{\pi_0}^T e_{\pi_1} \amp \cdots \amp e_{\pi_0}^T e_{\pi_{n-1}} \\ e_{\pi_1}^T e_{\pi_0} \amp e_{\pi_1}^T e_{\pi_1} \amp \cdots \amp e_{\pi_1}^T e_{\pi_{n-1}} \\ \vdots \amp \vdots \amp \amp \vdots \\ e_{\pi_{n-1}}^T e_{\pi_0} \amp e_{\pi_{n-1}}^T e_{\pi_1} \amp \cdots \amp e_{\pi_{n-1}}^T e_{\pi_{n-1}} \\ \end{array} \right) \\ ~~~=~~~~ \lt e_i^T e_j = \cdots \gt \\ \left( \begin{array}{c c c c} 1 \amp 0 \amp \cdots \amp 0 \\ 0 \amp 1 \amp \cdots \amp 0 \\ \vdots \amp \vdots \amp \amp \vdots \\ 0 \amp 0 \amp \cdots \amp 1 \end{array} \right) \end{array} \end{equation*}
fit width

We will see that when discussing the LU factorization with partial pivoting, a permutation matrix that swaps the first element of a vector with the π-th element of that vector is a fundamental tool.

Definition 5.3.2.2. Elementary pivot matrix.

Given π{0,,n1} define the elementary pivot matrix

˜P(π)=(eTπeT1eTπ1eT0eTπ+1eTn1)

or, equivalently,

˜P(π)={Inif π=0(00100Iπ1001000000Inπ1)otherwise,

where n is the size of the permutation matrix.

When ˜P(π) is applied to a vector, it swaps the top element with the element indexed with π. When it is applied to a matrix, it swaps the top row with the row indexed with π. The size of matrix ˜P(π) is determined by the size of the vector or the row size of the matrix to which it is applied.

In discussing LU factorization with pivoting, we will use elementary pivot matrices in a very specific way, which necessitates the definition of how a sequence of such pivots are applied. Let p be a vector of integers satisfying the conditions

p=(π0πk1), where 1kn and 0πi<ni,

then ˜P(p) will denote the sequence of pivots

˜P(p)=(Ik100˜P(πk1))(Ik200˜P(πk2))(100˜P(π1))˜P(π0).
(Here ˜P() is always an elementary pivot matrix "of appropriate size.") What this exactly does is best illustrated through an example:
Example 5.3.2.3.

Let

p=(211)andA=(0.00.10.21.01.11.22.02.12.23.03.13.2).

Evaluate ˜P(p)A.

Solution
\begin{equation*} \begin{array}{l} \widetilde P( p ) A \\ ~~~=~~~~ \lt \mbox{ instantiate } \gt \\ \widetilde P( \left( \begin{array}{c} 2 \\ 1 \\ 1 \end{array} \right) ) \left( \begin{array}{l l l l} 0.0 \amp 0.1 \amp 0.2 \\ 1.0 \amp 1.1 \amp 1.2 \\ 2.0 \amp 2.1 \amp 2.2 \\ 3.0 \amp 3.1 \amp 3.2 \end{array} \right) \\ ~~~=~~~~ \lt \mbox{ definition of } \widetilde P( \cdot ) \gt \\ \left( \begin{array}{c | c} 1 \amp 0 \\ \hline 0 \amp \widetilde P( \left( \begin{array}{c} 1 \\ 1 \end{array} \right) ) \end{array} \right) \widetilde P( 2 ) \left( \begin{array}{l l l l} 0.0 \amp 0.1 \amp 0.2 \\ 1.0 \amp 1.1 \amp 1.2 \\ 2.0 \amp 2.1 \amp 2.2 \\ 3.0 \amp 3.1 \amp 3.2 \end{array} \right) \\ ~~~=~~~~ \lt \mbox{ swap first row with row indexed with 2 } \gt \\ \left( \begin{array}{c | c} 1 \amp 0 \\ \hline 0 \amp \widetilde P( \left( \begin{array}{c} 1 \\ 1 \end{array} \right) ) \end{array} \right) \left( \begin{array}{l l l l} 2.0 \amp 2.1 \amp 2.2 \\ \hline 1.0 \amp 1.1 \amp 1.2 \\ 0.0 \amp 0.1 \amp 0.2 \\ 3.0 \amp 3.1 \amp 3.2 \end{array} \right) \\ ~~~=~~~~ \lt \mbox{ partitioned matrix-matrix multiplication } \gt \\ \left( \begin{array}{c} \left( \begin{array}{l l l } 2.0 \amp 2.1 \amp 2.2 \end{array} \right)\\ \hline \widetilde P( \left( \begin{array}{c} 1 \\ 1 \end{array} \right) ) \left( \begin{array}{l l l } 1.0 \amp 1.1 \amp 1.2 \\ 0.0 \amp 0.1 \amp 0.2 \\ 3.0 \amp 3.1 \amp 3.2 \end{array} \right) \end{array} \right) ~~~=~~~~ \lt \mbox{ swap current first row with row indexed with 1 relative to that row } \gt \\ \left( \begin{array}{c} \left( \begin{array}{l l l } 2.0 \amp 2.1 \amp 2.2 \\ 0.0 \amp 0.1 \amp 0.2 \\ \end{array} \right)\\ \hline \widetilde P( \left( \begin{array}{c} 1 \end{array} \right) ) \left( \begin{array}{l l l } 1.0 \amp 1.1 \amp 1.2 \\ 3.0 \amp 3.1 \amp 3.2 \end{array} \right) \end{array} \right) \\ ~~~=~~~~ \lt \mbox{ swap current first row with row indexed with 1 relative to that row } \gt \\ \left( \begin{array}{c} \left( \begin{array}{l l l } 2.0 \amp 2.1 \amp 2.2 \\ 0.0 \amp 0.1 \amp 0.2 \\ 3.0 \amp 3.1 \amp 3.2 \end{array} \right)\\ \hline \left( \begin{array}{l l l } 1.0 \amp 1.1 \amp 1.2 \\ \end{array} \right) \end{array} \right) \\ ~~~=~~~~ \\ \left( \begin{array}{l l l } 2.0 \amp 2.1 \amp 2.2 \\ 0.0 \amp 0.1 \amp 0.2 \\ 3.0 \amp 3.1 \amp 3.2 \\ 1.0 \amp 1.1 \amp 1.2 \\ \end{array} \right) \end{array} \\ \end{equation*}

The relation between ˜P() and P() is tricky to specify:

˜P((π0π1πk1))=P((Ik100˜P(πk1))(100˜P(π1))˜P(π0)(01k1)).