Objectives: At the end of this section, you should be able to
- understand what a matrix is,
- know what the dimension of a matrix is,
- understand when it is possible to add, subtract matrices
- understand when it is possible to multiply two matrices
- to transpose a matrix
- to write a linear system in matrix form.
Definition of a matrix
$$\left[\begin{array}{rrrr}
1&0&7&2\\
8&1&-3&3\\
7&6&0&-9
\end{array}\right],\quad
\left[\begin{array}{rrrrrr}
2&-1&8&5&3
\end{array}\right],\quad \left[\begin{array}{rrr|r}
1\\
2\\
-5
\end{array}\right], \quad\left[\begin{array}{rrrr}
0&0&0&0\\
0&0&0&0\\
0&0&0&0
\end{array}\right],\quad \left[\begin{array}{rrr|r}
1
\end{array}\right]$$
The entry that occurs in row $i$ and column $j$ of a matrix $A$ will be denoted by $a_{ij}$ or $(A)_{ij}$.
A general form of an $m\times n$ matrix is
\begin{eqnarray*}
\left[\begin{array}{rrrrr}
a_{11} & a_{12} & \cdots & a_{1n} \\
a_{21} & a_{22} & \cdots & a_{2n}\\
\vdots & \vdots & & \vdots \\
a_{m1} & a_{m2} & \cdots & a_{mn}\\
\end{array}\right]
\end{eqnarray*}
- The matrix
$\left[\begin{array}{rrrr}
1&0&7&2\\
8&1&-3&3\\
7&6&0&-9
\end{array}\right]$ is a $3\times 4$ matrix. - The matrix
$\left[\begin{array}{rrrrrr}
2&-1&8&5&3
\end{array}\right]$ is a $1\times 5$ matrix, hence it is a row matrix. - $\left[\begin{array}{rrr|r}
1\\
2\\
-5
\end{array}\right]$ is a $3\times 1$ matrix, hence it is a column matrix. - The matrix $\left[\begin{array}{rrrr}
0&0&0&0\\
0&0&0&0\\
0&0&0&0
\end{array}\right]$
is a $3\times 4$ matrix. - The matrix $\left[\begin{array}{rrr|r}
1
\end{array}\right]$ is a $1\times 1$ matrix. Hence it is both a row matrix and a column matrix.
\begin{eqnarray*}
\left[\begin{array}{rrrrr}
a_{11} & a_{12} & \cdots & a_{1n} \\
a_{21} & a_{22} & \cdots & a_{2n}\\
\vdots & \vdots & & \vdots \\
a_{n1} & a_{n2} & \cdots & a_{nn}\\
\end{array}\right]
\end{eqnarray*}
An important matrix we will frequently encounter is the identity matrix, which plays the unit’s role (as $1$ in $\mathbb{R}$). Another important matrix that we will encounter is the zero matrix which plays the role of $0$.
\begin{eqnarray*}
I_n=\left[\begin{array}{rrrrr}
1 & 0 & \cdots & 0 \\
0 & 1 & \cdots & 0\\
\vdots & \vdots & & \vdots \\
0 & 0 & \cdots & 1\\
\end{array}\right]
\end{eqnarray*}
The $m\times n$ zero matrix, denoted $\textbf{0}$ is the matrix
\begin{eqnarray*}
\textbf{0}=\left[\begin{array}{rrrrr}
0 & 0 & \cdots & 0 \\
0 & 0 & \cdots & 0\\
\vdots & \vdots & & \vdots \\
0 & 0 & \cdots & 0\\
\end{array}\right]
\end{eqnarray*}
- The matrix
$\left[\begin{array}{rrr}
0&\pi &2\\
8&-9&0\\
10&4&3
\end{array}\right]$ is a $3\times 3$ matrix, hence it is a square matrix of order $3$. - The matrix
$\left[\begin{array}{rrrrrr}
2&-1&8&5&3\\
3&2&3&1&-9\\
4&3&1&-5&8
\end{array}\right]$ is a $3\times 5$ matrix; hence it is not a square since the number of rows is not equal to the number of columns. - $\left[\begin{array}{rrrrr}
1& 0& 0& 0& 0 \\
0& 1& 0& 0& 0 \\
0& 0& 1& 0& 0 \\
0& 0& 0& 1& 0 \\
0& 0& 0& 0& 1
\end{array}\right]$ is a $5\times 5$ matrix, hence it is a square matrix of order $5$. - The matrix $\left[\begin{array}{rrrrr}
0&0&0&0\\
0&0&0&0\\
0&0&0&0\\
0&0&0&0
\end{array}\right]$
is a $4\times 4$ matrix. Hence it is a square matrix of order $4$. - The matrix $\left[\begin{array}{rrr|r}
3
\end{array}\right]$ is a $1\times 1$ matrix. Hence it is a square matrix of order $1$. - The matrix $\left[\begin{array}{rrr|r}
3& 2\\
0 & -1
\end{array}\right]$ is a $2\times 2$ matrix. Hence it is a square matrix of order $2$.
Operations on Matrices
Matrices are rectangular arrays of numbers or other mathematical objects that can be manipulated using a variety of operations. These operations include combining matrices by adding or subtracting their entries, multiplying a matrix by a scalar, multiplying two matrices together using the dot product, transposing a matrix by flipping its rows and columns, and finding the inverse of a square matrix. These operations are fundamental to many areas of mathematics and have important applications in fields such as engineering, physics, computer science, and economics.
Addition and subtraction
Matrix addition is an operation that combines two matrices of the same size by adding their corresponding entries. If $A$ and $B$ are two matrices of the same size, say $m \times n$, then the sum $A + B$ is the matrix obtained by adding the corresponding entries of $A$ and $B$. That is, the entry in the ith row and jth column of $A + B$ is the sum of the entries in the ith row and jth column of A and B, respectively.
their corresponding entries are equal. That is, if
\begin{eqnarray*}
A=\left[\begin{array}{rrrrr}
a_{11} & a_{12} & \cdots & a_{1n} \\
a_{21} & a_{22} & \cdots & a_{2n}\\
\vdots & \vdots & & \vdots \\
a_{m1} & a_{m2} & \cdots & a_{mn}\\
\end{array}\right]
\end{eqnarray*}
and
\begin{eqnarray*}
B=\left[\begin{array}{rrrrr}
b_{11} & b_{12} & \cdots & b_{1q} \\
b_{21} & b_{22} & \cdots & b_{2q}\\
\vdots & \vdots & & \vdots \\
b_{p1} & b_{p2} & \cdots & b_{pq}\\
\end{array}\right],
\end{eqnarray*} then $m=p$, $n=q$ and $a_{ij}=b_{ij}$ for all $1\leq i\leq m$ and $1\leq j\leq n$. This means
\begin{eqnarray*}
\begin{array}{rrrrr}
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 & \vdots & & \vdots \\
a_{m1}=b_{m1}, & a_{m2}=b_{m2}, & \cdots & a_{mn}=b_{mn}.\\
\end{array}
\end{eqnarray*}
- The matrices $A=\left[\begin{array}{rrrrr}
1& 2& 3& 0\\
0& 3& 0& 1\\
3& 2& 4& 7\\
0& 0& 0& 1
\end{array}\right]$ and $B=\left[\begin{array}{rrrrr}
1& 2& 3& 0\\
0& 3& 0& 1\\
3& 2& 4& 7
\end{array}\right]$ are not equal since they are not the same size. - The matrices $A=\left[\begin{array}{rrrrr}
1& 2& 3& 0\\
0& 3& 0& 1\\
3& 2& 4& 7\\
2& -1& \pi & 1
\end{array}\right]$ and $B=\left[\begin{array}{rrrrr}
1& 2& t& 0\\
x& 3& 0& 1\\
3& 2& 4& 7\\
2& y& z& w
\end{array}\right]$ are equal if and only if $t=3$, $x=0$, $y=-1$, $z=\pi$ and $w=1$.
a_{11} & a_{12} & \cdots & a_{1n} \\
a_{21} & a_{22} & \cdots & a_{2n}\\
\vdots & \vdots & & \vdots \\
a_{m1} & a_{m2} & \cdots & a_{mn}\\
\end{array}\right]
$
and
$
B=\left[\begin{array}{rrrrr}
b_{11} & b_{12} & \cdots & b_{1n} \\
b_{21} & b_{22} & \cdots & b_{2n}\\
\vdots & \vdots & & \vdots \\
b_{m1} & b_{m2} & \cdots & b_{mn}\\
\end{array}\right]$ be two matrices of \textbf{the same size} $m\times n$.
The sum of $A$ and $B$, denoted $A + B$, is the matrix
\begin{eqnarray*}
A+B&=&\left[\begin{array}{rrrrr}
a_{11} & a_{12} & \cdots & a_{1n} \\
a_{21} & a_{22} & \cdots & a_{2n}\\
\vdots & \vdots & & \vdots \\
a_{m1} & a_{m2} & \cdots & a_{mn}\\
\end{array}\right]+\left[\begin{array}{rrrrr}
b_{11} & b_{12} & \cdots & b_{1n} \\
b_{21} & b_{22} & \cdots & b_{2n}\\
\vdots & \vdots & & \vdots \\
b_{m1} & b_{m2} & \cdots & b_{mn}\\
\end{array}\right]\\
&=&\left[\begin{array}{rrrrr}
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 & \vdots & & \vdots \\
a_{m1}+b_{m1} & a_{m2}+b_{m2} & \cdots & a_{mn}+b_{mn}\\
\end{array}\right].
\end{eqnarray*}
The difference of $A$ and $B$, denoted$A – B$, is the matrix
\begin{eqnarray*}
A-B&=&\left[\begin{array}{rrrrr}
a_{11} & a_{12} & \cdots & a_{1n} \\
a_{21} & a_{22} & \cdots & a_{2n}\\
\vdots & \vdots & & \vdots \\
a_{m1} & a_{m2} & \cdots & a_{mn}\\
\end{array}\right]-\left[\begin{array}{rrrrr}
b_{11} & b_{12} & \cdots & b_{1n} \\
b_{21} & b_{22} & \cdots & b_{2n}\\
\vdots & \vdots & & \vdots \\
b_{m1} & b_{m2} & \cdots & b_{mn}\\
\end{array}\right]\\
&=&\left[\begin{array}{rrrrr}
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 & \vdots & & \vdots \\
a_{m1}-b_{m1} & a_{m2}-b_{m2} & \cdots & a_{mn}-b_{mn}\\
\end{array}\right].
\end{eqnarray*}
1& 2& 3& 0\\
8& 3& 2& 1\\
3& -2& 4& -7\\
10& -5& 4& 1
\end{array}\right]$ and $B=\left[\begin{array}{rrrrr}
2& 2& 7& -2\\
-5& 1& 2& 5\\
3& 2& 0& 8\\
2& 1& 0& 3
\end{array}\right].$
Compute $A+B$ and $A-B$ if possible.
The matrices $A$ and $B$ are the same size so that we can compute their sum $A+B$ and their difference $A-B$. We have
\begin{eqnarray*}
A+B&=&\left[\begin{array}{rrrrr}
1& 2& 3& 0\\
8& 3& 2& 1\\
3& -2& 4& -7\\
10& -5& 4& 1
\end{array}\right]+\left[\begin{array}{rrrrr}
2& 2& 7& -2\\
-5& 1& 2& 5\\
3& 2& 0& 8\\
2& 1& 0& 3
\end{array}\right]\\
&=&\left[\begin{array}{rrrrr}
1+2& 2+2& 3+7& 0+(-2)\\
8+(-5)& 3+1& 2+2& 1+5\\
3+3& -2+2& 4+0& -7+8\\
10+2& -5+1& 4+0& 1+3
\end{array}\right]\\
&=&\left[\begin{array}{rrrrr}
3& 4& 10& -2\\
3& 4& 4& 6\\
6& 0& 4& 1\\
12& -4& 4& 4
\end{array}\right]
\end{eqnarray*}
and
\begin{eqnarray*}
A-B&=&\left[\begin{array}{rrrrr}
1& 2& 3& 0\\
8& 3& 2& 1\\
3& -2& 4& -7\\
10& -5& 4& 1
\end{array}\right]-\left[\begin{array}{rrrrr}
2& 2& 7& -2\\
-5& 1& 2& 5\\
3& 2& 0& 8\\
2& 1& 0& 3
\end{array}\right]\\
&=&\left[\begin{array}{rrrrr}
1-2& 2-2& 3-7& 0-(-2)\\
8-(-5)& 3-1& 2-2& 1-5\\
3-3& -2-2& 4-0& -7-8\\
10-2& -5-1& 4-0& 1-3
\end{array}\right]\\
&=&\left[\begin{array}{rrrrr}
-1& 0& -4& 2\\
13& 2& 0& -4\\
0& -4& 4& -15\\
8& -6& 4& -2
\end{array}\right]
\end{eqnarray*}
Scalar Multiplication
Scalar multiplication of matrices is an operation that multiplies a matrix by a scalar, which is a single number. If $k$ is a scalar and $A$ is an $m \times n$ matrix, then the product $kA$ is the matrix obtained by multiplying each entry of $A$ by $k$. That is, the entry in the ith row and jth column of $kA$ is $k$ times the entry in the ith row and jth column of A. Matrices can be multiplied by a scalar value by multiplying each element in the matrix by the scalar.
a_{11} & a_{12} & \cdots & a_{1n} \\
a_{21} & a_{22} & \cdots & a_{2n}\\
\vdots & \vdots & & \vdots \\
a_{m1} & a_{m2} & \cdots & a_{mn}\\
\end{array}\right]
$ is any matrix and $c\in\mathbb{R}$ is any scalar, then the scalar product of $A$ by $c$, denoted $cA$, is the matrix
$$cA=\left[\begin{array}{rrrrr}
ca_{11} & ca_{12} & \cdots & ca_{1n} \\
ca_{21} & ca_{22} & \cdots & ca_{2n}\\
\vdots & \vdots & & \vdots \\
ca_{m1} & ca_{m2} & \cdots & ca_{mn}\\
\end{array}\right]
.$$
5& -3& 4& 8\\
\frac{1}{3}& \frac{2}{5}& 2& -3\\
0& 2& 3& -6
\end{array}\right]$ and $B=\left[\begin{array}{rrrrr}
7& 1& -2& 0\\
9& 10& 5& -3\\
2& 0& 6& 8\\
23& 15& 60& -6
\end{array}\right].$
Compute $2A$, $0\cdot A$ and $-\frac{3}{2}B$.
We have
\begin{eqnarray*}
2A&=&2\left[\begin{array}{rrrrr}
5& -3& 4& 8\\
\frac{1}{3}& \frac{2}{5}& 2& -3\\
0& 2& 3& -6
\end{array}\right]=\left[\begin{array}{rrrrr}
10& -6& 8& 16\\
\frac{2}{3}& \frac{4}{5}& 4& -6\\
0& 4& 6& -12
\end{array}\right]
\end{eqnarray*}
\begin{eqnarray*}
0\cdot A&=&0\cdot\left[\begin{array}{rrrrr}
5& -3& 4& 8\\
\frac{1}{3}& \frac{2}{5}& 2& -3\\
0& 2& 3& -6
\end{array}\right]=\left[\begin{array}{rrrrr}
0& 0& 0& 0\\
0& 0& 0& 0\\
0& 0& 0& 0
\end{array}\right]
\end{eqnarray*}
\begin{eqnarray*}
-\frac{3}{2}B&=&-\frac{3}{2}\left[\begin{array}{rrrrr}
7& 1& -2& 0\\
9& 10& 5& -3\\
2& 0& 6& 8\\
23& 15& 60& -6
\end{array}\right]=\left[\begin{array}{rrrrr}
-\frac{21}{2}& -\frac{3}{2}& 3& 0\\
-\frac{27}{2}& -15& -\frac{15}{2}& \frac{9}{2}\\
-3& 0& -9& -12\\
-\frac{69}{2}& -\frac{45}{2}& -90& 9
\end{array}\right]
\end{eqnarray*}
- $A+B=B+A$
- $(A+B)+C=A+(B+C)$
- $A+0=0+A=A$
- $(\alpha+\beta)A=\alpha A+\beta A$
- $\alpha (A+B)=\alpha A+\alpha B$
- $\alpha(\beta A)=(\alpha \beta) A$
Multiplication of Matrices
The product of matrices is an operation that combines two matrices to produce a third matrix. If $A$ is an $m \times n$ matrix and $B$ is an $n \times p$ matrix, then the product $AB$ is an $m\times p$ matrix obtained by taking the dot product of each row of $A$ with each column of $B$. That is, the entry in the ith row and jth column of $AB$ is the sum of the products of the entries in the ith row of $A$ and the jth column of $B$. If $A$ and $B$ are matrices and if the number of columns of $A$ is equal to the number of rows of $B$, then we can define the product of $A$ and $B$.
$$(AB)_{ij}=a_{i1}b_{1j}+a_{i2}b_{2j}+a_{i3}b_{3j}+\cdot +a_{ir}b_{rj}.$$
To find the entry in row $i$ and column $j$ of $AB$, single out row $i$ from the matrix $A$ and column $j$ from
the matrix $B$. Multiply the corresponding entries from the row and column, and then add the resulting products.
Note that the product of two matrices is defined only when the number of columns in the first matrix equals the number of rows in the second matrix. For instance, we can multiply a $2\times 3$ matrix by a $3\times 7$ matrix to obtain a $2\times 7$ matrix. But we cannot multiply a $2\times 3$ matrix by a $2\times 3$ matrix.
1& 2& 3& 0\\
8& 3& 2& 1\\
\end{array}\right]$ and $B=\left[\begin{array}{rrrrr}
2& -2\\
-5& 5\\
3& 8\\
2& 3
\end{array}\right].$
- Compute $AB$ if it is defined.
- Compute $BA$ if it is defined.
- Is $AB=BA$?
$A$ is a $2\times 4$ matrix and $B$ is a $4\times 2$. Since the number of columns of $A$ is equal to the number of rows of $B$, then $AB$ is defined, and the result is a $2\times 2$ matrix.
\begin{eqnarray*}
AB&=&\left[\begin{array}{rrrrr}
1& 2& 3& 0\\
8& 3& 2& 1
\end{array}\right]\left[\begin{array}{rrrrr}
2& -2\\
-5& 5\\
3& 8\\
2& 3
\end{array}\right]=\left[\begin{array}{rrrrr}
(AB)_{11}& (AB)_{12}\\
(AB)_{21}& (AB)_{22}
\end{array}\right]
\end{eqnarray*}
with
\begin{eqnarray*}
(AB)_{11}&=&\left[\begin{array}{rrrrr}
1& 2& 3& 0
\end{array}\right]\left[\begin{array}{rrrrr}
2\\
-5\\
3\\
2
\end{array}\right]=1\cdot 2+2\cdot(-5)+3\cdot 3+0\cdot 2=1\\
(AB)_{12}&=&\left[\begin{array}{rrrrr}
1& 2& 3& 0
\end{array}\right]\left[\begin{array}{rrrrr}
-2\\
5\\
8\\
3
\end{array}\right]=1\cdot (-2)+2\cdot5 +3\cdot 8+0\cdot 3= 32\\
(AB)_{21}&=&\left[\begin{array}{rrrrr}
8& 3& 2& 1
\end{array}\right]\left[\begin{array}{rrrrr}
2\\
-5\\
3\\
2
\end{array}\right]=8\cdot 2+3\cdot(-5)+2\cdot 3+1\cdot 2=9\\
(AB)_{22}&=&\left[\begin{array}{rrrrr}
8& 3& 2& 1
\end{array}\right]\left[\begin{array}{rrrrr}
-2\\
5\\
8\\
3
\end{array}\right]=8\cdot (-2)+3\cdot5 +2\cdot 8+1\cdot 3=18.
\end{eqnarray*}Hence
\begin{eqnarray*}
AB&=&\left[\begin{array}{rrrrr}
1& 2& 3& 0\\
8& 3& 2& 1
\end{array}\right]\left[\begin{array}{rrrrr}
2& -2\\
-5& 5\\
3& 8\\
2& 3
\end{array}\right]=\left[\begin{array}{rrrrr}
1& 32\\
9& 18
\end{array}\right]
\end{eqnarray*}- $B$ is a $4\times 2$ matrix and $A$ is a $2\times 4$. Since the number of columns of $B$ is equal to the number of rows of $A$, then $BA$ is defined, and the result is a $4\times 4$ matrix.
\begin{eqnarray*}
BA&=&\left[\begin{array}{rrrrr}
2& -2\\
-5& 5\\
3& 8\\
2& 3
\end{array}\right]\left[\begin{array}{rrrrr}
1& 2& 3& 0\\
8& 3& 2& 1
\end{array}\right]=\left[\begin{array}{rrrrr}
-14&-2& 2& -2\\
35& 5& -5& 5\\
67& 30& 25& 8\\
26& 13& 12& 3
\end{array}\right]
\end{eqnarray*} - $AB$ and $BA$ are not of the same size. Hence they cannot be equal. That is, $AB\neq BA$.
This show that \textbf{matrix multiplication is not commutative}.
a & b & c \\
d & e & f \\
g & h & i
\end{array}\right]$, $B=\left[\begin{array}{rrrrr}
1& 0& 0\\
0& 1& 0\\
0& 0& 1
\end{array}\right]$ and $\textbf{0}=\left[\begin{array}{rrrrr}
0& 0& 0\\
0& 0& 0\\
0& 0& 0
\end{array}\right]$.
- Compute $AI$ if it is defined.
- Compute $IA$ if it is defined.
- Compute $A\textbf{0}$ if it is defined.
- Compute $\textbf{0}A$ if it is defined.
Since the number of columns of $A$ equals the number of rows of $I$, the product $AI$ is defined. We have
\begin{eqnarray*}
AI&=&\left[\begin{array}{rrrrr}
a & b & c \\
d & e & f \\
g & h & i
\end{array}\right]\left[\begin{array}{rrrrr}
1& 0& 0\\
0& 1& 0\\
0& 0& 1
\end{array}\right]=\left[\begin{array}{rrrrr}
a & b & c \\
d & e & f \\
g & h & i
\end{array}\right]
\end{eqnarray*}
Since the number of columns of $I$ equals the number of rows of $A$, the product $IA$ is defined. We have
\begin{eqnarray*}
IA&=&\left[\begin{array}{rrrrr}
1& 0& 0\\
0& 1& 0\\
0& 0& 1
\end{array}\right]\left[\begin{array}{rrrrr}
a & b & c \\
d & e & f \\
g & h & i
\end{array}\right]=\left[\begin{array}{rrrrr}
a & b & c \\
d & e & f \\
g & h & i
\end{array}\right]
\end{eqnarray*}- Since the number of columns of $A$ is equal to the number of rows of $\textbf{0}$, then the product $A\textbf{0}$ is defined. We have
\begin{eqnarray*}
A\textbf{0}&=&\left[\begin{array}{rrrrr}
a & b & c \\
d & e & f \\
g & h & i
\end{array}\right]\left[\begin{array}{rrrrr}
0& 0& 0\\
0& 0& 0\\
0& 0& 0
\end{array}\right]=\left[\begin{array}{rrrrr}
0& 0& 0\\
0& 0& 0\\
0& 0& 0
\end{array}\right]
\end{eqnarray*}
Since the number of columns of $\textbf{0}$ is equal to the number of rows of $A$, then the product $\textbf{0}A$ is defined. We have
\begin{eqnarray*}
\textbf{0}A&=&\left[\begin{array}{rrrrr}
0& 0& 0\\
0& 0& 0\\
0& 0& 0
\end{array}\right]\left[\begin{array}{rrrrr}
a & b & c \\
d & e & f \\
g & h & i
\end{array}\right]=\left[\begin{array}{rrrrr}
0& 0& 0\\
0& 0& 0\\
0& 0& 0
\end{array}\right]
\end{eqnarray*}
- $A(BC)=(AB)C$
- $(A+B)C=AC+BC$
- $A(B+C)=AB+AC$
- $\alpha(AB)=(\alpha A)B=A(\alpha B)$
- $A\textbf{0}=\textbf{0} A=\textbf{0}$
- $AI=I A=A$
- $(\alpha+\beta)A=\alpha A+\beta A$
- $\alpha (A+B)=\alpha A+\alpha B$
- $\alpha(\beta A)=(\alpha \beta) A$
If $A$ is a square matrix of order $n$ and if $k$ is positive integer, then $A^k$ is the matrix
\[
A^k=\underbrace{AA\cdots A}_{\text{$k$ times}}
\]
By convention,
$A^0=I_n$ (the identity matrix of order $n$).
1 & 2\\
-3 & -1
\end{bmatrix}$
- Compute $A^2$
- Compute $A^3$
- Compute $A^0$
- $A^2=A\cdot A=\begin{bmatrix}
1 & 2\\
-3 & -1
\end{bmatrix}\begin{bmatrix}
1 & 2\\
-3 & -1
\end{bmatrix}=\begin{bmatrix}
-5 & 0\\
0 & -5
\end{bmatrix}$ - $A^3=A^2A=\begin{bmatrix}
-5 & 0\\
0 & -5
\end{bmatrix}\begin{bmatrix}
1 & 2\\
-3 & -1
\end{bmatrix}=\begin{bmatrix}
-5 & -10\\
15 & 5
\end{bmatrix}$ - $A^0=\begin{bmatrix}
1 & 0\\
0 & 1
\end{bmatrix}$
Transpose and Trace
In many applications of matrices, we find it necessary to interchange rows and columns. This process of interchanging rows and columns is called transposition.
a_{11} & a_{12} & \cdots & a_{1n} \\
a_{21} & a_{22} & \cdots & a_{2n}\\
\vdots & \vdots & & \vdots \\
a_{m1} & a_{m2} & \cdots & a_{mn}\\
\end{array}\right]
$ be an $m\times n$ matrix. The transpose of $A$ is the $n\times m$ matrix defined by
$$A^T=\left[\begin{array}{rrrrr}
a_{11} & a_{21} & \cdots & a_{n1} \\
a_{12} & a_{22} & \cdots & a_{n2}\\
\vdots & \vdots & & \vdots \\
a_{1m} & a_{2m} & \cdots & a_{nm}\\
\end{array}\right].
$$
In order words,
$$\left(A^T\right)_{ij}=(A)_{ji}.$$
Given any matrix $A$, its transpose $A^T$ is the matrix whose first row is the first column of $A$; its second row is the second column of $A$, and so on.
a_{11} & a_{12} & \cdots & a_{1n} \\
a_{21} & a_{22} & \cdots & a_{2n}\\
\vdots & \vdots & & \vdots \\
a_{n1} & a_{n2} & \cdots & a_{nn}\\
\end{array}\right]
$ be an $n\times n$ matrix. The trace of $A$, denoted $\mathrm{tr}(A)$, is the sum of its diagonal entries. In other words,
$$\mathrm{tr}(A)=a_{11}+a_{22}+a_{33}+\cdots +a_{nn}.$$
Note that the trace is defined only for square matrices. But the transpose is defined for all matrices.
$$A=\begin{bmatrix}
1& 2 & -1\\
0& 2& 0
\end{bmatrix},\qquad
B=\begin{bmatrix}
1& 2\\
-2 & 1
\end{bmatrix},\qquad
C=\begin{bmatrix}
0& 1& 2\\
1& 0 & -1\\
2 & 1 & 0
\end{bmatrix}.$$
Compute the following matrices or state why the matrix is not defined.
- $A^T$
- $(A^T)^T$
- $B^T$
- $C^T$
- $BA+AC^T$
- $CA^T+B^TA$
- $\mathrm{tr(B)}$
- $\mathrm{tr(B^T)}$
- $\mathrm{tr(C)}$
- $\mathrm{tr(C^T)}$
- $\mathrm{tr(A)}$
- $\mathrm{tr}(BA+AC^T)$
- $A^{T}=\begin{bmatrix}
1 & 0\\
2 & 2\\
-1 & 0
\end{bmatrix}$ - $(A^T)^T==\begin{bmatrix}
1 & 0\\
2 & 2\\
-1 & 0
\end{bmatrix}^T=\begin{bmatrix}
1& 2 & -1\\
0& 2& 0
\end{bmatrix}=A$ - $B^T=\begin{bmatrix}
1& -2\\
2 & 1
\end{bmatrix}$ - $C^T=\begin{bmatrix}
0& 1& 2\\
1& 0 & 1\\
2 & -1 & 0
\end{bmatrix}$ - Since $C$ is a $3\times 3$ then $C^T$ is a $3\times 3$. Because $A$ is a $2\times 3$ matrix, then $AC^T$ is defined, and it is a $2\times 3$. By the last part, we have that $BA$ is defined, and it is a $2\times 3$. Since $BA$ and $AC^T$ are of the same dimension, then $BA+AC^T$ is defined. We have
\begin{eqnarray*}
BA+AC^T&=&\begin{bmatrix}
1& 2\\-2 & 1
\end{bmatrix}\begin{bmatrix}
1& 2 & -1\\0& 2& 0
\end{bmatrix}+
\begin{bmatrix}
& 2 & -1\\0 & 2 & 0
\end{bmatrix}\begin{bmatrix}
0 & 1 & 2 \\1& 0 & 1\\2& -1 & 0
\end{bmatrix}
\begin{bmatrix}
1 & 6 & -1\\
-2 & -2 & 2
\end{bmatrix}\\
&=&
\begin{bmatrix}
1& 6&-1\\-2 & -2 & 2
\end{bmatrix}+\begin{bmatrix}
0 & 2 & 4\\ 2& 0 & 2
\end{bmatrix}=\begin{bmatrix}
1 & 8 & 3\\ 0 & -2 & 4
\end{bmatrix}
\end{eqnarray*} - Since $A$ is a $2\times 3$ then $A^T$ is a $3\times 2$. Because $C$ is a $3\times 3$ and $A^T$ is a $3\times 2$, then $CA^T$ is defined and it is a $3\times 2$. Since $B^T$ is a $2\times 2$ matrix and $A$ is a $2\times 3$, then $B^TA$ is defined and it is a $2\times 3$. Because $CA^T$ (which is a $3\times 2$ matrix) and $B^TA$ (which is a $2\times 3$ matrix) are not of the same dimension, then $CA^T+B^TA$ is not defined.
- Since $B$ is a square matrix, then $\mathrm{tr(B)}$ is defined and $\mathrm{tr(B)}=1+1=2$
- Since $B^T$ is a square matrix, then $\mathrm{tr(B^T)}$ is defined and $\mathrm{tr(B^T)}=1+1=2$
- Since $C$ is a square matrix, then $\mathrm{tr(C)}$ is defined and $\mathrm{tr(C)}=0+0+0=0$
- Since $C^T$ is a square matrix, then $\mathrm{tr(C^T)}$ is defined and $\mathrm{tr(C^T)}=0+0+0=0$
- Since $A$ is not a square matrix, then $\mathrm{tr(A)}$ is not defined.
- Since $BA+AC^T$ is not a square matrix, then $\mathrm{tr}(BA+AC^T)$ is not defined.
- $(A^T)^T=A$
- $(A+B)^T=A^T+B^T$
- $(\alpha A)^T=\alpha A^T$
- $(AB)^T=B^TA^T$
- $(A^T)^T_{ij}=(A^T)_{ji}=(A)_{ij}$
- $(A+B)^T_{ij}=(A+B)_{ji}=(A)_{ji}+(B)_{ji}=(A^T)_{ij}+(B^T)_{ij}$
- $(\alpha A)^T_{ij}=\alpha A^T$
- $(AB)^T=B^TA^T$
Matrix form of a linear system of equations
To transform a system of linear equations into matrix form, we can use the coefficients of the variables to construct a matrix $A$ and the constants on the right-hand side to construct a column vector $b$.
Let $A=\left[\begin{array}{rrrrr}
a_{11} & a_{12} & \cdots & a_{1n} \\
a_{21} & a_{22} & \cdots & a_{2n}\\
\vdots & \vdots & & \vdots \\
a_{m1} & a_{m2} & \cdots & a_{mn}\\
\end{array}\right]
$ be an $m\times n$ matrix and $X=\begin{bmatrix}
x_1\\x_2\\ \vdots \\
x_n
\end{bmatrix}$ be an $m\times 1$ matrix. Since the number of columns of $A$ is equal to the number of rows of $X$, then $AX$ is defined, and we have
\begin{eqnarray*}
AX&=&\left[\begin{array}{rrrrr}
a_{11} & a_{12} & \cdots & a_{1n} \\
a_{21} & a_{22} & \cdots & a_{2n}\\
\vdots & \vdots & & \vdots \\
a_{m1} & a_{m2} & \cdots & a_{mn}\\
\end{array}\right]
\begin{bmatrix}
x_1\\x_2\\ \vdots \\
x_n
\end{bmatrix}\\\\
&=&\left[\begin{array}{cccccccccc}
a_{11}x_1 & +& a_{12}x_2& +& a_{13}x_3& +& \cdots & +&a_{1n}x_n\\
a_{21}x_1 & +& a_{22}x_2& +& a_{23}x_3& +& \cdots & +&a_{2n}x_n\\
a_{31}x_1 & +& a_{32}x_2& +& a_{33}x_3& +& \cdots & +&a_{3n}x_n\\
& \vdots & & \vdots & & \vdots & & \vdots & \\
a_{m1}x_1 & +& a_{m2}x_2& +& a_{m3}x_3& +& \cdots & +&a_{mn}x_n
\end{array}\right]
\end{eqnarray*}
It follows that the linear system
\begin{eqnarray*}
\begin{array}{ccccccccccc}
a_{11}x_1 & +& a_{12}x_2& +& a_{13}x_3& +& \cdots & +&a_{1n}x_n&=&b_1\\
a_{21}x_1 & +& a_{22}x_2& +& a_{23}x_3& +& \cdots & +&a_{2n}x_n&=&b_2\\
a_{31}x_1 & +& a_{32}x_2& +& a_{33}x_3& +& \cdots & +&a_{3n}x_n&=&b_3\\
& \vdots & & \vdots & & \vdots & & \vdots & &\vdots &\\
a_{m1}x_1 & +& a_{m2}x_2& +& a_{m3}x_3& +& \cdots & +&a_{mn}x_n&=&b_m
\end{array}
\end{eqnarray*}
can be written in matrix form as
\begin{eqnarray*}
\left[\begin{array}{rrrrr}
a_{11} & a_{12} & \cdots & a_{1n} \\
a_{21} & a_{22} & \cdots & a_{2n}\\
\vdots & \vdots & & \vdots \\
a_{m1} & a_{m2} & \cdots & a_{mn}\\
\end{array}\right]
\begin{bmatrix}
x_1\\x_2\\ \vdots \\
x_n
\end{bmatrix}
&=&\left[\begin{array}{cccccccccc}
b_1\\b_2\\ \vdots \\
b_n
\end{array}\right]
\end{eqnarray*}
The linear system in the unknown variables $w$, $x$, $y$, and $z$
\begin{eqnarray*}
\begin{array}{ccccccccc}
5w&+&7x&+&3y&+&3z&=&2\\
&-& x&+& y&+& z&=&-1\\
& & x&-& y&-& z&=& 1\\
4w&+&5x&+&3y&+&3z&=&1
\end{array}
\end{eqnarray*}
can be written in matrix form as
\begin{eqnarray*}
\left[\begin{array}{rrrrrr}
5& 7 & 3 & 3 \\
0& -1 & 1 & 1\\
0& 1 & -1 & -1\\
4& 5 & 3 & 3\\
\end{array}\right]
\left[\begin{array}{rrrrr}
w\\
x\\
y\\
z\\
\end{array}\right]=\left[\begin{array}{rrrrr}
2\\
-1\\
1\\
1\\
\end{array}\right]
\end{eqnarray*}
\begin{eqnarray*}
\begin{array}{ccccccccc}
x_1&-&x_2&-&x_3&+&x_4&=&4\\
3x_1&-&3x_2&-&2x_3&+&8x_4&=&10\\
4x_1&-&4x_2&-&5x_3&+&6x_4&=&18
\end{array}
\end{eqnarray*}
can be written in matrix form as
\begin{eqnarray*}
\left[\begin{array}{rrrrr}
1 & -1 & -1 & 1 \\
3 & -3 & -2 & 8\\
4 & -4 & -5 & 6
\end{array}\right]\left[\begin{array}{rrrr}
x_1\\
x_2\\
x_3\\
x_4
\end{array}\right]=\left[\begin{array}{rrrr}
4\\
10\\
18
\end{array}\right]
\end{eqnarray*}
Comments 1