Back to the on-screen lesson ·

Vectors and matrices

Vector arithmetic, magnitude and the dot product as a test for perpendicularity; matrix addition, multiplication and the determinant.

Paper packet. Every task here also exists on screen, where it is checked automatically; answers written on paper are not assessed by Nydus. When you are back at a device, enter your answers there.

1. What you will learn

In this lesson quantities stop being single numbers. A vector carries a direction as well as a size, and adds, scales and measures component by component — with one operation, the dot product, that takes two vectors and hands back a single number whose sign tells you the angle between them. A matrix carries a whole grid, adds entry by entry, and multiplies in the one way that is not entry by entry: row dotted with column, an operation that depends on the order you write it in. You finish with the determinant, one number that decides whether a matrix can be undone.

2. What you bring to this

You can plot a point, use Pythagoras to find a distance, and read the cosine of an angle. You have also added numbers on a number line. A vector is that number line idea in two or three dimensions: a quantity with a direction as well as a size, written as a list of components.

3. Words you will need

Vector: a quantity with size and direction, written $(x, y)$ or $(x, y, z)$.

Component: one entry of that list.

Magnitude, written $|\mathbf{u}|$: the length of the arrow, $\sqrt{x^2 + y^2}$.

Scalar: an ordinary number, used to stretch a vector.

Dot product: $\mathbf{u}\cdot\mathbf{v} = u_1v_1 + u_2v_2 + \cdots$ — matching components multiplied and added, giving a number.

Orthogonal: another word for perpendicular.

4. Arrows you can compute with

A vector is an arrow written as its components, and everything is done component by component. Adding puts the arrows nose to tail: $(3, -1) + (2, 5) = (5, 4)$. Scaling stretches: $3(2, -1) = (6, -3)$, and subtracting is adding the negative, so $3(2,-1) - (1,4) = (5, -7)$. The magnitude is Pythagoras on the components: $|(6, 8)| = \sqrt{36 + 64} = 10$. The dot product is different in kind — it takes two vectors and returns a number: $(1,2,3)\cdot(4,-5,6) = 4 - 10 + 18 = 12$. Its meaning is $\mathbf{u}\cdot\mathbf{v} = |\mathbf{u}||\mathbf{v}|\cos\theta$, so the sign tells you whether the two arrows broadly agree ($+$), broadly disagree ($-$), or are perpendicular ($0$). That last case is the one you will use most: to make $(3, 4)$ and $(k, 6)$ perpendicular, solve $3k + 24 = 0$ to get $k = -8$.

Another way: picture

Two arrows drawn from the origin, one to $(3, -1)$ and one to $(2, 5)$, with a faint copy of the second arrow starting at the tip of the first and ending exactly at $(5, 4)$ — the sum, reached by walking one then the other.

Another way: story

Adding and scaling are about where the arrow points, and they happen slot by slot. The dot product asks a different question — how much do these two agree? — and the answer to that is a single number, not an arrow.

5. Three things that trip people up

"The magnitude of $(6, 8)$ is $14$." Adding the components measures the path along the streets; the vector goes straight there. $\sqrt{36 + 64} = 10$.

"The dot product is a vector." It is a single number. That is why it can be compared with zero, and why $\mathbf{u}\cdot\mathbf{v} = 0$ is a usable test for perpendicularity.

"Dot product zero means one of them is zero." Not at all: $(1, 0)\cdot(0, 1) = 0$ and neither is the zero vector. It means the angle between them is a right angle.

6. Is $(2, -3)$ perpendicular to $(6, 4)$?

  1. Compute the dot product: $2 \times 6 + (-3) \times 4 = 12 - 12 = 0$.

    Matching components, multiplied and added.

  2. Zero, so yes — the angle between them is $90^\circ$, even though neither vector is zero.

7. The magnitude of $(2, -3, 6)$

  1. In three dimensions Pythagoras still applies, one component at a time: $4 + 9 + 36 = 49$.

    Square each component and add.

  2. $\sqrt{49} = 7$.

8. Your turn: compute $2(1, -4) + (3, 1)$

  1. Scale first: $2(1, -4) = (2, -8)$.

  2. Your turn: work this step out. Its working is at the end of the packet.

    Then add: $(2 + 3, -8 + 1) = (5, -7)$.

9. Guided practice

Add the vectors $(-8, 1)$ and $(-4, -1)$.

(x, y)

10. Guided practice

What is the magnitude of the vector $(39, 80)$?

Answer:

11. Practice

Compute the dot product of $(1, 6, 2)$ and $(5, 1, 1)$.

Answer:

12. Practice

Compute $6(-8, -1) - (6, 4)$.

(x, y)

13. What you bring to this

You have just met the dot product, and matrix multiplication is built out of it. You also know how to keep track of rows and columns in a table, and you have solved a pair of simultaneous equations by elimination — which is the problem the next lesson turns matrices onto.

14. Words you will need

Matrix: a rectangular array of numbers; a $2 \times 3$ matrix has $2$ rows and $3$ columns.

Entry: one number in it, named by its row and column.

Square matrix: as many rows as columns.

Identity matrix $I$: ones down the main diagonal, zeros elsewhere; it leaves everything unchanged.

Determinant of $\begin{pmatrix} a & b \\ c & d \end{pmatrix}$: the number $ad - bc$.

Commutative: an operation for which order does not matter. Matrix multiplication is not.

15. Arithmetic on whole arrays

