Information support for schoolchildren and students
Site search

Solution of equations with five unknowns by the Gauss method. Gauss method: description of the algorithm for solving a system of linear equations, examples, solutions. Application of the Gauss method in game theory

Today we deal with the Gauss method for solving systems of linear algebraic equations. You can read about what these systems are in the previous article devoted to solving the same SLAE by the Cramer method. The Gauss method does not require any specific knowledge, only care and consistency are needed. Despite the fact that, from the point of view of mathematics, it will be enough for its application school preparation students often find it difficult to master this method. In this article, we will try to reduce them to nothing!

Gauss method

M Gauss method is the most universal method for solving SLAE (with the exception of very large systems). In contrast to the previously discussed Cramer's method, it is suitable not only for systems that have a unique solution, but also for systems that have an infinite number of solutions. There are three options here.

  1. The system has a unique solution (the determinant of the main matrix of the system is not equal to zero);
  2. The system has an infinite number of solutions;
  3. There are no solutions, the system is inconsistent.

So, we have a system (let it have one solution), and we are going to solve it using the Gaussian method. How it works?

The Gaussian method consists of two stages - direct and inverse.

Direct Gauss method

First, we write the augmented matrix of the system. To do this, we add a column of free members to the main matrix.

The whole essence of the Gaussian method is to reduce this matrix to a stepped (or, as they say, triangular) form by means of elementary transformations. In this form, there should be only zeros under (or above) the main diagonal of the matrix.

What can be done:

  1. You can rearrange the rows of the matrix;
  2. If there are identical (or proportional) rows in the matrix, you can delete all but one of them;
  3. You can multiply or divide a string by any number (except zero);
  4. Zero lines are removed;
  5. You can add a string multiplied by a non-zero number to a string.

Reverse Gauss method

After we transform the system in this way, one unknown xn becomes known, and it is possible to find all the remaining unknowns in reverse order, substituting the already known x's into the equations of the system, up to the first.

When the Internet is always at hand, you can solve the system of equations using the Gauss method online . All you have to do is enter the odds into the online calculator. But you must admit, it is much more pleasant to realize that the example was not solved computer program but with your own brain.

An example of solving a system of equations using the Gauss method

And now - an example, so that everything becomes clear and understandable. Let the system linear equations, and you need to solve it using the Gauss method:

First, let's write the augmented matrix:

Now let's take a look at the transformations. Remember that we need to achieve a triangular form of the matrix. Multiply the 1st row by (3). Multiply the 2nd row by (-1). Let's add the 2nd row to the 1st and get:

Then multiply the 3rd row by (-1). Let's add the 3rd line to the 2nd:

Multiply the 1st row by (6). Multiply the 2nd row by (13). Let's add the 2nd line to the 1st:

Voila - the system is brought to the appropriate form. It remains to find the unknowns:

System in this example has a unique solution. We will consider the solution of systems with an infinite set of solutions in a separate article. Perhaps at first you will not know where to start with matrix transformations, but after proper practice you will get your hands on it and will click the Gaussian SLAE like nuts. And if you suddenly come across a SLAU, which turns out to be too tough a nut to crack, contact our authors! You can order an inexpensive essay by leaving a request in the Correspondence Book. Together we will solve any problem!

Solving systems of linear equations by the 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 in the successive exclusion of unknown variables: first, the x 1 from all equations of the system, starting from the second, then x2 of all equations, starting with the third, and so on, until only the unknown variable remains in the last equation x n. Such a process of transforming the equations of the system for the successive elimination of unknown variables is called direct Gauss method. After the completion of the forward move of the Gauss method, from the last equation we find x n, using this value from the penultimate equation is calculated xn-1, and so on, from the first equation is found x 1. The process of calculating unknown variables when moving from the last equation of the system to the first is called 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, add the first equation multiplied by to the second equation of the system, add the first multiplied by to the third equation, and so on, to n-th add the first equation, multiplied by . The system of equations after such transformations will take the form

where , a .

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 with the second.

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

where , a . So the variable x2 excluded from all equations, starting with the third.

So we continue the direct course of the Gauss method until the system takes the form

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


