Today we are looking at 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 SLAEs using the Cramer method. The Gauss method does not require any specific knowledge, you only need attentiveness and consistency. Despite the fact that, from a mathematical point of view, school training is sufficient to apply it, students often find it difficult to master this method. In this article we will try to reduce them to nothing!

Gauss method

M Gaussian method– the most universal method for solving SLAEs (with the exception of very large systems). Unlike what was discussed earlier, it is suitable not only for systems that have a single solution, but also for systems that have an infinite number of solutions. There are three possible 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 incompatible.

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 Gauss method consists of two stages - forward and inverse.

Direct stroke of the Gaussian method

First, let's write down the extended matrix of the system. To do this, add a column of free members to the main matrix.

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

What you can do:

  1. You can rearrange the rows of the matrix;
  2. If there are equal (or proportional) rows in a matrix, you can remove all but one of them;
  3. You can multiply or divide a string by any number (except zero);
  4. Null rows are removed;
  5. You can append a string multiplied by a number other than zero to a string.

Reverse Gaussian method

After we transform the system in this way, one unknown Xn becomes known, and you can 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 a system of equations using the Gaussian method online. You just need to enter the coefficients into the online calculator. But you must admit, it’s much more pleasant to realize that the example was solved not by a computer program, but by 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 a system of linear equations be given, and you need to solve it using the Gauss method:

First we write the extended matrix:

Now let's do the transformations. We remember that we need to achieve a triangular appearance of the matrix. Let's multiply the 1st line by (3). Multiply the 2nd line by (-1). Add the 2nd line to the 1st and get:

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

Let's multiply the 1st line by (6). Let's multiply the 2nd line 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:

The system in this example has a unique solution. We will consider solving systems with an infinite number of solutions in a separate article. Perhaps at first you will not know where to start transforming the matrix, but after appropriate practice you will get the hang of it and will crack SLAEs using the Gaussian method like nuts. And if you suddenly come across a SLAE that turns out to be too tough a nut to crack, contact our authors! you can by leaving a request in the Correspondence Office. Together we will solve any problem!

