transcribe

Chapter 2.1a - Gaussian Elimination

Nathan Kutz · 12m · transcribed Jul 2026
More from Nathan Kutz Business
𝕏 Share ▶ YouTube 📥 PDF 🤖 .md

Section Insights

# 0:10

Introduction to Gaussian Elimination

What is Gaussian elimination and its relevance?

Gaussian elimination is a standard technique for solving the equation Ax = B. While it is foundational, faster methods exist for large-scale problems.

  • Gaussian elimination is a key algorithm in linear algebra.
  • It is commonly used in scientific computing and machine learning.
  • Faster methods are preferred for large-scale systems.
# 0:50

Solving a 2x2 System of Equations

How do you solve a simple system of equations using substitution?

By substituting one variable in terms of another, you can simplify the equations to find the values of x and y.

  • Substitution is a practical method for small systems.
  • It becomes impractical for larger systems.
  • Understanding basic methods is crucial before moving to computational techniques.
# 4:00

Forming the Augmented Matrix

What is the first step in applying Gaussian elimination?

The first step is to form the augmented matrix by combining the coefficient matrix A with the constant matrix B.

  • The augmented matrix represents the system of equations compactly.
  • It is essential for applying elimination techniques.
  • Understanding matrix representation is key in linear algebra.
# 6:00

Elimination Process

How do you eliminate variables to form an upper triangular matrix?

By manipulating the rows of the augmented matrix, you can eliminate variables below the pivot to achieve an upper triangular form.

  • Row operations are fundamental in Gaussian elimination.
  • Creating zeros below pivots simplifies solving the system.
  • This process is crucial for understanding the structure of solutions.
# 10:00

Operation Count in Gaussian Elimination

What is the computational cost of Gaussian elimination?

The operation count for Gaussian elimination is approximately O(n^3), which can be expensive for large matrices.

  • Understanding computational complexity is vital for efficiency.
  • Large matrices can lead to significant computational costs.
  • Optimizing algorithms is essential in scientific computing.
# 12:20

Back Substitution

What is back substitution and its cost?

Back substitution involves solving for variables starting from the last equation and moving upwards, with a computational cost of O(n^2).

  • Back substitution is necessary after forming an upper triangular matrix.
  • It is less computationally intensive than Gaussian elimination.
  • Efficiency in back substitution can improve overall algorithm performance.
# 16:40

Importance of Computational Cost

Why is it important to consider the computational cost of solving Ax = B?

The cost of solving Ax = B often dominates computational time in scientific computing, making it crucial to optimize these operations.

  • Most computational costs arise from solving linear systems.
  • Awareness of costs can guide algorithm selection.
  • Exploring faster methods is essential for large-scale problems.
# 20:20

Future Techniques for Solving Ax = B

What should we look forward to in solving Ax = B?

We will explore faster techniques for solving Ax = B that are more efficient than Gaussian elimination.

  • Advancements in algorithms can significantly reduce computation time.
  • Continuous learning about new methods is important.
  • The field of linear algebra is evolving with new computational techniques.

Transcript

0:10 we we're prepared now to introduce one of the standard solution techniques for ax equal to B which is known as Gan elimination in practice people don't really do Gan elimination at scale there are faster methods for solving ax equal to B what we're going to highlight is from an algorithm point of view How would we go about doing gination and then from that we're going to start building up a set of tools for ourselves to solve ax equal Tob as

0:38 this is one of the most common operations we do computationally both in scientific Computing machine learning everything that we might do is going to often resolve down to ax equal to B so first of all let's talk about how we probably first learn how to solve ax equal to B and let's consider a 2x2 system of equations 2x + y = 3 x - 2 y = 1 so the first thing we did and probably this is Junior High I don't know if you

1:03 remember back to Junior High but what we probably did is first do a substitution trick from the second equation it's really easi to solve for x so right you move the 2 y over to the other side and you get X is equal to 2 y + 1 okay great so now I know what x is in terms of Y I've used one of the equations I'm going to plug this into the top equation now I

1:26 have 2X + y = 3 and I know that X from the other another equation is 2 y + 1 so let's plug that in and when you plug that in you get the following equation for y Alone 4 y + 2 + y = 3 this allows you to solve for y which is 5 y = 1 which means y = 1/5 so I have the solution for y so now that I have y I

1:54 can plug it back in to get X and if you remember X was 2 y + 1 right which is given here so 2 I + 1 so plug in here Y is 1/5 so I get 25ths + 1 and then X is equal to 7 fths so this is just just a simple sort of substitution tricks right that you would use to solve something like a 2X two you could do 3 x3s but this gets complicated if you

