Solving small linear systems with Gaussian elimination
In this section, we will learn how to solve an n-by-n linear system of equations Ax = b, if possible, through a method called Gaussian elimination, which we will do by hand for a small problem. In the next section, we implement it with Python.
We will explain through an example of a 3-by-3 system, which should make the idea clear for larger systems, which we will formalize at the end of the section, and which we will prefer to solve with code.
First, notice that there are several manipulations we may do to the equation in the system without changing the solutions:
- We can switch the order of the equations, which corresponds to swapping the rows of the matrix [A|b].
- We can multiply both sides of an equation by a constant, which corresponds to multiplying a row of [A|b] by a constant.
- We can add a multiple of one equation to another equation, which corresponds to adding a multiple of one row of [A|b] to another...