Gaussian sequence method. Reverse of the Gaussian method

Here you can solve the system for free linear equations Gauss method online large sizes in complex numbers with a very detailed solution. Our calculator can solve online both the usual definite and indefinite systems of linear equations using the Gaussian method, which has an infinite number of solutions. In this case, in the answer you will receive the dependence of some variables through other, free ones. You can also check the system of equations for consistency online using the Gaussian solution.

Matrix size: 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 X 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101

About the method

When solving a system of linear equations online method Gauss the following steps are performed.

  1. We write the extended matrix.
  2. In fact, the solution is divided into forward and backward steps of the Gaussian method. The direct approach of the Gaussian method is the reduction of a matrix to a stepwise form. The reverse of the Gaussian method is the reduction of a matrix to a special stepwise form. But in practice, it is more convenient to immediately zero out what is located both above and below the element in question. Our calculator uses exactly this approach.
  3. It is important to note that when solving using the Gaussian method, the presence in the matrix of at least one zero row with a NOT zero right side(column of free members) indicates the incompatibility of the system. Solution linear system in this case it does not exist.

To best understand how the Gaussian algorithm works online, enter any example, select "very detailed solution" and look up his solution online.

Let a system of linear algebraic equations, which needs to be solved (find such values ​​of the unknowns xi that turn each equation of the system into equality).

We know that a system of linear algebraic equations can:

1) Have no solutions (be non-joint).
2) Have infinitely many solutions.
3) Have a single solution.

As we remember, Cramer's rule and the matrix method are not suitable 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 will lead us to the answer! The algorithm of the method itself in all three cases works the same. If the Cramer and matrix methods require knowledge of determinants, then to apply the Gauss method you only need knowledge of arithmetic operations, which makes it accessible even to primary school students.

Augmented 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 troki matrices Can rearrange in some places.

2) if proportional (as a special case – identical) rows appear (or exist) in the matrix, then you should delete from the matrix all these rows except one.

3) if a zero row appears in the matrix during transformations, then it should also be delete.

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

5) to a 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 a system of linear algebraic equations to a “triangular” step form: the elements of the extended matrix located below the main diagonal are equal to zero (top-down move). For example, to this type:

To do this, perform the following steps:

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

2) Let's move on to the next equation. Let this be the second equation and the coefficient for x 2 equal to M. We proceed with all “lower” equations as described above. Thus, “under” the unknown x 2 there will be zeros in all equations.

3) Move on to the next equation and so on until one last unknown and the transformed free term remain.

  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 obtain one first solution - the unknown x n. To do this, we solve the elementary equation A * x n = B. In the example given above, x 3 = 4. We substitute the found value into the “upper” next equation and solve it with respect to the next unknown. For example, x 2 – 4 = 1, i.e. x 2 = 5. And so on until we find all the unknowns.

Example.

Let's solve the system of linear equations using the Gauss method, as some authors advise:

Let us write down the extended matrix of the system and, using elementary transformations, bring it to a stepwise form:

We look at the upper left “step”. We should have one there. The problem is that there are no units in the first column at all, so rearranging the rows will not solve anything. In such cases, the unit must be organized using an elementary transformation. This can usually be done in several ways. Let's do 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 added the first and second lines, while the second line did not change.

Now at the top left there is “minus one”, which suits us quite well. Anyone who wants to get +1 can perform an additional action: multiply the first line by –1 (change its sign).

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

Step 3 . The first line was multiplied by –1, in principle, this is for beauty. The sign of the third line was also changed and it was moved to second place, so that on the second “step” we had the required unit.

Step 4 . The third line was added to the second line, multiplied by 2.

Step 5 . The third line was divided by 3.

