Skip to content
Hub Nexus

No author yetClaim it

Version 1Updated 2 min read

Support

This is a PASCAL routine to do k {ρ}_{i} + {ρ}_{j} to an augmented matrix.

PROCEDURE Pivot(VAR LinSys : AugMat;
k : REAL;
i, j : INTEGER)
VAR
Col : INTEGER;
BEGIN
FOR Col:=1 TO NumVars+1 DO
LinSys[j,Col]:=k*LinSys[i,Col]+LinSys[j,Col];
END;

Of course this is only one part of a whole program, but it makes the point that Gaussian reduction is ideal for computer coding.

There are pitfalls, however. For example, some arise from the computer's use of finite-precision approximations of real numbers.

These systems provide a simple example.

(The second two lines are hard to tell apart.)
Both have ( 1 , 1 ) as their unique solution.

In the first system, some small change in the numbers will produce only a small change in the solution:

\begin{matrix}x & + & 2 y & = & 3 \\ 3 x & − & 2 y & = & 1.008\end{matrix}

gives a solution of ( 1.002 , 0.999 ). Geometrically, changing one of the lines by a small amount does not change the intersection point by very much.

That's not true for the second system. A small change in the coefficients

\begin{matrix}x & + & 2 y & = & 3 \\ 1.000 \ 000 \ 01 x & + & 2 y & = & 3.000 \ 000 \ 03\end{matrix}

leads to a completely different answer: ( 3 , 0 ).

The solution of the second example varies wildly, depending on a 9-th digit. That's bad news for a machine using 8 digits to represent reals. In short, systems that are nearly singular may be hard to compute with.

Another thing that can go wrong is error propagation. In a system with a large number of equations (say, 100 or more), small rounding errors early in the procedure can snowball to overwhelm the solution at the end.

These issues, and many others like them, are outside the scope of this book, but remember that just because Gauss' method always works in theory and just because a program correctly implements that method and just because the answer appears on green-bar paper, doesn't mean that answer is right. In practice, always use a package where experts have worked hard to counter what can go wrong.

Where this page came from

This page was imported from Wikibooks. From “Linear Algebra” on Wikibooks, by its contributors, under CC BY-SA 4.0. Changed here: set as a page; navigation and edit links left out; each image under its own licence, credited in its caption.

Nobody has written it yet — it is the source material at a new address, which is why search engines are asked to skip it and why no one earns from it. It is up for grabs: take it on, and it is yours to rewrite and to earn from.

Comments

Spinner Logo

Next in Linear Algebra

CC BY-SA 4.0
For readers who have seen the elements of vectors before, in calculus or physics, this section is an optional review. However, later work will refer to this material so it is not optional if it is not a review. In the first section, we had to do a bit of work to show that there are only three types
CC BY-SA 4.0
"Higher-dimensional geometry" sounds exotic. It is exotic— interesting and eye-opening. But it isn't distant or unreachable. We begin by defining one-dimensional space to be the set ${ℝ}^{1}$.
CC BY-SA 4.0
We've translated the first section's results about solution sets into geometric terms for insight into how those sets look. But we must watch out not to be mislead by our own terms; labeling subsets of ${ℝ}^{k}$ of the forms $\{ \overset{→}{p} + t \overset{→}{v} \ | \ t ∈ ℝ \}$ and $\{ \overset{→}{p
CC BY-SA 4.0
After developing the mechanics of Gauss' method, we observed that it can be done in more than one way. One example is that we sometimes have to swap rows and there can be more than one row to choose from. Another example is that from this matrix $( \begin{matrix}2 & 2 \\ 4 & 3\end{matrix} )$ Gauss'
CC BY-SA 4.0
Gaussian elimination coupled with back-substitution solves linear systems, but it's not the only method possible. Here is an extension of Gauss' method that has some advantages. Example 1.1 To solve $\begin{matrix}x & + & y & − & 2 z & = & − 2 \\ & & y & + & 3 z & = & 7 \\ x & & & − & z & = & − 1\en
CC BY-SA 4.0
We will close this section and this chapter by proving that every matrix is row equivalent to one and only one reduced echelon form matrix. The ideas that appear here will reappear, and be further developed, in the next chapter. The underlying theme here is that one way to understand a mathematical