About

Matrices

Column

Introduction

In mathematics, a matrix (plural matrices ) is a rectangular array of numbers, symbols, or expressions, arranged in rows and columns.

Matrices are commonly written in box brackets.

An \(m \times n\) (read ‘m by n’) matrix is an arrangement of numbers (or algebraic expressions ) in \(m\) rows and \(n\) columns.

Each number in a given matrix is called an element or entry. A zero matrix has all its elements equal to zero.

Matrices and Systems of Equations

  • Dimensions of a Matrix
  • Matrix Multiplication
  • Matrix Calculations
  • Systems of Equations
  • Expression Systems of Equations as Matrices
  • Augmented Matrices
  • Guassian Elimination

Matrix algebra

  • Writing a system of linear equations as a matrix equation
  • The rules for when two matrices can be added and subtracted
  • The rules for when two matrices can be multiplied
  • Adding, subtracting and multiplying matrices of suitable sizes
  • The identity matrices In and their properties
  • Interpreting powers of the adiacency matrix of a graph/digraph

Matrix Operations

Commutativity and Associativity

Matrices of the same size can be added or subtracted element by element.

\[ A \times B \neq B \times A \]

Matrix Multiplication

  • Method for multiply a pair of \(2\times2\) matrices.

\[ \left( \begin{array}{cc} a_1 & a_2 \\ b_1 & b_2 \end{array} \right)\left( \begin{array}{cc} c_1 & d_1 \\ c_2 & d_2 \end{array} \right) = \left( \begin{array}{cc} (a_1 \times c_1) + (a_2 \times c_2) & (a_1 \times d_1) + (a_2 \times d_2) \\ (b_1 \times c_1) + (b_2 \times c_2) & (b_1 \times d_1) + (b_2 \times d_2) \end{array} \right) \]

Example

\[ \left( \begin{array}{cc} 1 & 3 \\ 0 & 2 \end{array} \right)\left( \begin{array}{cc} 1 & 2 \\ 4 & 1 \end{array} \right) = \left( \begin{array}{cc} (1 \times 1) + (3 \times 4) & (1 \times 2) + (3 \times 1) \\ (0 \times 4) + (2 \times 4) & (0 \times 2) + (2 \times 1) \end{array} \right) = \left( \begin{array}{cc} 14 & 5 \\ 8 & 2 \end{array} \right) \]

Determinants

The determinant helps us find the inverse of a matrix, tells us things about the matrix that are useful in systems of linear equations, calculus and more.

The symbol for determinant is two vertical lines either side: |A| means the determinant of the matrix A (exactly the same symbol as absolute value.)

In the case of a 2 × 2 matrix the determinant can be defined as

\[{\displaystyle {\begin{aligned}|A|={\begin{vmatrix}a&b\\c&d\end{vmatrix}}=ad-bc.\end{aligned}}}\] Similarly, for a 3 × 3 matrix A, its determinant is

\[{\displaystyle {\begin{aligned}|A|={\begin{vmatrix}a&b&c\\d&e&f\\g&h&i\end{vmatrix}}&=a\,{\begin{vmatrix}e&f\\h&i\end{vmatrix}}-b\,{\begin{vmatrix}d&f\\g&i\end{vmatrix}}+c\,{\begin{vmatrix}d&e\\g&h\end{vmatrix}}\\[3pt]&=aei+bfg+cdh-ceg-bdi-afh.\end{aligned}}}\]

Terminology

Order of a Matrix

Consider the following matrix \(A\) \[A = \right(\begin{array}{ccc} 6 & 3 & 2 \\ 4 & 7 & 5 \\ \end{array}\left) \]

  • \(A\) has 2 rows and 3 columns.
  • We would say A is a \(2 \times 3\) matrix.

Square Matrices

A square matrix is a matrix with the same number of rows and columns. An \(n\times n\) matrix is known as a square matrix of order n. Any two square matrices of the same order can be added and multiplied.

