Section 2.2 Solving Systems
Subsection 2.2.1 The Assignment
- Read section 2.2 of Strang (pages 45-51).
- Watch a video or two from the YouTube series Essence of Linear Algebra by user 3Blue1Brown.
- Read the following and complete the exercises below.
Subsection 2.2.2 Learning Goals
Before class, a student should be able to do the following things.
- Clearly state and use the following vocabulary words: pivot, multiplier, triangular matrix, back substitution, singular, non-singular
Sometime after class, a student should be able to the following things.
- Perform elimination to put a system of linear equations into triangular form.
- Solve small systems by hand.
- Explain the two failure modes for elimination, and describe which leads to no solutions, and which leads to infinitely many solutions.
- Solve larger systems with the help of a computer algebra package (Sage).
Subsection 2.2.3 Discussion: Elimination for Solving Systems of Linear Equations
Now we begin the process of learning how to solve a system of linear equations systematically through a process called elimination.
Subsubsection 2.2.3.1 Some terminology
A typical system looks something like this:
This situation is two equations in three unknowns. The unknowns here are the three numbers \(x_1\text{,}\) \(x_2\) and \(x_3\) for which we search. Usually, we bundle the numbers together as a vector \((x_1, x_2, x_3)\text{.}\) If we can find a vector which makes all of the equations true simultaneously, we call that vector a solution.
Keep in mind that the process involves eliminating instances of the variable below pivots. Strang describes the process pretty well, and gives good examples. What Strang describes in this section is sometimes called the forward pass elimination.
Watch out for situations which are singular in that they have fewer pivots than unknowns. A system is called non-singular if it has as many pivots as unknowns.
Subsubsection 2.2.3.2 Keeping track of things
Playing with all of the equations is nice, but all that really matters is the collection of coefficients, and the numbers on the right hand sides of the equal signs. Experienced solvers get tired of copying notation from line to line in a computation, so they only keep track of the matrix of coefficients, augmented by the vector on the right-hand side. In the example above, that augmented matrix is
All of the row operations can be performed on just this augmented matrix, without losing any of the essential information.
Subsection 2.2.4 SageMath and Row Operations
The process of elimination for systems of equations involves performing operations on the equations. When translated to matrix form, it involves operations on the rows of the coefficient matrix. The corresponding matrix methods come in two types.
The first type of method modifies the matrix “in place”, which means that it Changes the input matrix.
-
A.rescale_row(r, num)multiplies rowrby the factor ofnum. -
A.swap_rows(r1, r2)switches the places of rowsr1andr2. -
A.add_multiple_of_row(target, useful, num). This addsnumtimes rowusefulto rowtarget.
Throughout, please remember that SageMath uses \(0\)-based indexing! So the rows are labeled 0, 1, 2, ...
This just did the whole process of forward pass elimination. (Well, we did a bit more than Strang would. He wouldn't rescale the rows.)
Sometimes you do not want to change the matrix A. If instead, you want to leave A alone, you can use these methods, which return a new object and do not change A.
A.with_rescaled_row(r, num)A.with_swapped_rows(r1, r2)A.with_added_multiple_of_row(t, u, num)
Let's do the same operations as above, but without changing A. This will mean making a bunch of new matrices. In fact, let's also change the name of our matrix to B.
This second option has some advantages. At any point, you can revise your work, because the original matrix is still in memory, and so are all of the intermediate steps. Let's display all six of the matrices at once to see that they all still exist.
Subsection 2.2.5 Exercises
(a)
Use the elimination method to transform this system into an easier one. (Can you make it triangular?) Circle the pivots in the final result.(b)
Suppose that a system of three equations in three unknowns has two solutions \((1,0,-1)\) and \((2,1,2)\text{.}\) Explain why the system must have other solutions than these two. Describe clearly two other solutions.(c)
Find three examples of numbers \(a\) so that elimination will fail to give three pivots for this coefficient matrix:(d)
Complete the following to make an example of a system of two equations in two unknowns which is singular but still has a solution, or explain why no such example exists.(e)
Complete the following to a system of three equations in three unknowns which is singular and does not have a solution, or explain why no such example exists.(f)
Complete the following to a system of three equations in three unknowns which is singular but still has a solution, or explain why no such example exists.(g)
- How many ways can three planes in three dimensional space meet? Make examples to represent as many qualitatively different situations as you can.
- How many ways can two lines in the plane meet? Make examples to represent as many qualitatively different situations as you can.