Biographies Characteristics Analysis

Gaussian transformation. Examples of solving slough using the Gaussian method

Systems solution linear equations Gauss method. Suppose we need to find a solution to the system from n linear equations with n unknown variables
the determinant of the main matrix of which is different from zero.

The essence of the Gauss method consists of sequentially eliminating unknown variables: first eliminating x 1 from all equations of the system, starting from the second, is further excluded x 2 from all equations, starting with the third, and so on, until only the unknown variable remains in the last equation x n. This process of transforming the equations of the system for sequential elimination unknown variables are called direct Gaussian method. After completing the forward progression of the Gaussian method, from the last equation we find x n, using this value from the penultimate equation we calculate xn-1, and so on, from the first equation we find x 1. The process of calculating unknown variables when moving from the last equation of the system to the first is called in reverse Gauss method.

Let us briefly describe the algorithm for eliminating unknown variables.

We will assume that , since we can always achieve this by rearranging the equations of the system. Eliminate the unknown variable x 1 from all equations of the system, starting from the second. To do this, to the second equation of the system we add the first, multiplied by , to the third equation we add the first, multiplied by , and so on, to nth to the equation we add the first one, multiplied by . The system of equations after such transformations will take the form

where and .

We would arrive at the same result if we expressed x 1 through other unknown variables in the first equation of the system and the resulting expression was substituted into all other equations. So the variable x 1 excluded from all equations, starting from the second.

Next, we proceed in a similar way, but only with part of the resulting system, which is marked in the figure

To do this, to the third equation of the system we add the second, multiplied by , to the fourth equation we add the second, multiplied by , and so on, to nth to the equation we add the second one, multiplied by . The system of equations after such transformations will take the form

where and . So the variable x 2 excluded from all equations starting from the third.

Next we proceed to eliminating the unknown x 3, in this case we act similarly with the part of the system marked in the figure

So we continue the direct progression of the Gaussian method until the system takes the form

From this moment we begin the reverse of the Gaussian method: we calculate x n from the last equation as, using the obtained value x n we find xn-1 from the penultimate equation, and so on, we find x 1 from the first equation.


Example.

Solve system of linear equations Gauss method.

In this article, the method is considered as a method for solving systems of linear equations (SLAEs). The method is analytical, that is, it allows you to write a solution algorithm in general view, and then substitute values ​​from specific examples there. Unlike the matrix method or Cramer's formulas, when solving a system of linear equations using the Gauss method, you can also work with those that have an infinite number of solutions. Or they don't have it at all.

What does it mean to solve using the Gaussian method?

First, we need to write our system of equations in It looks like this. Take the system:

The coefficients are written in the form of a table, and the free terms are written in a separate column on the right. The column with free terms is separated for convenience. The matrix that includes this column is called extended.

Next, the main matrix with coefficients must be reduced to an upper triangular form. This is the main point of solving the system using the Gaussian method. Simply put, after certain manipulations, the matrix should look so that its lower left part contains only zeros:

Then, if you write the new matrix again as a system of equations, you will notice that the last row already contains the value of one of the roots, which is then substituted into the equation above, another root is found, and so on.

This is a description of the solution by the Gaussian method in the most general outline. What happens if suddenly the system has no solution? Or are there infinitely many of them? To answer these and many other questions, it is necessary to consider separately all the elements used in solving the Gaussian method.

Matrices, their properties

None hidden meaning not in the matrix. This is simply a convenient way to record data for subsequent operations with it. Even schoolchildren do not need to be afraid of them.

The matrix is ​​always rectangular, because it is more convenient. Even in the Gaussian method, where everything comes down to constructing a matrix triangular in appearance, the entry contains a rectangle, only with zeros in the place where there are no numbers. Zeros may not be written, but they are implied.

The matrix has a size. Its “width” is the number of rows (m), “length” is the number of columns (n). Then the size of the matrix A (capital letters are usually used to denote them) letters) will be denoted as A m×n. If m=n, then this matrix is ​​square, and m=n is its order. Accordingly, any element of matrix A can be denoted by its row and column numbers: a xy ; x - row number, changes, y - column number, changes.

B is not the main point of the decision. In principle, all operations can be performed directly with the equations themselves, but the notation will be much more cumbersome, and it will be much easier to get confused in it.

Determinant

The matrix also has a determinant. This is very important characteristic. There is no need to find out its meaning now; you can simply show how it is calculated, and then tell what properties of the matrix it determines. The easiest way to find the determinant is through diagonals. Imaginary diagonals are drawn in the matrix; the elements located on each of them are multiplied, and then the resulting products are added: diagonals with a slope to the right - with a plus sign, with a slope to the left - with a minus sign.

It is extremely important to note that the determinant can only be calculated for a square matrix. For rectangular matrix you can do the following: from the number of rows and the number of columns, select the smallest (let it be k), and then randomly mark k columns and k rows in the matrix. The elements located at the intersection of the selected columns and rows will form a new square matrix. If the determinant of such a matrix is ​​a non-zero number, it is called the basis minor of the original rectangular matrix.

Before you start solving a system of equations using the Gaussian method, it doesn’t hurt to calculate the determinant. If it turns out to be zero, then we can immediately say that the matrix has either an infinite number of solutions or none at all. In such a sad case, you need to go further and find out about the rank of the matrix.

System classification

There is such a thing as the rank of a matrix. This is the maximum order of its non-zero determinant (if we remember about basic minor, we can say that the rank of the matrix is ​​the order of the basis minor).

Based on the situation with rank, SLAE can be divided into:

  • Joint. U In joint systems, the rank of the main matrix (consisting only of coefficients) coincides with the rank of the extended matrix (with a column of free terms). Such systems have a solution, but not necessarily one, so additionally joint systems divided into:
  • - certain- having a single solution. In certain systems, the rank of the matrix and the number of unknowns (or the number of columns, which is the same thing) are equal;
  • - undefined - with an infinite number of solutions. The rank of matrices in such systems is less than the number of unknowns.
  • Incompatible. U In such systems, the ranks of the main and extended matrices do not coincide. Incompatible systems have no solution.

The Gauss method is good because during the solution it allows one to obtain either an unambiguous proof of the inconsistency of the system (without calculating the determinants of large matrices), or a solution in general form for a system with an infinite number of solutions.

Elementary transformations

Before proceeding directly to solving the system, you can make it less cumbersome and more convenient for calculations. This is achieved through elementary transformations - such that their implementation does not change the final answer in any way. It should be noted that some of the given elementary transformations are valid only for matrices, the source of which was the SLAE. Here is a list of these transformations:

  1. Rearranging lines. Obviously, if you change the order of the equations in the system record, this will not affect the solution in any way. Consequently, rows in the matrix of this system can also be swapped, not forgetting, of course, the column of free terms.
  2. Multiplying all elements of a string by a certain coefficient. Very helpful! It can be used to shorten big numbers in the matrix or remove zeros. Many decisions, as usual, will not change, but further operations will become more convenient. The main thing is that the coefficient is not equal to zero.
  3. Removing rows with proportional factors. This partly follows from the previous paragraph. If two or more rows in a matrix have proportional coefficients, then when one of the rows is multiplied/divided by the proportionality coefficient, two (or, again, more) absolutely identical rows are obtained, and the extra ones can be removed, leaving only one.
  4. Removing a null line. If, during the transformation, a row is obtained somewhere in which all elements, including the free term, are zero, then such a row can be called zero and thrown out of the matrix.
  5. Adding to the elements of one row the elements of another (in the corresponding columns), multiplied by a certain coefficient. The most unobvious and most important transformation of all. It is worth dwelling on it in more detail.

Adding a string multiplied by a factor

For ease of understanding, it is worth breaking down this process step by step. Two rows are taken from the matrix:

a 11 a 12 ... a 1n | b1

a 21 a 22 ... a 2n | b 2

Let's say you need to add the first to the second, multiplied by the coefficient "-2".

a" 21 = a 21 + -2×a 11

a" 22 = a 22 + -2×a 12

a" 2n = a 2n + -2×a 1n

Then the second row in the matrix is ​​replaced with a new one, and the first remains unchanged.

a 11 a 12 ... a 1n | b1

a" 21 a" 22 ... a" 2n | b 2

It should be noted that the multiplication coefficient can be selected in such a way that, as a result of adding two rows, one of the elements of the new row is equal to zero. Therefore, it is possible to obtain an equation in a system where there will be one less unknown. And if you get two such equations, then the operation can be done again and get an equation that will contain two fewer unknowns. And if each time you turn one coefficient of all rows that are below the original one to zero, then you can, like stairs, go down to the very bottom of the matrix and get an equation with one unknown. This is called solving the system using the Gaussian method.

In general

Let there be a system. It has m equations and n unknown roots. You can write it as follows:

The main matrix is ​​compiled from the system coefficients. A column of free terms is added to the extended matrix and, for convenience, separated by a line.

  • the first row of the matrix is ​​multiplied by the coefficient k = (-a 21 /a 11);
  • the first modified row and the second row of the matrix are added;
  • instead of the second row, the result of the addition from the previous paragraph is inserted into the matrix;
  • now the first coefficient in new second line is a 11 × (-a 21 /a 11) + a 21 = -a 21 + a 21 = 0.

