Math 1410, Spring 2020

Introduction to Matrix Algebra

February 11, 2020

Sean Fitzpatrick
University of Lethbridge

Introduction

Warm-Up

Find the general solution to the homogeneous ystem

\begin{equation*} \begin{array}{ccccccccc} x_1\amp - \amp 2x_2 \amp + \amp x_3 \amp -\amp 4x_4 \amp = \amp 0\\ -2x_1\amp + \amp 4x_2 \amp -\amp 3x_3 \amp + \amp 5x_4\amp = \amp 0\\ -x_1 \amp + \amp 2x_2 \amp - \amp 3x_3 \amp - \amp 2x_4 \amp = \amp 0 \end{array}\text{.} \end{equation*}

Linear Systems as Matrix-Vector Equations

Vector solutions

It can be convenient to write our solutions in vector form. For later work with matrices, we use column vectors. Instead of giving solutions for \(x_1, x_2, \ldots, x_n\) separately, we collect things into a vector \(\bbm x_1\\x_2\\ \vdots\\ x_n\ebm\text{.}\)

For homogeneous systems this lets us easily determine the basic solutions. If our general solution has parameters \(t_1,t_2,\ldots, t_k\text{,}\) the basic solutions are obtained by setting one parameter equal to 1, and the others to 0.

Vector solutions, continued

This can be notationally convenient. A system

\begin{equation*} \begin{array}{ccccccccc} a_{11}x_1 \amp + \amp a_{12}x_2\amp + \amp \cdots \amp + \amp a_{1n}x_n \amp = \amp b_1\\ a_{21}x_1 \amp + \amp a_{22}x_2\amp + \amp \cdots \amp + \amp a_{2n}x_n \amp = \amp b_2\\ \vdots \amp \amp \vdots \amp \amp \amp \amp \vdots \amp \amp \vdots\\ a_{m1}x_1 \amp + \amp a_{m2}x_2\amp + \amp \cdots \amp + \amp a_{mn}x_n \amp = \amp b_m \end{array} \end{equation*}
has three main pieces:
\begin{equation*} A = \bbm a_{11} \amp a_{12} \amp \cdots \amp a_{1n}\\ a_{21} \amp a_{22} \amp \cdots \amp a_{2n}\\ \vdots \amp \vdots \amp \ddots \amp \vdots\\ a_{m1} \amp a_{m2} \amp \cdots \amp a_{mn}\ebm, \vec{x} = \bbm x_1 \\ x_2 \\ \vdots \\ x_n \ebm, \text{ and } \vec{b} = \bbm b_1 \\b_2 \\ \vdots \\ b_m\ebm\text{.} \end{equation*}

Matrix-vector product

