Linear Algebra

1.5 Elementary Matrices and a Method for Finding \(A^{-1}\)

Imron Rosyadi

Linear Algebra in ECE

1.5 Elementary Matrices and a Method for Finding \(A^{-1}\)

Imron Rosyadi



An essential tool for understanding and solving linear systems in engineering.

Moment of Silence

1D elastic collision

A mass \(M1\) (moving) with initial velocity \(U_1\) hits another mass \(m_2\) that is initially at rest. We assume a perfectly elastic collision in one dimension. Unknown final velocities are:

  • \(V_1\) — final velocity of mass \(M1\),
  • \(v_2\) — final velocity of mass \(m2\).

Two equations govern the collision:

  1. Conservation of linear momentum

\[ M_1 U_1 = M_1 V_1 + m_2 v_2 \]

  1. Elastic collision condition (relative velocity reversal)

\[ V_1 - v_2 = -(U_1 - 0) = -U_1 \]

Rewrite as a linear system \(A\mathbf{x}=\mathbf{b}\) with \(\mathbf{x}=[V_1,\,v_2]^\top\):

\[ \begin{bmatrix} M_1 & m_2 \\[4pt] 1 & -1 \end{bmatrix} \begin{bmatrix} V_1 \\ v_2 \end{bmatrix} = \begin{bmatrix} M_1 U_1 \\ -U_1 \end{bmatrix}. \]

Linear Algebra in ECE

1.5 Elementary Matrices and a Method for Finding \(A^{-1}\)

Introduction: Why Elementary Matrices?

  • How do we systematically find the inverse of a matrix?
  • How do basic row operations relate to matrix multiplication?

In this section, we’ll develop an algorithm for finding the inverse of a matrix and discuss key properties of invertible matrices. We’ll start by revisiting elementary row operations.

Elementary Row Operations

Recall the three elementary row operations on a matrix \(A\):

  1. Scaling: Multiply a row by a nonzero constant \(c\).
    • Inverse Operation: Multiply the same row by \(1/c\).
  2. Interchange: Interchange two rows.
    • Inverse Operation: Interchange the same two rows.
  3. Replacement: Add a constant \(c\) times one row to another.
    • Inverse Operation: Add \(-c\) times the same row to the other.

Row Equivalence & Elementary Matrices

DEFINITION 1: Row Equivalence
Matrices \(A\) and \(B\) are row equivalent if either (hence each) can be obtained from the other by a sequence of elementary row operations.

DEFINITION 2: Elementary Matrix
A matrix \(E\) is called an elementary matrix if it can be obtained from an identity matrix by performing a single elementary row operation.

Example 1: Elementary Matrices

Listed below are four elementary matrices and the operations that produce them from an identity matrix \(I\).

Elementary Matrices Examples

Theorem 1.5.1: Row Operations by Matrix Multiplication

If the elementary matrix \(E\) results from performing a certain row operation on \(I_m\) and if \(A\) is an \(m \times n\) matrix, then the product \(EA\) is the matrix that results when this same row operation is performed on \(A\).

This is a powerful result: performing a row operation on \(A\) is equivalent to multiplying \(A\) by an elementary matrix from the left.

Example 2: Using Elementary Matrices

Consider the matrix: \[ A = \left[ \begin{array}{rrrr}1 & 0 & 2 & 3 \\ 2 & -1 & 3 & 6 \\ 1 & 4 & 4 & 0 \end{array} \right] \]

And the elementary matrix: \[ E = \left[ \begin{array}{lll}1 & 0 & 0 \\ 0 & 1 & 0 \\ 3 & 0 & 1 \end{array} \right] \]

\(E\) results from adding 3 times the first row of \(I_3\) to its third row.

The product \(EA\) is:

\[ EA = \left[ \begin{array}{rrrr}1 & 0 & 2 & 3 \\ 2 & -1 & 3 & 6 \\ 4 & 4 & 10 & 9 \end{array} \right] \]

This is precisely what you get by adding 3 times row 1 of \(A\) to row 3 of \(A\).

Example 2: Python Demonstration

Let’s compute \(EA\).

The result of EA confirms the effect of adding 3 times the first row of \(A\) to the third row.

Inverse Operations

For every elementary matrix \(E\), there’s an inverse elementary row operation that transforms \(E\) back to the identity matrix \(I\).

Row Operation on \(I\) That Produces \(E\)

  • Multiply row \(i\) by \(c \neq 0\)
  • Interchange rows \(i\) and \(j\)
  • Add \(c\) times row \(i\) to row \(j\)

