Today we’re going to talk about something that’s near and dear to the heart of every math nerd out there numerical methods for solving linear systems!
Now, if you’re not familiar with what a “linear system” is, let me break it down for you in layman’s terms. Imagine you have a bunch of equations that look like this:
x + y = 5
2x y = 10
These are called linear systems because they involve only one variable (in this case x and y) raised to the first power, with no higher-order terms or variables. The goal is to find values for x and y that satisfy both equations at once. In other words, we want to solve for a pair of numbers that make both statements true simultaneously.
But here’s the thing solving linear systems by hand can be a real pain in the butt! Especially if you have more than two variables or more complicated equations. That’s where numerical methods come in handy. These are techniques we use to approximate solutions using computers, rather than trying to solve them exactly with pen and paper (or chalkboard).
Now, there are many different types of numerical methods for solving linear systems, but let’s focus on two that are particularly popular: Gaussian elimination and LU decomposition.
Gaussian elimination is a method that involves transforming the original system into an equivalent one with simpler coefficients (i.e., ones that are easier to work with). The basic idea is to use row operations to eliminate variables from each equation, until you’re left with a triangular matrix (one where all entries below the main diagonal are zero) and a set of equations involving only those remaining variables.
For example, let’s say we have this system:
x + y z = 10
2x + y + z = 35
-x + y + 4z = 78
To apply Gaussian elimination to this system, we would first use row operations to eliminate x from the second equation. This involves subtracting twice the value of x in the first equation (which is -10) from both sides of the second equation:
x + y z = 10
-y + z = 25
Next, we would use row operations to eliminate x and y from the third equation. This involves subtracting a multiple of the first equation (which is -1/2) and a multiple of the second equation (-3/4) from both sides of the third equation:
x + y z = 10
-y + z = 25
-7z = -680
Now, we have a triangular matrix (with all entries below the main diagonal equal to zero), and a set of equations involving only two variables (z). This makes it much easier to solve for z! In fact, we can use back substitution to find its value:
-7z = -680
z = 97.14285714…
And there you have it the solution to our original system! Of course, this is just a simple example, and in practice Gaussian elimination can be much more complicated (especially for larger systems). But hopefully that gives you an idea of how it works.
LU decomposition is another popular method for solving linear systems, which involves factoring the coefficient matrix into two simpler matrices: L (lower triangular) and U (upper triangular). The basic idea is to use row operations to transform the original system into a form where these factors can be easily computed.
For example, let’s say we have this system:
x + y z = 10
2x + y + z = 35
-x + y + 4z = 78
To apply LU decomposition to this system, we would first use row operations to eliminate x from the second equation (just like in Gaussian elimination). This involves subtracting twice the value of x in the first equation (-10) from both sides of the second equation:
x + y z = 10
-y + z = 25
Next, we would use row operations to eliminate x and y from the third equation. This involves subtracting a multiple of the first equation (which is -1/2) and a multiple of the second equation (-3/4) from both sides of the third equation:
This article on numerical methods for linear systems was really helpful!