2:22 start doing large scale systems and a lot of what we're going to do in Computing is solve large system of equations that might be a billion by billion and you're clearly not going to do substitution in that case you want to use computational methods that are fast so we want to find a way to automate this process that's the entire goal of scientific Computing often is how do you solve ax equal to B at massive scale and

2:46 you're not going to do substitution tricks like this so the first thing we're going to learn is an algorithm that does gination so we're going to think about ax equal to B and we're going to think about say for instance these are going to be our matrices we're going to play with first we're going have a matrix here a 3X3 B is a three rows by one column so we're going to solve this system of equations so this ultimately

3:13 represents three equations and three unknowns and that's what the x is is the unknowns that we're trying to solve for so first of all linear algebra allows us to write system of equations right as this compact form a x equal to B right in fact what we're going to eventually solve are systems of this thing you know ax equal to D form that are quite large right where a is thousand by thousand 10,000 by 10,000

3:44 eventually if you're doing really large scale Computing this can be billions by billion by billion and we want to solve these very large scale structure axal be Sol problem Solutions and that will start to show up much later in this course as we go to very large scale axal B problems and we're going to talk about fast solution techniques for it but right now what we want to focus in on is how would I solve this in a very

4:07 practical way so the first thing you do is you form What's called the augmented Matrix you take the A and you take the B okay here it is a and there's a bar here so the a is the Matrix you have B is the right hand side and so if I put this in what we just had I put in the a matrix here and here's the B Here and Now what we're going to do is if you've had this

4:30 in linear algebra which hopefully you've seen some of this what we're going to do is try to do put this in Upper triangular form and another we're going to try to make all these down here zeros okay so here's how I'm going to do it I'm going to pick a pivot and typically what we're going to do with the pivots is we're going to start with this top level pivot and we're going to walk down this diagonal okay so the first is one

4:54 and then two and nine we're going to walk down that diagonal and try to eliminate all the values below it to be zero so what this is equivalent to is manipulating these three equations and these three unknowns so I'm going to try to make these zero so how I'm going to do it well I'm going to Define what I'm showing here in purple the one two three the first row second row and third row now the first second and third row

5:20 represent equations and now what I can do and what we did with substitution is I can do things with these equations I can add equations together I can subtract equations this is all legal and just mathematical manipulation and so what I want to do is start thinking about can I add or subtract these equations maybe with some con coefficient in front in order to eliminate and make these zeros up here so I want to make new

5:48 equations that I can make that I want to make that have zeros here in this first underneath that one so here's how you would do this so first of all to make a new second row I could take the second equation and subtract the first from it and I could do the same thing with the third row take the third equation subtract the first equation from it these are going to give us two new equations but notice what happens

6:14 now when I do this when I subtract those this is what I get so now this is the new system 3X3 system of equations I subtracted the second equation from the first and from the third equation and from the first equation I subtracted the third equation and so now notice what I did here when I'm doing that this one canel the one so it's zero and then this one canel the one it's zero so here we go I got the

6:39 zeros I got three new equations still with the unknowns I had before but I just rewrote those equations but now I have zeros underneath Here and Now what I want to do is try to get a zero under here so now I'm just going to look at this second and third equations and figure out what do I have to do to make get rid of this so this a zero so what I can do here is I can take the new third row

7:03 which has a two there okay and take that third row and just divide by two that's going to make that a one which means then I could just subtract right if I do that just divide by two so other is I take both sides of the equation divide by two which is perfectly legal move here's my new set of equations okay so that the two becomes a one the eight becomes a four and add zero over here so

7:28 I divide by two it's zero and now I take the third row subtract the second row from it and now I have finally this this form of the solution here where it's an upper triangular form so what this now represents is a new system of equations and I can ask the question how long did it take me to get this because now once I have this I can just do back substitution because the third equation says that 1 X3 is equal to 2 so that's

7:58 really easy to solve that means X3 is equal to 2 and then I can bring it up here because I know what X3 is to solve for X2 I have X2 and X3 which can means I can bring it up here to solve for X1 so getting into this form not only do I want to look at the structure of this but my real goal here is to start to understand the algorithm and how much it's going to cost me to do this so

8:22 let's talk about the operation count of doing this the first thing I have to do is move down all those pivots so remember I'm moving down the pivots right so the pivots that you move down here to make everything zero and there's n pivots so I have to move through all the nend pivots for each pivot I have to eliminate all the rows below it and go across every column so eliminating all the rows there's like n