Now the same series of transformations is performed, only the first and third rows are involved. Accordingly, at each step of the algorithm, element a 21 is replaced by a 31. Then everything is repeated for a 41, ... a m1. The result is a matrix where the first element in the rows is zero. Now you need to forget about line number one and perform the same algorithm, starting from line two:

  • coefficient k = (-a 32 /a 22);
  • the second modified line is added to the “current” line;
  • the result of the addition is substituted into the third, fourth, and so on lines, while the first and second remain unchanged;
  • in the rows of the matrix the first two elements are already equal to zero.

The algorithm must be repeated until the coefficient k = (-a m,m-1 /a mm) appears. This means that the last time the algorithm was executed was only for the lower equation. Now the matrix looks like a triangle, or has a stepped shape. In the bottom line there is the equality a mn × x n = b m. The coefficient and free term are known, and the root is expressed through them: x n = b m /a mn. The resulting root is substituted into the top line to find x n-1 = (b m-1 - a m-1,n ×(b m /a mn))÷a m-1,n-1. And so on by analogy: in each next line there is new root, and, having reached the “top” of the system, one can find many solutions. It will be the only one.

When there are no solutions

If in one of matrix rows all elements except the free term are equal to zero, then the equation corresponding to this line looks like 0 = b. It has no solution. And since such an equation is included in the system, then the set of solutions of the entire system is empty, that is, it is degenerate.

When there are an infinite number of solutions

It may happen that in the given triangular matrix there are no rows with one coefficient element of the equation and one free term. There are only lines that, when rewritten, would look like an equation with two or more variables. This means that the system has an infinite number of solutions. In this case, the answer can be given in the form of a general solution. How to do it?

All variables in the matrix are divided into basic and free. Basic ones are those that stand “on the edge” of the lines in step matrix. The rest are free. In the general solution, the basic variables are written through free ones.

For convenience, the matrix is ​​first rewritten back into a system of equations. Then in the last of them, where exactly there is only one basic variable left, it remains on one side, and everything else is transferred to the other. This is done for every equation with one basic variable. Then, in the remaining equations, where possible, the expression obtained for it is substituted instead of the basic variable. If the result is again an expression containing only one basic variable, it is again expressed from there, and so on, until each basic variable is written as an expression with free variables. That's what it is common decision SLAU.

You can also find the basic solution of the system - give the free variables any values, and then for this specific case calculate the values ​​of the basic variables. There are an infinite number of particular solutions that can be given.

Solution with specific examples

Here is a system of equations.

For convenience, it is better to immediately create its matrix

It is known that when solved by the Gaussian method, the equation corresponding to the first row will remain unchanged at the end of the transformations. Therefore, it will be more profitable if the upper left element of the matrix is ​​the smallest - then the first elements of the remaining rows after the operations will turn to zero. This means that in the compiled matrix it will be advantageous to put the second row in place of the first one.

second line: k = (-a 21 /a 11) = (-3/1) = -3

a" 21 = a 21 + k×a 11 = 3 + (-3)×1 = 0

a" 22 = a 22 + k×a 12 = -1 + (-3)×2 = -7

a" 23 = a 23 + k×a 13 = 1 + (-3)×4 = -11

b" 2 = b 2 + k×b 1 = 12 + (-3)×12 = -24

third line: k = (-a 3 1 /a 11) = (-5/1) = -5

a" 3 1 = a 3 1 + k×a 11 = 5 + (-5)×1 = 0

a" 3 2 = a 3 2 + k×a 12 = 1 + (-5)×2 = -9

a" 3 3 = a 33 + k×a 13 = 2 + (-5)×4 = -18

b" 3 = b 3 + k×b 1 = 3 + (-5)×12 = -57

Now, in order not to get confused, you need to write the matrix with intermediate results transformations.

Obviously, such a matrix can be made more convenient for perception using certain operations. For example, you can remove all “minuses” from the second line by multiplying each element by “-1”.

It is also worth noting that in the third line all elements are multiples of three. Then you can shorten the line by this number, multiplying each element by "-1/3" (minus - at the same time, to remove negative values).

Looks much nicer. Now we need to leave the first line alone and work with the second and third. The task is to add the second line to the third line, multiplied by such a coefficient that the element a 32 becomes equal to zero.