Example.

Solve a system of linear equations using the Gaussian method. .

Answer:

x 1 = 4, x 2 = 0, x 3 = -1.

1. System of linear algebraic equations

1.1 The concept of a system of linear algebraic equations

A system of equations is a condition consisting in the simultaneous execution of several equations in several variables. A system of linear algebraic equations (hereinafter referred to as SLAE) containing m equations and n unknowns is a system of the form:

where the numbers a ij are called the coefficients of the system, the numbers b i are free members, aij and b i(i=1,…, m; b=1,…, n) are some known numbers, and x 1 ,…, x n- unknown. In the notation of the coefficients aij the first index i denotes the number of the equation, and the second index j is the number of the unknown at which this coefficient stands. Subject to finding the number x n . It is convenient to write such a system in a compact matrix form: AX=B. Here A is the matrix of coefficients of the system, called the main matrix;

is a column vector of unknown xj.
is a column vector of free members bi.

The product of matrices A * X is defined, since there are as many columns in matrix A as there are rows in matrix X (n pieces).

The extended matrix of the system is the matrix A of the system, supplemented by a column of free members

1.2 Solution of a system of linear algebraic equations

The solution of a system of equations is an ordered set of numbers (values ​​of variables), when substituting them instead of variables, each of the equations of the system turns into a true equality.

The solution of the system is n values ​​of the unknowns x1=c1, x2=c2,…, xn=cn, substituting which all equations of the system turn into true equalities. Any solution of the system can be written as a matrix-column

A system of equations is called consistent if it has at least one solution, and inconsistent if it has no solutions.

A joint system is called definite if it has a unique solution, and indefinite if it has more than one solution. In the latter case, each of its solutions is called a particular solution of the system. The set of all particular solutions is called the general solution.

To solve a system means to find out whether it is consistent or inconsistent. If the system is compatible, find it common decision.

Two systems are called equivalent (equivalent) if they have the same general solution. In other words, systems are equivalent if every solution to one of them is a solution to the other, and vice versa.

A transformation, the application of which turns the system into new system, equivalent to the original one, is called an equivalent or equivalent transformation. The following transformations can serve as examples of equivalent transformations: swapping two equations of the system, swapping two unknowns together with the coefficients of all equations, multiplying both parts of any equation of the system by a non-zero number.

A system of linear equations is called homogeneous if all free terms are equal to zero:

homogeneous system is always compatible, since x1=x2=x3=…=xn=0 is the solution of the system. This solution is called null or trivial.

2. Gaussian elimination method

2.1 The essence of the Gaussian elimination method

The classical method for solving systems of linear algebraic equations is the method of successive elimination of unknowns - Gauss method(It is also called the Gaussian elimination method). This is a method of successive elimination of variables, when, with the help of elementary transformations, a system of equations is reduced to an equivalent system of a stepped (or triangular) form, from which all other variables are found sequentially, starting from the last (by number) variables.

The Gaussian solution process consists of two stages: forward and backward moves.

1. Direct move.

At the first stage, the so-called direct move is carried out, when, by means of elementary transformations over rows, the system is brought to a stepped or triangular form, or it is established that the system is inconsistent. Namely, among the elements of the first column of the matrix, a non-zero one is chosen, it is moved to the uppermost position by permuting the rows, and the first row obtained after the permutation is subtracted from the remaining rows, multiplying it by a value equal to the ratio of the first element of each of these rows to the first element of the first row, zeroing thus the column below it.

After the indicated transformations have been made, the first row and the first column are mentally crossed out and continue until a zero-size matrix remains. If at some of the iterations among the elements of the first column there was not found a non-zero one, then go to the next column and perform a similar operation.

At the first stage (forward run), the system is reduced to a stepped (in particular, triangular) form.

The system below is stepwise:

,

The coefficients aii are called the main (leading) elements of the system.

(if a11=0, rearrange the rows of the matrix so that a 11 was not equal to 0. This is always possible, because otherwise the matrix contains a zero column, its determinant is equal to zero and the system is inconsistent).