One of the simplest ways to solve a system of linear equations is a technique based on the calculation of determinants ( Cramer's rule). Its advantage is that it allows you to immediately record the solution; it is especially convenient in cases where the coefficients of the system are not numbers, but some parameters. Its disadvantage is the cumbersomeness of calculations in the case of a large number of equations; moreover, Cramer's rule is not directly applicable to systems in which the number of equations does not coincide with the number of unknowns. In such cases, it is usually used Gaussian method.

Systems of linear equations having the same set of solutions are called equivalent. Obviously, the set of solutions of a linear system will not change if any equations are swapped, or if one of the equations is multiplied by some non-zero number, or if one equation is added to another.

Gauss method (method of sequential elimination of unknowns) is that with the help of elementary transformations the system is reduced to an equivalent system of a step type. First, using the 1st equation, we eliminate x 1 of all subsequent equations of the system. Then, using the 2nd equation, we eliminate x 2 from the 3rd and all subsequent equations. This process, called direct Gaussian method, continues until there is only one unknown left on the left side of the last equation x n. After this it is done inverse of the Gaussian method– solving the last equation, we find x n; after that, using this value, from the penultimate equation we calculate x n–1, etc. We find the last one x 1 from the first equation.

It is convenient to carry out Gaussian transformations by performing transformations not with the equations themselves, but with the matrices of their coefficients. Consider the matrix:

called extended matrix of the system, because, in addition to the main matrix of the system, it includes a column of free terms. The Gaussian method is based on reducing the main matrix of the system to a triangular form (or trapezoidal form in the case of non-square systems) using elementary row transformations (!) of the extended matrix of the system.

Example 5.1. Solve the system using the Gaussian method:

Solution. Let's write out the extended matrix of the system and, using the first row, after that we will reset the remaining elements:

we get zeros in the 2nd, 3rd and 4th rows of the first column:


Now we need all elements in the second column below the 2nd row to be equal to zero. To do this, you can multiply the second line by –4/7 and add it to the 3rd line. However, in order not to deal with fractions, let's create a unit in the 2nd row of the second column and only

Now, to get a triangular matrix, you need to reset the element of the fourth row of the 3rd column; to do this, you can multiply the third row by 8/54 and add it to the fourth. However, in order not to deal with fractions, we will swap the 3rd and 4th rows and the 3rd and 4th columns and only after that we will reset the specified element. Note that when rearranging the columns, the corresponding variables change places and this must be remembered; other elementary transformations with columns (addition and multiplication by a number) cannot be performed!


The last simplified matrix corresponds to a system of equations equivalent to the original one:

From here, using the inverse of the Gaussian method, we find from the fourth equation x 3 = –1; from the third x 4 = –2, from the second x 2 = 2 and from the first equation x 1 = 1. In matrix form, the answer is written as

We considered the case when the system is definite, i.e. when there is only one solution. Let's see what happens if the system is inconsistent or uncertain.

Example 5.2. Explore the system using the Gaussian method:

Solution. We write out and transform the extended matrix of the system

We write a simplified system of equations:

Here, in the last equation it turns out that 0=4, i.e. contradiction. Consequently, the system has no solution, i.e. she incompatible. à

Example 5.3. Explore and solve the system using the Gaussian method:

Solution. We write out and transform the extended matrix of the system:

As a result of the transformations, the last line contains only zeros. This means that the number of equations has decreased by one:

Thus, after simplifications, there are two equations left, and four unknowns, i.e. two unknown "extra". Let them be "superfluous", or, as they say, free variables, will x 3 and x 4 . Then

Believing x 3 = 2a And x 4 = b, we get x 2 = 1–a And x 1 = 2ba; or in matrix form

A solution written in this way is called general, because, giving parameters a And b different values, all possible solutions of the system can be described. a

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 its general solution.

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.

A transformation, the application of which turns a system into a 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 stepped or triangular shape, or it is established 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:

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 All these rows are from the matrix 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:
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.

Two systems of linear equations are called equivalent if the set of all their solutions coincides.

Elementary transformations of a system of equations are:

  1. Deleting trivial equations from the system, i.e. those for which all coefficients are equal to zero;
  2. Multiplying any equation by a number other than zero;
  3. Adding to any i-th equation any j-th equation multiplied by any number.

A variable x i is called free if this variable is not allowed, but the entire system of equations is allowed.

Theorem. Elementary transformations transform a system of equations into an equivalent one.

The meaning of the Gaussian method is to transform the original system of equations and obtain an equivalent resolved or equivalent inconsistent system.

So, the Gaussian method consists of the following steps:

  1. Let's look at the first equation. Let's choose the first non-zero coefficient and divide the entire equation by it. We obtain an equation in which some variable x i enters with a coefficient of 1;
  2. Let us subtract this equation from all the others, multiplying it by such numbers that the coefficients of the variable x i in the remaining equations are zeroed. We obtain a system resolved with respect to the variable x i and equivalent to the original one;
  3. If trivial equations arise (rarely, but it happens; for example, 0 = 0), we cross them out of the system. As a result, there are one fewer equations;
  4. We repeat the previous steps no more than n times, where n is the number of equations in the system. Each time we select a new variable for “processing”. If inconsistent equations arise (for example, 0 = 8), the system is inconsistent.

As a result, after a few steps we will obtain either a resolved system (possibly with free variables) or an inconsistent one. Allowed systems fall into two cases:

  1. The number of variables is equal to the number of equations. This means that the system is defined;
  2. The number of variables is greater than the number of equations. We collect all the free variables on the right - we get formulas for the allowed variables. These formulas are written in the answer.

That's all! System of linear equations solved! This is a fairly simple algorithm, and to master it you do not have to contact a higher mathematics tutor. Let's look at an example:

Task. Solve the system of equations:

Description of steps:

  1. Subtract the first equation from the second and third - we get the allowed variable x 1;
  2. We multiply the second equation by (−1), and divide the third equation by (−3) - we get two equations in which the variable x 2 enters with a coefficient of 1;
  3. We add the second equation to the first, and subtract from the third. We get the allowed variable x 2 ;
  4. Finally, we subtract the third equation from the first - we get the allowed variable x 3;
  5. We have received an approved system, write down the response.

The general solution of a simultaneous system of linear equations is a new system, equivalent to the original one, in which all allowed variables are expressed in terms of free ones.

When might a general solution be needed? If you have to do fewer steps than k (k is how many equations there are). However, the reasons why the process ends at some step l< k , может быть две:

  1. After the lth step, we obtained a system that does not contain an equation with number (l + 1). In fact, this is good, because... the authorized system is still obtained - even a few steps earlier.
  2. After the lth step, we obtained an equation in which all coefficients of the variables are equal to zero, and the free coefficient is different from zero. This is a contradictory equation, and, therefore, the system is inconsistent.

It is important to understand that the emergence of an inconsistent equation using the Gaussian method is a sufficient basis for inconsistency. At the same time, we note that as a result of the lth step, no trivial equations can remain - all of them are crossed out right in the process.

Description of steps:

  1. Subtract the first equation, multiplied by 4, from the second. We also add the first equation to the third - we get the allowed variable x 1;
  2. Subtract the third equation, multiplied by 2, from the second - we get the contradictory equation 0 = −5.

So, the system is inconsistent because an inconsistent equation has been discovered.

Task. Explore compatibility and find a general solution to the system:


Description of steps:

  1. We subtract the first equation from the second (after multiplying by two) and the third - we get the allowed variable x 1;
  2. Subtract the second equation from the third. Since all the coefficients in these equations are the same, the third equation will become trivial. At the same time, multiply the second equation by (−1);
  3. Subtract the second from the first equation - we get the allowed variable x 2. The entire system of equations is now also resolved;
  4. Since the variables x 3 and x 4 are free, we move them to the right to express the allowed variables. This is the answer.

So, the system is consistent and indeterminate, since there are two allowed variables (x 1 and x 2) and two free ones (x 3 and x 4).



This article is also available in the following languages: Thai

  • Next

    THANK YOU so much for the very useful information in the article. Everything is presented very clearly. It feels like a lot of work has been done to analyze the operation of the eBay store

    • Thank you and other regular readers of my blog. Without you, I would not be motivated enough to dedicate much time to maintaining this site. My brain is structured this way: I like to dig deep, systematize scattered data, try things that no one has done before or looked at from this angle. It’s a pity that our compatriots have no time for shopping on eBay because of the crisis in Russia. They buy from Aliexpress from China, since goods there are much cheaper (often at the expense of quality). But online auctions eBay, Amazon, ETSY will easily give the Chinese a head start in the range of branded items, vintage items, handmade items and various ethnic goods.

      • Next

        What is valuable in your articles is your personal attitude and analysis of the topic. Don't give up this blog, I come here often. There should be a lot of us like that. Email me I recently received an email with an offer that they would teach me how to trade on Amazon and eBay.

  • And I remembered your detailed articles about these trades. area
    I re-read everything again and concluded that the courses are a scam. I haven't bought anything on eBay yet. I am not from Russia, but from Kazakhstan (Almaty). But we also don’t need any extra expenses yet.