k = (-a 32 /a 22) = (-3/7) = -3/7 (if during some transformations the answer does not turn out to be an integer, it is recommended to maintain the accuracy of the calculations to leave it “as is”, in the form of an ordinary fractions, and only then, when the answers are received, decide whether to round and convert to another form of recording)

a" 32 = a 32 + k×a 22 = 3 + (-3/7)×7 = 3 + (-3) = 0

a" 33 = a 33 + k×a 23 = 6 + (-3/7)×11 = -9/7

b" 3 = b 3 + k×b 2 = 19 + (-3/7)×24 = -61/7

The matrix is ​​written again with new values.

1 2 4 12
0 7 11 24
0 0 -9/7 -61/7

As you can see, the resulting matrix already has a stepped form. Therefore, further transformations of the system using the Gaussian method are not required. What can be done here is to remove from the third line overall coefficient "-1/7".

Now everything is beautiful. All that’s left to do is write the matrix again in the form of a system of equations and calculate the roots

x + 2y + 4z = 12 (1)

7y + 11z = 24 (2)

The algorithm by which the roots will now be found is called the reverse move in the Gaussian method. Equation (3) contains the z value:

y = (24 - 11×(61/9))/7 = -65/9

And the first equation allows us to find x:

x = (12 - 4z - 2y)/1 = 12 - 4×(61/9) - 2×(-65/9) = -6/9 = -2/3

We have the right to call such a system joint, and even definite, that is, having a unique solution. The answer is written in the following form:

x 1 = -2/3, y = -65/9, z = 61/9.

An example of an uncertain system

Solution option a certain system analyzed by the Gaussian method, now it is necessary to consider the case if the system is uncertain, that is, infinitely many solutions can be found for it.

x 1 + x 2 + x 3 + x 4 + x 5 = 7 (1)

3x 1 + 2x 2 + x 3 + x 4 - 3x 5 = -2 (2)

x 2 + 2x 3 + 2x 4 + 6x 5 = 23 (3)

5x 1 + 4x 2 + 3x 3 + 3x 4 - x 5 = 12 (4)

The very appearance of the system is already alarming, because the number of unknowns is n = 5, and the rank of the system matrix is ​​already exactly less than this number, because the number of rows is m = 4, that is highest order the squared determinant is 4. This means that there are solutions infinite set, and we need to look for its general appearance. The Gauss method for linear equations allows you to do this.

First, as usual, an extended matrix is ​​compiled.

Second line: coefficient k = (-a 21 /a 11) = -3. In the third line, the first element is before the transformations, so you don’t need to touch anything, you need to leave it as is. Fourth line: k = (-a 4 1 /a 11) = -5

By multiplying the elements of the first row by each of their coefficients in turn and adding them to the required rows, we obtain the matrix the following type:

As you can see, the second, third and fourth rows consist of elements proportional to each other. The second and fourth are generally identical, so one of them can be removed immediately, and the remaining one can be multiplied by the coefficient “-1” and get line number 3. And again, out of two identical lines, leave one.

The result is a matrix like this. While the system has not yet been written down, it is necessary to determine the basic variables here - those standing at the coefficients a 11 = 1 and a 22 = 1, and free ones - all the rest.

In the second equation there is only one basic variable - x 2. This means that it can be expressed from there by writing it through the variables x 3 , x 4 , x 5 , which are free.

We substitute the resulting expression into the first equation.

The result is an equation in which the only basic variable is x 1 . Let's do the same with it as with x 2.

All basic variables, of which there are two, are expressed in terms of three free ones; now we can write the answer in general form.

You can also specify one of the particular solutions of the system. For such cases, zeros are usually chosen as values ​​for free variables. Then the answer will be:

16, 23, 0, 0, 0.

An example of a non-cooperative system

Solving incompatible systems of equations using the Gauss method is the fastest. It ends immediately as soon as at one of the stages an equation is obtained that has no solution. That is, the stage of calculating the roots, which is quite long and tedious, is eliminated. The following system is considered:

x + y - z = 0 (1)

2x - y - z = -2 (2)

4x + y - 3z = 5 (3)

As usual, the matrix is ​​compiled:

1 1 -1 0
2 -1 -1 -2
4 1 -3 5

And it is reduced to a stepwise form:

k 1 = -2k 2 = -4

1 1 -1 0
0 -3 1 -2
0 0 0 7

After the first transformation, the third line contains an equation of the form

without a solution. Consequently, the system is inconsistent, and the answer will be the empty set.

Advantages and disadvantages of the method