Diagonal and triangular matrices

If all entries of A below the main diagonal are zero, A is called an upper triangular matrix. Similarly if all entries of A above the main diagonal are zero, A is called a lower triangular matrix. If all entries outside the main diagonal are zero, A is called a diagonal matrix.

The Identity Matrix

The identity matrix or unit matrix of size n is the \(n\times n\) square matrix with ones on the main diagonal and zeros elsewhere. It is denoted by \(I_n\), or simply by I if the size is immaterial or can be trivially determined by the context.

\[ I_{1}={\begin{bmatrix}1\end{bmatrix}},\ I_{2}={\begin{bmatrix}1&0\\0&1\end{bmatrix}},\ I_{3}={\begin{bmatrix}1&0&0\\0&1&0\\0&0&1\end{bmatrix}},\ \cdots ,\ I_{n}={\begin{bmatrix}1&0&\cdots &0\\0&1&\cdots &0\\\vdots &\vdots &\ddots &\vdots \\0&0&\cdots &1\end{bmatrix}} \]

  • When A is a square matrix (i.e. \(n\times n\)), it is a property of matrix multiplication that \[I_{N}A=AI_{n}=A.\,\]

  • When A is \(m\times n\), it is a property of matrix multiplication that \[I_{m}A=AI_{n}=A.\,\]

  • The Identity matrix itself is invertible, being its own inverse.

  • The Identity matrix is symmetrix, which is to say, it is it’s own tranpose.

\[ \right(\begin{array}{ccc} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ \end{array}\left) \]

Tranpose of a Matrix

A symmetric matrix is a matrix that is identical to it’s tranpose.

Tutorials

Matrices Tutorial 1

Linear Algebra

Column

Introduction

Linear algebra is the branch of mathematics concerning linear equations such as: linear maps such as: and their representations in vector spaces and through matrices. Linear algebra is central to almost all areas of mathematics.

Reduced Row Echelon Form

Specifically, a matrix is in row echelon form if

  • All nonzero rows (rows with at least one nonzero element) are above any rows of all zeroes (all zero rows, if any, belong at the bottom of the matrix).
  • The leading coefficient (the first nonzero number from the left, also called the pivot) of a nonzero row is always strictly to the right of the leading coefficient of the row above it.
  • All entries in a column below a leading entry are zeroes (implied by the first two criteria).[1]

\[\left[ \begin{array}{ccccc} 1 & a_0 & a_1 & a_2 & a_3 \\ 0 & 0 & 1 & a_4 & a_5 \\ 0 & 0 & 0 & 1 & a_6 \end{array} \right]\]

Worked Example

\[ {\begin{array}{ccccc} 1&2 & 6 &3 & 5 \\ 0&1&4 &0 & 6 \\ 0&1&2 &1 & 7 \\ 0&0&1 &1 & 7 \end{array}} \]

\[ {\begin{array}{ccccc} 1&1 & 6 &8 & 5 \\ 0&2&6 &0 & 6 \\ 0&0&1 &1 & 7 \\ 0&0&0 &1 & 7 \end{array}} \]

\[ {\begin{array}{ccccc} 1&1 & 6 &8 & 5 \\ 0&1&6 &0 & 6 \\ 0&0&0 &1 & 7 \\ 0&0&1 &1 & 7 \end{array}} \]

[ { \[\begin{array}{ccccc} 1&1 & 6 &8 & 5 \\ 0&1&6 &0 & 6 \\ 0&0&0 &0 & 1 \end{array}\]

} ] }

Fundamental Theorem of Linear Algebra

  • The rank of a matrix is \(n\).
  • The determinant of the matrix is not zero.
  • The matrix is invertible.
  • The rows are linearly independent
  • There exists a solution to a set of Linear equation based on the matrix

Diagonalization

\[ A = PDP^{-1} \]

By extension \[ D = P^{-1}AP\]

Systems of Linear Equations

Column