Row Operation on \(E\) That Reproduces \(I\)

  • Multiply row \(i\) by \(1/c\)
  • Interchange rows \(i\) and \(j\)
  • Add \(-c\) times row \(i\) to row \(j\)

Theorem 1.5.2: Invertibility of Elementary Matrices

Every elementary matrix is invertible, and its inverse is also an elementary matrix.

This theorem is a building block for many results that follow.

Theorem 1.5.3: Equivalent Statements

If \(A\) is an \(n \times n\) matrix, then the following statements are equivalent (all true or all false):

  1. \(A\) is invertible.
  2. \(A\mathbf{x} = \mathbf{0}\) has only the trivial solution (\(\mathbf{x}=\mathbf{0}\)).
  3. The reduced row echelon form (RREF) of \(A\) is \(I_n\).
  4. \(A\) is expressible as a product of elementary matrices.

This theorem connects seemingly diverse ideas in linear algebra!

A Method for Inverting Matrices

Inversion Algorithm:

To find the inverse of an invertible matrix \(A\):

  1. Form the augmented matrix \([A \mid I_n]\).
  2. Perform a sequence of elementary row operations to reduce \(A\) to the identity matrix \(I_n\).
  3. As you perform these operations on \(A\), simultaneously apply them to \(I_n\).
  4. If \(A\) reduces to \(I_n\), the right side of the augmented matrix will be \(A^{-1}\). The final matrix will have the form \([I_n \mid A^{-1}]\).

This method leverages the fact that the same sequence of operations that transforms \(A\) to \(I_n\) will transform \(I_n\) to \(A^{-1}\).

Example 4: Using Row Operations to Find \(A^{-1}\)

Find the inverse of \[ A = \left[ \begin{array}{lll}1 & 2 & 3 \\ 2 & 5 & 3 \\ 1 & 0 & 8 \end{array} \right] \]

We start with the augmented matrix \([A \mid I]\):

\[ \left[ \begin{array}{r r r | r r r}{1}&{2}&{3} & {1}&{0}&{0}\\ {2}&{5}&{3} & {0}&{1}&{0}\\ {1}&{0}&{8} & {0}&{0}&{1}\end{array} \right] \] Apply row operations: 1. \(R_2 \leftarrow R_2 - 2R_1\) 2. \(R_3 \leftarrow R_3 - R_1\)

\[ \left[ \begin{array}{r r r | r r r}{1}&{2}&{3} & {1}&{0}&{0}\\ {0}&{1}&{-3} & {-2}&{1}&{0}\\ {0}&{-2}&{5} & {-1}&{0}&{1}\end{array} \right] \]

Example 4: Using Row Operations to Find \(A^{-1}\) (Cont.)

From previous step: \[ \left[ \begin{array}{r r r | r r r}{1}&{2}&{3} & {1}&{0}&{0}\\ {0}&{1}&{-3} & {-2}&{1}&{0}\\ {0}&{-2}&{5} & {-1}&{0}&{1}\end{array} \right] \] Apply row operations: 3. \(R_3 \leftarrow R_3 + 2R_2\)

\[ \left[ \begin{array}{r r r | r r r}{1}&{2}&{3} & {1}&{0}&{0}\\ {0}&{1}&{-3} & {-2}&{1}&{0}\\ {0}&{0}&{-1} & {-5}&{2}&{1}\end{array} \right] \] 4. \(R_3 \leftarrow -1 \cdot R_3\)

\[ \left[ \begin{array}{r r r | r r r}{1}&{2}&{3} & {1}&{0}&{0}\\ {0}&{1}&{-3} & {-2}&{1}&{0}\\ {0}&{0}&{1} & {5}&{-2}&{-1}\end{array} \right] \]

Example 4: Using Row Operations to Find \(A^{-1}\) (Cont.)

From previous step: \[ \left[ \begin{array}{r r r | r r r}{1}&{2}&{3} & {1}&{0}&{0}\\ {0}&{1}&{-3} & {-2}&{1}&{0}\\ {0}&{0}&{1} & {5}&{-2}&{-1}\end{array} \right] \] Apply row operations: 5. \(R_2 \leftarrow R_2 + 3R_3\) 6. \(R_1 \leftarrow R_1 - 3R_3\)

\[ \left[ \begin{array}{r r r | r r r}{1}&{2}&{0} & {-14}&{6}&{3}\\ {0}&{1}&{0} & {13}&{-5}&{-3}\\ {0}&{0}&{1} & {5}&{-2}&{-1}\end{array} \right] \] 7. \(R_1 \leftarrow R_1 - 2R_2\)