A matrix is a grid of numbers, and two of the same shape add entry by entry: $\begin{pmatrix} 1 & 2 \\ 3 & 4\end{pmatrix} + \begin{pmatrix} 5 & 6 \\ 7 & 8\end{pmatrix} = \begin{pmatrix} 6 & 8 \\ 10 & 12\end{pmatrix}$. A scalar multiplies every entry. Multiplication is the one that is not entry by entry: the entry in row $i$, column $j$ of $AB$ is row $i$ of $A$ dotted with column $j$ of $B$. So $\begin{pmatrix} 1 & 2 \\ 3 & 4\end{pmatrix}\begin{pmatrix} 0 & 1 \\ 1 & 0\end{pmatrix} = \begin{pmatrix} 2 & 1 \\ 4 & 3\end{pmatrix}$. This needs the first matrix to have as many columns as the second has rows, and it is not commutative: $AB$ and $BA$ are usually different matrices, and sometimes only one of them even exists. For a $2 \times 2$ matrix the determinant $ad - bc$ is a single number that decides everything about invertibility: it is zero exactly when the rows are multiples of each other, and then the matrix squashes the plane onto a line and cannot be undone. $\begin{pmatrix} 3 & 1 \\ 4 & 2\end{pmatrix}$ has determinant $6 - 4 = 2$, so it is invertible.

Another way: picture

A $2\times2$ times a $2\times2$ with the top row of the first matrix highlighted and drawn sliding down the first column of the second, the two products written underneath and added to give the single entry in the top-left of the answer.

Another way: steps

  1. Check the shapes: to multiply, the columns of the first must match the rows of the second.
  2. For each entry of the answer, take the matching row and column and dot them.
  3. Write the answer in the shape rows-of-first by columns-of-second.
  4. For a $2\times2$, compute $ad - bc$ if you need to know whether it can be undone.

16. Three things that trip people up

Multiplying matrices entry by entry. Addition works that way; multiplication does not. Every entry of a product is a row dotted with a column, so it is a sum of products.

"$AB = BA$." Almost never. $\begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix}$ and $\begin{pmatrix} 1 & 0 \\ 1 & 1 \end{pmatrix}$ give different answers in the two orders, which is enough to kill the rule for good.

"The determinant is $ad + bc$." It is $ad - bc$, and the minus sign is doing real work: it is what makes the determinant zero exactly when the two rows are proportional, which is exactly when the matrix has no inverse.

17. $\begin{pmatrix} 2 & 0 \\ 1 & 3\end{pmatrix}\begin{pmatrix} 1 & 4 \\ 5 & 2\end{pmatrix}$

  1. Top-left: row $(2, 0)$ dotted with column $(1, 5)$ gives $2 + 0 = 2$. Top-right: $(2,0)\cdot(4,2) = 8$.

    Row of the first, column of the second.

  2. Bottom-left: $(1,3)\cdot(1,5) = 16$. Bottom-right: $(1,3)\cdot(4,2) = 10$. The product is $\begin{pmatrix} 2 & 8 \\ 16 & 10\end{pmatrix}$.

18. For which $k$ does $\begin{pmatrix} 2 & 4 \\ 3 & k\end{pmatrix}$ have no inverse?

  1. No inverse means determinant zero: $2k - 12 = 0$.

    Set $ad - bc$ to zero.

  2. $k = 6$, and then the second row $(3, 6)$ is exactly $1.5$ times the first — the rows have collapsed onto one direction.

19. Your turn: the determinant of $\begin{pmatrix} 5 & -2 \\ 3 & 1\end{pmatrix}$

  1. Main diagonal: $5 \times 1 = 5$. Other diagonal: $(-2) \times 3 = -6$.

  2. Your turn: work this step out. Its working is at the end of the packet.

    $5 - (-6) = 11$, which is not zero, so the matrix is invertible.

20. Guided practice

Enter the sum $\begin{pmatrix} 4 & 4 \\ 6 & 1 \end{pmatrix} + \begin{pmatrix} 9 & 1 \\ 9 & 6 \end{pmatrix}$.

This task has no paper form; do it on a device.

21. Guided practice

Find the determinant of $\begin{pmatrix} 3 & -4 \\ -5 & -8 \end{pmatrix}$.

Answer:

22. Practice

Enter the product $\begin{pmatrix} 3 & 4 \\ 4 & 5 \end{pmatrix}\begin{pmatrix} 3 & 4 \\ 5 & 5 \end{pmatrix}$.

This task has no paper form; do it on a device.

23. Practice

Enter $2\begin{pmatrix} 2 & 5 \\ 0 & 4 \end{pmatrix}$.

This task has no paper form; do it on a device.

24. Somewhere new

A designer cuts a parallelogram whose two edges from one corner are the vectors $(3, -8)$ and $(-7, 3)$, in centimetres. What is its area, in square centimetres?

Answer:

25. Lesson test

Lesson test: one question per skill, one attempt each, no hints. Your answers are checked when you submit.

26. Test question

For which value of $k$ are $(1, 4)$ and $(k, 1)$ perpendicular?

Answer:

27. Test question

For square matrices $A$ and $B$ of the same size, is $AB$ always equal to $BA$?

28. What you can do now

You can compute with vectors and matrices. Without looking: what does a dot product of zero tell you, and why is matrix multiplication not entry by entry?

Working for the steps left to you

8. Your turn: compute $2(1, -4) + (3, 1)$, step 2

19. Your turn: the determinant of $\begin{pmatrix} 5 & -2 \\ 3 & 1\end{pmatrix}$, step 2