Summary
IVocabulary and rules of operationsAVocabularyBAdd, subtract, and multiply matrices by scalarsCMultiply two matricesIITransformation matricesADefinitionBExamples of transformation matrices1Stretching transformations2Rotations3Reflections4TranslationsCVertex matrixVocabulary and rules of operations
Vocabulary
Matrix
A matrix is a rectangular array of numbers.
The following is a matrix:
\begin{bmatrix} 1 & 0 & 3 \cr\cr 14 & -1 & \dfrac{1}{2} \end{bmatrix}
If a matrix has m rows and n columns, then we say the matrix is of size m\times n.
- The rows are labeled 1 through m starting from the top.
- The columns are labeled 1 through n starting from the left.
- The element which is in the i th row and j th column is called the i,j -entry of A.
- If we write A=\left[a_{ij}\right], then we mean A is a matrix whose i,j -entry is denoted by a_{ij}
The following matrix has size 1\times 4 :
\begin{bmatrix} 11 & 12 & 8 & 11 \end{bmatrix}
We have:
- a_{1{,}1}=11
- a_{1{,}2}=12
- a_{1{,}3}=8
- a_{1{,}4}=11
Matrices are typically labeled with capital letters such as A,B, and C.
For example, if we write:
A=\begin{bmatrix} 1 & 0 & 3 \cr\cr 14 & -1 & \dfrac{1}{2} \end{bmatrix}
Then we can refer to the matrix as A.
Column matrix
Let m be an integer such that m\geq1. A matrix of size m\times 1 is called a column matrix.
The matrix \begin{bmatrix}3\\2\\1\end{bmatrix} is a column matrix of size 3\times 1.
The information of a column matrix of size m\times 1 is the same information as an m -dimensional vector. For example, the two dimensional vector \langle 2{,}1 \rangle carries the same information as the 2\times 1 column matrix \begin{bmatrix}2\\1\end{bmatrix}. For this reason, we use symbols such as \vec{v} to denote column matrices.
Add, subtract, and multiply matrices by scalars
Adding and subtracting matrices are a natural extensions of adding and subtracting numbers.
Addition of matrices
If A and B are matrices of the same size m\times n, then we let A+B be the m\times n matrix obtained by adding the components of A and B. If A=\left[a_{ij}\right] and B=\left[b_{ij}\right], then:
A+B=\left[a_{ij}+b_{ij}\right]
The following matrix addition is performed by adding components:
\begin{bmatrix}2 & 3& 4 \\ 4 & 3 &-1\end{bmatrix}+\begin{bmatrix}1 & 2& -3 \\ 0 & 0 &1\end{bmatrix}=\begin{bmatrix}2+1 & 3+2& 4-3 \\ 4+0 & 3+0 &-1+1\end{bmatrix}=\begin{bmatrix}3 & 5& 1 \\ 4 & 3 &0\end{bmatrix}
Subtracting of matrices
If A and B are matrices of the same size m\times n, then we let A-B be the m\times n matrix obtained by subtracting the components of B from the components of A. If A=\left[a_{ij}\right] and B=\left[b_{ij}\right], then:
A-B=\left[a_{ij}-b_{ij}\right]
The following matrix subtraction is performed by subtracting components:
\begin{bmatrix}2 & 3& 4 \\ 4 & 3 &-1\end{bmatrix}-\begin{bmatrix}1 & 2& -3 \\ 0 & 0 &1\end{bmatrix}=\begin{bmatrix}2-1 & 3-2& 4-\left(-3\right) \\ 4-0 & 3-0 &-1-1\end{bmatrix}=\begin{bmatrix}1 & 1& 7 \\ 4 & 3 &-2\end{bmatrix}
We cannot add or subtract two matrices of different sizes.
Let A=\begin{bmatrix} 2 & 7 \\ 3 & -1\end{bmatrix} and B=\begin{bmatrix}2& 7 &18 &0\end{bmatrix}. Since A and B are not the same size, neither A+B nor A-B are defined.
Scalar multiplication
Let A be an m\times n matrix and \alpha a number. Then we define \alpha A to be the m\times n matrix obtained by multiplying the entries of A by \alpha. If A=\left[a_{ij}\right] and \alpha a real number, then:
\alpha A=\left[\alpha a_{ij}\right]
The following is an example of scalar multiplying a matrix:
3\begin{bmatrix}2 & 3& 4 \\ 4 & 3 &-1\end{bmatrix}=\begin{bmatrix}3\left(2\right) & 3\left(3\right)& 3\left(4\right) \\ 3\left(4\right) & 3\left(3\right) &3\left(-1\right)\end{bmatrix}=\begin{bmatrix}6 & 9& 12 \\ 12 & 9 &-3\end{bmatrix}
Multiply two matrices
Unlike addition and subtraction, multiplying two matrices does not mean multiplying the entries of the matrices component-wise.
We can only multiply matrices A and B when the number of column of A are equal to the number of rows of B.
In other words, the multiplication AB will only be defined when there are integers m,n,p such that:
- A is of size m\times n.
- B is of size n\times p.
The resulting multiplication matrix, AB, will be of size m\times p.
If A=\begin{bmatrix}2&3&7\\-1&2&6\\1&0&0\end{bmatrix} and B=\begin{bmatrix}2&13\\-3&4\\99&8\end{bmatrix}, then we can multiply A with B, that is AB will be well defined. This is because the number of columns of A and the number of rows of B have the same value of 3.
However, we can not multiply B with A, that is the multiplication BA is not defined. This is because the number of columns of B is 2 whereas the number of rows of A is 3.
Matrix multiplication with column matrix
Let A=\left[a_{ij}\right]=\begin{bmatrix}a_{1{,}1}& a_{1{,}2}& \cdots &a_{1,n}\\ a_{2{,}1}& a_{2{,}2}& \cdots &a_{2,n}\\\vdots & \vdots & & \vdots\\ a_{m,1}& a_{m,2}& \cdots &a_{m,n}\end{bmatrix} be an m\times n matrix and \vec{v}=\begin{bmatrix}v_1 \\ v_2 \\ \vdots \\ v_n\end{bmatrix} be a column matrix of size n\times 1.
Then A\vec{v} is defined to be the following m\times 1 matrix:
A\vec{v}=\begin{bmatrix}a_{1{,}1}& a_{1{,}2}& \cdots &a_{1,n}\\ a_{2{,}1}& a_{2{,}2}& \cdots &a_{2,n}\\\vdots & \vdots & & \vdots\\ a_{m,1}& a_{m,2}& \cdots &a_{m,n}\end{bmatrix}\begin{bmatrix}v_1\\v_2 \\ \vdots \\ v_n\end{bmatrix}=\begin{bmatrix}a_{1{,}1}v_1+a_{1{,}2}v_2+\cdots +a_{1,n}v_n\\ a_{2{,}1}v_1+a_{2{,}2}v_2+\cdots +a_{2,n}v_n\\ \vdots \\ a_{m,1}v_1+a_{m,2}v_2+\cdots +a_{m,n}v_n\end{bmatrix}\\
Let A=\begin{bmatrix}4 &3\\8&1\end{bmatrix} and \vec{v}=\begin{bmatrix}2\\ 1\end{bmatrix}. Then
A\vec{v}=\begin{bmatrix}4&3\\8&1\end{bmatrix}\begin{bmatrix}2\\1\end{bmatrix}=\begin{bmatrix}4\left(2\right)+3\left(1\right)\\8\left(2\right)+1\left(1\right)\end{bmatrix}=\begin{bmatrix}11\\17\end{bmatrix}
Suppose B is a matrix of size m\times p. Then B can be thought of as p column matrices of size m\times 1. If we denote the i th column of B as \vec{v}_i, then we write B=\begin{bmatrix} \vec{v}_1 | \vec{v}_2| \cdots | \vec{v}_p \end{bmatrix}.
Matrix multiplication
Let A be an m\times n matrix and B=\begin{bmatrix}\vec{v_1} | \vec{v}_2 | \cdots | \vec{v}_p\end{bmatrix} be a matrix of size n\times p. Then define AB to be the m\times p matrix whose i th column is the m\times 1 column vector A\vec{v}_i.
Let A=\begin{bmatrix}2&4\\-1& 0\\ 3&3\end{bmatrix} and B=\begin{bmatrix}1&1\\3& -3\end{bmatrix}. Then:
AB=\begin{bmatrix}2&4\\-1&0\\3&3\end{bmatrix}\begin{bmatrix}1&1\\3&-3\end{bmatrix}
AB=\begin{bmatrix}2\left(1\right)+4\left(3\right)&2\left(1\right)+4\left(-3\right)\\-1\left(1\right)+0\left(3\right)&-1\left(1\right)+0\left(-3\right)\\3\left(1\right)+3\left(3\right)&3\left(1\right)+3\left(-3\right)\end{bmatrix}
AB=\begin{bmatrix}2+12&2-12\\-1+0& -1+0\\ 3+9&3-9\end{bmatrix}
AB=\begin{bmatrix}14&-10\\-1& -1\\ 12&-6\end{bmatrix}
Suppose A=\left[a_{ij}\right] is an m\times n and B=\left[b_{ij}\right] is a n\times p matrix. Compute the i,j -entry of the product AB by simply computing the product of the i th row of A with the j th column of B.
Let A=\begin{bmatrix}2&3\\ 4&-1\\ 7&2\end{bmatrix} and B=\begin{bmatrix}1&7\\3&-6\end{bmatrix}. To compute the 3{,}1 -entry of the product AB, multiply the 3 rd row of A, which is \begin{bmatrix}7&2\end{bmatrix}, with the 1 st column of B, which is \begin{bmatrix}1\\3\end{bmatrix} :
AB=\begin{bmatrix}\textcolor{Red}{2}&\textcolor{Red}{3}\\ 4&-1\\ 7&2\end{bmatrix}.\begin{bmatrix}\textcolor{Red}{1}&7\\\textcolor{Red}{3}&-6\end{bmatrix}
AB=\begin{bmatrix} \textcolor{Red}{2\left(1\right)+3\left(3\right)} & ... \cr\cr ... & ... \cr\cr ... & ... \end{bmatrix}
AB=\begin{bmatrix} \textcolor{Red}{13} & ... \cr\cr ... & ... \cr\cr ... & ... \end{bmatrix}
If A and B are square matrices of the same size, then both AB and BA are well defined. However, it may be the case that AB\neq BA.
Let A=\begin{bmatrix}1&2\\3&4\end{bmatrix} and B=\begin{bmatrix}0&1\\0&0\end{bmatrix}.
We have:
AB=\begin{bmatrix}1&2\\3&4\end{bmatrix}\begin{bmatrix}0&1\\0&0\end{bmatrix}=\begin{bmatrix}0&1\\0&3\end{bmatrix}
And:
BA=\begin{bmatrix}0&1\\0&0\end{bmatrix}\begin{bmatrix}1&2\\3&4\end{bmatrix}=\begin{bmatrix}3&4\\0&0\end{bmatrix}
Observe that:
AB\neq BA
Transformation matrices
Multiplying a matrix with a column matrix produces a new column matrix. In particular, a matrix can be viewed as a transformation of the plane.
Definition
Transformation matrix
Any 2\times 2 matrix is a transformation matrix. This is because a 2\times 2 matrix multiplied against a 2\times 1 column vector produces a transformed 2\times 1 column vector.
Consider the matrix A=\begin{bmatrix}-1 & 0\\ 0 & -1\end{bmatrix}. If \begin{bmatrix}a\\ b\end{bmatrix} is a 2\times 1 column matrix, then:
A\begin{bmatrix}a\\ b\end{bmatrix}=\begin{bmatrix}-a\\ -b\end{bmatrix}
Therefore, if we associate the point \left(a,b\right) in the xy -plane with the column matrix \begin{bmatrix}a\\ b\end{bmatrix} then the matrix A transforms the xy -plane by reflecting points across the origin.
Examples of transformation matrices
Stretching transformations
Stretching transformation I
Let k be a real number. Then the matrix \begin{bmatrix}k& 0\\ 0 & 1\end{bmatrix} transforms the xy -plane by stretching the x -axis by a factor of k.
If a,b are any real numbers, then:
\begin{bmatrix}k& 0\\ 0 & 1\end{bmatrix}\begin{bmatrix}a\\b\end{bmatrix}=\begin{bmatrix}ka\\b\end{bmatrix}
Consider the matrix \begin{bmatrix}3 & 0\\ 0 & 1\end{bmatrix}. Then:
\begin{bmatrix}3 & 0\\ 0 & 1\end{bmatrix}\begin{bmatrix}3\\ 2\end{bmatrix}=\begin{bmatrix}9\\ 2\end{bmatrix}
Observe that the transformation matrix \begin{bmatrix}3 & 0 \\ 0 & 1\end{bmatrix} stretches the x -component of the point \left(3{,}2\right) by a factor of 3.
Stretching transformation II
Let k be a real number. Then the matrix \begin{bmatrix}1& 0\\ 0 & k\end{bmatrix} transforms the xy -plane by stretching the y -axis by a factor of k.
If a,b are any real numbers, then:
\begin{bmatrix}1&0\\ 0 & k\end{bmatrix}\begin{bmatrix}a\\b\end{bmatrix}=\begin{bmatrix}a\\kb\end{bmatrix}
Consider the matrix \begin{bmatrix}1 & 0\\ 0 & 3\end{bmatrix}. Then:
\begin{bmatrix}1 & 0\\ 0 & 3\end{bmatrix}\begin{bmatrix}3\\ 2\end{bmatrix}=\begin{bmatrix}3\\ 6\end{bmatrix}
Observe that the transformation matrix \begin{bmatrix}1 & 0 \\ 0 & 3\end{bmatrix} stretches the y -component of the point \left(3{,}2\right) by a factor of 3.
Rotations
Clockwise rotation transformation
Let \theta be an angle. The transformation matrix \begin{bmatrix}\cos\left(\theta\right)&\sin\left(\theta\right)\\ -\sin\left(\theta\right)& \cos\left(\theta\right)\end{bmatrix} acts on vectors in xy -plane by rotating them clockwise by an angle of \theta.
Let \theta=60^\circ then:
- \sin\left(\theta\right)=\dfrac{\sqrt{3}}{2}
- \cos\left(\theta\right)=\dfrac{1}{2}
The corresponding transformation matrix is \begin{bmatrix}\dfrac{1}{2}&\dfrac{\sqrt{3}}{2}\\ -\dfrac{\sqrt{3}}{2}& \dfrac{1}{2}\end{bmatrix}.
We have:
\begin{bmatrix}\dfrac{1}{2}&\dfrac{\sqrt{3}}{2}\\ -\dfrac{\sqrt{3}}{2}& \dfrac{1}{2}\end{bmatrix}\begin{bmatrix}1\\0\end{bmatrix}=\begin{bmatrix}\dfrac{1}{2}\\{-\dfrac{\sqrt{3}}{2}}\end{bmatrix}
Observe that the transformation matrix \begin{bmatrix}\dfrac{1}{2}&\dfrac{\sqrt{3}}{2}\\ -\dfrac{\sqrt{3}}{2}& \dfrac{1}{2}\end{bmatrix} rotates the point \left(1{,}0\right) by 60^\circ clockwise.
Counterclockwise rotation transformation
Let \theta be an angle. The transformation matrix \begin{bmatrix}\cos\left(\theta\right)&-\sin\left(\theta\right)\\ \sin\left(\theta\right)& \cos\left(\theta\right)\end{bmatrix} acts on vectors in xy -plane by rotating them counterclockwise by an angle of \theta.
Let \theta=60^\circ then :
- \sin\left(\theta\right)=\dfrac{\sqrt{3}}{2}
- \cos\left(\theta\right)=\dfrac{1}{2}
The corresponding transformation matrix is \begin{bmatrix}\dfrac{1}{2}&-\dfrac{\sqrt{3}}{2}\\ \dfrac{\sqrt{3}}{2}& \dfrac{1}{2}\end{bmatrix}.
We have:
\begin{bmatrix}\dfrac{1}{2}&-\dfrac{\sqrt{3}}{2}\\ \dfrac{\sqrt{3}}{2}& \dfrac{1}{2}\end{bmatrix}\begin{bmatrix} 1 \\ 0 \end{bmatrix}=\begin{bmatrix} \dfrac{1}{2}\\ \dfrac{\sqrt{3}}{2} \end{bmatrix}
Observe that the transformation matrix \begin{bmatrix}\dfrac{1}{2}&-\dfrac{\sqrt{3}}{2}\\ \dfrac{\sqrt{3}}{2}& \dfrac{1}{2}\end{bmatrix} rotates the vector counterclockwise by 60^\circ.
90^\circ counterclockwise rotation
The transition matrix \begin{bmatrix}0&-1\\1&0\end{bmatrix} acts on vectors by rotating them 90^\circ counterclockwise.
Observe that:
\begin{bmatrix}0&-1\\1&0\end{bmatrix}\begin{bmatrix}1\\1\end{bmatrix}=\begin{bmatrix}-1\\1\end{bmatrix}
The transformation matrix \begin{bmatrix}0&-1\\1&0\end{bmatrix} rotates the vector by 90^\circ counterclockwise.
180^\circ counterclockwise rotation
The transition matrix \begin{bmatrix}-1&0\\0&-1\end{bmatrix} acts on vectors by rotating them 180^\circ counterclockwise.
Observe that:
\begin{bmatrix}0&-1\\1&0\end{bmatrix}\begin{bmatrix}1\\1\end{bmatrix}=\begin{bmatrix}-1\\-1\end{bmatrix}
The transformation matrix \begin{bmatrix}0&-1\\-1&0\end{bmatrix} rotates the vector by 180^\circ counterclockwise.
90^\circ clockwise rotation
The transition matrix \begin{bmatrix}0&1\\-1&0\end{bmatrix} acts on vectors by rotating them 90^\circ clockwise.
Observe that:
\begin{bmatrix}0&1\\-1&0\end{bmatrix}\begin{bmatrix}1\\1\end{bmatrix}=\begin{bmatrix}1\\-1\end{bmatrix}
The transformation matrix \begin{bmatrix}0&-1\\1&0\end{bmatrix} rotates the vector by 90^\circ clockwise.
Reflections
Reflection across the x -axis
The transformation matrix \begin{bmatrix}1 & 0 \\ 0 &-1\end{bmatrix} reflects the points across the x -axis. If \left(a,b\right) a point in the xy -plane, then:
\begin{bmatrix}1&0\\0&-1\end{bmatrix}\begin{bmatrix}a\\b\end{bmatrix}=\begin{bmatrix}a\\-b\end{bmatrix}
Observe that:
\begin{bmatrix}1 & 0 \\ 0 & -1\end{bmatrix}\begin{bmatrix}3\\2\end{bmatrix}=\begin{bmatrix}3\\ -2\end{bmatrix}
The transformation matrix \begin{bmatrix}1 & 0 \\ 0 & -1\end{bmatrix} reflects the point \left(3{,}2\right) across the x -axis.
Reflection across the y -axis
The transformation matrix \begin{bmatrix}-1 & 0 \\ 0 &1\end{bmatrix} reflects the points across the y -axis. If \left(a,b\right) a point in the xy -plane, then:
\begin{bmatrix}-1&0\\0&1\end{bmatrix}\begin{bmatrix}a\\b\end{bmatrix}=\begin{bmatrix}-a\\b\end{bmatrix}
Observe that:
\begin{bmatrix}-1 & 0 \\ 0 & 1\end{bmatrix}\begin{bmatrix}3\\2\end{bmatrix}=\begin{bmatrix}-3\\ 2\end{bmatrix}
The transformation matrix \begin{bmatrix}1 & 0 \\ 0 & -1\end{bmatrix} reflects the point \left(3{,}2\right) across the y -axis.
Reflection across the line y=x
The transformation matrix \begin{bmatrix}0 & 1 \\ 1 &0\end{bmatrix} reflects the points across the line y=x. If \left(a,b\right) is a point in the xy -plane then:
\begin{bmatrix}0&1\\1&0\end{bmatrix}\begin{bmatrix}a\\b\end{bmatrix}=\begin{bmatrix}b\\a\end{bmatrix}
Observe that
\begin{bmatrix}0 & 1 \\ 1 & 0\end{bmatrix}\begin{bmatrix}3\\2\end{bmatrix}=\begin{bmatrix}2\\ 3\end{bmatrix}
The transformation matrix \begin{bmatrix}0 & 1 \\ 1 & 0\end{bmatrix} reflects the point \left(3{,}2\right) across the line y=x.
Reflection across the line y=-x
The transformation matrix \begin{bmatrix}0 & -1 \\ -1 &0\end{bmatrix} acts on a point by reflecting the point across the line y=-x. If \left(a,b\right) a point in the xy -plane, then:
\begin{bmatrix}0&-1\\-1&0\end{bmatrix}\begin{bmatrix}a\\b\end{bmatrix}=\begin{bmatrix}-b\\-a\end{bmatrix}
Observe that:
\begin{bmatrix}0 & 1 \\ 1 & 0\end{bmatrix}\begin{bmatrix}3\\2\end{bmatrix}=\begin{bmatrix}2\\ 3\end{bmatrix}
The transformation matrix \begin{bmatrix}0 & 1 \\ 1 & 0\end{bmatrix} reflected the point \left(3{,}2\right) across the line y=-x.
Translations
Translation matrix
Suppose \alpha,\beta are real numbers and consider the matrix A=\begin{bmatrix}1&0&\alpha\\ 0 & 1 & \beta \\ 0&0&1\end{bmatrix}. If we associate a point \left(a,b\right) in the xy -plane with the 3\times 1 column vector \begin{bmatrix}a\\b\\1\end{bmatrix}, then the matrix A transforms the xy -plane by translating the point \left(a,b\right) to \left(a+\alpha, b+\beta\right) :
\begin{bmatrix}1&0&\alpha\\ 0 & 1 & \beta \\ 0&0&1\end{bmatrix}\begin{bmatrix}a\\b\\1\end{bmatrix}=\begin{bmatrix}a+\alpha\\b+\beta\\1\end{bmatrix}
Observe that:
\begin{bmatrix}1 & 0 & 6 \\ 0 & 1 & -2\\ 0 & 0 &1\end{bmatrix}\begin{bmatrix}3\\2\\1\end{bmatrix}=\begin{bmatrix}9\\ 0\\1\end{bmatrix}
The transformation matrix A=\begin{bmatrix}1&0&6\\ 0 & 1 & -2 \\ 0&0&1\end{bmatrix} translates the point \left(3{,}2\right) to the point \left(3+6, 2-2\right)=\left(9{,}0\right).
Vertex matrix
Graph
A graph is a collection of points and arrows between those points.
The use of graphs, such as the one above, are widespread throughout various science disciplines. For example, graphs can be used to model data structures in computer science, molecular structures in biology, or neural connections in the brain.
The information of a graph can be stored in a matrix.
Vertex matrix
Suppose a graph has vertices labeled 1 through n. Then the vertex matrix of the graph is the n\times n matrix A=\begin{bmatrix}a_{ij}\end{bmatrix} whose i,j -entry is:
- a_{ij}=1 if there is an arrow from i to j.
- a_{ij}=0 if there is no arrow from i to j.
Consider the following graph.
The above graph has four vertices and three arrows.
- Arrow a_1 points from vertex 2 to vertex 1. The vertex matrix of the graph will therefore have a 1 in the 2{,}1 -entry.
- Arrow a_2 points from vertex 3 to vertex 2. The vertex matrix of the graph will therefore have a 1 in the 3{,}2 -entry.
- Arrow a_3 points from vertex 3 to vertex 4. The vertex matrix of the graph will therefore have a 1 in the 3{,}4 -entry.
- All other entries of the vertex matrix are 0.
The vertex matrix of the above graph is the following 4\times 4 matrix:
\begin{bmatrix}0&0&0&0\\1&0&0&0\\0&1&0&1\\0&0&0&0\end{bmatrix}