\[ \left[ \begin{array}{r r r | r r r}{1}&{0}&{0} & {-40}&{16}&{9}\\ {0}&{1}&{0} & {13}&{-5}&{-3}\\ {0}&{0}&{1} & {5}&{-2}&{-1}\end{array} \right] \]

Thus, the inverse is: \[ A^{-1} = \left[ \begin{array}{rrr} - 40 & 16 & 9 \\ 13 & -5 & -3 \\ 5 & -2 & -1 \end{array} \right] \]

Example 4: Python Verification

Let’s verify the inverse using numpy.linalg.inv.

The computed inverse matches our manual calculation, and \(A A^{-1} \approx I\).

Example 5: Showing That a Matrix Is Not Invertible

Consider the matrix: \[ A = \left[ \begin{array}{rrr}1 & 6 & 4 \\ 2 & 4 & -1 \\ -1 & 2 & 5 \end{array} \right] \] Start with \([A \mid I]\) and apply row operations:

\[ \quad \left[ \begin{array}{r r r | r r r}{1} & {6} & {4} & {1} & {0} & {0}\\ {2} & {4} & {-1} & {0} & {1} & {0}\\ {-1} & {2} & {5} & {0} & {0} & {1} \end{array} \right] \] 1. \(R_2 \leftarrow R_2 - 2R_1\) 2. \(R_3 \leftarrow R_3 + R_1\)

\[ \left[ \begin{array}{r r r | r r r}{1} & {6} & {4} & {1} & {0} & {0}\\ {0} & {-8} & {-9} & {-2} & {1} & {0}\\ {0} & {8} & {9} & {1} & {0} & {1} \end{array} \right] \] 3. \(R_3 \leftarrow R_3 + R_2\)

\[ \left[ \begin{array}{r r r | r r r}{1} & {6} & {4} & {1} & {0} & {0}\\ {0} & {-8} & {-9} & {-2} & {1} & {0}\\ {0} & {0} & {0} & {-1} & {1} & {1} \end{array} \right] \]

Since we obtained a row of zeros on the left side, \(A\) is not invertible.

Example 5: Python Check for Non-Invertibility

What happens when numpy.linalg.inv tries to invert a singular matrix?

numpy correctly identifies the matrix as singular, consistent with our manual process.

Example 6: Analyzing Homogeneous Systems

Use Theorem 1.5.3 to determine whether the given homogeneous systems have nontrivial solutions.

System (a): \[ \begin{array}{r l} & {x_{1} + 2x_{2} + 3x_{3} = 0}\\ & {2x_{1} + 5x_{2} + 3x_{3} = 0}\\ & {x_{1} + 0x_{2} + 8x_{3} = 0} \end{array} \] Coefficient matrix: \(A = \left[ \begin{array}{lll}1 & 2 & 3 \\ 2 & 5 & 3 \\ 1 & 0 & 8 \end{array} \right]\) (from Example 4)

Example 6: Analyzing Homogeneous Systems

System (b): \[ \begin{array}{r l} & {x_{1} + 6x_{2} + 4x_{3} = 0}\\ & {2x_{1} + 4x_{2} - x_{3} = 0}\\ & {-x_{1} + 2x_{2} + 5x_{3} = 0} \end{array} \] Coefficient matrix: \(A = \left[ \begin{array}{rrr}1 & 6 & 4 \\ 2 & 4 & -1 \\ -1 & 2 & 5 \end{array} \right]\) (from Example 5)

Solution: From parts (a) and (b) of Theorem 1.5.3: a homogeneous linear system \(A\mathbf{x}=\mathbf{0}\) has only the trivial solution if and only if its coefficient matrix \(A\) is invertible.

  • System (a)’s coefficient matrix (Example 4) is invertible. Thus, system (a) has only the trivial solution.
  • System (b)’s coefficient matrix (Example 5) is NOT invertible. Thus, system (b) has nontrivial solutions.

ECE Applications & Summary

Key Concepts for ECE:

  • System Analysis: Inverting matrices is crucial for solving systems of linear equations that model electrical circuits, control systems, and communication networks.
  • Transformations: Elementary matrices represent fundamental transformations that can be applied to data (e.g., in signal processing or computer graphics).
  • Invertibility: Determines if a unique solution exists for a given engineering problem (e.g., unique current/voltage in a circuit, unique control input for a desired output).

ECE Applications & Summary

Today We Covered:

  • Elementary Row Operations and their matrix representation.
  • The definition and invertibility of Elementary Matrices.
  • The fundamental Equivalence Theorem linking invertibility, homogeneous solutions, RREF, and elementary matrices.
  • A practical algorithm for finding \(A^{-1}\) using row operations.
  • How to identify non-invertible matrices during the inversion process.