If you choose which method to solve SLAEs on paper with a pen, then the method that was discussed in this article looks the most attractive. IN elementary transformations it is much more difficult to get confused than if you have to manually look for a determinant or some tricky inverse matrix. However, if you use programs to work with this type of data, for example, spreadsheets, then it turns out that such programs already contain algorithms for calculating the main parameters of matrices - determinant, minors, inverse, and so on. And if you are sure that the machine will calculate these values ​​​​itself and will not make a mistake, it is more advisable to use matrix method or Cramer's formulas, because their application begins and ends with the calculation of determinants and inverse matrices.

Application

Since the Gaussian solution is an algorithm, and the matrix is ​​actually a two-dimensional array, it can be used in programming. But since the article positions itself as a guide “for dummies,” it should be said that the easiest place to put the method into is spreadsheets, for example, Excel. Again, any SLAE entered into a table in the form of a matrix will be considered by Excel as a two-dimensional array. And for operations with them there are many nice commands: addition (you can only add matrices of the same size!), multiplication by a number, multiplication of matrices (also with certain restrictions), finding the inverse and transposed matrices and, most importantly, calculating the determinant. If this time-consuming task is replaced by a single command, it is possible to determine the rank of the matrix much more quickly and, therefore, establish its compatibility or incompatibility.

The online calculator finds a solution to a system of linear equations (SLE) using the Gaussian method. Given detailed solution. To calculate, select the number of variables and the number of equations. Then enter the data into the cells and click on the "Calculate" button.

x 1

+x 2

+x 3

x 1

+x 2

+x 3

x 1

+x 2

+x 3

=

=

=

Number representation:

Integers and/or Common fractions
Whole Numbers and/or Decimals

Number of places after decimal separator

×

Warning

Clear all cells?

Close Clear

Data entry instructions. Numbers are entered as integers (examples: 487, 5, -7623, etc.), decimals (ex. 67., 102.54, etc.) or fractions. The fraction must be entered in the form a/b, where a and b (b>0) are integers or decimal numbers. Examples 45/5, 6.6/76.4, -7/6.7, etc.

Gauss method

The Gauss method is a method of transition from the original system of linear equations (using equivalent transformations) to a system that is easier to solve than the original system.

Equivalent transformations of a system of linear equations are:

  • swapping two equations in the system,
  • multiplying any equation in the system by a nonzero real number,
  • adding to one equation another equation multiplied by an arbitrary number.

Consider a system of linear equations:

(1)

Let us write system (1) in matrix form:

Ax=b (2)
(3)

A- called the coefficient matrix of the system, bright part restrictions, x− vector of variables to be found. Let rank( A)=p.

Equivalent transformations do not change the rank of the coefficient matrix and the rank of the extended matrix of the system. The set of solutions of the system also does not change when equivalent transformations. The essence of the Gauss method is to reduce the matrix of coefficients A to diagonal or stepped.

Let's build an extended matrix of the system:

At the next stage, we reset all elements of column 2, below the element. If this element is zero, then this row is swapped with the row lying below this row and having a non-zero element in the second column. Next, reset all elements of column 2 below the leading element a 22. To do this, add lines 3, ... m with string 2 multiplied by − a 32 /a 22 , ..., −a m2/ a 22, respectively. Continuing the procedure, we obtain a matrix of diagonal or stepped type. Let the resulting extended matrix have the form:

(7)

Because rangA=rang(A|b), then the set of solutions (7) is ( n−p)− variety. Hence n−p the unknowns can be chosen arbitrarily. The remaining unknowns from system (7) are calculated as follows. From the last equation we express x p through the remaining variables and insert into the previous expressions. Next, from the penultimate equation we express x p−1 through the remaining variables and insert into the previous expressions, etc. Consider the Gaussian method on specific examples.

Examples of solving a system of linear equations using the Gauss method

Example 1. Find a general solution to a system of linear equations using the Gauss method:

Let us denote by a ij elements i-th line and j th column.

Let's exclude the elements of the 1st column of the matrix below the element a eleven . To do this, add lines 2,3 with line 1, multiplied by -2/3,-1/2, respectively:

We divide each row of the matrix by the corresponding leading element (if the leading element exists):

Substituting the upper expressions into the lower ones, we obtain the solution.

Since the beginning of the 16th-18th centuries, mathematicians have intensively begun to study functions, thanks to which so much in our lives has changed. Computer technology without this knowledge it simply would not exist. For solutions complex tasks, linear equations and functions were created various concepts, theorems and solution techniques. One of such universal and rational methods and techniques for solving linear equations and their systems was the Gauss method. Matrices, their rank, determinant - everything can be calculated without using complex operations.

What is SLAU

