## Want to study astronomy... bad at math

For the discussion of math. Duh.

Moderators: gmalivuk, Moderators General, Prelates

### Re: Want to study astronomy... bad at math

Just started learning about matrices. Question; what is the practical application of matrices? Why the seemlingly arbitrary multiplication rules? I want to understand the point behind what I'm doing rather than just learn to go through the motions.

BryanRabbit

Posts: 64
Joined: Sun Jun 24, 2012 5:36 am UTC
Location: New York

### Re: Want to study astronomy... bad at math

Matrices allow you to solve linear systems of equations conveniently and easily, for one. When you eventually hit quantum mechanics, you will use them a lot to describe particle states and how they evolve. They provide a nice way to describe rotations. Many branches of physics use their big brothers, tensors, extensively (mechanics has the inertia tensor, EM the Maxwell stress-energy tensor, GR is all tensors, etc.). This is just off the top my head.

Others can answer your questions about why they have the multiplication rules and such better than I can.
starslayer

Posts: 213
Joined: Wed Dec 02, 2009 9:58 am UTC

### Re: Want to study astronomy... bad at math

Wow, I didn't know they played such a huge role.

btw, this is making me feel really stupid: 6x - y = y +2 simplifies to 6x - 2 = 2y. But what happened to both sides of the equation here...?

BryanRabbit

Posts: 64
Joined: Sun Jun 24, 2012 5:36 am UTC
Location: New York

### Re: Want to study astronomy... bad at math

I'm going to approach this from the perspective of linear transformations. There are some lies below (simplifications, where I use a word more narrowly than it is usually defined), but the gist should be accurate.

A matrix represents a linear transformation on vectors.

A vector is a tuple -- a coordinate. (1, 2, 3) is a vector. As is (0,0,0) and (-1, 2, 3, 4,5, pi). The number of coordinates is the dimension of the vector.

A linear transformation is a function f such that f(s a+b) = s f(a) + f(b), where a and b are vectors, and s is a real number, for all vectors a and b and all scalars s. In effect, linear transformations let scalar multiplication and vector addition "fall through". These functions are important, because we can solve problems involving them! (seriously) So we like reducing questions to linear questions, then solve them from that perspective.

Each row of the matrix tells you how to build a coordinate of the output vector from an input vector. We end up adding up a weighted sum of the input vector's coordinates to calculate each coordinate.

So if we have a matrix row that looks like this:
Code: Select all
[ 1 2 0 -1 ]

it means take 1 times the first coordinate, 2 times the second, 0 times the third, and -1 times the 4th, add that up, and that is the output of this row.

Each row defines one output coordinate. So the number of rows = dimension of the output vector. The number of columns corresponds to the dimension of the input vector that this matrix can process.

You can show that all linear transformations on finite dimensional vectors can be represented as matrices, and all matrices represent some linear transformation of finite dimensional vectors.

Now, how about matrix multiplication? Well, it solves this problem. Imagine you have two linear transformations f and g. You want to know what happens to vectors if you do g, then f?

We call this composition of functions. In a non-linear case, imagine if g(x) = x+2, and f(x) = x^2. Then f(g(x)) = f(x+2) = x^2+4x+4. We can define a new function h(x) = f(g(x)).

Matrix multiplication lets us calculate h(x) = f(g(x)) in the form of a matrix. Because as it happens, the composition of linear functions is also linear!

When we matrix multiply, we are trying to work out what the weights should be for the linear function that consists of doing each of the original matrix transformations in order.

To calculate the weight of the first input coordinate on the first output coordinate, we first calculate how the first input coordinate contributes to all output coordinates. This is described by the first column of the first matrix we apply (the one on the right). If you change the first coordinate of the input vector, that first column of the first matrix describes how the output of the first matrix will change.

Now, imagine that intermediate vector -- the output of the first (rightmost) matrix, and the input of the second (leftmost) matrix. How do changes to in that intermediate vector's coordinates impact the first coordinate of the output of the second matrix?

Whew. Well, that is described by the first row of the second matrix.

So if you increase the first coordinate of the first matrix by 1, the first column describes what happens to the 'intermediate' vector. The 3rd entry in the first column of the first matrix tells you how much the 3rd coordinate of the intermediate vector changes when you increase the first coordinate of the input vector.

Then, to figure out how that impacts the first coordinate of the output to the second matrix, you have to look at the first row, 3rd column of the second matrix.

And when we multiply two matrices together, you'll note that the first column 3rd row entry of the right(first) matrix is multiplied by the first row, 3rd column entry of the left(second) matrix, and that (among other things) is added up to work out what the first column first row of the result of the multiplication looks like.

That operation -- the pairwise product of the first column of the first matrix (right one) with the first row of the second matrix (left one) -- fully calculates the impact that the first coordinate of the input vector has on the output vector of the composition of the two matrices. We then do the same thing for each input coordinate and output coordinate.

And the result is matrix multiplication.

I suspect examples might help?
One of the painful things about our time is that those who feel certainty are stupid, and those with any imagination and understanding are filled with doubt and indecision - BR

Last edited by JHVH on Fri Oct 23, 4004 BCE 6:17 pm, edited 6 times in total.

Yakk

Posts: 10039
Joined: Sat Jan 27, 2007 7:27 pm UTC
Location: E pur si muove

### Re: Want to study astronomy... bad at math