Augmented Matrices

Given the matrices \(A\) and \(B\), where

\[A = \begin{bmatrix} 1 & 3 & 2 \\ 2 & 0 & 1 \\ 5 & 2 & 2 \end{bmatrix} , \quad B = \begin{bmatrix} 4 \\ 3 \\ 1 \end{bmatrix},\]

the augmented matrix (\(A|B\)) is written as

\[(A|B)= \left[\begin{array}{ccc|c} 1 & 3 & 2 & 4 \\ 2 & 0 & 1 & 3 \\ 5 & 2 & 2 & 1 \end{array}\right].\]

Systems of Linear Equations

\[ \begin{bmatrix} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33} \\ \end{bmatrix} \begin{bmatrix} x_{1} \\ x_{2} \\ x_{3} \\\end{bmatrix} = \begin{bmatrix} b_{1} \\ b_{2} \\ b_{3} \\ \end{bmatrix}\]

\[ a_{11}x_{1} + a_{12}x_{2} + a_{13}x_{3} = b_1 \\ a_{21}x_{1} + a_{22}x_{2} + a_{23}x_{3} = b_2 \\ a_{31}x_{1} + a_{32}x_{2} + a_{33}x_{3} = b_3 \\ \]

Video List

Video List

Video List

Matrices - Worksheets

Column

Work Sheet 1

Question 1

Consider the following matrices \(A\) and \(B\) which are given as

\[ A = \left( \begin{array}{ccc} 0 & 2 & 1 \\ 2 &1 &2\\ 1 &2 &0\\ \end{array} \right) \qquad B = \left( \begin{array}{ccc} 1 &0 &1\\ 2 &1 &0\\ 1 &2 &1\\ \end{array} \right) \]

Questions
  1. Show that \(AB\) and \(BA\) are not equal.

  2. Find matrices \(C\), \(D\) and \(E\) such that

  3. \(B\) + \(C\) = \(A\)

  1. \(BD\) = \(B\)

  2. \(B\) - \(E\) = \(A\).


Question 2

\[A = \begin{bmatrix} -4 & 3 \\ 2 & 1 \\ \end{bmatrix} , \qquad B = \begin{bmatrix} 4 & -2 \\ 1 & 3 \\ \end{bmatrix}, \qquad C = \begin{bmatrix} -4 & 0 & 5 \\ 1 & -3 & 2\\ \end{bmatrix} \]

  1. Calculate \(2BC\)

  2. Calculate \((A+B)C\)


Question 3

\[A = \begin{bmatrix} 1 & 3 \\ -2 & 4 \\ \end{bmatrix} , \qquad B = \begin{bmatrix} 2 & -3 & 7 \\ 1 & 0 & 2 \\ \end{bmatrix}, \qquad C = \begin{bmatrix} 1 & - 2 \\ 4 & 3 \\ 0 & 5 \\ \end{bmatrix} \]

  1. Calculate \(A+BC\)
  2. Calculate \(CB\)
Solution

Question 4

  1. Write down the augmented matrix for the following system of equations.

  2. Use Gaussian elimination to solve the system.

Question 5

Calculate the following if possible: \(AB\),\(BA\), \(AC\) and \(C^{T}\) \[A = \begin{bmatrix} 2 & 2 \\ 3 & 6 \\ \end{bmatrix} , \qquad B = \begin{bmatrix} -1 & 3 \\ 2 & -2 \\ \end{bmatrix}, \qquad C = \begin{bmatrix} 2 & - 2 \\ 1 & 4 \\ 1 & 1 \\ \end{bmatrix} \]

Solution

Question 6

Given the matrices

\[A = \begin{bmatrix} 0 & 2 & 3 \\ 2 & 3 & 1 2 & 1 & 3 \\ \end{bmatrix} \mbox{ and } B = \begin{bmatrix} 2 \\ 4 \\ 2 \\ \end{bmatrix} \]

  1. Calculate \(AB\).

  2. Find a matrix \(X\) such that \(AX = B\)

  3. Find a matrix \(Y\) such that \(AY = A\)

