🧮 Algebra

🗂️Introduction to Matrices

Numbers arranged in a grid, added cell by cell, multiplied row times column — and at the end one matrix rotates an entire figure by 90 degrees.

Data lined up in rows and columns forms a matrix — a tidy table of numbers. The pixels on your screen, a league table, the score sheets of three classes: all relatives of matrices. Do not underestimate the table — it can do arithmetic on its own, and it can move an entire figure in one sweep.

Matrix addition and scalar multiplication

Adding two matrices of the same shape follows a rule too plain to memorize: add the entries at matching positions.

(1234)+(5678)=(681012)\begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} + \begin{pmatrix} 5 & 6 \\ 7 & 8 \end{pmatrix} = \begin{pmatrix} 6 & 8 \\ 10 & 12 \end{pmatrix}

Scalar multiplication also goes cell by cell: 2×(1032)=(2064)2 \times \begin{pmatrix} 1 & 0 \\ 3 & 2 \end{pmatrix} = \begin{pmatrix} 2 & 0 \\ 6 & 4 \end{pmatrix}. Matrices of different shapes cannot be added — the positions do not even line up.

Row times column: the main event

The coefficients of simultaneous equations arrange into a matrix as old partners; multiplication itself, though, refuses to work cell by cell. Its rule is row times column: the entry in row i, column j of the result comes from row i of the left matrix meeting column j of the right one — multiply pairwise, then add. Watch:

(1201)(1120)=(11+2211+2001+1201+10)=(5120)\begin{pmatrix} 1 & 2 \\ 0 & 1 \end{pmatrix} \begin{pmatrix} 1 & 1 \\ 2 & 0 \end{pmatrix} = \begin{pmatrix} 1\cdot1 + 2\cdot2 & 1\cdot1 + 2\cdot0 \\ 0\cdot1 + 1\cdot2 & 0\cdot1 + 1\cdot0 \end{pmatrix} = \begin{pmatrix} 5 & 1 \\ 2 & 0 \end{pmatrix}

The top-left 5 comes from row (1,2)(1, 2) meeting column (1,2)(1, 2): 1×1+2×2=51\times1 + 2\times2 = 5. The other three cells follow the same recipe.

Verify every cell yourself

Top-right 1: row (1,2)(1, 2) meets column (1,0)(1, 0), 1×1+2×0=11\times1+2\times0=1. Bottom-left 2: row (0,1)(0, 1) meets column (1,2)(1, 2), 0×1+1×2=20\times1+1\times2=2. Bottom-right 0: 0×1+1×0=00\times1+1\times0=0. All four check out.

Order matters

Among plain numbers 3×4=4×33 \times 4 = 4 \times 3; matrices lose that freedom. Swap the order of the two matrices above:

(1120)(1201)=(1324)\begin{pmatrix} 1 & 1 \\ 2 & 0 \end{pmatrix} \begin{pmatrix} 1 & 2 \\ 0 & 1 \end{pmatrix} = \begin{pmatrix} 1 & 3 \\ 2 & 4 \end{pmatrix}

Earlier the answer was (5120)\begin{pmatrix} 5 & 1 \\ 2 & 0 \end{pmatrix}; now it comes out (1324)\begin{pmatrix} 1 & 3 \\ 2 & 4 \end{pmatrix} — swap the order and the whole answer changes. In the matrix world, AB=BAAB = BA generally fails.

Moving shapes with matrices

The strange row-times-column rule reveals its true meaning in geometry. In the coordinate plane, write the point (x,y)(x, y) as a column and let a matrix multiply it from the left:

(0110)(xy)=(yx)\begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} -y \\ x \end{pmatrix}

The new point is (y,x)(-y, x) — exactly a 90° counterclockwise rotation about the origin. Try two points: (1,0)(1, 0), pointing due east, turns to (0,1)(0, 1), due north; (2,3)(2, 3) turns to (3,2)(-3, 2).

Send (3, 1) flying

Substitute: the new x-coordinate =0×3+(1)×1=1= 0 \times 3 + (-1) \times 1 = -1, and the new y-coordinate =1×3+0×1=3= 1 \times 3 + 0 \times 1 = 3, giving (1,3)(-1, 3). One 2×2 matrix, one multiplication, and the point has turned 90° — a figure is built from thousands of points, and a single matrix turns them all at once.

A matrix plus the instruction "multiply by me" is a geometric command. Beyond rotation come reflections and stretches — the whole repertoire of Transformations is within a matrix's reach.

Check yourself

Quick quiz

  1. 1. What is [1,2,3,4] plus [5,6,7,8] (two rows, two columns, listed by rows)?

  2. 2. Does matrix multiplication satisfy AB = BA?

  3. 3. Using the rotation matrix, turn the point (2, 1) counterclockwise by 90°. What do you get?