A sign that indicates an error in calculations (more rarely, 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 an error was made during elementary transformations.

Let’s do the reverse; in the design of examples, the system itself is often not rewritten, but the equations are “taken directly from the given matrix.” The reverse move, I remind you, works from the bottom up. IN in this example it turned out to be a gift:

x 3 = 1
x 2 = 3
x 1 + x 2 – x 3 = 1, therefore x 1 + 3 – 1 = 1, x 1 = –1

Answer:x 1 = –1, x 2 = 3, x 3 = 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

Multiplying 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

Subtracting the second from the third equation, we obtain a “stepped” extended matrix:

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

Thus, since the error accumulated during the calculations, we obtain x 3 = 0.96 or approximately 1.

x 2 = 3 and x 1 = –1.

By 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 coefficients for unknowns, because in practice (in economic and technical calculations) one has to deal with non-integer coefficients.

I wish you success! See you in class! Tutor Dmitry Aystrakhanov.

website, when copying material in full or in part, a link to the source is required.

Let a system of linear algebraic equations be given that needs to be solved (find such values ​​of the unknowns xi 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 non-joint).
2) Have infinitely many solutions.
3) Have a single solution.

As we remember, Cramer's rule and the matrix method are not suitable 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 will lead us to the answer! The method algorithm itself works the same in all three cases. If the Cramer and matrix methods require knowledge of determinants, then to apply the Gauss method you only need knowledge of arithmetic operations, which makes it accessible even to primary school students.

Augmented 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 troki matrices Can rearrange in some places.

2) if proportional (as a special case – identical) rows appear (or exist) in the matrix, then you should delete from the matrix all these rows except one.

3) if a zero row appears in the matrix during transformations, then it should also be delete.

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

5) to a 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 a system of linear algebraic equations to a “triangular” step form: the elements of the extended matrix located below the main diagonal are equal to zero (top-down move). For example, to this type:

To do this, perform the following steps:

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

2) Let's move on to the next equation. Let this be the second equation and the coefficient for x 2 equal to M. We proceed with all “lower” equations as described above. Thus, “under” the unknown x 2 there will be zeros in all equations.

3) Move on to the next equation and so on until one last unknown and the transformed free term remain.

  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 obtain one first solution - the unknown x n. To do this, we solve the elementary equation A * x n = B. In the example given above, x 3 = 4. We substitute the found value into the “upper” next equation and solve it with respect to the next unknown. For example, x 2 – 4 = 1, i.e. x 2 = 5. And so on until we find all the unknowns.

Example.

Let's solve the system of linear equations using the Gauss method, as some authors advise:

Let us write down the extended matrix of the system and, using elementary transformations, bring it to a stepwise form:

We look at the upper left “step”. We should have one there. The problem is that there are no units in the first column at all, so rearranging the rows will not solve anything. In such cases, the unit must be organized using an elementary transformation. This can usually be done in several ways. Let's do 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 added the first and second lines, while the second line did not change.

Now at the top left there is “minus one”, which suits us quite well. Anyone who wants to get +1 can perform an additional action: multiply the first line by –1 (change its sign).

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

Step 3 . The first line was multiplied by –1, in principle, this is for beauty. The sign of the third line was also changed and it was moved to second place, so that on the second “step” we had the required unit.

Step 4 . The third line was added to the second line, multiplied by 2.

Step 5 . The third line was divided by 3.