In mathematics there is the concept of SLAE - a system of linear algebraic equations. What is she like? This is a set of m equations with the required n unknown quantities, usually denoted as x, y, z, or x 1, x 2 ... x n, or other symbols. Solve by Gaussian method this system- means to find all the unknown unknowns. If the system has same number unknowns and equations, then it is called an nth order system.

The most popular methods for solving SLAEs

IN educational institutions Secondary education students study various methods for solving such systems. Most often this simple equations, consisting of two unknowns, so any existing method It won’t take much time to find the answer to them. This can be like a substitution method, when another is derived from one equation and substituted into the original one. Or the method of term-by-term subtraction and addition. But the Gauss method is considered the easiest and most universal. It makes it possible to solve equations with any number of unknowns. Why is this particular technique considered rational? It's simple. Matrix method The good thing is that there is no need to rewrite unnecessary symbols several times in the form of unknowns; it is enough to perform arithmetic operations on the coefficients - and you will get a reliable result.

Where are SLAEs used in practice?

The solution to SLAEs are the points of intersection of lines on the graphs of functions. In our high-tech computer age, people who are closely associated with the development of games and other programs need to know how to solve such systems, what they represent and how to check the correctness of the resulting result. Most often, programmers develop special linear algebra calculator programs, which also includes a system of linear equations. The Gauss method allows you to calculate all existing solutions. Other simplified formulas and techniques are also used.

SLAU compatibility criterion

Such a system can only be solved if it is compatible. For clarity, let us represent the SLAE in the form Ax=b. It has a solution if rang(A) equals rang(A,b). In this case, (A,b) is an extended form matrix that can be obtained from matrix A by rewriting it with free terms. It turns out that solving linear equations using the Gaussian method is quite easy.

Perhaps some of the symbols are not entirely clear, so it is necessary to consider everything with an example. Let's say there is a system: x+y=1; 2x-3y=6. It consists of only two equations, in which there are 2 unknowns. The system will have a solution only if the rank of its matrix is ​​equal to the rank of the extended matrix. What is rank? This is the number of independent lines of the system. In our case, the rank of the matrix is ​​2. Matrix A will consist of coefficients located near the unknowns, and the coefficients located behind the “=” sign also fit into the extended matrix.

Why can SLAEs be represented in matrix form?

Based on the compatibility criterion according to the proven Kronecker-Capelli theorem, a system of linear algebraic equations can be represented in matrix form. Using the Gaussian cascade method, you can solve the matrix and get a single reliable answer for the entire system. If the rank of an ordinary matrix is ​​equal to the rank of its extended matrix, but is less than the number of unknowns, then the system has an infinite number of answers.

Matrix transformations

Before moving on to solving matrices, you need to know what actions can be performed on their elements. There are several elementary transformations:

  • Rewriting the system in matrix view and by solving it, you can multiply all elements of the series by the same coefficient.
  • In order to transform the matrix into canonical form, you can swap two parallel rows. The canonical form implies that all matrix elements that are located along the main diagonal become ones, and the remaining ones become zeros.
  • The corresponding elements of parallel rows of the matrix can be added to one another.

Jordan-Gauss method

The essence of solving systems of linear homogeneous and inhomogeneous equations The Gaussian method is to gradually eliminate the unknowns. Let's say we have a system of two equations in which there are two unknowns. To find them, you need to check the system for compatibility. The equation is solved very simply by the Gauss method. It is necessary to write down the coefficients located near each unknown in matrix form. To solve the system, you will need to write out the extended matrix. If one of the equations contains a smaller number of unknowns, then “0” must be put in place of the missing element. All known transformation methods are applied to the matrix: multiplication, division by a number, adding the corresponding elements of the series to each other, and others. It turns out that in each row it is necessary to leave one variable with the value “1”, the rest should be reduced to zero type. For a more precise understanding, it is necessary to consider the Gauss method with examples.

A simple example of solving a 2x2 system

To begin with, let's take a simple system of algebraic equations, in which there will be 2 unknowns.

Let's rewrite it into an extended matrix.

To solve this system of linear equations, only two operations are required. We need to bring the matrix to canonical form so that there are ones along the main diagonal. So, transferring from the matrix form back to the system, we get the equations: 1x+0y=b1 and 0x+1y=b2, where b1 and b2 are the resulting answers in the solution process.

  1. The first action when solving an extended matrix will be this: the first row must be multiplied by -7 and added corresponding elements to the second row in order to get rid of one unknown in the second equation.
  2. Since solving equations using the Gauss method involves reducing the matrix to canonical form, then it is necessary to perform the same operations with the first equation and remove the second variable. To do this, we subtract the second line from the first and get the required answer - the solution of the SLAE. Or, as shown in the figure, we multiply the second row by a factor of -1 and add the elements of the second row to the first row. It is the same.