For the record, I'm saving all these long detailed posts you guys are contributing, so I can come back and read them when I'm better equipped to understand (not that you didn't do a good job of explaining, just keep in mind I'm still reviewing math fundamentals, I'm in rehab here).

I get the sense matrices are relevant to programming, something else I really want (and need) to learn. I got nothing out of the Java class I took for my degree, which kind of makes me feel like I didn't earn it because that was the most important class for the major (probably).

Anyway, I'm afraid to ask but yes I think an example would help, what you are talking about is kind of abstract, but I think I would enjoy the application once I understand it, if you're saying this is like the graphing of coordinates and linear equations we had to do in school but with more dimensions.

Is this what Sheldon Cooper's (0, 0, 0, 0) joke is based on? From the episode where penny shot his cushion with a paintball gun? No...? *crickets*

EDIT: btw thanks for the new word, "tuple", I did not know that's what they were called.

BryanRabbit

Posts: 64
Joined: Sun Jun 24, 2012 5:36 am UTC
Location: New York

### Re: Want to study astronomy... bad at math

BryanRabbit wrote:Wow, I didn't know they played such a huge role.

btw, this is making me feel really stupid: 6x - y = y +2 simplifies to 6x - 2 = 2y. But what happened to both sides of the equation here...?

Well, (6x - 2) - (6x - y) = y - 2, and (2y) - (y + 2) = y - 2, so y - 2 was added to both sides. Or another way to look at it, the -y on the left side was moved to the right (adding y to both sides), and the 2 on the left was moved to the right (subtracting 2 from both sides).
gmalivuk wrote:
King Author wrote:If space (rather, distance) is an illusion, it'd be possible for one meta-me to experience both body's sensory inputs.
Yes. And if wishes were horses, wishing wells would fill up very quickly with drowned horses.

Sizik

Posts: 584
Joined: Wed Aug 27, 2008 3:48 am UTC

### Re: Want to study astronomy... bad at math

Sizik wrote:
BryanRabbit wrote:Wow, I didn't know they played such a huge role.

btw, this is making me feel really stupid: 6x - y = y +2 simplifies to 6x - 2 = 2y. But what happened to both sides of the equation here...?

Well, (6x - 2) - (6x - y) = y - 2, and (2y) - (y + 2) = y - 2, so y - 2 was added to both sides. Or another way to look at it, the -y on the left side was moved to the right (adding y to both sides), and the 2 on the left was moved to the right (subtracting 2 from both sides).

Ah, see when you explain it as two steps (the way I'm used too) it makes perfect sense to me. Now I see what happened in one step. Sometimes I just can't seem to think logically and my brain gets stuck on "the steps." I need to do like a million of these so I can get over this mental block.

Thank you

BryanRabbit

Posts: 64
Joined: Sun Jun 24, 2012 5:36 am UTC
Location: New York

### Re: Want to study astronomy... bad at math

BryanRabbit wrote:Just started learning about matrices. Question; what is the practical application of matrices? Why the seemlingly arbitrary multiplication rules? I want to understand the point behind what I'm doing rather than just learn to go through the motions.

One thing that matrices represent is a kind of function on a vector space, a linear function, or linear transformation. After you pick a basis for a vector space, and lets say that its finite dimensional with dimension n, every nxn matrix (with entries in the field of scalars of the vector space) uniquely defines a linear transformation.

In particular, if

A = \begin{pmatrix} a_{11} & a_{12} & \cdots & a_{1n} \\ a_{21} & a_{22} & \cdots & a_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ a_{n1} & a_{n2} & \cdots & a_{nn} \end{pmatrix}

And a linear transfomation, T, maps

v = \begin{pmatrix} v_1 \\ v2 \\ \vdots \\ v_n \end{pmatrix} \mapsto T(v) = \begin{pmatrix} a_{11} v_1 + a_{12} v_2 + \cdots + a_{1n} v_n \\ a_{21} v_1 + a_{22} v2 + \cdots + a_{2n}v_n \\ \vdots \\ a_{n1}v_1 + a_{n2}v_2 + \cdots + a_{nn}v_n \end{pmatrix}

Then, T(v) = A\cdot v, where the \cdot there is a matrix multiplication. What's more, given two matrixes, A and B, with linear transformations associated with them, S and T respectively,

S(T(v)) = A \cdot B \cdot v

and it doesn't matter how I bracket the RHS there.

Long story short, matrices correspond to linear transformations of vector spaces, and matrix multiplication corresponds to the composition linear transformations.

The reason that this stuff is important is that you can work out what's going on with linear transformations, and differentiability implies that you can locally approximate with an affine transformation, which is a linear transformation plus adding a constant vector.
ameretrifle wrote:Magic space feudalism is therefore a viable idea.

jestingrabbit

Posts: 5187
Joined: Tue Nov 28, 2006 9:50 pm UTC
Location: Sydney

### Re: Want to study astronomy... bad at math

I’ll chime in on the matrix stuff. Do you know about the vector dot product?

Given two vectors of the same dimension, their dot product is the sum of their element-wise products. That is, if u=(u1, u2, …, un) and v=(v1, v2, …, vn) are vectors, then their dot product is uv=u1v1+u2v2+⋯+unvn.

This dot product operation comes up quite frequently in physics, pretty much anytime one object acts at an angle on another object. It is extremely important, especially because uv=|u|·|v|·cos(θ), which eventually you’ll want to prove once you acquire the relevant skills.

In any case, the dot product is simple to calculate, by adding up the element-wise products, and it often happens that we want to take the dot product of each of several vectors ui with each of several vectors vj. So for notation purposes, we write down the u vectors horizontally, one on each row, to form the matrix
U = \left[\begin{array}{c}\mathbf{u_1} \\
\mathbf{u_2} \\
\vdots \\
\mathbf{u_k} \\
\end{array}\right]

And we write down the v vectors vertically, one in each column, to form the matrix
V = \left[\begin{array}{cccc}\mathbf{v_1} & \mathbf{v_2} & \cdots & \mathbf{v_k} \end{array}\right]

Then the matrix product is defined by putting the number uivj in the i’th row at the j’th column. That is,
UV = \left[\begin{array}{cccc}
\mathbf{u_1}\cdot\mathbf{v_1} & \mathbf{u_1}\cdot\mathbf{v_2} & \cdots & \mathbf{u_1}\cdot\mathbf{v_k} \\
\mathbf{u_2}\cdot\mathbf{v_1} & \mathbf{u_2}\cdot\mathbf{v_2} & \cdots & \mathbf{u_2}\cdot\mathbf{v_k} \\
\vdots & \vdots & \ddots & \vdots \\
\mathbf{u_k}\cdot\mathbf{v_1} & \mathbf{u_k}\cdot\mathbf{v_2} & \cdots & \mathbf{u_k}\cdot\mathbf{v_k} \\
\end{array}\right]

This might not make much sense as far as “why” it’s done that way, but for remembering how it goes and what to do when calculating, this can be useful. Just think of the matrix on the left as being made of “row vectors”, and the matrix on the right as “column vectors”. Then just take the dot product of each row with each column, and write the result in the corresponding row and column of the result.

The actual “why” is along the lines of what Yakk and JR said, about compositions of linear maps, and matrix multiplication works great. It should all make a lot more sense when you get to practical applications where matrices naturally arise as the most concise way to represent the data you are working with, and you need to apply linear transformations to them. Notably, any time you have a system of linear equations to solve simultaneously, using matrices and row-reduction is a straightforward approach. Even when there is no solution to the system, the techniques of linear algebra will let you find the “best fit”, or closest you can get to a solution.
Last edited by Qaanol on Thu Jul 12, 2012 7:00 am UTC, edited 1 time in total.
Small Government Liberal

Qaanol

Posts: 2241
Joined: Sat May 09, 2009 11:55 pm UTC

### Re: Want to study astronomy... bad at math

I'm watching a YouTube video about multiplying matrices right now, the narrarator is explaining some of the things you mention; dot product, vector, etc. It's pretty cool, his explanation for the seemingly arbitrary rules is that it's not natural math so a standard rule had to be chosen, it could have been any other way.

While I honestly feel like a retarded baby starting from where I'm at, I'm looking forward to getting into higher level maths so I can see these applications to physics (and graphics programming, apparently, had to look up affine transformation, pretty cool). It's going to take me a while before I understand about half of the terminology in some of these posts.

BryanRabbit

Posts: 64
Joined: Sun Jun 24, 2012 5:36 am UTC
Location: New York

### Re: Want to study astronomy... bad at math

BryanRabbit wrote:I'm watching a YouTube video about multiplying matrices right now, the narrarator is explaining some of the things you mention; dot product, vector, etc. It's pretty cool, his explanation for the seemingly arbitrary rules is that it's not natural math so a standard rule had to be chosen, it could have been any other way.

I really dislike that explanation. Matrix multiplication is natural math. Rotations are natural math, and they're linear transformations. If you do one rotation, then another, its the same as multiplying the matrices, and then applying that one rotation. And other things too. I personally believe that it could really only be one way, although maybe some reflection of that way could also be natural.

And regarding the terminology, it takes a while to be relaxed with all that, and I probably wrote a little too technically there. Sorry.
ameretrifle wrote:Magic space feudalism is therefore a viable idea.

jestingrabbit

Posts: 5187
Joined: Tue Nov 28, 2006 9:50 pm UTC
Location: Sydney

### Re: Want to study astronomy... bad at math

jestingrabbit wrote:I really dislike that explanation. Matrix multiplication is natural math. Rotations are natural math, and they're linear transformations. If you do one rotation, then another, its the same as multiplying the matrices, and then applying that one rotation. And other things too. I personally believe that it could really only be one way, although maybe some reflection of that way could also be natural.

Oh, well then maybe that statement was only appropriate for it's context; trying to teach algebra students how to multiply them in the first place. I'll try to find something that talks about their applications (which this one briefly mentions but glosses over) and maybe I'll understand better.

jestingrabbit wrote:And regarding the terminology, it takes a while to be relaxed with all that, and I probably wrote a little too technically there. Sorry.

No worries, everyone's doing it, lol.

When you're already into a subject and it comes naturally to you it's hard to predict what outsiders will be familiar with, but that just gives me incentive to try and understand it better, anything I don't know I consider it homework. (this is what happens when you're out of school for so long).

BryanRabbit

Posts: 64
Joined: Sun Jun 24, 2012 5:36 am UTC
Location: New York

### Re: Want to study astronomy... bad at math

BryanRabbit wrote:Just started learning about matrices. Question; what is the practical application of matrices? Why the seemlingly arbitrary multiplication rules? I want to understand the point behind what I'm doing rather than just learn to go through the motions.

Let me demonstrate merely a single practical application of matrices (in the field of computer simulation and graphics). A point in n-dimensional space can be defined relative to a given zero point by an n-dimensional vector (for simplicity, I will use two-dimensional space, but three- or even more-dimensional space can be dealt with in a similar manner). For example, consider the point (3, 4). How do I rotate this point by theta degrees?

Easy. I multiply it be the relevant rotation matrix. A two-dimensional rotation matrix takes the form:

\begin{pmatrix} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \end{pmatrix}

Multiply this by (3, 4) and I get the coordinates of the point rotated through an angle of theta about the origin. I can apply this rotation to as many points as I wish (such as, for example, all the pixels in an image). Other matrices can be used for other effects.

Now, here's an interesting consequence of this; let us say that I want to do several transformations of the same data (rotate all points twelve degrees to the left about the origin; move all points up a distance of three; then rotate all point to the right by ninety-four degrees) - I can simply take the matrices defining these operations, multiply then with each other, and come up with a single transformation matrix which can then be applied to all the two thousand pixels in the image (instead of applying each operation individually)

BryanRabbit wrote:
Sizik wrote:
BryanRabbit wrote:Wow, I didn't know they played such a huge role.

btw, this is making me feel really stupid: 6x - y = y +2 simplifies to 6x - 2 = 2y. But what happened to both sides of the equation here...?

Well, (6x - 2) - (6x - y) = y - 2, and (2y) - (y + 2) = y - 2, so y - 2 was added to both sides. Or another way to look at it, the -y on the left side was moved to the right (adding y to both sides), and the 2 on the left was moved to the right (subtracting 2 from both sides).

Ah, see when you explain it as two steps (the way I'm used too) it makes perfect sense to me. Now I see what happened in one step. Sometimes I just can't seem to think logically and my brain gets stuck on "the steps." I need to do like a million of these so I can get over this mental block.

Thank you

People often skip steps when writing down the solution. Some people do this because they've practiced enough that they can see what the next two or three steps are and apply them all at once to save time. Other people do it because they want to look like they're better at maths than they are. Still other people do it because they're writing a paper or a physics textbook and don't want to waste space filling in what they consider to be basic (and they want the emphasis to be on the consequences of the maths, not on the maths itself).

One way to deal with this is two write down the first equation, solve it yourself, and see if you happen to hit upon the second equation at any point in finding the solution. (Note: some people skip half a dozen steps at once; also note: some problems can be solved in different ways, so you might run through the whole problem and hit the correct solution without ever hitting the second equation exactly; for example, I might simplify 6x - y = y +2 to 6x = 2y + 2 and work from there without ever hitting 6x - 2 = 2y). Even if you don't hit on the second equation that way, you might hit on something that more easily leads to the second equation. It's not perfect, but more often than not you'll find some way to get to the second equation... which may or may not be the way that the original author got there (which is difficult to find out, because the original author left out the intermediate steps).
CCC

Posts: 46
Joined: Thu Jun 14, 2012 12:29 pm UTC

### Re: Want to study astronomy... bad at math

So we have a vector:
v = (2, 5)
And we have a simple linear transformation:
T = multiply the vector's coordinates by 2

We can represent T as a matrix:
Code: Select all
[ 2 0 ]
[ 0 2 ]

and the vector as a matrix:
Code: Select all
[ 2 ]
[ 5 ]

Calculate this:
Code: Select all
[ 2 0 ] [ 2 ]
[ 0 2 ] [ 5 ]

(Please actually do it, on paper. Continuing to read this post without doing exercises might feel good and like progress, but I strongly recommend doing the excersie before continuing on, or even checking the answer.)

Spoiler:
Code: Select all
[ 4 ]
[ 10 ]

Next, what happens if we apply T twice?

Do this:
Code: Select all
[ 2 0 ] [ 2 0 ] [ 2 ]
[ 0 2 ] [ 0 2 ] [ 5 ]

starting from the right. You have already done the right multiplication above.

Spoiler:
Code: Select all
[ 8 ]
[ 20 ]

Ok, now calculate this:
Code: Select all
[ 2 0 ] [ 2 0 ]
[ 0 2 ] [ 0 2 ]

isn't that interesting?

Spoiler:
Code: Select all
[ 4 0 ]
[ 0 4 ]

Now remember this?
Code: Select all
[ 2 0 ] [ 2 0 ] [ 2 ]
[ 0 2 ] [ 0 2 ] [ 5 ]

do it from left-to-right -- multiply the square matrices together, then multiply it by the column matrix.

Spoiler:

Ok, if you have been following along (and I'm guessing you actually cheated, and didn't, but hope springs eternal), we can now move on to more complex transfomations.

We can increase x but not y with this matrix:
Code: Select all
[ 2 0 ]
[ 0 1 ]

This matrix:
Code: Select all
[ 0 1 ]
[ 1 0 ]

flips your x and y coordinates.

This one:
Code: Select all
[ 0 -1 ]
[ 1  0 ]

Can you construct a set of matrices that:
1) Scale the input by a factor of 3
2) Flips the x and y coordinate
3) Scales the y coordinate by a factor of 1/2
4) Flips the x and y coordinate
in that order?

