August 5, 2025
A matrix is a rectangular array of numbers arranged in rows and columns.
Note: In MAT350, we’ll consider matrices whose entries are real numbers, although this restriction is not generally required.
The dimension (or size) of a matrix is described as \(m \times n\) (read: “\(m\) by \(n\)”), where \(m\) is the number of rows and \(n\) is the number of columns.
Example: The matrix \(A = \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{bmatrix}\) is a \(2 \times 3\) matrix.
Example: Find the dimensions of each of the following matrices
\[B = \begin{bmatrix} 2 & 8\\ -3 & 1\\ -5 & -2\\ 0 & 7\end{bmatrix}~~~~~~C = \begin{bmatrix} -2 & 0\\ 0 & 0\end{bmatrix}~~~~~~D = \begin{bmatrix} -9\\ 0\\ 1\\ 4\\ -3\end{bmatrix}\]
Similar to vectors, we can transpose a matrix.
If the matrix \(A\) is an \(m\times n\) matrix, then the matrix \(A^T\) is an \(n\times m\) matrix whose rows are the columns of the matrix \(A\).
Example: Determine the transpose for each of the following matrices.
Example: If the matrix \(A\) is a \(5\times 7\) matrix, then what are the dimensions of the matrix \(A^T\)?
Consider the matrix \(A = \begin{bmatrix} a_{11} & a_{12} & \cdots & a_{1n}\\ a_{21} & a_{22} & \cdots & a_{2n}\\ \vdots & & \ddots & \vdots\\ a_{m1} & a_{m2} & \cdots & a_{mn}\end{bmatrix}\) and a scalar \(c\).
The product \(cA\) is obtained by multiplying every element of \(A\) by the scalar \(c\). That is,
Consider the matrix \(A = \begin{bmatrix} a_{11} & a_{12} & \cdots & a_{1n}\\ a_{21} & a_{22} & \cdots & a_{2n}\\ \vdots & & \ddots & \vdots\\ a_{m1} & a_{m2} & \cdots & a_{mn}\end{bmatrix}\) and a scalar \(c\).
The product \(cA\) is obtained by multiplying every element of \(A\) by the scalar \(c\). That is,
\[cA = \begin{bmatrix} ca_{11} & ca_{12} & \cdots & ca_{1n}\\ ca_{21} & ca_{22} & \cdots & ca_{2n}\\ \vdots & & \ddots & \vdots\\ ca_{m1} & ca_{m2} & \cdots & ca_{mn}\end{bmatrix}\]
Example: Consider the matrix \(A = \begin{bmatrix} 5 & -2 & 0 & 11 & 7\\ -3 & 1 & 1 & 4 & 0\\ 0 & 0 & 2 & 1 & -5\end{bmatrix}\). Compute the product \(-2A\).
Like vectors, matrices can be added or subtracted if they have the same dimensions.
Addition and subtraction are performed element-wise. That is, if
\[A = \begin{bmatrix} a_{11} & a_{12} & \cdots & a_{1n}\\ a_{21} & a_{22} & \cdots & a_{2n}\\ \vdots & & \ddots & \vdots\\ a_{m1} & a_{m2} & \cdots & a_{mn}\end{bmatrix}~~~~~\text{and}~~~~~B = \begin{bmatrix} b_{11} & b_{12} & \cdots & b_{1n}\\ b_{21} & b_{22} & \cdots & b_{2n}\\ \vdots & & \ddots & \vdots\\ b_{m1} & b_{m2} & \cdots & b_{mn}\end{bmatrix}\]
then
\[A + B = \begin{bmatrix} a_{11} + b_{11} & a_{12} + b_{12} & \cdots & a_{1n} + b_{1n}\\ a_{21} + b_{21} & a_{22} + B_{22} & \cdots & a_{2n} + b_{2n}\\ \vdots & & \ddots & \vdots\\ a_{m1} + b_{m1} & a_{m2} + b_{m2} & \cdots & a_{mn} + b_{mn}\end{bmatrix}\]
\[A + B = \begin{bmatrix} a_{11} + b_{11} & a_{12} + b_{12} & \cdots & a_{1n} + b_{1n}\\ a_{21} + b_{21} & a_{22} + B_{22} & \cdots & a_{2n} + b_{2n}\\ \vdots & & \ddots & \vdots\\ a_{m1} + b_{m1} & a_{m2} + b_{m2} & \cdots & a_{mn} + b_{mn}\end{bmatrix}\]
Example: Let \(A = \begin{bmatrix} 1 & -2 & 0 \\ 0 & 7 & -1 \end{bmatrix}\) and \(B = \begin{bmatrix} 5 & -3 & 1 \\ -1 & 2 & 8 \end{bmatrix}\), then compute
Matrix multiplication is not done element-wise, instead it is based on row-by-column dot products.
Given matrices \(A\) and \(B\), the \(ij^{\text{th}}\) entry (the entry in row \(i\) and column \(j\)) of the matrix product \(AB\) is given by the dot product between row \(i\) of matrix \(A\) and column \(j\) of matrix \(B\).
Requirements and Results: Because the matrix product \(AB\) consists of dot products between rows of \(A\) and columns of \(B\), then
Example: Given the matrices below, compute the matrix products if they are defined. If the matrix product is not defined, describe why.
We can treat vectors as \(n\times 1\) matrices, so multiplying matrices by vectors is also possible (and often very useful!).
Example: Compute the product \(A\vec{v}\) where \(A = \begin{bmatrix} 1 & 0 & -1\\ 0 & 2 & 3\end{bmatrix}\) and \(\vec{v} = \begin{bmatrix} 2\\ -1\\ 3\end{bmatrix}\)
We saw vector products in the last notebook but, with our knowledge of matrix multiplication, we can define the dot product (or inner product) and the outer product just as special cases of matrix multiplication.
Consider two \(n\times 1\) vectors \(\vec{u} = \begin{bmatrix} u_1\\ u_2\\ \vdots\\ u_n\end{bmatrix}\) and \(\vec{v} = \begin{bmatrix} v_1\\ v_2\\ \vdots\\ v_n\end{bmatrix}\).
Example: Given the vectors \(\vec{u} = \begin{bmatrix} -2\\ 7\\ 0\end{bmatrix}\) and \(\vec{v} = \begin{bmatrix} 1\\ 1\\ -3\end{bmatrix}\), compute the following:
Rewrite the matrix \(A = \begin{bmatrix} a_{11} & a_{12} & \cdots & a_{1n}\\ a_{21} & a_{22} & \cdots & a_{2n}\\ \vdots & & \ddots & \vdots\\ a_{m1} & a_{m2} & \cdots & a_{mn}\end{bmatrix}\) as \(A = \begin{bmatrix} \vec{a_1} & \vec{a_2} & \cdots & \vec{a_n}\end{bmatrix}\)
Where \(\vec{a_i} = \begin{bmatrix} a_{1i}\\ a_{2i}\\ \vdots\\ a_{mi}\end{bmatrix}\)
Consider the product \(A\vec{v}\), where \(A = \begin{bmatrix} \vec{a_1} & \vec{a_2} & \cdots & \vec{a_n}\end{bmatrix}\) and \(\vec{v} = \begin{bmatrix} v_1\\ v_2\\ \vdots\\ v_n\end{bmatrix}\)
\[\begin{align} A\vec{v} &= \begin{bmatrix} \vec{a_1} & \vec{a_2} & \cdots & \vec{a_n}\end{bmatrix}\begin{bmatrix} v_1\\ v_2\\ \vdots\\ v_n\end{bmatrix}\\ &= v_1\vec{a_1} + v_2\vec{a_2} + \cdots + v_n\vec{a_n} \end{align}\]
The result is a sum of scalar multiples of the columns of \(A\)
This Section Intentionally Left Undefined…*
There are several special matrices that we’ll encounter throughout linear algebra. We’ll introduce two of those now.
Identity Matrix: The \(n\times n\) identity matrix, \(I_n\), is a matrix such that \(I_nA = AI_n = A\). That is, multiplying a matrix \(A\) by a compatible identity matrix leaves the matrix \(A\) unchanged.
The form of the \(n\times n\) identity matrix is
\[I_n = \begin{bmatrix} 1 & 0 & \cdots & 0\\ 0 & 1 & \cdots & 0\\ \vdots & \vdots & \ddots & \vdots\\ 0 & 0 & \cdots & 1\end{bmatrix}\]
There are several special matrices that we’ll encounter throughout linear algebra. We’ll introduce two of those now.
The form of the \(n\times n\) identity matrix is
\[I_n = \begin{bmatrix} 1 & 0 & \cdots & 0\\ 0 & 1 & \cdots & 0\\ \vdots & \vdots & \ddots & \vdots\\ 0 & 0 & \cdots & 1\end{bmatrix}\]
Example: Consider the matrix \(A = \begin{bmatrix} 1 & 0 & -2\\ 0 & 3 & 8\\ 3 & 0 & -1\end{bmatrix}\). Compute the following products.
There are several special matrices that we’ll encounter throughout linear algebra. We’ll introduce two of those now.
Inverse Matrices: For an \(n\times n\) matrix \(A\), there may exist an \(n\times n\) matrix \(B\) such that \(AB = BA = I_n\). In this case, we call \(B\) the inverse of \(A\) and write \(B = A^{-1}\).
There are several special matrices that we’ll encounter throughout linear algebra. We’ll introduce two of those now.
Inverse Matrices: For an \(n\times n\) matrix \(A\), there may exist an \(n\times n\) matrix \(B\) such that \(AB = BA = I_n\). In this case, we call \(B\) the inverse of \(A\) and write \(B = A^{-1}\).
Example: Show that the matrix \(B = \begin{bmatrix} 1 & 3\\ 2 & 7\end{bmatrix}\) is the inverse of the matrix \(A = \begin{bmatrix} 7 & -3\\ -2 & 1\end{bmatrix}\) by computing \(AB\) and \(BA\).
Example: Use the matrix \(B\) above to solve the matrix equation \(\begin{bmatrix} 1 & 3\\ 2 & 7\end{bmatrix}\vec{x} = \begin{bmatrix} 5\\ -8\end{bmatrix}\)
In this slide deck, you’ve seen and practiced…
recognizing the dimension of a matrix
multiplying a matrix by a scalar
adding and subtracting compatible matrices
multiplying matrices and vectors
identifying and using an identity matrix
verifying two matrices are inverses of one another
using the inverse of a matrix to solve a matrix equation
\[\Huge{\text{Finish Homework 1}}\] \[\Huge{\text{on MyOpenMath}}\]
\(\Huge{\text{Finding Solutions to Linear Systems}}\)