As we can see, our system was solved by the Jordan-Gauss method. We rewrite it in the required form: x=-5, y=7.

An example of a 3x3 SLAE solution

Suppose we have a more complex system of linear equations. The Gauss method makes it possible to calculate the answer even for the most seemingly confusing system. Therefore, in order to delve deeper into the calculation methodology, you can move on to more complex example with three unknowns.

As in the previous example, we rewrite the system in the form of an extended matrix and begin to bring it to its canonical form.

To solve this system, you will need to perform much more actions than in the previous example.

  1. First you need to make the first column one unit element and the rest zeros. To do this, multiply the first equation by -1 and add the second equation to it. It is important to remember that we rewrite the first line in its original form, and the second in a modified form.
  2. Next, we remove this same first unknown from the third equation. To do this, multiply the elements of the first row by -2 and add them to the third row. Now the first and second lines are rewritten in their original form, and the third - with changes. As you can see from the result, we got the first one at the beginning of the main diagonal of the matrix and the remaining zeros. A few more steps, and the system of equations by the Gaussian method will be reliably solved.
  3. Now you need to perform operations on other elements of the rows. The third and fourth actions can be combined into one. We need to divide the second and third lines by -1 to get rid of the minus ones on the diagonal. We have already brought the third line to the required form.
  4. Next we bring the second line to canonical form. To do this, we multiply the elements of the third row by -3 and add them to the second row of the matrix. From the result it is clear that the second line is also reduced to the form we need. It remains to perform a few more operations and remove the coefficients of the unknowns from the first line.
  5. To make 0 from the second element of a row, you need to multiply the third row by -3 and add it to the first row.
  6. The next decisive step will be to add the necessary elements of the second row to the first row. This way we get the canonical form of the matrix, and, accordingly, the answer.

As you can see, solving equations using the Gauss method is quite simple.

An example of solving a 4x4 system of equations

Some more complex systems equations can be solved by the Gaussian method using computer programs. It is necessary to enter the coefficients for the unknowns into the existing empty cells, and the program itself will step by step calculate the required result, describing in detail each action.

Described below step-by-step instruction solutions to this example.

In the first step, free coefficients and numbers for unknowns are entered into empty cells. Thus, we get the same extended matrix that we write manually.

And all the necessary arithmetic operations are performed to bring the extended matrix to its canonical form. It is necessary to understand that the answer to a system of equations is not always integers. Sometimes the solution may be from fractional numbers.

Checking the correctness of the solution

The Jordan-Gauss method provides for checking the correctness of the result. In order to find out whether the coefficients are calculated correctly, you just need to substitute the result into the original system of equations. Left-hand side the equation must correspond to the right side behind the equal sign. If the answers do not match, then you need to recalculate the system or try to apply to it another method of solving SLAEs known to you, such as substitution or term-by-term subtraction and addition. After all, mathematics is a science that has great amount various techniques solutions. But remember: the result should always be the same, no matter what solution method you used.

Gauss method: the most common errors when solving SLAEs

When solving linear systems of equations, errors most often occur such as incorrect transfer of coefficients into matrix form. There are systems in which some unknowns are missing from one of the equations; then, when transferring data to an extended matrix, they can be lost. As a result, when solving this system, the result may not correspond to the actual one.

Another major mistake may be incorrectly writing out the final result. It is necessary to clearly understand that the first coefficient will correspond to the first unknown from the system, the second - to the second, and so on.

The Gauss method describes in detail the solution of linear equations. Thanks to it, it is easy to carry out the necessary operations and find the right result. Moreover, this universal remedy to find a reliable answer to equations of any complexity. Maybe that's why it is so often used when solving SLAEs.

Let the system be given, ∆≠0. (1)
Gauss method is a method of sequentially eliminating unknowns.