Try multiplying it out explicitly. Can you figure out a shorter way to describe what it does?

How about the above rotation matrix, done twice? Three times? Four times?
One of the painful things about our time is that those who feel certainty are stupid, and those with any imagination and understanding are filled with doubt and indecision - BR

Last edited by JHVH on Fri Oct 23, 4004 BCE 6:17 pm, edited 6 times in total.

Yakk

Posts: 10039
Joined: Sat Jan 27, 2007 7:27 pm UTC
Location: E pur si muove

### Re: Want to study astronomy... bad at math

Okay... I was following (and writing it out) until you mentioned x and y coordinates. (The last time I dealt with x and y coordinates was representing linear equations on graph paper in high school, calculating slope, etc. I saw some of calculus is based on this but with graphing curves, parabolas, waves, etc. So I've gone back into studying this part of algebra).

So when I multiply

Code: Select all
[ 2 0 ]
[ 0 1 ]

by

Code: Select all
[ 0 1 ]
[ 1 0 ]

I see the first matrix is now mirrored.

Code: Select all
[ 0 2 ]
[ 1 0 ]

If that's what you meant for me to do I see what you're driving at, but I don't see how applying the next matrix rotates the coordinates (I multiplied it by the one before and after it was flipped).

I'm sorry I know you dumbed it down for me but I'm still a little lost, by scale the input factor by 3 do you mean multiply the column vector by T three times now instead of 2?

BryanRabbit

Posts: 64
Joined: Sun Jun 24, 2012 5:36 am UTC
Location: New York

### Re: Want to study astronomy... bad at math

The matrix:
Code: Select all
[ 2 0 ]
[ 0 2 ]

can be described as a matrix that "scales its input by a factor of 2".

Feed it these vectors:
Code: Select all
[ 1 ]
[ 1 ]

[ 2 ]
[ 0 ]

[ 7 ]
[ -2 ]

[ a ]
[ b ]

(the last one has two variables, a and b).

Here is an important matrix. It is called the identity matrix:
Code: Select all
[ 1 0 ]
[ 0 1 ]

when you feed it a vector, you get .. the same vector out! (Give it a try).

You can make the "multiply things by 2" matrix by ... multiplying the identity matrix by 2! (see above)

Can you guess how to make a matrix that multiplies its input by 3?

Test it, by feeding it:
Code: Select all
[ a ]
[ b ]
One of the painful things about our time is that those who feel certainty are stupid, and those with any imagination and understanding are filled with doubt and indecision - BR

Last edited by JHVH on Fri Oct 23, 4004 BCE 6:17 pm, edited 6 times in total.

Yakk

Posts: 10039
Joined: Sat Jan 27, 2007 7:27 pm UTC
Location: E pur si muove

### Re: Want to study astronomy... bad at math

Is this homework?

Yakk wrote:Feed it these vectors

So...

Code: Select all
[ 2 ]
[ 2 ]

[ 4 ]
[ 0 ]

[ 14 ]
[ -4 ]

[ 2a ]
[ 2b ]

Everything just doubles...

Yakk wrote:Here is an important matrix. It is called the identity matrix:
Code: Select all
[ 1 0 ]
[ 0 1 ]

when you feed it a vector, you get .. the same vector out! (Give it a try).

You can make the "multiply things by 2" matrix by ... multiplying the identity matrix by 2! (see above)

Cool! I'm putting that up on my wall.

Yakk wrote:Can you guess how to make a matrix that multiplies its input by 3?

Is this right?:

Code: Select all
[ 3 0 ]
[ 0 3 ]

I think I get it now, some matrices are like formulas for getting certain results, like how these 2x2 matrices double or triple the values in column vectors. That's pretty neat.

BryanRabbit

Posts: 64
Joined: Sun Jun 24, 2012 5:36 am UTC
Location: New York

### Re: Want to study astronomy... bad at math

Right! So now here's some extra credit: Can you apply this to something physical or practical? Don't over think this. Just try to make a jump from abstraction to application.
Birk

Posts: 232
Joined: Tue May 19, 2009 5:08 pm UTC

### Re: Want to study astronomy... bad at math

All matrices are (well, representations) of formulas (well, functions) that transform vectors.

The family of functions they can represent is called "linear functions".

Matrix multiplication corresponds to "composition" of linear functions (if we have matrix M and N which represent functions f(v) and g(v), then M * N represents f(g(v))).

Even non-square matrices represent such functions, they just transform vectors between vector spaces with different dimension. (There are only identity matrices when the matrix is square, however).
One of the painful things about our time is that those who feel certainty are stupid, and those with any imagination and understanding are filled with doubt and indecision - BR

Last edited by JHVH on Fri Oct 23, 4004 BCE 6:17 pm, edited 6 times in total.

Yakk

Posts: 10039
Joined: Sat Jan 27, 2007 7:27 pm UTC
Location: E pur si muove

### Re: Want to study astronomy... bad at math

Thank you, this is starting to make more sense, that little exercise helped.

Birk wrote:Right! So now here's some extra credit: Can you apply this to something physical or practical? Don't over think this. Just try to make a jump from abstraction to application.

The only thing I can think of is in programming, if you had to tell a computer to multiply a set of values all at once, you could write in those square matrices as formulas for it to use. Still not sure how it applies to physics or coordinate geometry, except for that flipping example, although I didn't understand what was rotated....

But if that's the case, I suppose if you had to write a program that used coordinates to keep track of something moving, like... a radar system? ... and every time the object being tracked moved it's coordinates (the numbers in the matrix) would change. You would use those matrices to tell it how to do that.

Sorry, guess that counts as over thinking it, lol. I'm grasping at straws for something physical.

BryanRabbit

Posts: 64
Joined: Sun Jun 24, 2012 5:36 am UTC
Location: New York

### Re: Want to study astronomy... bad at math

Sure, computer programming is a good example. Linear Algebra is used all the time in fields like image processing.

The application to physics is not that esoteric either. Perhaps there is some confusion about what a vector is? A vector is an object which carries information about both direction and magnitude. Therefore they are incredibly useful for representing physical quantities. For example, a velocity vector associated with an object tells you both the direction of motion and the speed. A force acting on an object has a direction and a magnitude. You can see then how you could apply transformations to these vectors.

I think matrices are useful in any situation where you have a system of linear equations but some of my favorite examples are in slightly more intermediate to advanced topics such as:

-Optics and Light: http://en.wikipedia.org/wiki/Ray_transf ... x_analysis
-Special Relativity: http://en.wikipedia.org/wiki/Minkowski_ ... d_symmetry
-Quantum Mechanics: http://en.wikipedia.org/wiki/Pauli_matrices
-Systems of Differential Equations: http://tutorial.math.lamar.edu/Classes/ ... emsDE.aspx

and I'm sure others will have even better examples.
Birk

Posts: 232
Joined: Tue May 19, 2009 5:08 pm UTC

### Re: Want to study astronomy... bad at math

BryanRabbit wrote:I didn't understand what was rotated

Try this: start with the vector v0 = (1, 0), and interpret it as the xy-coordinates of a point in the plane. That is, (1, 0) is the point 1 unit to the right of the origin, and 0 units up, so it is on the x-axis. Draw a picture: make a vertical line for the y-axis and a horizontal line for the x-axis, like a big plus sign. Mark off tics every inch or so along the axes, and label them 0 (at the origin where the axes cross), 1, 2, etc. going up (on the y-axis) and right (on the x-axis), and negative numbers -1, -2, etc. going the other direction away from the origin. Now make a dot for the point (1, 0).

Still with me? Okay, now look at the matrix A = \left[\begin{array}{cc}\frac{\sqrt{3}}{2} & \frac{-1}{2} \\ \frac{1}{2} & \frac{\sqrt{3}}{2}\end{array}\right] \approx \left[\begin{array}{cc}0.866 & -0.5 \\ 0.5 & 0.866\end{array}\right].

Take that matrix A and multiply it by the vector v0 = (1, 0), to get the result v1 = Av0. Make the dot corresponding to that point on your graph. Multiply by A again, and make a new dot for v2 = Av1 = A2v0. Repeat this a few more times, and make dots for v3, v4, and v5.

Now it should make sense to you when you look at the dots on your graph: the matrix A is quite literally transforming the points of the plane in a predictable manner. How would you describe the action of A on vectors?

Now pick some arbitrary vector, like u = (3, 5) but you can pick whatever you like. Mark both the location of your vector u and of Au on your graph. Is Au where you thought it would be?
Small Government Liberal

Qaanol

Posts: 2241
Joined: Sat May 09, 2009 11:55 pm UTC

### Re: Want to study astronomy... bad at math

They're creating radii of circles, like a more confusing version of x^2 + y^2 = 4

I'm assuming I did this right, I made v0 a column vector in a matrix and multiplied the way you are apparently supposed to and ended up with a very tight circle hugging the origin, u yielded a much larger circle. Hey that's really nifty! This is transformation? Do you always use that specific matrix for this kind of rotation?

I'm starting to get the hang of notation and terminology btw, I think that was half my problem (I just learned what that squiggly equal sign is). Also been doing some reading, I was always into philosophy but I didn't realize Rene Decartes was responsible for all that homework I had to do on graph paper in algebra class. I just thought he was a philosopher of mind. But I guess that's dense of me not ever putting two and two together hearing "Cartesian coordinates." (I think, therefore m = y2 - y1/x2 - x1?). I also never though of it as some revolutionary unification of geometry and absract algebra, but now that I think about it it's kind of impressive.

BryanRabbit

Posts: 64
Joined: Sun Jun 24, 2012 5:36 am UTC
Location: New York

### Re: Want to study astronomy... bad at math

There are a family of matrices called "rotation matrices" that happen to rotate every input point by some fixed (for the matrix) angle around the origin.

Calculating them isn't all that tricky -- it involves sin and cos. I think someone posted it earlier in this thread, but deriving it isn't all that hard. If you have a vector (1,0) and you rotate it by 45 degrees, where does it end up? And (0,1), where does it end up? How about a rotation by "sigma" radians?

All linear transformations on R2 (the vector space of pairs of real numbers) are completely defined by where they take (1,0) and (0,1). It isn't hard to build the matrix once you know where they go -- the first column of the matrix is where it takes (1,0) and the second column where it takes (0,1)!
One of the painful things about our time is that those who feel certainty are stupid, and those with any imagination and understanding are filled with doubt and indecision - BR

Last edited by JHVH on Fri Oct 23, 4004 BCE 6:17 pm, edited 6 times in total.

Yakk

Posts: 10039
Joined: Sat Jan 27, 2007 7:27 pm UTC
Location: E pur si muove

### Re: Want to study astronomy... bad at math

BryanRabbit wrote:They're creating radii of circles, like a more confusing version of x^2 + y^2 = 4 :shock:

I’d like to be clear here: the matrix A that I posted above, when applied repeatedly, does not move (1, 0) to every point on a circle. What it does, is rotate every point around the origin by 30°, which is π/6 radians. So, whatever point v you start with, the point Av will be the same distance from (0, 0) as v was, but rotated 30°, and every time you multiply A by the result, it will rotate another 30°.

Also, I didn’t expressly ask you to do it, but if you calculate the matrix B=A·A, then you’ll find that Bv=A·(Av). It is important to note that this fact, namely (A·A)v=A·(Av), is not at all obvious. In particular, given the complicated, counter-intuitive definition for matrix multiplication, there is no reason a priori to expect matrix multiplication will behave anything like regular multiplication of numbers.

In fact, matrix multiplication does not behave like regular multiplication in some very important ways. It is easy enough to come up with two matrices B and C with the property that B·C and C·B are not the same. We say matrix multiplication is not commutative. Try it: see if you can write down two 2×2 matrices that do not commute with each other.

However, for any three matrices X, Y, and Z, if it is possible to multiply X·Y and Y·Z, then the matrices X·(Y·Z) and (X·Y)·Z will be the same. We say matrix multiplication is associative. As a consequence, the 30°-rotation matrix A that I posted above, when multiplied by itself must give the 60°-rotation matrix A2.

BryanRabbit wrote:I'm assuming I did this right, I made v0 a column vector in a matrix and multiplied the way you are apparently supposed to and ended up with a very tight circle hugging the origin, u yielded a much larger circle. Hey that's really nifty!

Excellent.

BryanRabbit wrote:This is transformation? Do you always use that specific matrix for this kind of rotation?

A transformation is any sort of function. The transformations performed by matrix multiplication are all linear transformations, which was defined earlier in this thread. Linear transformations are “nice” and easy to work with, and they arise quite frequently in a plethora of situations.

Rotation is one type of linear transformation, reflection (like a mirror) is another, and scaling (zooming larger or smaller) is a third. There are few others like shearing and projecting, as well some transformations which are not technically linear, but can be subsumed into a linear transformation by “going up a dimension”, such as translation (moving everything by the same amount) and perspective. The powerful thing is that any combination of linear transformations is still a linear transformation, and they can be combined simply by multiplying their corresponding matrices in sequence.

BryanRabbit wrote:I'm starting to get the hang of notation and terminology btw, I think that was half my problem (I just learned what that squiggly equal sign is).

That’s good. It’s called an approximately equals sign.

BryanRabbit wrote:Also been doing some reading, I was always into philosophy but I didn't realize Rene Decartes was responsible for all that homework I had to do on graph paper in algebra class. I just thought he was a philosopher of mind. But I guess that's dense of me not ever putting two and two together hearing "Cartesian coordinates." (I think, therefore m = y2 - y1/x2 - x1?).

Yup, René was one smart fellow.

BryanRabbit wrote:I also never though of it as some revolutionary unification of geometry and absract algebra, but now that I think about it it's kind of impressive.

As a terminology point, the field known as “abstract algebra” is distinct from the algebra you are studying now. It deals with abstract mathematical structures, such as those called “rings”, “fields”, and “groups”.
Small Government Liberal

Qaanol

Posts: 2241
Joined: Sat May 09, 2009 11:55 pm UTC

### Re: Want to study astronomy... bad at math

Yakk wrote:All linear transformations on R2 (the vector space of pairs of real numbers) are completely defined by where they take (1,0) and (0,1). It isn't hard to build the matrix once you know where they go -- the first column of the matrix is where it takes (1,0) and the second column where it takes (0,1)!

You know, I never thought about it that way before, but that makes a lot of sense. Noting, of course, that the point (0, 0) is fixed through the transformation.

--------------

BryanRabbit: Rotation matrices combine matrix manipulation with trigonometry. Let me show you how trigonometry relates to rotation. First, I'll quote my previous post defining the basics of trig to provide context:

CCC wrote:Now, as to trig; trig is really all about an angle and six different functions.

Consider, first, your basic graph. You have a horizontal x-axis, a vertical y-axis. The x-axis is positive to the right and negative to the left; the y-axis is positive up and negative down.

Consider a line, starting from the origin of the graph, at an angle of theta (where an angle of 0 would mean 'lying along the x-axis' and theta is measured anti-clockwise). Now, be careful; there's at least three different units that I can use for theta. If I measure theta in degrees, then I will have 360 of them making up a full circle; if I measure theta in radians, then I will have 2*pi of them forming a full circle. (This is important if using a calculator for trig; if you put in an angle in degrees and the calculator is working out its trig in radians, then you will get the wrong answer. So know what your calculator expects, and how to change it.)

Okay. So we've got a graph and a line at an angle of theta. (If I was writing this, instead of typing, I would be using the actual Greek letter theta, of course, instead of writing it out every time. I can use any letter I want, but theta is sort of traditional for angles). Now put a point on that line. Anywhere on the line, it doesn't matter. Now, let me name three additional values.

X: This is the x-coordinate of the point; if I drop an object from the point to the x-axis, it will hit the axis at this value.
Y: This is the y-coordinate of the point; the position on the y-axis that is level with it.
R: This is the distance from the point to the origin.

Now, I define six functions from these variables:
sine (theta) is Y/R, normally abbreviated to sin(theta)
cosine (theta) is X/R, normally abbreviated to cos(theta)
tangent (theta) is Y/X, normally abbreviated to tan(theta)
cotangent (theta) is X/Y, normally abbreviated to cot(theta)
secant (theta) is R/X, normally abbreviated to sec(theta)
cosecant (theta) is R/Y, normally abbreviated to cosec(theta)

That's basically all of trig, those six functions and their interactions. (You're going to have to memorise those definitions, unfortunately. It helps to notice that adding 'co' to the front simply changes X's to Y's and Y's to X's) And there's a lot of interactions, because X, Y and R are all related to each other by Pythagoras' Theorem: R2=X2+Y2. For example: [sin(theta)]2+[cos(theta)]2 = (Y/R)2+(X/R)2 = (Y2+X2)/R2 = R2/R2 = 1. Thus, [sin(theta)]2+[cos(theta)]2=1, for any theta.

