Linear Algebra Lab I

This lab has some personalized content. Enter your Linear Talk login name and press enter to unlock it here:

Objectives

At this point, we've learned the basic mathematical concepts and notation for expressing linear systems symbolically and in terms of a matrix. We've also learned how to solve those systems using elimination. More formally, in the context of matrices, we've learned how to place a matrix into reduced row echelon form using Gauss-Jordan elimination. In principle, these processes are fairly simple but can be tedious - particularly, as we move to larger systems.

Thus, in this lab, we'll learn how to automate these processes on the computer.

Solving linear systems is an absolutely fundamental part of computational science. As a result, there are loads of systems to choose from for this task and no single system that's the best possible choice for everyone. For this class, I've chosen to use SageMath. Advantages of this choice include:

Expressing and solving linear systems of equations

At its most elementary level, linear algebra deals with systems of linear equations. Sage is able to deal with symbolic expressions and we can certainly express and solve linear systems symbolically. Suppose, for example, that we'd like to solve the following system:

$$ \begin{align} 3x_1-4x_2+6x_3-2x_4 &= 2 \\ 3x_2 - x_4 &= 9 \\ 5x_1-2x_2-3x_3-3x_4 &= -8 \\ 9x_1+x_2-4x_3+2x_4 &= 8 \end{align} $$

We can do so very easily with Sage's solve command:

Note that we get exactly one solution. Here are a couple of obvious modifications you should think about.

Problem 1

Use Sage's solve command to solve the following system.

What happens if you delete two of the equations?

You should post your answer as a comment to this forum discussion. Be sure to:

Reduced Row Echelon Form

As we've seen, systems of equations can be represented more compactly using matrices. In this context, the process of solving the system can be expressed in terms of placing the matrix into reduced row echelon form. Working with matrices at this level is often more efficient than working with systems of equations - on the computer, as well as by hand. Thus, it's not surprising that Sage has tools to define and work with matrices directly. Suppose, for example, that we'd like to find the Reduced Row Echelon Form of $$ \left( \begin{array}{cccccc} -2 & -8 & -1 & -8 & -6 & -5 \\ 16 & -8 & 8 & 6 & -5 & 0 \\ 8 & 8 & 4 & -8 & -4 & -1 \\ 8 & -16 & 4 & 14 & -1 & 1 \\ -12 & 3 & -6 & -5 & 2 & -4 \\ \end{array} \right). $$ We can do so with the following Sage code:

Problem 2

Use Sage to find the reduced row echelon form of the following matrix:

If we view this matrix as the augmented matrix of a system, what is the system and what is the solution?

You should post your answer as a comment to this forum discussion. Be sure to: