Skip to main content

TR Memescape

  • Talk Rational: The best at being a message board.

Topic: uncool school, take 3 (Read 985 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • uncool
uncool school, take 3
Well, we're starting up again. Not sure whether to count this as take 2, 3, or 4, so I took the average. Starting with the same post as last time.

So the last thread, I accidentally turned what was supposed to be a "school" on linear algebra into an exploration of linear algebra through the lens of category theory. Which was useful to me, but probably less useful to the people who were watching the thread. This thread is for those people.

So! Linear algebra.

What is linear algebra? Linear algebra is the study of what you can do when you are restricted to two basic operations - adding things together, and multiplying everything by a number.

Seems restrictive, right? Well, that's a lot of how math works - by restricting what you think you can do, you can make more situations similar - and so you can study things much more deeply.

The thing is, we actually haven't restricted ourselves all too much. Or rather, we've restricted ourselves to a pair of very useful things we can do. Don't believe me?

Every day, Alice buys two apples and one banana for breakfast. Every day, Bob buys one apple and two bananas for breakfast. Last month, Alice paid $5, while Bob paid $4. This month, Alice paid $5, while Bob paid $7.

How did the prices change?

Let the price of an apple be a dollars, and the price of a banana be b dollars. We then get the equations for last month:

2a + b = 5
a + 2b = 4

So let's solve. Double the second equation - multiply all the numbers in it by 2. That still gives us a valid equation. The cost of 2 apples and 4 bananas would be 8 dollars.

2a + b = 5
2a + 4b = 8

Now, if it cost 5 dollars to get 2 apples and a banana, and 8 dollars to get 2 apples and 4 bananas, it stands to reason (assuming no discounts) that the difference in cost comes from the difference in goods. So we can subtract the first equation from the second, to get:

2a + b = 5
3b = 3

Again assuming no discounts, if 3 bananas cost $3, then one banana would cost $1.

2a + b = 5
b = 1

Finally, we can remove bananas from the equation and divide by 2 to find that an apple cost $2 last month.

2a = 4
b = 1

a = 2
b = 1

Notice that the only things we did were listed above - we multiplied (or divided) by numbers, and then we added (or subtracted) two things.

OK. Now let's do the calculation for this month.

2a + b = 5
a + 2b = 7

2a + b = 5
2a + 4b = 14

2a + b = 5
3b = 9

2a + b = 5
b = 3

2a = 2
b = 3

a = 1
b = 3

We have found that the new prices are $1 for an apple, and $3 for a banana. But one thing to notice - we in fact did the exact same calculations as we did before, just with different numbers on the right. This will be important later.

Hopefully I have already convinced you that we already use linear equations commonly. Next up, the process of solving generally, and some notation.

  • Brother Daniel
  • Global Moderator
  • predisposed to antagonism
Re: uncool school, take 3
Reply #1
bump!

  • el jefe
  • asleep till 2020 or 2024
Re: uncool school, take 3
Reply #2
you could have saved a lot of space by just defining linear algebra as the comparative form of liney algebra.  eta: you're welcome.

Re: uncool school, take 3
Reply #3
you could have saved a lot of space by just defining linear algebra as the comparative form of liney algebra.  eta: you're welcome.
Do you mean linesque algebra?

  • uncool
Re: uncool school, take 3
Reply #4
Sorry for taking so long to add to this; I've been doing a bunch of research. I'll hopefully be adding to this within the next week or so.

Ironically, the most recent part will be trying to find an 11 by (something smaller) matrix, and then finding its kernel.

  • uncool
Re: uncool school, take 3
Reply #5
And it turns out I was in a place with no internet, so I haven't made any progress.

Should be ready within 2 days.

Re: uncool school, take 3
Reply #6
what is math

  • el jefe
  • asleep till 2020 or 2024
Re: uncool school, take 3
Reply #7
don't tell him

  • Brother Daniel
  • Global Moderator
  • predisposed to antagonism
Re: uncool school, take 3
Reply #8
:sadcheer:

  • Brother Daniel
  • Global Moderator
  • predisposed to antagonism
Re: uncool school, take 3
Reply #9
bump!

  • uncool
Re: uncool school, take 3
Reply #10
Graaagh. I've been trying, but it's been a lot busier than I expected.

Sorry.

  • uncool
Re: uncool school, take 3
Reply #11
Welp, it's been half a year, which means it's time for me to try to write another post.

So how do we solve sets of simultaneous linear equations? Well, how did we solve them last time? We simplify our current set of equations to use a smaller set of variables, then solve the new set of equations.

Now, I don't know about you guys, but I find that writing all those variables can get rather tedious. So let's use a different notation:

Earlier, we had the equations:

2a + b = 5
a + 2b = 4

I'm going to rewrite this as follows:

Code: [Select]
|  2    1  |  5  |
|  1    2  |  4  |
(This is what I'll use to replace LaTeX, since iirc we don't have it now).

With this notation, there is now a specific "order" to the variables. So when we eliminate variables, we will be eliminating them from left to right.

So how did we accomplish this before? We doubled the second equation, resulting in new equations that under our new notation would be

Code: [Select]
|  2    1  |  5  |
|  2    4  |  8  |

Or equivalently - we doubled everything in the second row.

We then subtracted the first equation from the second, getting
Code: [Select]
|  2    1  |  5  |
|  0    3  |  3  |

Or equivalently - we subtracted each component in the first row from the corresponding component in the second row.

This suggests that we have two basic operations that we commonly do:

1) Multiply everything in a row by some nonzero number.
2) Subtract some multiple of one row from another.

These are called "elementary row operations". We can use them to eliminate variables from left to right as follows: Use the first equation to zero out the later equations in the first column. Then ignore the first equation (row) and first variable (column), and repeat until you can do no more. Once we have the last value, we can then back-substitute to find the rest.

It turns out that we may need one more elementary row operation: Say that for some reason, Alice decided to skip apples for a week, and instead we had the following equations:

Code: [Select]
|  0    1  |  2  |
|  1    2  |  5  |

How would we eliminate the variable a? We clearly can't eliminate it using the first equation, because apples are irrelevant to Alice's price. So we have to switch our equations, and get


Code: [Select]
|  1    2  |  5  |
|  0    1  |  2  |

which we can then solve normally.

Next time: more on back-substituting and linear algebra.

Re: uncool school, take 3
Reply #12
I swear to fucking god if I see another matrix tonight I'm gonna burn one down.

Happy new year everyone.
Love is like a magic penny
 if you hold it tight you won't have any
if you give it away you'll have so many
they'll be rolling all over the floor

  • Brother Daniel
  • Global Moderator
  • predisposed to antagonism
Re: uncool school, take 3
Reply #13
I swear to fucking god if I see another matrix tonight I'm gonna burn one down.
:eek:
Quote from: Testy
Happy new year everyone.
you too!

  • uncool
Re: uncool school, take 3
Reply #14
Another half-year, plus half that. So it's time to add on.

So we now have three elementary row operations:
1) Multiply everything in a row by some nonzero number.
2) Subtract some multiple of one row from another.
3) Switch two rows.

We've been able to use these to get to the point where all we need is to back-substitute. But it turns out that we can even represent back-substitution using these operations.

For example:

We had gotten to this point before.

Code: [Select]
|  2    1  |  5  |
|  0    3  |  3  |

By multiplying the second line by 1/3, we get

Code: [Select]
|  2    1  |  5  |
|  0    1  |  1  |
so the last equation is now equivalent to "b = 1".

We can then subtract the 2nd line from the first line:
Code: [Select]
|  2    0  |  4  |
|  0    1  |  1  |
This is clearly the same result as what we would get by back-substituting and subtracting the constant terms. Finally, we can multiply the first line by 1/2, to get:

Code: [Select]
|  1    0  |  2  |
|  0    1  |  1  |
or in other words, "a = 2, b = 1".

So we can represent this entire process using this array of numbers, which is very convenient. We will give these arrays a specific name, and next time talk about how to use them.
  • Last Edit: September 06, 2017, 10:37:56 AM by uncool

  • MikeS
Re: uncool school, take 3
Reply #15
Ergo, Erogan, eiger sanction, umm..., Igor (nononono) ... errrr ...

And then something to do with how much something costs, it's net present worth or something.

Ummmm....

  • uncool
Re: uncool school, take 3
Reply #16
Time to come back to this!

So last time, we came up with a shorthand way to write certain equations. Namely: the equations have to have sums of multiples of variables on the left-hand side, and constants on the right-hand side. If that's the case, we can write those coefficients in an array, put a vertical line after those coefficients, and then write the constants.

We call this an augmented matrix (for reasons we will see soon). But I promised I would talk more about back-substituting.

So last time (ETA: Erk, make that the time before last, guess we get to have some repeating!), we started with the augmented matrix


Code: [Select]
|  2    1  |  5  |
|  1    2  |  4  |

and ended up with the augmented matrix

Code: [Select]
|  2    1  |  5  |
|  0    3  |  3  |

We then deduced that b = 1, a = 2, through back-substitution. Specifically, we deduced that b = 1 because 3b = 3. But we could also have determined that by multiplying the second row of that matrix by 1/3:

Code: [Select]
|  2    1  |  5  |
|  0    1  |  1  |

We then could have determined a = 2 by using another elementary row operation: subtracting the second row from the first row:

Code: [Select]
|  2    0  |  4  |
|  0    1  |  1  |

and multiplying the first row by 1/2:


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

This now represents the equations 1a + 0b = 2, 0a + 1b = 1, or more simply, a = 2, b = 1. So even back-substitution can be done using linear algebra - specifically, using the elementary row operations.

This suggests that we now have a general idea of what we want to do with augmented matrices: try to change the stuff before the vertical line until it has 1s on the diagonal, and 0s everywhere else. And we now have a standard process to do it (called Gauss-Jordan elimination), in 2 major steps: elimination and back-substitution:

Gaussian elimination:
1) If the top left element is zero, switch a row that has left-most element nonzero to the top.
2) Subtract multiples of the top row so the left column is otherwise zero
3) Repeat, disregarding both the first row and column (i.e. looking at terms in the second row and beyond, in the second column and beyond).

Back-substitution:
1) Multiply the last row so that it has a 1 first.
2) Subtract multiples of the last row from rows above it so the right column is otherwise zero.
3) Repeat, disregarding both the last row and column.

Next time, we talk about a somewhat more general possibility - where we can't always get that 1s and 0s matrix.
  • Last Edit: April 18, 2018, 06:12:54 PM by uncool

Re: uncool school, take 3
Reply #17
why am i subscribed to this thread full of witchcraft  :staregonk:

Re: uncool school, take 3
Reply #18
You are definitely shaking out some cobwebs! I have become so accustomed to just punching in the column vector followed by the matrix and just hitting divide and watching the answers magically appear on my calculator. It is good to be reminded of what is actually going on behind the scenes, so please keep it going. Too bad we don't have LaTex though.
"When a true genius appears in this world, you may know him by this sign, that the dunces are all in confederacy against him." (Jonathan Swift)