Remix.run Logo
srean 2 days ago

> Even the "why does matrix multiplication look that way" is incredibly deep but practically impossible to motivate from other considerations. You just start with "well that's the way it is" and grind away

In my experience it need not be like that at all.

One can start by defining and demonstrating linear transformations. Perhaps from graphics -- translation, rotation, reflection etc. Show the students that these follow the definition of a linear transformation. That rotating a sum is same as summing the rotated(s).

[One may also mention that all differentiable functions (from vector to vector) are locally linear.]

Then you define adding two linear transformations using vector addition. Next you can define scaling a linear transformation. The point being that the combination can be expressed as linear transformations themself. No need to represent the vectors as R^d, geometric arrows and parallelogram rule would suffice.

Finally, one demonstrates composition of linear transformations and the fact that the result itself is a linear transformation.

The beautiful reveal is that this addition and composition of linear transformations behave almost the same as addition and multiplication of real numbers.

The addition asociates and commutes. The multiplication associates but doesn't necessarily commute. Most strikingly, the operations distributes. It's almost like algebra of real numbers !

Now, when you impose a coordinate system or choose a basis, the students can discover that matrix multiplication rule for themselves over a couple of days of playing with it -- Look, rather than maintaining this long list of linear transformations, I can store it as a single linear transformation in the chosen basis.

andrewla 2 days ago | parent | next [-]

> Perhaps from graphics -- translation, rotation, reflection

Maybe ... but the fact that you included translation in the list of linear operations seems like a big red flag. Translation feels very linear but it is emphatically not [1]. This is not intended to be a personal jab; just that the intuitions of linear algebra are not easy to internalize.

Adding linear transformations is similarly scary territory. You can multiply rotations to your heart's content but adding two rotations gives you a pretty funky object that does not have any obvious intuition in graphics.

[1] I wouldn't jump into projective or affine spaces until you have the linear algebra tools to deal with them in a sane way, so this strikes me as a bit scary to approach it this way.

srean 2 days ago | parent | next [-]

Mea culpa about translation.

For a moment I was thinking in homogeneous coordinates - that's not the right thing to do in the introductory phase.

Thanks for catching the error and making an important point. I am letting my original comment stand unedited so that your point stands.

About rotations though, one need not let the cat out of the bag and explain what addition of rotation is *.

One simply defines addition of two linear operators as the addition of the vectors that each would have individually produced. This can be demonstrated geometrically with arrows, without fixing coordinates.

* In 2D it's a scaled rotation.

dreamcompiler 2 days ago | parent | prev | next [-]

To me the fact that translation in n dimensions is nonlinear but it becomes linear if you embed your system in n+1 dimensions is one of the coolest results from linear algebra, and it's why you need 4x4 matrices to express the full set of transformations possible in 3-space.

ferfumarma 2 days ago | parent | prev [-]

Can you elaborate on your point that translation is not linear? The OP agrees with you, so clearly your point is correct, but I personally just don't understand it. Isn't it true that translation is linear within the coordinate space of your model, even if the final distance traveled within a projected camera view is not?

edit to add: (I think your point relates only to the projection system, and not a pure, unprojected model; I just want to make sure I understand because it seems like an important point)

srean 2 days ago | parent | next [-]

All linear operators map origin to origin. But translation applied to the origin will shift it. So translation cannot be linear.

Let's take another approach.

Take a point p that's sum of vectors a and b, that is

p = a + b.

Now, if translation was a linear transformation, then translating p (say along x-axis by 1 unit) is equivalent to applying same translation to a and b separately and then summing them. But the latter ends up translating by twice the amount. Or in other words

p +t ≠ (a +t) + (b +t) = p + 2t.

So translation is not a linear operators in this vector space.

andrewla a day ago | parent | prev [-]

No, with projective geometry or affine geometry you can make translation into a linear operation. But in ordinary Euclidean space translation is not a linear operation.

Most obvious case that it fails is that it doesn't map zero to itself, and you can see the contradiction there:

    T(0 + 0) = T(0) = t
    T(0) + T(0) = t + t = 2 * t
cosmic_cheese 2 days ago | parent | prev | next [-]

If anybody is aware of materials that teach linear algebra via graphics as suggested here, I would be interested to hear about them. As someone who learns best through practical application, maths have been by far among my greatest weak points, despite having written software for upwards of a decade. It’s limiting in some scenarios and pure imposter syndrome fuel.

viewtransform 2 days ago | parent | next [-]

3Blue1Brown [Essense of linear algebra](https://www.youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2x...)

itchingsphynx 2 days ago | parent [-]

This series by Grant was very useful to review and learn and see the implications. Highly recommended.

te 2 days ago | parent | prev | next [-]

codingthematrix.com

rramadass a day ago | parent | prev | next [-]

https://news.ycombinator.com/item?id=45110857

AadiBugg 2 days ago | parent | prev [-]

[dead]

imtringued 2 days ago | parent | prev [-]

>The beautiful reveal is that this addition and composition of linear transformations behave almost the same as addition and multiplication of real numbers.

This is only beautiful if you already understand monoids, magmas and abelian half groups (semigroups) and how they form groups. Also, we do not talk of linear transformations, we talk of group homomorphisms.

I don't know about anyone else, but I was taught linear algebra this way in the first semester and it felt like stumbling in a dark room and then having the lights turned on in the last week as if that was going to be payback for all the toe stubbing.

srean 2 days ago | parent [-]

It can be beautiful with less.

All that needs to be demonstrated is that for real numbers + associates and commutes. That * associates and commutes. And most satisfyingly, these two operations interact through the distribution property.

Of course, it's more revealing and interesting if one has some exposure to groups and fields.

Do people encounter linear algebra in their course work before that ?

For us it came after coordinate/analytical geometry where we had encountered parallelogram law. So while doing LA we had some vague awareness that there's a connection. This connection solidified later.

We also had an alternative curriculum where matrices were taught in 9th grade as a set of rules without any motivation whatsoever. "This is the rule for adding, this one's for multiplication, see you at the test"