Of course, once you've got the functions, you can throw them into algebra any way you please.

Now, let us say that we wish to rotate a point through an angle of theta. Imagine a line, of length d, before and after rotation. We'll define the "before-rotation" version as zero degrees, and call it B, for Before. I can draw a line, from the end of the "after-rotation" line (A, for After), that hits the "before-rotation" line at right angles. Call this line L, for Line.

Now, L, A and B form a right-angled triangle. In fact, from the point of view of angle theta, and looking at the trig definitions above, A is R, L is Y, and the portion of B between the rotation point and where L hits it is X.

Now, I know how long line A is; it has length d. Thus, R=d. So I look over my trig functions and see which ones will let me find the lengths of B (up to where it hits L) (equal to X) and L (equal to Y). Four of them will do; sin(theta)=Y/R, cos(theta)=X/R, sec(theta)=R/X, and cosec(theta)=R/Y.

I can find Y as either d*sin(theta) or as d/cosec(theta). Either will do. Similarly, I can find X as either d*cos(theta) or d/sec(theta).

Now, using this, can you find the rotation matrix for a rotation through 10 degrees?
CCC

Posts: 46
Joined: Thu Jun 14, 2012 12:29 pm UTC

### Re: Want to study astronomy... bad at math

Out can show linear functions leave zero alone because scalar multiplication passes through.
One of the painful things about our time is that those who feel certainty are stupid, and those with any imagination and understanding are filled with doubt and indecision - BR