We transform the system by eliminating the unknown x1 in all equations except the first one (using elementary transformations of the system). To do this, multiply both sides of the first equation by

and add term by term with the second equation of the system (or from the second equation we subtract term by term the first multiplied by ). Then we multiply both parts of the first equation by and add it to the third equation of the system (or subtract the first one multiplied by the third term by term). Thus, we successively multiply the first row by a number and add to i-th line, for i= 2, 3, …,n.

Continuing this process, we get the equivalent system:


– new values ​​of the coefficients for unknowns and free terms in the last m-1 equations of the system, which are determined by the formulas:

Thus, at the first step, all coefficients under the first leading element a are destroyed. equalities of the form 0=0, they are discarded. If there is an equation of the form

This indicates the incompatibility of the system.

This completes the direct course of the Gauss method.

2. Reverse move.

At the second stage, the so-called reverse move is carried out, the essence of which is to express all the resulting basic variables in terms of non-basic ones and construct fundamental system solutions, or, if all variables are basic, then express in numerical form the only solution of the system of linear equations.

This procedure begins with the last equation, from which the corresponding basic variable is expressed (there is only one in it) and substituted into the previous equations, and so on, going up the "steps".

Each line corresponds to exactly one basic variable, so at each step, except for the last (topmost), the situation exactly repeats the case of the last line.

Note: in practice, it is more convenient to work not with the system, but with its extended matrix, performing all elementary transformations on its rows. It is convenient that the coefficient a11 be equal to 1 (rearrange the equations, or divide both sides of the equation by a11).

2.2 Examples of solving SLAE by the Gauss method

In this section, using three different examples, we will show how the Gaussian method can be used to solve SLAE.

Example 1. Solve SLAE of the 3rd order.

Set the coefficients to zero at

In this article, the method is considered as a way to solve. The method is analytical, that is, it allows you to write a solution algorithm in a general form, 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 infinitely many solutions. Or they don't have it at all.

What does Gauss mean?

First you need to write down our system of equations in It looks like this. The system is taken:

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

Further, the main matrix with coefficients must be reduced to the upper triangular shape. This is the main point of solving the system by the Gauss method. Simply put, after certain manipulations, the matrix should look like this, so that there are only zeros in its lower left part:

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 description of the solution by the Gauss method in the most in general terms. And what happens if suddenly the system does not have a solution? Or are there an infinite number of them? To answer these and many more questions, it is necessary to consider separately all the elements used in the solution by the Gauss method.

Matrices, their properties

There is no hidden meaning in the matrix. It's just a convenient way to record data for later operations. Even schoolchildren should not be afraid of them.

The matrix is ​​always rectangular, because it is more convenient. Even in the Gauss method, where everything boils down to building a triangular matrix, a rectangle appears in the entry, only with zeros in the place where there are no numbers. Zeros can be omitted, but they are implied.

The matrix has a size. Its "width" is the number of rows (m), its "length" is the number of columns (n). Then the size of the matrix A (capital Latin letters are usually used for their designation) 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 the matrix A can be denoted by the number of its row and column: a xy ; x - row number, changes , y - column number, changes .

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

Determinant