The essence of the Gauss method is to transform (1) to a system with a triangular matrix, from which the values ​​of all unknowns are then obtained sequentially (in reverse). Let's consider one of the computational schemes. This circuit is called a single division circuit. So let's look at this diagram. Let a 11 ≠0 (leading element) divide the first equation by a 11. We get
(2)
Using equation (2), it is easy to eliminate the unknowns x 1 from the remaining equations of the system (to do this, it is enough to subtract equation (2) from each equation, previously multiplied by the corresponding coefficient for x 1), that is, in the first step we obtain
.
In other words, at step 1, each element of subsequent rows, starting from the second, is equal to the difference between the original element and the product of its “projection” onto the first column and the first (transformed) row.
Following this, leaving the first equation alone, we perform a similar transformation over the remaining equations of the system obtained in the first step: we select from among them the equation with the leading element and, with its help, exclude x 2 from the remaining equations (step 2).
After n steps, instead of (1) we get equivalent system
(3)
Thus, at the first stage we obtain a triangular system (3). This stage is called forward stroke.
At the second stage (reverse), we find sequentially from (3) the values ​​x n, x n -1, ..., x 1.
Let us denote the resulting solution as x 0 . Then the difference ε=b-A x 0 called residual.
If ε=0, then the found solution x 0 is correct.

Calculations using the Gaussian method are performed in two stages:

  1. The first stage is called the forward method. At the first stage, the original system is converted to a triangular form.
  2. The second stage is called the reverse stroke. At the second stage, a triangular system equivalent to the original one is solved.
The coefficients a 11, a 22, ... are called leading elements.
At each step, the leading element was assumed to be nonzero. If this is not the case, then any other element can be used as a leading element, as if rearranging the equations of the system.

Purpose of the Gauss method

The Gauss method is designed for solving systems of linear equations. Refers to direct solution methods.

Types of Gaussian method

  1. Classical Gaussian method;
  2. Modifications of the Gauss method. One of the modifications of the Gaussian method is a scheme with the choice of the main element. A feature of the Gauss method with the choice of the main element is such a rearrangement of the equations so that at the kth step the leading element turns out to be the largest element in the kth column.
  3. Jordano-Gauss method;
The difference between the Jordano-Gauss method and the classical one Gauss method consists in applying the rectangle rule, when the direction of searching for a solution occurs along the main diagonal (transformation to identity matrix). In the Gauss method, the direction of searching for a solution occurs in columns (transformation to a system with triangular matrix).
Let's illustrate the difference Jordano-Gauss method from the Gaussian method with examples.

Example of a solution using the Gaussian method
Let's solve the system:

For ease of calculation, let's swap the lines:

Let's multiply the 2nd line by (2). Add the 3rd line to the 2nd

Multiply the 2nd line by (-1). Add the 2nd line to the 1st

From the 1st line we express x 3:
From the 2nd line we express x 2:
From the 3rd line we express x 1:

An example of a solution using the Jordano-Gauss method
Let us solve the same SLAE using the Jordano-Gauss method.

We will sequentially select the resolving element RE, which lies on the main diagonal of the matrix.
The resolution element is equal to (1).



NE = SE - (A*B)/RE
RE - resolving element (1), A and B - matrix elements forming a rectangle with elements STE and RE.
Let's present the calculation of each element in the form of a table:

x 1x 2x 3B
1 / 1 = 1 2 / 1 = 2 -2 / 1 = -2 1 / 1 = 1


The resolving element is equal to (3).
In place of the resolving element we get 1, and in the column itself we write zeros.
All other elements of the matrix, including elements of column B, are determined by the rectangle rule.
To do this, we select four numbers that are located at the vertices of the rectangle and always include the resolving element RE.
x 1x 2x 3B
0 / 3 = 0 3 / 3 = 1 1 / 3 = 0.33 4 / 3 = 1.33


The resolution element is (-4).
In place of the resolving element we get 1, and in the column itself we write zeros.
All other elements of the matrix, including elements of column B, are determined by the rectangle rule.
To do this, we select four numbers that are located at the vertices of the rectangle and always include the resolving element RE.
Let's present the calculation of each element in the form of a table:
x 1x 2x 3B
0 / -4 = 0 0 / -4 = 0 -4 / -4 = 1 -4 / -4 = 1


Answer: x 1 = 1, x 2 = 1, x 3 = 1

Implementation of the Gaussian method

The Gaussian method is implemented in many programming languages, in particular: Pascal, C++, php, Delphi, and there is also an online implementation of the Gaussian method.

Using the Gaussian Method

Application of the Gauss method in game theory

In game theory, when finding the maximin optimal strategy of a player, a system of equations is compiled, which is solved by the Gaussian method.

Application of the Gauss method in solving differential equations

To find a partial solution to a differential equation, first find derivatives of the appropriate degree for the written partial solution (y=f(A,B,C,D)), which are substituted into the original equation. Next to find variables A,B,C,D a system of equations is compiled and solved by the Gaussian method.

Application of the Jordano-Gauss method in linear programming

IN linear programming, in particular, in the simplex method, the rectangle rule, which uses the Jordano-Gauss method, is used to transform the simplex table at each iteration.