8:47 rows and then there's n columns so essentially I'm going down n diagonals n rows n columns which means I have something that's Operation count is order n cubed so that's my operation count so that can be quite expensive if my code starts if my if my Matrix is really large let's say a billion by a billion then I'm a billion cubed operations to do this right and I need not only that I need three Loops to do

9:19 this I need a loop to go through the the go down through the pivots I need a loop to go across rows and across columns okay so three loops and two if statements by the way one of the things you learn in linear algebra if all of a sudden I get to a pivot and it's a zero I have to trade that row out for another row so I have to have an if statement always asking is the pivot a zero if it is

9:46 trade a row with it okay all right so that's what I want to watch for is the pivots itself okay so that's the operation count or the algorithm we have to start thinking about okay but once I have it in that form notice what I have all I have to do is back substitution so here were the three equations written out from this form let me just bring it back to here so this is this system here

10:13 I'm now going to write this as a system of equations and that's what we're looking at here so from the third one X3 is equal to two so easy I know what X3 is from the second equation notice I know what X3 is already so now what I do is put that in here that that's two that's six move it to the other side I get minus 8 I know what X2 and X3 are which allow me to solve for X1 and I'm

10:36 doing this back substitution so once I get it into that form I still have to do back substitution and the question is how much is this back substitution going to cost me well the back substitution you can clearly see it from this little algorithm right here right which is I have to go through each equation and there's n of them but for each equation notice I have to walk through all these variables there's n of them generically

10:59 so something like an order N squared operation which is better than n cubed n cubed is very expensive but this is still back substitutions order N squared approximately so so the operation count is order N squared and have two Loops I have to go through each row and all the columns okay and it's not quite N squared it's a little bit less than n Square because when you start the algorithm you you don't have all the

11:27 rows you have to go through but it's just an operation count ballpark figure okay so this is the idea behind gy elimination what I wanted to highlight is if you've done gy elimination before which presumably you hopefully you have you've worked this out maybe by pen but here what we're really trying to look at it is from an operations point of view as a computational tool if we were to do a Gyan elimination routine right we have

11:58 to start counting what is the cost of solving this ax equal to B in most scientific Computing the bulk of your computational cost and what makes codes really slow is solving ax equal to B so we want to be very mindful of how much it's going to cost computationally especially as we go to very large matrices and we want to think about Alternatives or fast solution methods for ax equal to B again you can find everything here as we go forward and

12:28 now we're going to learn some new techniques for solving axal to B that are in fact faster

Summary

The discussion focuses on Gaussian elimination as a method for solving the equation \( Ax = B \), emphasizing its algorithmic approach and computational efficiency. While Gaussian elimination is a foundational technique, the speaker notes that it is not typically used for large-scale problems due to its computational expense, prompting a need for faster methods in scientific computing and machine learning.

- Gaussian elimination is introduced as a standard solution technique for \( Ax = B \).
- The speaker illustrates solving a simple 2x2 system using substitution, highlighting the limitations of this method for larger systems.
- The process involves forming an augmented matrix and transforming it into upper triangular form through row operations.
- The operation count for Gaussian elimination is \( O(n^3) \), making it inefficient for large matrices (e.g., billion by billion).
- Back substitution is required after achieving upper triangular form, which has a complexity of \( O(n^2) \).
- The speaker emphasizes the importance of understanding the computational cost associated with solving \( Ax = B \).
- Alternatives and faster methods for solving large-scale systems will be explored later in the course.

Questions Answered

What is Gaussian elimination and its relevance?

Gaussian elimination is a standard technique for solving the equation Ax = B. While it is foundational, faster methods exist for large-scale problems.

How do you solve a simple system of equations using substitution?

By substituting one variable in terms of another, you can simplify the equations to find the values of x and y.

What is the first step in applying Gaussian elimination?

The first step is to form the augmented matrix by combining the coefficient matrix A with the constant matrix B.

How do you eliminate variables to form an upper triangular matrix?

By manipulating the rows of the augmented matrix, you can eliminate variables below the pivot to achieve an upper triangular form.

What is the computational cost of Gaussian elimination?

The operation count for Gaussian elimination is approximately O(n^3), which can be expensive for large matrices.

What is back substitution and its cost?

Back substitution involves solving for variables starting from the last equation and moving upwards, with a computational cost of O(n^2).

Why is it important to consider the computational cost of solving Ax = B?

The cost of solving Ax = B often dominates computational time in scientific computing, making it crucial to optimize these operations.

What should we look forward to in solving Ax = B?

We will explore faster techniques for solving Ax = B that are more efficient than Gaussian elimination.

© transcribe · For agents Built with care and craft by Gokul Rajaram