The matrix also has a determinant. This is a very important feature. Finding out its meaning now is not worth it, 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 a rectangular matrix, you can do the following: choose the smallest of the number of rows and the number of columns (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 number other than zero, then it is called the basis minor of the original rectangular matrix.

Before proceeding with the solution of the system of equations by the Gauss method, it does not 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 there are 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 (remembering the basis minor, we can say that the rank of a matrix is ​​the order of the basis minor).

According to how things are with the rank, SLAE can be divided into:

  • Joint. At of joint systems, the rank of the main matrix (consisting only of coefficients) coincides with the rank of the extended one (with a column of free terms). Such systems have a solution, but not necessarily one, therefore, joint systems are additionally divided into:
  • - certain- having a unique 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;
  • - indefinite - with an infinite number of solutions. The rank of matrices for such systems is less than the number of unknowns.
  • Incompatible. At such systems, the ranks of the main and extended matrices do not coincide. Incompatible systems have no solution.

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

Elementary transformations

Before proceeding directly to the solution of the system, it is possible to 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 above elementary transformations are valid only for matrices, the source of which was precisely the SLAE. Here is a list of these transformations:

  1. String permutation. It is obvious that if we change the order of the equations in the system record, then this will not affect the solution in any way. Consequently, it is also possible to interchange rows in the matrix of this system, not forgetting, of course, about the column of free members.
  2. Multiplying all elements of a string by some factor. Very useful! It can be used to shorten big numbers in the matrix or remove zeros. The set of solutions, as usual, will not change, and it will become more convenient to perform further operations. The main thing is that the coefficient is not equal to zero.
  3. Delete rows with proportional coefficients. This partly follows from the previous paragraph. If two or more rows in the matrix have proportional coefficients, then when multiplying / dividing one of the rows by the proportionality coefficient, two (or, again, more) absolutely identical rows are obtained, and you can remove the extra ones, leaving only one.
  4. Removing the null line. If in the course of transformations a string is obtained somewhere in which all elements, including the free member, are zero, then such a string 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 obscure 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 disassembling 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

Suppose you need to add the first to the second, multiplied by the coefficient "-2".

a" 21 \u003d a 21 + -2 × a 11

a" 22 \u003d a 22 + -2 × a 12

a" 2n \u003d a 2n + -2 × a 1n

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

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

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

It should be noted that the multiplication factor can be chosen in such a way that, as a result of the addition of two strings, one of the elements of the new string is equal to zero. Therefore, it is possible to obtain an equation in the 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 already contain two less unknowns. And if each time we turn to zero one coefficient for all rows that are lower than the original one, then we can, like steps, 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 down like this:

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

  • 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 the new second row 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, in each step of the algorithm, the 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 equal to zero. Now we need to forget about line number one and execute the same algorithm starting from the second line:

  • coefficient k \u003d (-a 32 / a 22);
  • the second modified line is added to the "current" line;
  • the result of the addition is substituted in 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 in last time the algorithm was performed only for the lower equation. Now the matrix looks like a triangle, or has a stepped shape. The bottom line contains 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 row 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 a new root, and, having reached the "top" of the system, you can find many solutions. It will be the only one.

When there are no solutions

If in one of the matrix rows all elements, except for the free term, are equal to zero, then the equation corresponding to this row 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 turn out that in the reduced triangular matrix there are no rows with one element-the coefficient of the equation, and one - a free member. There are only strings 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 - these are those that stand "on the edge" of the rows in the stepped matrix. The rest are free. In the general solution, the basic variables are written in terms of the free ones.

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

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 infinitely many particular solutions.

Solution with specific examples

Here is the system of equations.

For convenience, it is better to immediately create its matrix

It is known that when solving by the Gauss 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 in place of the first row.

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

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

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

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

b "2 \u003d b 2 + k × b 1 \u003d 12 + (-3) × 12 \u003d -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 \u003d b 3 + k × b 1 \u003d 3 + (-5) × 12 \u003d -57

Now, in order not to get confused, it is necessary to write down the matrix with the intermediate results of the transformations.

It is obvious that such a matrix can be made more convenient for perception with the help of some 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 row all elements are multiples of three. Then you can reduce the string 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 alone the first line and work with the second and third. The task is to add the second row to the third row, multiplied by such a coefficient that the element a 32 becomes equal to zero.

k = (-a 32 / a 22) = (-3/7) = -3/7 common fraction, and only then, when the answers are received, decide whether to round up and translate into another form of record)

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

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

b "3 \u003d b 3 + k × b 2 \u003d 19 + (-3/7) × 24 \u003d -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 by the Gauss method are not required. What can be done here is to remove the overall coefficient "-1/7" from the third line.

Now everything is beautiful. The point is small - 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 Gauss method. Equation (3) contains the value of z:

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

And the first equation allows you to find x:

x = (12 - 4z - 2y)/1 = 12 - 4x(61/9) - 2x(-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 response is written in the following form:

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

An example of an indefinite system

Solution certain system has been analyzed by the Gaussian method, now it is necessary to consider the case if the system is indefinite, 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 matrix of the system is already exactly less than this number, because the number of rows is m = 4, that is greatest order determinant-square - 4. This means that there are an infinite number of solutions, and we must look for its general form. The Gauss method for linear equations makes it possible to do this.

First, as usual, the augmented 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 it is. Fourth line: k = (-a 4 1 /a 11) = -5

Multiplying the elements of the first row by each of their coefficients in turn and adding them to the desired rows, we get the matrix the following kind:

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

It turned out such a matrix. The system has not yet been written down, it is necessary here to determine the basic variables - standing at the coefficients a 11 \u003d 1 and a 22 \u003d 1, and free - all the rest.

The second equation has only one basic variable - x 2 . Hence, it can be expressed from there, writing through the variables x 3 , x 4 , x 5 , which are free.

We substitute the resulting expression into the first equation.

It turned out 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 you can write the answer in a general form.

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

16, 23, 0, 0, 0.

An example of an incompatible system

The solution of inconsistent systems of equations by the Gauss method is the fastest. It ends as soon as at one of the stages an equation is obtained that has no solution. That is, the stage with the calculation of the roots, which is quite long and dreary, disappears. 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 stepped form:

k 1 \u003d -2k 2 \u003d -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

having no solution. Therefore, the system is inconsistent, and the answer is the empty set.

Advantages and disadvantages of the method

If you choose which method to solve SLAE on paper with a pen, then the method that was considered in this article looks the most attractive. In elementary transformations, it is much more difficult to get confused than it happens if you have to manually look for the determinant or some tricky inverse matrix. However, if you use programs to work with data of this type, for example, spreadsheets, it turns out that such programs already contain algorithms for calculating the main parameters of matrices - the 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 expedient 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, in fact, 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 in is spreadsheets, for example, Excel. Again, any SLAE entered in 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, matrix multiplication (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 much faster to determine the rank of a matrix and, therefore, to establish its compatibility or inconsistency.

Let a system of linear algebraic equations be given, which must be solved (find such values ​​of the unknowns хi that turn each equation of the system into an equality).

We know that a system of linear algebraic equations can:

1) Have no solutions (be incompatible).
2) Have infinitely many solutions.
3) Have a unique solution.

As we remember, Cramer's rule and the matrix method are unsuitable in cases where the system has infinitely many solutions or is inconsistent. Gauss methodthe most powerful and versatile tool for finding solutions to any system of linear equations, which in every case lead us to the answer! The algorithm of the method in all three cases works the same way. If the Cramer and matrix methods require knowledge of determinants, then the application of the Gauss method requires knowledge of only arithmetic operations, which makes it accessible even to primary school students.

Extended matrix transformations ( this is the matrix of the system - a matrix composed only of the coefficients of the unknowns, plus a column of free terms) systems of linear algebraic equations in the Gauss method:

1) with troky matrices can rearrange places.

2) if there are (or are) proportional (as a special case - identical) rows in the matrix, then it follows delete from the matrix, all these rows except one.

3) if a zero row appeared in the matrix during the transformations, then it also follows delete.

4) the row of the matrix can multiply (divide) to any number other than zero.

5) to the row of the matrix, you can add another string multiplied by a number, different from zero.

In the Gauss method, elementary transformations do not change the solution of the system of equations.

The Gauss method consists of two stages:

  1. "Direct move" - ​​using elementary transformations, bring the extended matrix of the system of linear algebraic equations to a "triangular" stepped form: the elements of the extended matrix located below the main diagonal are equal to zero (top-down move). For example, to this kind:

To do this, perform the following steps:

1) Let us consider the first equation of a system of linear algebraic equations and the coefficient at x 1 is equal to K. The second, third, etc. we transform the equations as follows: we divide each equation (coefficients for unknowns, including free terms) by the coefficient for unknown x 1, which is in each equation, and multiply by K. After that, subtract the first from the second equation (coefficients for unknowns and free terms). We get at x 1 in the second equation the coefficient 0. From the third transformed equation we subtract the first equation, so until all equations, except the first, with unknown x 1 will not have a coefficient 0.

