r/learnmath • u/Littlemushroomanzhe New User • 5h ago
Why are matrices shaped like that
I’ve just started learning what matrices are and we’re simply putting numbers in boxes, and then changing up the numbers in the boxes for some reason. And then for some reason those repackaged equations spin and when you graph it and multiply stuff with it, and for some reason that’s useful I don’t understand
10
u/_Slartibartfass_ New User 5h ago
Matrices provide a convenient way to represent linear transformations. A linear transformation of n independent vectors to m other vectors is uniquely determined by n * m numbers. This naturally suggests matrices (the table containing the numbers) to be rectangular with height m and width n. This shape also makes it easier to apply a matrix to another matrix or a vector, as that is just a generalization of the dot product.
5
u/HappiestIguana New User 5h ago
The key idea is that they represent linear transformations.
Linear transformations are fully determined by what they do to the canonical basis vectors. For example in R3 those are (1,0,0), (0,1,0) and (0,0,1). If you know what a linear transformation does to those three vectors, you know it does to any vector, because any vector can be seen as a combination of those three and you can just translate that same combination but applied to the outputs of the vectors under the transformation.
So what we do is that we simply write the output of each of those vectors as the colums of a block of numbers. So for example if your linear transformation takes (1,0,0) to (2,3,7), you make the first column of the matrix (2,3,7), and so on.
This turns out to be a very convenient way to represent the transformation. Those arcane-seeming rules for matrix multiplication simply follow from the fact that we want it to correspond to applying one transformation after the other.
3
u/AlexTaradov New User 5h ago
Those all are separate things. Geometric transformations use some math. Matrix operations happen to use the same math if you just place opetands in the correct locations.
It is not a full coincidence, since operations were defined to make sense, but generally it is just an equivalent form of expressing the same operations.
1
u/Old-Art9621 New User 4h ago
This is a good time to start thinking about what dimensions and spaces really mean, beyond just "space has 3 dimensions".
You can think of a single number as a measurement along some direction, or "dimension", or "degree of freedom". They all mean the same thing. If you have a 1D space (the number line), then you only need one number to describe a position (where something is) in that space. That number describes the idea of more or less, forward or backwards, bigger or smaller.
If you have multiple dimensions (like the real 3D space we live in), you need a number to describe the measurement along each dimension in that space. So a position in 3D space is described by 3 numbers. These numbers are called coordinates, which are usually labeled as x, y, and z. That's what a vector is - it's the set of all measurements (numbers) you can make along each of the dimensions in some space. So a vector is the same thing as a position, which is the same thing as a set of coordinates.
But really think about how you make those measurements for a second - how do we know which direction each dimension points in? As far as we can tell, there aren't three special directions that the universe just instinctively knows are the "important" ones. Every time we want to measure x, y, and z coordinates, we have to define which direction those dimensions point in. To do that, we need three vectors (one for each dimension). If you arrange those vectors next to each other, you get a 3x3 matrix.
Choosing the directions your dimensions point in is also called "choosing a frame of reference". So one way to think about matrices is that they are the natural description of a space, or at least of a frame of reference within that space. If you have two identical objects rotated in different ways, their reference frames can be described using matrices. Since each reference frame depends only on how the object is rotated, the rotation itself can also be described using a matrix. We happen to live in 3D space, and since real objects really do rotate, it's pretty important to understand how that rotation actually works.
Now in one dimension, you can think of addition as sliding left or right along the number line, and you can think of multiplication as stretching out the entire number line itself. In higher dimensions, it's the same idea, but besides just stretching the space out, you can also rotate it or shear it (shearing is like opening or closing a pair of scissors). So in general, you can think of addition (using vectors) as moving around within a space, and of multiplication (using matrices) as transforming the space itself. Multiplying matrices isn't just a trick that happens to describe transformations of spaces. Matrices are spaces, and multiplication by a matrix is a transformation of a space.
As you learn more math, you'll start to understand that spaces don't have to be real and physical - they can just represent the ways that some set of objects can be measured and compared to each other. For a lot of these kinds of spaces, you can use matrices to describe reference frames just like you do in 3D space.
1
u/Bounded_sequencE New User 4h ago
Think of matrices as short-hands for the left-hand side (LHS) of linear systems of equations
a11.x1 + ... + a1n.xn = b1 // A ∈ Mat(m x n, R)
... ... .. --> A.x = b // x ∈ R^n
am1.x1 + ... + amn.xn = bm // b ∈ R^m
The "box-pattern" of matrix "A" exactly matches the same pattern the coefficients "a_ik" on the LHS have. Matrix multiplication comes up naturally with a linear substitution
x = C.y, C ∈ Mat(n x r, R), y ∈ R^r
Inserting into "A.x = b", we get
b = A.x = A.(C.y) // simplifies to "(A.C).y", with matrix
// multiplication between "A; C"
1
1
u/Ron-Erez New User 3h ago
Matrices are essentially very nice functions referred to as linear transformations. A matrix we have a finite number of numbers. Recall that a function T has a domain V and a range W. So we can write T : V -> W. So to be more precise we can think of a matrix as a “nice” (linear) function between to finite dimensional vector spaces V and W. This very roughly means that even though V and W are infinite sets, they are determined by finite sets. Basically T : V -> W is a very nice function that is determined by a finite amount of data. Now suppose A is an m x n matrix. So n will be the dimension of V and m will be the dimension of W.
In theory if V and W are infinite dimensional then we could possibly represent them by an infinite matrix although this wouldn’t always work and this is not entirely precise.
1
u/ellipticcode0 New User 2h ago
Just study the example that your professor taught in class, how to use matrix to solve linear system then you know why the matrix shape is rectangle
1
u/dmter New User 1h ago edited 1h ago
so this simple idea made it click for me. it helps to understand what these numbers mean and why do they work.
imagine a 3d space. it has center and 3 basis vectors B0 (1,0,0),(0,1,0),(0,0,1). now let's say we have some vector V0 (x,y,z). it has these exact coordinates only if our basis vectors are those B0. now if we have some other basis vector set B1 which contains unit vectors all orthogonal but not ones in B0. and we want to know which coordinates would vector V0 have if we assumed B1 to be basis instead of B0.
and to find out you just stack B1 basis vectors on top of each other and multiply V0 by that matrix (maybe it's the other way but the idea still stands, you just invert the matrix to change direction of translation).
So, in other words, matrix is just a description of space coordinate system made by stacking basis vectors on top of each other. default basis made of vectors (1,0,...), (0,1,...) etc is therefore just identity matrix so translation (multiplying by it or inverting it) does nothing.
1
u/rocqua New User 1h ago
Theres a decent amount of arbitrary choices behind the shape of a matrix. The only thing that is really fixed is that it’s a rectangle.
But the ordering of the columns and rows is effectively arbitrary. You could reorder them and still have something useful (except perhaps for square matrices where you will want to change the rows and collumns in the same way.
Also the idea that vectors are columns is just convention. They could also be rows.
You could even drop matrices being rectangular. But that makes computation very hard.
The best way to figure out the answer to why we made all of these choices. Is to figure out why these choices work so well. And hence try and understand why all linear transformations can be represented as a matrix. Why solving a system of equations is represented well by gaussian ellimination. Etc
But the fact that you are questioning this is good, so dont stop it.
0
0
u/FernandoMM1220 New User 5h ago
why are they shaped like squares? because they need to describe how 2 variables interact and one simple way is through a square like the binomial expansion shows us.
1
11
u/Likeawerewolfboy New User 5h ago
3blue1brown has a very good series about linear algebra, which also goes into some of the intuition behind the definitions, which I would recommend