A sign that indicates an error in calculations (more rarely, 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 an error was made during elementary transformations.

Let’s do the reverse; in the design of examples, the system itself is often not rewritten, but the equations are “taken directly from the given matrix.” The reverse move, I remind you, works from the bottom up. In this example, the result was a gift:

x 3 = 1
x 2 = 3
x 1 + x 2 – x 3 = 1, therefore x 1 + 3 – 1 = 1, x 1 = –1

Answer:x 1 = –1, x 2 = 3, x 3 = 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

Multiplying 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

Subtracting the second from the third equation, we obtain a “stepped” extended matrix:

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

Thus, since the error accumulated during the calculations, we obtain x 3 = 0.96 or approximately 1.

x 2 = 3 and x 1 = –1.

By 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 coefficients for unknowns, because in practice (in economic and technical calculations) one has to deal with non-integer coefficients.

I wish you success! See you in class! Tutor.

blog.site, when copying material in full or in part, a link to the original source is required.

Solving systems of linear equations using 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 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 system equations to sequentially eliminate unknown variables is 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 inverse of the Gaussian 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.

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 of simultaneous execution of several equations with respect to several variables. A system of linear algebraic equations (hereinafter referred to as SLAE) containing m equations and n unknowns is called a system of the form:

where numbers a ij are called system coefficients, numbers b i are called free terms, a ij And b i(i=1,…, m; b=1,…, n) represent some known numbers, and x 1 ,…, x n– unknown. In the designation of coefficients a ij the first index i denotes the number of the equation, and the second j is the number of the unknown at which this coefficient stands. The numbers x n must be found. It is convenient to write such a system in a compact matrix form: AX=B. Here A is the matrix of system coefficients, called the main matrix;

– column vector of unknowns xj.
is a column vector of free terms 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 a system is the matrix A of the system, supplemented by a column of free terms

1.2 Solving a system of linear algebraic equations

The solution to 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.

A solution to a system is n values ​​of the unknowns x1=c1, x2=c2,…, xn=cn, upon substitution of which all equations of the system become true equalities. Any solution to the system can be written as a column matrix

A system of equations is called consistent if it has at least one solution, and inconsistent if it does not have any solution.

A consistent system is said to be determinate if it has a single 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.

Solving a system means finding out whether it is compatible or inconsistent. If the system is consistent, 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 of one of them is a solution of the other, and vice versa.

Transformation, the application of which turns the system into new system, equivalent to the original one, is called an equivalent or equivalent transformation. Examples of equivalent transformations include the following transformations: interchanging two equations of a system, interchanging two unknowns along with the coefficients of all equations, multiplying both sides of any equation of a system by a nonzero number.

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

A homogeneous system is always consistent, since x1=x2=x3=…=xn=0 is a solution of the system. This solution is called zero 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 sequential elimination of unknowns - Gaussian method(it is also called the Gaussian elimination method). This is a method of sequential elimination of variables, when, using elementary transformations, a system of equations is reduced to an equivalent system of a step (or triangular) form, from which all other variables are found sequentially, starting with the last (by number) variables.

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

1. Direct stroke.

At the first stage, the so-called direct move is carried out, when, through elementary transformations over the rows, the system is brought to a stepwise or triangular shape, or establish that the system is incompatible. Namely, among the elements of the first column of the matrix, select a non-zero one, move it to the uppermost position by rearranging the rows, and subtract the resulting first row from the remaining rows after the rearrangement, 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 these transformations have been completed, the first row and first column are mentally crossed out and continued until a zero-size matrix remains. If at any iteration there is no non-zero element among the elements of the first column, then go to the next column and perform a similar operation.

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

The system below has a stepwise form:

,

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).

Let's transform the system by eliminating the unknown x1 in all equations except the first (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 subtract term by term by the first, multiplied by ). Then we multiply both sides of the first equation by and add them to the third equation of the system (or from the third we subtract the first one multiplied by ). Thus, we sequentially multiply the first line by a number and add to i th line, for i= 2, 3, …,n.

Continuing this process, we obtain an equivalent system:


– new values ​​of 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 lying under the first leading element a 11 are destroyed

0, in the second step the elements lying under the second leading element a 22 (1) are destroyed (if a 22 (1) 0), etc. Continuing this process further, we finally, at the (m-1) step, reduce the original system to a triangular system.

If, in the process of reducing the system to a stepwise form, zero equations appear, i.e. equalities of the form 0=0, they are discarded. If an equation of the form appears

then this indicates the incompatibility of the system.

This is where the direct progression of Gauss's method ends.

2. Reverse stroke.

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 build a fundamental system of solutions, or, if all the variables are basic, then express numerically the only solution to 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 basis variable, so at every step except 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 the elementary transformations on its rows. It is convenient for the coefficient a11 to be equal to 1 (rearrange the equations, or divide both sides of the equation by a11).

2.2 Examples of solving SLAEs using the Gaussian method

In this section, using three different examples, we will show how the Gaussian method can solve SLAEs.

Example 1. Solve a 3rd order SLAE.

Let's reset the coefficients at

in the second and third lines. To do this, multiply them by 2/3 and 1, respectively, and add them to the first line:

Views