2) Move on to the next equation. Let this be the second equation and the coefficient at x 2 is equal to M. With all the "subordinate" equations, we proceed as described above. Thus, "under" the unknown x 2 in all equations will be zeros.

3) We pass to the next equation and so on until one last unknown and transformed free term remains.

  1. The "reverse move" of the Gauss method is to obtain a solution to a system of linear algebraic equations (the "bottom-up" move). From the last "lower" equation we get one first solution - the unknown x n. To do this, we solve the elementary equation A * x n \u003d B. In the example above, x 3 \u003d 4. We substitute the found value in the “upper” next equation and solve it with respect to the next unknown. For example, x 2 - 4 \u003d 1, i.e. x 2 \u003d 5. And so on until we find all the unknowns.

Example.

We solve the system of linear equations using the Gauss method, as some authors advise:

We write the extended matrix of the system and, using elementary transformations, bring it to a step form:

We look at the upper left "step". There we should have a unit. The problem is that there are no ones in the first column at all, so nothing can be solved by rearranging the rows. In such cases, the unit must be organized using elementary transformation. This can usually be done in several ways. Let's do it like this:
1 step . To the first line we add the second line, multiplied by -1. That is, we mentally multiplied the second line by -1 and performed the addition of the first and second lines, while the second line did not change.

Now at the top left "minus one", which suits us perfectly. Whoever wants to get +1 can perform an additional action: multiply the first line by -1 (change its sign).

2 step . The first line multiplied by 5 was added to the second line. The first line multiplied by 3 was added to the third line.

3 step . The first line was multiplied by -1, in principle, this is for beauty. The sign of the third line was also changed and moved to the second place, thus, on the second “step, we had the desired unit.

4 step . To the third line, add the second line, multiplied by 2.

5 step . The third line is divided by 3.

A sign that indicates an error in calculations (less often a typo) is a “bad” bottom line. That is, if we got something like (0 0 11 | 23) below, and, accordingly, 11x 3 = 23, x 3 = 23/11, then with a high degree of probability we can say that a mistake was made during elementary transformations.

We perform a reverse move, in the design of examples, the system itself is often not rewritten, and the equations are “taken directly from the given matrix”. The reverse move, I remind you, works "from the bottom up." In this example, the gift turned out:

x 3 = 1
x 2 = 3
x 1 + x 2 - x 3 \u003d 1, therefore x 1 + 3 - 1 \u003d 1, x 1 \u003d -1

Answer:x 1 \u003d -1, x 2 \u003d 3, x 3 \u003d 1.

Let's solve the same system using the proposed algorithm. We get

4 2 –1 1
5 3 –2 2
3 2 –3 0

Divide the second equation by 5 and the third by 3. We get:

4 2 –1 1
1 0.6 –0.4 0.4
1 0.66 –1 0

Multiply the second and third equations by 4, we get:

4 2 –1 1
4 2,4 –1.6 1.6
4 2.64 –4 0

Subtract the first equation from the second and third equations, we have:

4 2 –1 1
0 0.4 –0.6 0.6
0 0.64 –3 –1

Divide the third equation by 0.64:

4 2 –1 1
0 0.4 –0.6 0.6
0 1 –4.6875 –1.5625

Multiply the third equation by 0.4

4 2 –1 1
0 0.4 –0.6 0.6
0 0.4 –1.875 –0.625

Subtract the second equation from the third equation, we get the “stepped” augmented matrix:

4 2 –1 1
0 0.4 –0.6 0.6
0 0 –1.275 –1.225

Thus, since an error accumulated in the process of calculations, we get x 3 \u003d 0.96, or approximately 1.

x 2 \u003d 3 and x 1 \u003d -1.

Solving in this way, you will never get confused in the calculations and, despite the calculation errors, you will get the result.

This method of solving a system of linear algebraic equations is easily programmable and does not take into account the specific features of the coefficients for unknowns, because in practice (in economic and technical calculations) one has to deal with non-integer coefficients.

Wish you luck! See you in class! Tutor Dmitry Aistrakhanov.

site, with full or partial copying of the material, a link to the source is required.