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)
In the column vector form, the top number is the movement across and the bottom number is the movement up. So (34) means 3 right and 4 up, and (−25) means 2 left and 5 up.
Column vector arithmetic
Add and subtract componentwise — tops with tops, bottoms with bottoms.
Let a=(23) and b=(5−1).
a+b=(2+53+(−1))=(72)
a−b=(2−53−(−1))=(−34)
A scalar multiple multiplies both components:
3a=(69)
The result points the same way but is three times as long. A negative multiple reverses the direction.
So (23) and (69) are parallel, and so is (−4−6) — it is −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∣. It comes straight from Pythagoras:
(xy)=x2+y2
(34)=9+16=25=5
(−68)=36+64=100=10
Position vectors
The position vector of a point is the vector from the origin to it. If A is the point (1,2) then OA=(12).
To travel between two points, go back to the origin and out again:
AB=OB−OA
A is (1,2) and B is (4,6). Find AB and its length.
AB=(46)−(12)=(34)
∣AB∣=9+16=5
So B is 3 right and 4 up from A, a straight-line distance of 5 units.
Matrices: order and addition
The order of a matrix is rows × columns, in that order.
(142536) has order 2×3
Two rows, three columns.
Addition and subtraction work element by element, and are only possible when the two matrices have the same order.
(2314)+(1052)=(3366)
Scalar multiplication multiplies every element:
2(2314)=(4628)
Matrix multiplication
Multiplication is the one that needs care, and it starts with a compatibility check.
(m×n)×(n×p)=(m×p)
The inner numbers must match, and the outer numbers give the order of the answer. So a 2×3 times a 3×2 works and gives a 2×2; a 2×3 times a 2×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.