Last edited by JHVH on Fri Oct 23, 4004 BCE 6:17 pm, edited 6 times in total.

Yakk

Posts: 10039
Joined: Sat Jan 27, 2007 7:27 pm UTC
Location: E pur si muove

### Re: Want to study astronomy... bad at math

Sorry I haven't responded yet ccc, I will get to it (with pencil and paper in hand) because I really want to know trig, right now I'm just obsessed with getting through my algebra book as fast and thoroughly as possible. I see now I really needed a refresher of the basics.

Quick question, when calculating the slope of a line do I always plug in the larger of the two y values for y2? For example if a line passes through points A (0,-2) and B (-5, 12) I know point B is further up on the y axis because it's y-value is higher. That makes it easy because if I make that assumption I know right away m = 12 - (-2) / -5 - 0

Text books don't explicitly state this but so far that's the only way I can get the right answer (otherwise I end up with either a negative or positive version of the same answer, this is a bad example because either order always yields -14/5). I just want to make sure I'm doing this right. I've struggled with math so much I've become skeptical of myself.

Thanks again everyone

BryanRabbit

Posts: 64
Joined: Sun Jun 24, 2012 5:36 am UTC
Location: New York

### Re: Want to study astronomy... bad at math

The slope should be the same regardless of the order you put the points into the forumla. Think about it this way:

You have two points on a line. They are (x1,y1) , (x2,y2). Now:

m = (y2-y1)/(x2-x1)

Multiply both sides of the equation by 1. On the left hand side we just write "1" but on the right hand side we write (-1)/(-1) which is just "1" right? Now we have

(1) * m = [(-1) * (y2-y1)] / [(-1) * (x2-x1)]

m = (-y2 + y1) / (-x2 + x1)

m = (y1 - y2) / (x1 - x2)

You could also think of it as factoring a (-1) out of the top and bottom of the right hand side and canceling the terms

m = (y2-y1)/(x2-x1) = [(-1) * (-y2+y1)] / [(-1) * (-x2+x1)] = [(-1) * (-y2+y1)] / [(-1) * (-x2+x1)] = (y1 - y2) / (x1 - x2)
Birk

Posts: 232
Joined: Tue May 19, 2009 5:08 pm UTC

### Re: Want to study astronomy... bad at math

I see, and yeah I just found another example where it didn't matter what order I plugged in the y values. So basically that means I messed up on one example where I tried switching the order (and got a different answer).

I guess this is just my dyslexia again with negatives and positives. But knowing this makes it easier because I can always check my answer by switching the order.

Thanks Birk

BryanRabbit

Posts: 64
Joined: Sun Jun 24, 2012 5:36 am UTC
Location: New York

