Salick Academy

Vectors and Matrices I

No calculator

A vector has both size and direction. A matrix is a rectangle of numbers. They look unrelated at first, and the connection only becomes clear later — for now, treat them as two sets of rules to get right.

Vectors and notation

A vector is drawn as an arrow: its length is the size, its direction is the way the arrow points. A quantity with size only — mass, temperature, time — is a scalar.

The same vector can be written three ways:

ABa(34)\overrightarrow{AB} \qquad \mathbf{a} \qquad \begin{pmatrix} 3 \\ 4 \end{pmatrix}

In the column vector form, the top number is the movement across and the bottom number is the movement up. So (34)\begin{pmatrix} 3 \\ 4 \end{pmatrix} means 3 right and 4 up, and (25)\begin{pmatrix} -2 \\ 5 \end{pmatrix} means 2 left and 5 up.

Column vector arithmetic

Add and subtract componentwise — tops with tops, bottoms with bottoms.

Let a=(23)\mathbf{a} = \begin{pmatrix} 2 \\ 3 \end{pmatrix} and b=(51)\mathbf{b} = \begin{pmatrix} 5 \\ -1 \end{pmatrix}.

a+b=(2+53+(1))=(72)\mathbf{a} + \mathbf{b} = \begin{pmatrix} 2+5 \\ 3+(-1) \end{pmatrix} = \begin{pmatrix} 7 \\ 2 \end{pmatrix}

ab=(253(1))=(34)\mathbf{a} - \mathbf{b} = \begin{pmatrix} 2-5 \\ 3-(-1) \end{pmatrix} = \begin{pmatrix} -3 \\ 4 \end{pmatrix}

A scalar multiple multiplies both components:

3a=(69)3\mathbf{a} = \begin{pmatrix} 6 \\ 9 \end{pmatrix}

The result points the same way but is three times as long. A negative multiple reverses the direction.

So (23)\begin{pmatrix} 2 \\ 3 \end{pmatrix} and (69)\begin{pmatrix} 6 \\ 9 \end{pmatrix} are parallel, and so is (46)\begin{pmatrix} -4 \\ -6 \end{pmatrix} — it is 2-2 times the first, pointing the opposite way along the same line.

Magnitude

The magnitude (or modulus) of a vector is its length, written a|\mathbf{a}|. It comes straight from Pythagoras:

(xy)=x2+y2\left|\begin{pmatrix} x \\ y \end{pmatrix}\right| = \sqrt{x^2 + y^2}

(34)=9+16=25=5\left|\begin{pmatrix} 3 \\ 4 \end{pmatrix}\right| = \sqrt{9 + 16} = \sqrt{25} = 5

(68)=36+64=100=10\left|\begin{pmatrix} -6 \\ 8 \end{pmatrix}\right| = \sqrt{36 + 64} = \sqrt{100} = 10

Position vectors

The position vector of a point is the vector from the origin to it. If AA is the point (1,2)(1,2) then OA=(12)\overrightarrow{OA} = \begin{pmatrix} 1 \\ 2 \end{pmatrix}.

To travel between two points, go back to the origin and out again:

AB=OBOA\overrightarrow{AB} = \overrightarrow{OB} - \overrightarrow{OA}

AA is (1,2)(1,2) and BB is (4,6)(4,6). Find AB\overrightarrow{AB} and its length.

AB=(46)(12)=(34)\overrightarrow{AB} = \begin{pmatrix} 4 \\ 6 \end{pmatrix} - \begin{pmatrix} 1 \\ 2 \end{pmatrix} = \begin{pmatrix} 3 \\ 4 \end{pmatrix}

AB=9+16=5|\overrightarrow{AB}| = \sqrt{9+16} = 5

So BB is 3 right and 4 up from AA, a straight-line distance of 5 units.

Matrices: order and addition

The order of a matrix is rows × columns, in that order.

(123456) has order 2×3\begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{pmatrix} \text{ has order } 2 \times 3

Two rows, three columns.

Addition and subtraction work element by element, and are only possible when the two matrices have the same order.

(2134)+(1502)=(3636)\begin{pmatrix} 2 & 1 \\ 3 & 4 \end{pmatrix} + \begin{pmatrix} 1 & 5 \\ 0 & 2 \end{pmatrix} = \begin{pmatrix} 3 & 6 \\ 3 & 6 \end{pmatrix}

Scalar multiplication multiplies every element:

2(2134)=(4268)2\begin{pmatrix} 2 & 1 \\ 3 & 4 \end{pmatrix} = \begin{pmatrix} 4 & 2 \\ 6 & 8 \end{pmatrix}

Matrix multiplication

Multiplication is the one that needs care, and it starts with a compatibility check.

(m×n)×(n×p)=(m×p)(m \times n) \times (n \times p) = (m \times p)

The inner numbers must match, and the outer numbers give the order of the answer. So a 2×32 \times 3 times a 3×23 \times 2 works and gives a 2×22 \times 2; a 2×32 \times 3 times a 2×32 \times 3 does not work at all.

To find each element, take a row from the left matrix and a column from the right, multiply the pairs and add.

A=(2134)B=(1502)A = \begin{pmatrix} 2 & 1 \\ 3 & 4 \end{pmatrix} \qquad B = \begin{pmatrix} 1 & 5 \\ 0 & 2 \end{pmatrix}

AB=((2)(1)+(1)(0)(2)(5)+(1)(2)(3)(1)+(4)(0)(3)(5)+(4)(2))=(212323)AB = \begin{pmatrix} (2)(1)+(1)(0) & (2)(5)+(1)(2) \\ (3)(1)+(4)(0) & (3)(5)+(4)(2) \end{pmatrix} = \begin{pmatrix} 2 & 12 \\ 3 & 23 \end{pmatrix}

Order matters here as it did with composite functions:

BA=((1)(2)+(5)(3)(1)(1)+(5)(4)(0)(2)+(2)(3)(0)(1)+(2)(4))=(172168)BA = \begin{pmatrix} (1)(2)+(5)(3) & (1)(1)+(5)(4) \\ (0)(2)+(2)(3) & (0)(1)+(2)(4) \end{pmatrix} = \begin{pmatrix} 17 & 21 \\ 6 & 8 \end{pmatrix}

ABBAAB \ne BA.