## Matrices

A matrix is just an  array of numbers for which operations can be defined. $A=\left|\begin{array}{cc}a&b\\ c&d\end{array}\right|$

A matrix’s size is always described as rows by columns, the size of a matrix restricts which matrices it can be added to or multiplied by. A has two rows and two columns which is a two by two matrix.

A matrix with rows that are the same length as columns is known as a square matrix.

## Matrix Arithmetic

Let’s take a quick look at some basic matrix operations.

• If we times the matrix A by a factor k, we can only expand it by multiplying each element in the matrix by k $kA=k\left|\begin{array}{cc}a&b\\ c&d\end{array}\right|=\left|\begin{array}{cc}ka&kb\\ kc&kd\end{array}\right|$

• If we have a matrix B it will only equal A if it is the same size and each element is the same that is a=e, b = f, c = g and d = h $B=\left|\begin{array}{cc}e&f\\ g&h\end{array}\right|$

• If we wish to add or subtract matrices they must be the same size like A and B which are both two by two matrices. The order which we add them makes no difference.

A+B=B+A $A+B=\left|\begin{array}{cc}a&b\\ c&d\end{array}\right|+\left|\begin{array}{cc}e&f\\ g&h\end{array}\right|=\left|\begin{array}{cc}a+e&b+f\\ c+e&d+f\end{array}\right|$

• The order of matrix in matrix multiplication is important

A×B≠B×A

• Matrix multiplication is only possible if the columns of the first matrix match the rows of the second. $C=\left|\begin{array}{cc}i&j\\ k&l\\m&n\end{array}\right|$

A is a 2×2 matrix and C is a 3×2 matrix, therefore we cannot multiply A by C since there are 2 A columns and 3 C Rows

A×C

(2×2)(3×2)

However we can multiply C by A since there are 2 C columns and 2 A rows

C×A

(3×2)(2×2)

• When multiplying the matrices together our first step is to work out the size of the new matrix. Step two is we follow the rule of moving across the row of the first matrix and multiply it by moving down the column of the second matrix. $C \times A=\left|\begin{array}{cc}i&j\\ k&l\\m&n\end{array}\right| \times \left|\begin{array}{cc}a&b\\ c&d\end{array}\right| = \left|\begin{array}{cc}ai+jc&bi+jd\\ ka+lc&kb+ld\\ma+nc&mb+nd\end{array}\right|$

• A special type of matrix is the Identity matrix, if two matrices are multiplied together and they equal the identity matrix then they are said to be an inverse of each other. $I=\begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}$

• An inverse of a two by two matrix is calculated by the formula. Finding the inverse of matrices greater than 2×2, is not need in maths methods 3&4. $A^{-1}=\frac{1}{det(A)}\left|\begin{array}{cc}d&-b\\ -c&a\end{array}\right|$

• The determinant is calculated by: $det(A)=ad-bc$

There are a lot of rules to remember when dealing with matrices, but the best way to learn them is through practice.

## Example

Lets practice multiplying matrix A by B $A=\begin{bmatrix} 6 & 2 & 0 \\ 4 & 1 & 1 \end{bmatrix}$ $B=\begin{bmatrix}2&4\\ -3&4\\1&0\end{bmatrix}$

A×B=?

We can see that A can be multiplied by B since A is a two by three matrix and B is a three by two matrix therefore the columns of match the rows of b and we will get a two by two matrix. $A \times B=\begin{bmatrix} 6 & 2 & 0 \\ 4 & 1 & 1 \end{bmatrix} \times \begin{bmatrix}2&4\\ -3&4\\1&0\end{bmatrix}$ $=\begin{bmatrix}6 \times 2 +2 \times -3 +0 \times 1 &6\times 4+2\times4+0\times 0\\ 4\times 2+1\times-3+1\times 1&4\times 4+1\times4+1\times 0\end{bmatrix} \newline\newline=\begin{bmatrix}6&32\\6&20\end{bmatrix}$