I need to write a bit more introduction to matrices, matrix multiplication mechanics, a bit about row-reduction, etc. To be fair these are my personal notes and I’m not writing a textbook.
A matrix is a grid of numbers. An matrix has rows and columns.
You can add two matrices of the same size by adding each element. Matrix addition is commutative and associative because addition of real numbers is commutative and associative.
You can scale a matrix by a real number by multiplying all the elements of the matrix by the number. As you’d expect from algebra, scaling distributes over addition – .
The zero matrix is a matrix where all the elements are 0. The zero matrix is an addition identity.
A matrix corresponds to a linear system, and “row operations” are ways of solving the system. If you’ve solved systems of equations before linear algebra you’re already familiar with row operations.
I am horrible at arithmetic, okay. I can never figure out what “minus four minus minus seven” is without carefully thinking through the signs and usually I have to count on my fingers. If you’re like me, don’t fret because you can still do row operations.
Actually I often do it in two steps by flipping the signs while multiplying. Multiplying signed numbers is easier than adding and subtracting them IMO. And if there aren’t too many minus signs in the row, sometimes I can subtract in my head too.
In other words: Usually row operations are described as “you can add and subtract rows from each other”. But you can always multiply a row by a scalar, and -1 is a perfectly fine scalar, so you only really “need” the ability to add rows.
~ Blah blah blah, write some stuff about matrix multiplication ~
There’s two hard-to-explain rules:
I like to write the size of the matrix above it and then cross out the middle two numbers.
Now the rules are easier to explain:
The most common types of matrix multiplication are multiplying two square matrices of the same size, which results in another square matrix of the same size, and multiplying a matrix by a column vector (a one-column matrix), which is called the matrix-vector product.
Why is matrix multiplication defined like that? Why can’t it be easy and elementwise, like matrix addition?
A square matrix with 1s on the diagonal and 0s everywhere else. It’s
the identity for matrix multiplication (like the number 1
for scalar multiplication), both on the left and on the right.
Flip a matrix diagonally over a sloping-downwards 45° line. Rows become columns and columns become rows. “The transpose of ” is written as , with a superscript “T”.
The transpose distributes over addition: .
It also “antidistributes” over multiplication: – you need to switch the order.
A matrix is “symmetric” if . Visually, symmetric matrices are indeed symmetric around that sloping-downwards line.
If you take two column vectors, transpose the left one, and matrix-multiply them: you end up with the dot product. (Similar to how matrix multiplication is like taking a bunch of dot products.)
Formal definition: If the only solution to is , where are coefficients and are the columns of the matrix.
Pracitcal definition: Set the vectors up as columns in a matrix, one column per vector. Row-reduce. If the matrix is reducible to the identity matrix, the vectors are linearly independent. Otherwise (if there is a row or column of zeroes), the vectors are linearly dependent.
In other words: A set of vectors is linearly independent if there is no way to combine some of them to make the zero vector (apart from scaling every vector to 0). More handwavingly: …if there is no way to combine some vectors to equal a different one.
A matrix is “nonsingular” if the only solution to is , which is the case only if its columns are linearly independent.
Another way of saying “the only solution to is ” is “the null space of A is the zero space” or “the nullity of is 0”. These mean the same thing.
Matrices have a multiplicative inverse if and only if they are nonsingular. “Singular” is another word for “noninvertible”, and “invertible” is another word for “nonsingular”.
Intuition: if a matrix does some transformation that sends two distinct points to 0, you can’t distinguish the points from each other anymore, so there is no way to invert that transformation. In computer graphics, a famous singular matrix is the view transform, which flattens the three-dimensional world being simulated into the two-dimensional space of the computer screen. If is the center of the screen – imagine looking at a pencil end-on, all the points along the pencil get flattened into the single point at .
Here.
This way. This is when linear algebra starts getting fun.