Solution

Worksheet 2

Question 1

For the vectors given below, evaluate the following expressions where it is possible. \[ \vec{u}=\left[ \begin{array}{c} 1 \\ 2 \\ 3 \end{array}\right], \vec{v}=\left[ \begin{array}{c} -1 \\ 0 \\ 4 \end{array}\right], \vec{x}=\left[ \begin{array}{c} 3 \\ 4 \end{array}\right], \vec{y}=\left[ \begin{array}{c} -4 \\ 3 \end{array}\right], \vec{w}=\left[ \begin{array}{c} 1 \\ 0\\ 2 \\ -5 \end{array}\right], \vec{z}=\left[ \begin{array}{c} 2 \\ 2 \\ 2 \\ 3 \end{array}\right] \]

  • \(2\vec{u} + 3\vec{v}\)
  • \(3\vec{u} - \vec{v}\)
  • \(\vec{x} + 3\vec{v}\)
  • \(2\vec{z} - \vec{w}\)
  • \(\vec{u}+\vec{x}\)
  • \(\vec{v}+\vec{w}\)
  • \(\vec{u}\cdot \vec{v}\)
  • \(\left(2\vec{u}\right)\cdot \left(3\vec{v}\right)\)
  • \(\vec{x}\cdot \vec{y}\)
  • \(\vec{w} \cdot \vec{z}\)
  • \(\vec{w} \cdot (\vec{z}+\vec{w})\)
  • \(|\vec{x}|\)
  • \(|\vec{w}|\)
  • \(|\vec{y}|+|\vec{w}|\)

Question 2

Calculate the angles between the pairs \(\vec{u},\vec{v}\), \(\vec{x},\vec{y}\), and \(\vec{w},\vec{z}\) from the previous question. Give your answers in both radians and degrees.


Question 3

For the matrices below, evaluate the following expressions where it is possible. \[ A=\left[ \begin{array}{cc} 1 & 2 \\ 3 & 4 \end{array}\right], B=\left[ \begin{array}{cc} -2 & 0 \\ 1 & -7 \end{array}\right], C=\left[ \begin{array}{ccc} 3 & 2 & -2 \\ 4 & 8 & 2 \end{array}\right], D=\left[ \begin{array}{ccc} 3 & 2 & -2 \\ 4 & 8 & 2 \end{array}\right], \] \[ E=\left[ \begin{array}{ccc} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{array}\right], F=\left[ \begin{array}{ccc} -1 & 0 & 2 \\ 3 & 4 & 1 \\ 3 & 1 & 0 \end{array}\right], \]


\[ G=\left[ \begin{array}{cc}3 & 4 \\1 & 2 \\2 &-1 \\ \end{array}\right], H=\left[ \begin{array}{ccc}3 & 4 & 3\\1 & 2 & 2\\ \end{array}\right], I=\left[ \begin{array}{ccc}2 & 2 & 1\\ \end{array}\right], \]

\[ J=\left[ \begin{array}{c} 3\\ 1\\ 1\\ \end{array}\right], K=\left[ \begin{array}{ccc} 2 & 1 & 3\\1 & 2 & 2\\2 & 1 & 0\\\end{array}\right], \]

  • \(2A+3B\)
  • \(3C-D\)
  • \(8A+4C\)
  • \(2000A+3000B\)
  • \(E-F\)
  • \(A\vec{x}\)
  • \(B\vec{x}\)
  • \(A\vec{y}+B\vec{x}\)
  • \(A\vec{u}\)
  • \(C\vec{x}\)
  • \(C\vec{w}\)
  • \(E\vec{u}\)
  • \(E\vec{w}-\vec{F}\vec{w}\)

\[2x + y - z = 2\] \[x - y + z = 4\] \[x + 2y + 2z = 10\]