We want to write our system in the form \(A\vec{x}=\vec{b}\text{.}\) How do we define the product \(A\vec{x}\text{?}\)

  • As a linear combination:

    \begin{equation*} \bbm a_{11} \amp a_{12} \amp \cdots \amp a_{1n}\\ a_{21} \amp a_{22} \amp \cdots \amp a_{2n}\\ \vdots \amp \vdots \amp \ddots \amp \vdots\\ a_{m1} \amp a_{m2} \amp \cdots \amp a_{mn}\ebm \bbm x_1\\x_2\\ \vdots \\x_n\ebm = x_1\bbm a_{11}\\ a_{21}\\ \vdots \\ a_{m1}\ebm + x_2\bbm a_{12}\\a_{22}\\ \vdots \\ a_{m2}\ebm + \cdots + x_n \bbm x_{1n}\\ x_{2n}\\ \vdots \\x_{mn}\ebm\text{.} \end{equation*}

  • Using row-times-column “dot products”:

    \begin{equation*} \bbm a_{11} \amp a_{12} \amp \cdots \amp a_{1n}\\ a_{21} \amp a_{22} \amp \cdots \amp a_{2n}\\ \vdots \amp \vdots \amp \ddots \amp \vdots\\ a_{m1} \amp a_{m2} \amp \cdots \amp a_{mn}\ebm \bbm x_1\\x_2\\ \vdots \\ x_n\ebm = \bbm a_{11}x_1 +a_{12}x_2 +\cdots + a_{1n}x_n\\ a_{21}x_1+a_{22}x_2+\cdots + a_{2n}x_n\\ \vdots \\ a_{m1}x_1+a_{m2}x_2+\cdots a_{mn}x_n\ebm\text{.} \end{equation*}

  • Both produce the same result! (Let's try an example or two.)

Properites of the product

Let \(A\) be an \(m\times n\) matrix, and let \(\vec{x}\) be an \(k\times 1\) column vector.

  1. The product \(A\vec{x}\) is only defined if \(k=n\)

  2. The result is an \(m\times 1\) column vector.

  3. For \(n\times 1\) vectors \(\vec{v},\vec{w}\text{,}\) \(A(\vec{v}+\vec{w})=A\vec{v}+A\vec{w}\text{.}\)

  4. For any \(n\times 1\) vector \(\vec{v}\) and scalar \(c\text{,}\) \(A(c\vec{v})=c(A\vec{v})\text{.}\)

Matrix-Vector Form

With our new notation, we can write a system of equations as \(A\vec{x}=\vec{b}\text{.}\)

  • This is notationally convenient: it's an easy way to refer to a general system of equations.

  • It's meant to remind you of the case of one equation with one variable: \(ax=b\text{.}\)

  • It can be used to quickly establish facts about systems.

Examples

Example:

Verify that \(\vec{x}=\bbm 2\\-1\\-3\ebm\) is a solution to

\begin{equation*} \bbm 3 \amp -1 \amp 2\\ -2 \amp 2 \amp -5\\ 4 \amp 0 \amp 1\ebm\bbm x\\y\\z\ebm = \bbm 1\\9\\5\ebm\text{.} \end{equation*}

Example:

Show that if \(\vec{v}\) is a solution to the homogeneous system \(A\vec{x}=\vec{0}\text{,}\) and \(\vec{w}\) is a solution to the non-homogeneous system \(A\vec{x}=\vec{b}\text{,}\) then \(\vec{v}+\vec{w}\) is also a solution to \(A\vec{x}=\vec{b}\text{.}\)

Rank and structure of solutions

The rank of a matrix is the number of leading ones in reduced row-echelon form. Given a system \(A\vec{x}=\vec{b}\) where \(A\) is \(m\times n\text{,}\) note:

  • There are \(m\) equations.

  • There are \(n\) variables.

  • If \(\rank(A) = r\text{,}\) then the general solution to \(A\vec{x}=\vec{0}\) has \(k=n-r\) parameters.

  • If \(\rank\left(\!\begin{array}{c|c}A \amp \vec{b}\end{array}\!\right)=\rank(A)\text{,}\) the system \(A\vec{x}=\vec{b}\) is consistent, and the general solution can be written as \(\vec{x}=\vec{x}_p+\vec{x}_h\text{,}\) where \(\vec{x}_p\) is a particular solution to \(A\vec{x}=\vec{b}\text{,}\) and \(\vec{x}_h\) is the general solution to the homogeneous system \(A\vec{x}=\vec{0}\text{.}\)

  • If \(\rank\left(\!\begin{array}{c|c}A\amp \vec{b}\end{array}\!\right)\gt\rank(A)\text{,}\) then the system is inconsistent.

Examples

Determine the rank of \(A\text{,}\) and solve \(A\vec{x}=\vec{b}\text{,}\) where

  1. \(A = \bbm -2 \amp 1\amp 3\\1\amp 0\amp -2\\ 0\amp 1\amp -1\ebm\text{,}\) \(\vec{b}=\bbm 5\\-2\\1\ebm\)

  2. \(A = \bbm 1 \amp -2 \amp 2\amp 0\\2\amp -3 \amp 7\amp -2\ebm\text{,}\) \(\vec{b}=\bbm 2\\-1\ebm\)

Matrix algebra

Matrices

By now, we've seen plenty of matrices. A matrix is just a rectangular array of numbers, arranged into rows and columns. If a matrix has \(m\) rows and \(n\) columns, we say it has size (or shape) \(m\times n\text{.}\)

Some examples of matrices:

\begin{equation*} A = \bbm 2 \amp -5\amp 0\\ \ln(42) \amp 1410 \amp 2020\ebm, B = \bbm 1\\2\\3\\4\\5\ebm, C = \bbm 0 \amp 0 \amp 0\\0\amp 0\amp 0\\0\amp 0\amp 0\ebm\text{.} \end{equation*}

Particular entries in a matrix are referenced by row and column. We write \(a_{ij}\) for the \((i,j)\)-entry of a matrix \(A\text{.}\)

Addition and scalar multiplication

This works exactly like you'd expect. Given matrices \(A = [a_{ij}], B=[b_{ij}]\) of the same size, define

\begin{equation*} A+B = [a_{ij}+b_{ij}]\text{.} \end{equation*}
For any scalar \(c\text{,}\) define \(cA = [ca_{ij}]\text{.}\)

Aside: what do we mean by “=”?

Properties

Let \(A\text{,}\) \(B\text{,}\) and \(C\) be matrices of the same size. Then:

  1. \(\displaystyle A+B=B+A\)
  2. \(\displaystyle A+(B+C)=(A+B)+C\)
  3. \(A+0=A\) (here \(0\) is the zero matrix)
  4. \(\displaystyle c(A+B)=cA+cB\)
  5. \(\displaystyle (c+d)A = cA+dA\)
  6. \(\displaystyle c(dA)=(cd)A\)