### Re: Want to study astronomy... bad at math

Yeah, sign errors are very skilled at sneaking their way into computations. They will subside in time.

Also just to clarify, although im sure you know this. The order doesn't matter but it does have to be consistent. For instance

m = y2-y1 / x1-x2

is incorrect. This would introduce a sign error.
Birk

Posts: 232
Joined: Tue May 19, 2009 5:08 pm UTC

### Re: Want to study astronomy... bad at math

I'm confused about the definition of a constant. If it's a number that doesn't change it's value and is the opposite of a variable (like pi) why does, for example, my text book define b as a constant in the formula y = mx + b?

W. Michael Kelley wrote:The coefficient of the x-term is the slope of the line, and the constant marks the point where the line crosses the y-axis.

BryanRabbit

Posts: 64
Joined: Sun Jun 24, 2012 5:36 am UTC
Location: New York

### Re: Want to study astronomy... bad at math

The concept of a constant is somewhat context dependent. In the example of y = mx + b the slope and y-intercept (m and b) are constants for a given line and the values of x and y are what change as you move along the line.
Birk

Posts: 232
Joined: Tue May 19, 2009 5:08 pm UTC

### Re: Want to study astronomy... bad at math

Ah okay, so as long as within a given line they don't change no matter what the point values, but not if it's a completely different line, m and b are still considered constants. That makes sense I guess.

BryanRabbit

Posts: 64
Joined: Sun Jun 24, 2012 5:36 am UTC
Location: New York

### Re: Want to study astronomy... bad at math

Sorry to resurrect an old thread, just thought I'd give an update, my last post in this thread was about 8 months ago and at that time I was struggling with decimals and positive/negative numbers. I'm now studying trigonometry ( with "For Dummies and "The Humongous Book of Trig Problems") and I still haven't run out of fuel yet. I took a another peek at the pre-calculus book I bought way back when but still haven't gotten to, when I first read the synopsis:

...from absolute value and quadratic equations to logarithms and exponential functions to trig identities and matrix operations.

^ I didn't know what any of that stuff was, it was alien speak as far as I was concerned. Now I'm familiar with everything in that sentence but trig identities, which I just started learning. It looks like once I'm done with my Trig books this one will just be review, I could even skip if it I wanted to (I won't, but somehow it feels good to know I probably could). I still don't know if I'm going to pursue astronomy, I'm trying to make a cost benefit-analysis and my focus has shifted from engineering to computer science, etc, something that will get me a job and hopefully I can get into natural science later if I wanted.

Point is I have more realistic options now. I literally thought something was wrong with me, as if I had math dyslexia. now the sort of thing that used to make me break out in a sweat feels like a game, like I'm passing the time with a jigsaw puzzle. Amazingly this combined with practicing programming which I started around the same time has done a lot to alleviate my depression/low self-esteem. I'm also starting to get a lot more xkcd jokes.

I'm sure once I'm actually in school majoring in something STEMish I'll be sweating again, I won't be studying at my leisure anymore, and obviously I still have a long way to go. But I didn't realize how fast I could learn what I learned, that I would retain it, and while I wouldn't call it easy it wasn't the nightmare I thought it would be. I'm officially not afraid of math anymore.
Last edited by BryanRabbit on Thu Feb 21, 2013 8:53 pm UTC, edited 1 time in total.

BryanRabbit

Posts: 64
Joined: Sun Jun 24, 2012 5:36 am UTC
Location: New York

### Re: Want to study astronomy... bad at math

That's fantastic to hear, hooray!
LE4dGOLEM: What's a Doug?
Noc: A larval Doogly. They grow the tail and stinger upon reaching adulthood.

Meaux: It's not jumping the shark if you never come down.

doogly
Dr. The Juggernaut of Touching Himself

Posts: 3860
Joined: Mon Oct 23, 2006 2:31 am UTC
Location: Somerville, MA

### Re: Want to study astronomy... bad at math

Btw I'm convinced if I had Sal Khan as my math teacher in high school I'd already be an astronomer.

I feel like writing a testimonial on that site.

BryanRabbit

Posts: 64
Joined: Sun Jun 24, 2012 5:36 am UTC
Location: New York

### Re: Want to study astronomy... bad at math

Nice! Welcome back. Happy to hear everything is still moving along.
Birk

Posts: 232
Joined: Tue May 19, 2009 5:08 pm UTC

Previous