General solution of the system using the Gaussian method. Gaussian method

The online calculator finds a solution to the system linear equations(SLN) by the Gauss method. Is given detailed solution... Select the number of variables and the number of equations to calculate. Then enter the data in the cells and click on the "Calculate."

x 1

+x 2

+x 3

x 1

+x 2

+x 3

x 1

+x 2

+x 3

=

=

=

Number representation:

Integers and / or Ordinary fractions
Whole numbers and / or Decimal fractions

Number of places after decimal point

×

A warning

Clear all cells?

Close Clear

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

Gauss method

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

Equivalent transformations of the system of linear equations are:

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

Consider a system of linear equations:

(1)

Let us write system (1) in matrix form:

Ax = b (2)
(3)

A-called the matrix of the coefficients of the system, b- the right side of the restrictions, x Is the vector of variables to be found. Let rang ( A)=p.

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

Let's construct the extended matrix of the system:

In the next step, we zero out all the elements in column 2, below the element. If the given element is zero, then we swap this line with the line lying below this line and having a nonzero element in the second column. Next, we zero out all the elements in column 2 below the pivot. a 22. To do this, add lines 3, ... m with line 2 multiplied by - a 32 /a 22 , ..., −a m2 / a 22, respectively. Continuing the procedure, we obtain a diagonal or stepped matrix. Let the resulting expanded matrix have the form:

(7)

Because rangA = rang(A | b), then the set of solutions (7) is ( n − p) - variety. Hence n − p unknowns can be chosen arbitrarily. The rest of the unknowns from system (7) are calculated as follows. From the last equation we express x p through the rest of the variables and insert into the previous expressions. Further, from the penultimate equation, we express x p − 1 through the rest of the variables and insert into the previous expressions, etc. Let's consider the Gauss method using specific examples.

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

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

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

a eleven . To do this, add rows 2,3 with row 1 multiplied by -2 / 3, -1 / 2, respectively:

Matrix type of record: Ax = b, where

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

Eliminate the elements of the 1st column of the matrix below the element a eleven . To do this, add rows 2,3 with row 1 multiplied by -1 / 5, -6 / 5, respectively:

Divide each row of the matrix by the corresponding pivot (if a pivot exists):

where x 3 , x

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

Then the vector solution can be represented as follows:

where x 3 , x 4 - arbitrary real numbers.

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 inconsistent).
2) Have infinitely many solutions.
3) Have only decision.

As we remember, Cramer's rule and the matrix method are inapplicable in cases where the system has infinitely many solutions or is inconsistent. Gauss methodmost powerful and universal tool to find a solution to any system of linear equations, which the in every case will lead us to the answer! The algorithm of the method itself works the same in all three cases. If the knowledge of determinants is required in the Cramer and matrix methods, then for the application of the Gauss method, knowledge of only arithmetic operations is necessary, which makes it accessible even for 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 strings matrices can rearrange places.

2) if the matrix contains (or is) proportional (as a special case - the same) rows, 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 be multiply (divide) to any number other than zero.

5) the row of the matrix can be add another string multiplied by a number nonzero.

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

Gaussian method consists of two stages:

  1. “Direct move” - with the help of elementary transformations, reduce the extended matrix of the system of linear algebraic equations to a “triangular” stepwise form: the elements of the extended matrix located below the main diagonal are equal to zero (“top-down” move). For example, to this form:

To do this, perform the following actions:

1) Suppose we consider the first equation of a system of linear algebraic equations and the coefficient at x 1 is K. The second, third, etc. the equations are transformed as follows: each equation (coefficients for unknowns, including free terms) is divided by the coefficient for the unknown x 1, standing in each equation, and multiplied by K. After that, we subtract the first from the second equation (coefficients for unknowns and free terms). We get the coefficient 0 for x 1 in the second equation. Subtract the first equation from the third transformed equation until all equations, except for the first, for unknown x 1 have a coefficient of 0.

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

3) Go to the next equation and so on until there is one last unknown and the transformed free term.

  1. "Reverse" of the Gauss method - obtaining a solution to a system of linear algebraic equations ("bottom-up" move). From the last "lower" equation we obtain one first solution - the unknown x n. For this we decide elementary equation A * x n = B. In the example above, x 3 = 4. 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 by 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 a unit there. The problem is that there are no ones in the first column at all, so rearranging the rows will not solve anything. In such cases, the unit needs to be organized using an elementary transformation. This can usually be done in several ways. Let's do this:
Step 1 ... To the first line, 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 is "minus one", which is fine for us. 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. We also changed the sign of the third line and moved it to the second place, thus, on the second “step, we have the required unit.

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

Step 5 ... The third line was split by 3.

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

We carry out the 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". V this example got 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 according to 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

Subtracting 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 get a "stepwise" extended 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 course of calculations, we obtain x 3 = 0.96 or approximately 1.

x 2 = 3 and x 1 = –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 success! See you in class! Tutor.

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

Karl Friedrich Gauss, the greatest mathematician long time hesitated, choosing between philosophy and mathematics. Perhaps it was this kind of mindset that allowed him to so noticeably "inherit" in world science. In particular, by creating the "Gaussian Method" ...

For almost 4 years, the articles of this site have dealt with school education, mainly, from the side of philosophy, the principles of (mis) understanding, introduced into the minds of children. The time comes for more specifics, examples and methods ... I believe that this is the approach to familiar, confusing and important areas of life gives the best results.

We humans are so arranged that no matter how much you talk about abstract thinking, but understanding always going through examples... If there are no examples, then it is impossible to grasp the principles ... Just as it is impossible to be on the top of the mountain except by passing its entire slope from the bottom.

Also with the school: bye living stories not enough we instinctively continue to think of it as a place where children are taught to understand.

For example, teaching the Gauss method ...

Gauss method in grade 5 school

I'll make a reservation right away: the Gauss method has much broader application, for example, when solving systems of linear equations... What we are going to talk about takes place in the 5th grade. it start after understanding which, it is much easier to understand the more "advanced options". In this article we are talking about method (method) Gauss when finding the sum of the series

Here is an example that mine brought from school younger son attending the 5th grade of the Moscow gymnasium.

School demonstration of the Gauss method

Math teacher using interactive whiteboard ( modern methods teaching) showed the children a presentation of the history of "method creation" by little Gauss.

The school teacher whipped little Karl (an outdated method, nowadays it is not used in schools) because he

instead of sequentially adding the numbers from 1 to 100 to find their sum noticed that pairs of numbers that are equidistant from the edges of the arithmetic progression add up to the same number. for example, 100 and 1, 99 and 2. Having counted the number of such pairs, little Gauss almost instantly solved the problem proposed by the teacher. For which he was subjected to execution in front of the amazed audience. So that the rest of the thought was discouraged.

What did little Gauss do developed sense of number? Noticed some feature a number series with a constant step (arithmetic progression). AND exactly this later made him a great scientist, able to notice possessing feeling, instinct of understanding.

This is the value of mathematics, which develops ability to see general in particular - abstract thinking... Therefore, most parents and employers instinctively regard mathematics as an important discipline ...

"Mathematics only then must be taught, that it puts the mind in order.
MV Lomonosov ".

However, the followers of those who flogged future geniuses with rods turned the Method into something opposite. As my scientific advisor said 35 years ago: "We have learned the question." Or as my youngest son said yesterday about the Gauss method: "Maybe it's not worth doing a great science out of this, eh?"

The consequences of the creativity of "scientists" are visible in the level of the current school mathematics, the level of its teaching and understanding of the "Queen of Sciences" by the majority.

However, let's continue ...

Methods of explaining the Gauss method in grade 5 school

The mathematics teacher of the Moscow gymnasium, explaining the Gauss method according to Vilenkin, complicated the task.

What if the difference (step) of the arithmetic progression is not one, but another number? For example, 20.

The task he gave to the fifth graders:


20+40+60+80+ ... +460+480+500


Before getting acquainted with the gymnasium method, let's take a look on the Internet: how do school teachers - mathematics tutors do it? ..

Gauss Method: Explanation # 1

A well-known tutor on his YOUTUBE channel gives the following reasoning:

"write the numbers from 1 to 100 as follows:

first a series of numbers from 1 to 50, and strictly below it another series of numbers from 50 to 100, but in reverse order "


1, 2, 3, ... 48, 49, 50

100, 99, 98 ... 53, 52, 51

"Please note: the sum of each pair of numbers from the top and bottom rows is the same and equals 101! Let's count the number of pairs, it is 50 and multiply the sum of one pair by the number of pairs! Voila: The answer is ready!"

“If you couldn’t understand - don’t be upset!” - the teacher repeated three times in the process of explanation. "You will pass this method in the 9th grade!"

Gaussian Method: Explanation # 2

Another less well-known tutor (judging by the number of views) uses more scientific approach, offering a solution algorithm of 5 points that must be performed sequentially.

For the uninitiated: 5 is one of the Fibonacci numbers traditionally considered magical. The 5-step method is always more scientific than the 6-step method, for example. ... And this is hardly an accident, most likely, the Author is a hidden adherent of the Fibonacci theory

An arithmetic progression is given: 4, 10, 16 ... 244, 250, 256 .

Algorithm for finding the sum of the numbers of a series using the Gauss method:


  • Step 1: rewrite the given sequence of numbers in reverse, exactly under the first.
  • 4, 10, 16 ... 244, 250, 256

    256, 250, 244 ... 16, 10, 4

  • Step 2: calculate the sum of pairs of numbers located in vertical rows: 260.
  • Step 3: count how many such pairs are in the number series. To do this, subtract the minimum from the maximum number of the numerical series and divide by the step size: (256 - 4) / 6 = 42.
  • In this case, you need to remember about plus one rule : it is necessary to add one to the obtained quotient: otherwise we will get a result that is less by one than the true number of pairs: 42 + 1 = 43.

  • Step 4: multiply the sum of one pair of numbers by the number of pairs: 260 x 43 = 11 180
  • Step5: since we have calculated the amount pairs of numbers, then the amount received should be divided by two: 11 180/2 = 5590.
  • This is the required sum of the arithmetic progression from 4 to 256 with a difference of 6!

    Gauss method: explanation in grade 5 of a Moscow gymnasium

    And here is how it was required to solve the problem of finding the sum of a series:

    20+40+60+ ... +460+480+500

    in the 5th grade of a Moscow gymnasium, Vilenkin's textbook (from the words of my son).

    After showing the presentation, the math teacher showed a couple of examples using the Gauss method and gave the class a problem to find the sum of the numbers in a series with a step of 20.

    This required the following:

  • Step 1: be sure to write down all the numbers of the series in a notebook from 20 to 500 (in increments of 20).
  • Step 2: write down consecutive terms - pairs of numbers: the first with the last, the second with the penultimate, etc. and calculate their amounts.
  • Step 3: calculate the "sum of sums" and find the sum of the whole series.
  • As you can see, it is more compact and effective technique: number 3 is also a member of the Fibonacci sequence

    My comments on the school version of the Gauss method

    The great mathematician would definitely have chosen philosophy if he had foreseen what his "method" followers would turn into. German teacher, who whipped Karl with rods. He would have seen both symbolism and the dialectical spiral and the undying stupidity of the "teachers", trying to measure with algebra misunderstanding the harmony of living mathematical thought ....

    By the way: did you know. that our educational system is rooted in the German school of the 18th and 19th centuries?

    But Gauss chose mathematics.

    What is the essence of his method?

    V simplification... V observing and grasping simple patterns of numbers. V turning dry school arithmetic into interesting and exciting activity , which activates the desire to continue in the brain, rather than blocking high-cost mental activity.

    Is it possible, by one of the above "modifications of the Gauss method," to calculate the sum of the numbers of an arithmetic progression almost instantly? According to the "algorithms", little Karl would be guaranteed to avoid flogging, fostered an aversion to mathematics and suppressed his creative impulses in the bud.

    Why did the tutor so insistently advise the fifth-graders "not to be afraid of misunderstanding" the method, convincing them that they would solve "such" problems already in the 9th grade? Psychologically illiterate action. It was a good reception to mark: "See? You already in grade 5 you can solve problems that you will go through only after 4 years! What good fellows you are! "

    To use the Gaussian method, level 3 class is sufficient, when normal children already know how to add, multiply and divide 2-3 digit numbers. Problems arise due to the inability of adult teachers, who “do not enter,” how to explain the simplest things in normal human language, not that in mathematical language ... Those who are not able to interest mathematics and completely discourage even those who are “capable”.

    Or, as my son commented, "making it a great science."

  • How (in the general case) to find out which number should be used to "expand" the record of numbers in method no. 1?
  • What to do if the number of members of the series turns out to be odd?
  • Why turn into a "Rule plus 1" what a child could simply assimilate even in first grade, if I had developed a "sense of number", and didn't remember"count in ten"?
  • And finally: where did ZERO disappear, a brilliant invention, which is more than 2,000 years old and which modern mathematics teachers avoid using?!.
  • Gauss method, my explanations

    My wife and I explained this "method" to our child, it seems, even before school ...

    Simplicity instead of complication or a game of questions - answers

    "Look, here are the numbers from 1 to 100. What do you see?"

    It's not about what the child will see. The trick is for him to look.

    "How can you fold them?" The son grasped that such questions are not asked "just like that" and that you need to look at the question "somehow differently, differently than he usually does"

    It doesn't matter if the child sees the solution right away, it's unlikely. It is important that he stopped being afraid to look, or as I say: "moved the task"... This is the beginning of the path to understanding

    "Which is easier: to add, for example, 5 and 6 or 5 and 95?" A leading question ... But after all, any training comes down to "guiding" a person to the "answer" - in any way acceptable to him.

    At this stage, guesses may already arise about how to "save" on calculations.

    All we did was hint: the "head-on, linear" method of counting is not the only possible one. If the child truncated this, then later he will invent many more such methods, it's interesting !!! And he will definitely avoid a "misunderstanding" of mathematics, he will not be disgusted with it. He got a victory!

    If child discovered that the addition of pairs of numbers giving a total of one hundred is a trifling exercise, then "arithmetic progression with a difference of 1"- a rather dreary and uninteresting thing for a child - suddenly found life for him . Order has emerged out of chaos, and this always inspires enthusiasm: this is how we are!

    A tricky question: why, after the child received an insight, again drive him into the framework of dry algorithms, moreover, functionally useless in this case ?!

    Why make stupid rewrite sequence numbers in a notebook: so that even those who are capable do not have a single chance of understanding? Statistically, of course, but mass education is geared towards "statistics" ...

    Where did zero go?

    And yet, adding numbers that add up to 100 is much more acceptable to the mind than giving 101 ...

    The "school Gauss method" requires exactly this: mindlessly fold pairs of numbers equidistant from the center of the progression, no matter what.

    And if you look?

    Still zero - greatest invention of humanity, which is more than 2,000 years old. And the math teachers continue to ignore him.

    It is much easier to convert a series of numbers starting with 1 to a series starting with 0. The sum will not change, will it? You need to stop "thinking with textbooks" and start looking ... And to see that pairs with the sum of 101 can be replaced by pairs with the sum of 100!

    0 + 100, 1 + 99, 2 + 98 ... 49 + 51

    How to remove the plus 1 rule?

    To be honest, I first heard about such a rule from that YouTube tutor ...

    What do I still do when I need to determine the number of members of a row?

    I look at the sequence:

    1, 2, 3, .. 8, 9, 10

    and when completely tired, then to a simpler row:

    1, 2, 3, 4, 5

    and I estimate: if you subtract one from 5, you get 4, but I am quite clear see 5 numbers! Therefore, you need to add one! Sense of number developed in primary school, suggests: even if the members of the series are a whole Google (10 to the hundredth power), the pattern will remain the same.

    What about the rules? ..

    To fill the entire space between the forehead and the back of the head in a couple or three years and stop thinking? And how to earn bread and butter? After all, we are moving in even ranks into the era of the digital economy!

    More about the school method of Gauss: "why make science out of this? .."

    It's not for nothing that I posted a screenshot from my son's notebook ...

    "What was there in the lesson?"

    “Well, I counted right away, raised my hand, but she didn’t ask. Therefore, while the others were counting, I began to do DZ in Russian so as not to waste time. Then, when the others finished writing (???), she called me to the blackboard. I said the answer. "

    "That's right, show me how you solved it," said the teacher. I showed. She said: "Wrong, you need to count as I showed!"

    “It’s good that I didn’t put a two. And I made me write in the notebook the“ course of the solution ”in their language. Why make a big science out of this? ..”

    The main crime of the math teacher

    Hardly after that case Karl Gauss had a high sense of respect for his school math teacher. But if he knew how followers of that teacher distort the very essence of the method... he would have roared with indignation and through the World Intellectual Property Organization WIPO secured a ban on the use of his good name in school textbooks! ..

    In what main mistake school approach? Or, as I put it, the crime of school math teachers against children?

    Algorithm of misunderstanding

    What do school methodologists, the vast majority of whom do not know how to think?

    Methods and algorithms are created (see). it a defensive reaction that protects teachers from criticism ("Everything is done according to ..."), and children from understanding. And thus - from the desire to criticize teachers!(The second derivative of bureaucratic "wisdom", a scientific approach to the problem). A person who does not grasp the meaning will rather blame his own misunderstanding, and not the stupidity of the school system.

    This is exactly what happens: parents blame their children, and teachers ... the same with children who "do not understand mathematics! ..

    Do you dare?

    What did little Karl do?

    Absolutely unconventional approached a formulaic task... This is the essence of His approach. it the main thing that should be taught at school: think not with textbooks, but with your head... Of course, there is also an instrumental component that can be used quite well ... in search of simpler and effective methods bills.

    Gauss method according to Vilenkin

    The school teaches that the Gauss method is to

  • in pairs find the sums of numbers equidistant from the edges of a number series, certainly starting from the edges!
  • find the number of such pairs, etc.
  • what, if the number of elements of the series turns out to be odd, as in the problem you were asked to your son? ..

    The "catch" is that in this case you should find the "extra" number of the row and add it to the sum of the pairs. In our example, this number is 260.

    How to detect? Rewriting all pairs of numbers in a notebook!(This is why the teacher forced the children to do this stupid job, trying to teach "creativity" by the Gaussian method ... And this is why such a "method" is practically inapplicable to large data series, And this is why it is not a Gaussian method).

    A little creativity in the school routine ...

    The son acted differently.

  • First, he noted that it is easier to multiply the number 500, rather than 520.
  • (20 + 500, 40 + 480 ...).

  • Then he figured out: the number of steps turned out to be odd: 500/20 = 25.
  • Then he added ZERO to the beginning of the series (although it was possible to discard the last term of the series, which would also ensure parity) and added up the numbers giving a total of 500
  • 0+500, 20+480, 40+460 ...

  • 26 steps are 13 pairs of "five hundred": 13 x 500 = 6500 ..
  • If we have discarded the last term of the series, then there will be 12 pairs, but we should not forget to add the "discarded" five hundred to the result of the calculations. Then: (12 x 500) + 500 = 6500!

  • Not difficult, right?

    And in practice it is even easier, which allows you to carve out 2-3 minutes on the DZ in Russian, while the rest "count". In addition, it retains the number of steps of the methodology: 5, which does not allow criticizing the approach for being unscientific.

    Obviously, this approach is simpler, faster and more universal, in the style of Method. But ... the teacher not only didn’t praise, but made me rewrite in the “correct way” (see screenshot). That is, she made a desperate attempt to stifle the creative impulse and the ability to understand mathematics at the root! Apparently, then to hire a tutor ... I attacked the wrong one ...


    Everything that I have described for so long and tediously can be explained to a normal child in a maximum of half an hour. Along with examples.

    And so that he will never forget it.

    And it will step to understanding... not just mathematics.

    Admit it: how many times in your life have you added the Gaussian method? And I never!

    But instinct of understanding that develops (or extinguishes) in the process of studying mathematical methods at school ... Oh! .. This is truly an irreplaceable thing!

    Especially in the age of universal digitalization, into which we imperceptibly entered under the strict leadership of the Party and the Government.

    A few words in defense of teachers ...

    It is unfair and wrong to place the full responsibility for this style of learning solely on the school teachers. The system works.

    Some teachers understand the absurdity of what is happening, but what to do? Law on education, federal state educational standards, methods, technological maps Lessons ... Everything must be done "according to and based on" and everything must be documented. A step to the side - got in line to be fired. Let's not be hypocrites: the salaries of Moscow teachers are very good ... They will be fired - where to go? ..

    Therefore, this site not about education... He about individual education, the only possible way get out of the crowd generation Z ...

    Gauss method, also called method successive elimination unknowns is as follows. With the help of elementary transformations, the system of linear equations is brought to such a form that its matrix of coefficients turns out to be trapezoidal (same as triangular or stepped) or close to trapezoidal (direct move of the Gauss method, further - just a direct move). An example of such a system and its solution is in the figure above.

    In such a system, the last equation contains only one variable and its value can be found unambiguously. Then the value of this variable is substituted into the previous equation ( backward Gaussian method , then just reverse), from which the previous variable is found, and so on.

    In a trapezoidal (triangular) system, as we see, the third equation no longer contains the variables y and x, and the second equation is the variable x .

    After the matrix of the system has taken a trapezoidal shape, it is no longer difficult to understand the question of the compatibility of the system, determine the number of solutions and find the solutions themselves.

    The advantages of the method:

    1. when solving systems of linear equations with the number of equations and unknowns more than three, the Gauss method is not as cumbersome as the Cramer method, since less calculations are required when solving the Gauss method;
    2. using the Gauss method, one can solve indefinite systems of linear equations, that is, having a general solution (and we will analyze them in this lesson), and using Cramer's method, one can only state that the system is indefinite;
    3. you can solve systems of linear equations in which the number of unknowns is not equal to the number of equations (we will also analyze them in this lesson);
    4. the method is based on elementary (school) methods - the method of substitution of unknowns and the method of adding equations, which we touched upon in the corresponding article.

    So that everyone is imbued with the simplicity with which trapezoidal (triangular, stepwise) systems of linear equations are solved, we will give a solution to such a system using the reverse motion. A quick solution to this system was shown in the picture at the beginning of the lesson.

    Example 1. Solve a system of linear equations using the reverse motion:

    Solution. In this trapezoidal system, the variable z is uniquely found from the third equation. We substitute its value into the second equation and get the value by changing y:

    Now we know the values ​​of two variables - z and y... We substitute them into the first equation and get the value of the variable x:

    From the previous steps, we write out the solution to the system of equations:

    To obtain such a trapezoidal system of linear equations, which we solved very simply, it is required to apply a direct move associated with elementary transformations systems of linear equations. It is also not very difficult.

    Elementary transformations of a system of linear equations

    Repeating the school method of algebraic addition of the equations of the system, we found out that another equation of the system can be added to one of the equations of the system, and each of the equations can be multiplied by some numbers. As a result, we obtain a system of linear equations equivalent to the given one. In it, one equation already contained only one variable, substituting the value of which into other equations, we arrive at a solution. Such addition is one of the types of elementary transformation of the system. When using the Gaussian method, we can use several types of transformations.

    The animation above shows how the system of equations gradually turns into a trapezoidal one. That is, one that you saw in the very first animation and made sure for yourself that it is easy to find the values ​​of all unknowns from it. How to perform such a transformation and, of course, examples will be discussed further.

    When solving systems of linear equations with any number of equations and unknowns in the system of equations and in the extended matrix of the system can:

    1. rearrange the lines (this was mentioned at the very beginning of this article);
    2. if, as a result of other transformations, equal or proportional rows appeared, they can be deleted, except for one;
    3. delete "zero" lines where all coefficients are equal to zero;
    4. any string to multiply or divide by some number;
    5. to any line add another line multiplied by some number.

    As a result of the transformations, we obtain a system of linear equations equivalent to the given one.

    Algorithm and examples of solving the system of linear equations with a square matrix by the Gauss method

    Let us first consider the solution of systems of linear equations in which the number of unknowns is equal to the number of equations. The matrix of such a system is square, that is, the number of rows in it is equal to the number of columns.

    Example 2. Solve the system of linear equations by the Gauss method

    Solving systems of linear equations using school methods, we multiplied one of the equations by a certain number, so that the coefficients of the first variable in the two equations were opposite numbers. The addition of equations eliminates this variable. The Gauss method works in a similar way.

    To simplify appearance solutions compose an extended matrix of the system:

    In this matrix, on the left before the vertical bar, the coefficients for the unknowns are located, and on the right, after the vertical bar, are the free terms.

    For the convenience of dividing the coefficients of variables (to obtain division by one) swap the first and second rows of the system matrix... We obtain a system equivalent to the given one, since in the system of linear equations the equations can be rearranged in places:

    Using the new first equation exclude the variable x from the second and all subsequent equations... To do this, add the first row multiplied by (in our case, by) to the second row of the matrix, and the first row multiplied by (in our case, by) to the third row.

    This is possible since

    If our system of equations had more than three, then the first row should be added to all subsequent equations, multiplied by the ratio of the corresponding coefficients, taken with a minus sign.

    As a result, we get a matrix equivalent to this system new system equations in which all equations, starting with the second do not contain a variable x :

    To simplify the second row of the resulting system, we multiply it by and get again the matrix of the system of equations equivalent to this system:

    Now, keeping the first equation of the resulting system unchanged, using the second equation, we exclude the variable y from all subsequent equations. To do this, add the second row multiplied by (in our case, by) to the third row of the system matrix.

    If in our system of equations there were more than three, then the second row should be added to all subsequent equations, multiplied by the ratio of the corresponding coefficients, taken with a minus sign.

    As a result, we again obtain the matrix of the system equivalent to the given system of linear equations:

    We have obtained an equivalent to the given trapezoidal system of linear equations:

    If the number of equations and variables is greater than in our example, then the process of successive elimination of variables continues until the system matrix becomes trapezoidal, as in our demo example.

    We will find the solution "from the end" - reverse course... For this from the last equation we define z:
    .
    Substituting this value in the previous equation, find y:

    From the first equation find x:

    Answer: the solution to this system of equations is .

    : in this case, the same answer will be returned if the system has an unambiguous solution. If the system has an infinite number of solutions, then this will be the answer, and this is the subject of the fifth part of this lesson.

    Solve a system of linear equations by the Gaussian method yourself, and then see the solution

    Before us is again an example of a joint and definite system of linear equations, in which the number of equations is equal to the number of unknowns. The difference from our demo example from the algorithm is that there are already four equations and four unknowns.

    Example 4. Solve the system of linear equations by the Gaussian method:

    Now you need to use the second equation to exclude the variable from the subsequent equations. Let's carry out preparatory work... To make it more convenient with the ratio of the coefficients, you need to get the unit in the second column of the second row. To do this, subtract the third from the second line, and multiply the resulting second line by -1.

    Let us now carry out the actual elimination of the variable from the third and fourth equations. To do this, add to the third line the second, multiplied by, and to the fourth - the second, multiplied by.

    Now, using the third equation, we eliminate the variable from the fourth equation. To do this, add to the fourth line the third, multiplied by. We get an expanded trapezoidal matrix.

    A system of equations was obtained, which is equivalent for this system:

    Consequently, the obtained and the given system are consistent and definite. We find the final solution “from the end”. From the fourth equation, we can directly express the value of the variable "x fourth":

    We substitute this value into the third equation of the system and obtain

    ,

    ,

    Finally, value substitution

    The first equation gives

    ,

    where we find "x first":

    Answer: this system of equations has a unique solution .

    You can also check the solution of the system on a calculator that solves by Cramer's method: in this case, the same answer will be given if the system has an unambiguous solution.

    Solution by the Gauss method of applied problems by the example of a problem on alloys

    Systems of linear equations are used to model real objects of the physical world. Let's solve one of these problems - for alloys. Similar tasks - tasks on a mixture, cost or specific gravity individual goods in a group of goods and the like.

    Example 5. Three pieces of alloy have a total weight of 150 kg. The first alloy contains 60% copper, the second - 30%, the third - 10%. Moreover, in the second and third alloys taken together, copper is 28.4 kg less than in the first alloy, and in the third alloy, copper is 6.2 kg less than in the second. Find the mass of each piece of alloy.

    Solution. We compose a system of linear equations:

    Multiplying the second and third equations by 10, we obtain an equivalent system of linear equations:

    We compose an expanded system matrix:

    Attention, direct course. By adding (in our case, subtracting) one row multiplied by a number (we apply two times) with the expanded matrix of the system, the following transformations occur:

    The direct move has ended. Received an expanded trapezoidal matrix.

    We apply the reverse motion. We find a solution from the end. We see that.

    From the second equation we find

    From the third equation -

    You can also check the solution of the system on a calculator that solves by Cramer's method: in this case, the same answer will be given if the system has an unambiguous solution.

    The simplicity of the Gauss method is evidenced by the fact that the German mathematician Karl Friedrich Gauss took only 15 minutes to invent it. In addition to the method of his name, from the work of Gauss is known the saying "We should not mix what seems incredible and unnatural to us, with the absolutely impossible" - a kind of short instruction to make discoveries.

    In many applied problems, there may not be a third constraint, that is, the third equation, then it is necessary to solve the system of two equations with three unknowns by the Gauss method, or, conversely, there are fewer unknowns than equations. We will now proceed to the solution of such systems of equations.

    Using the Gauss method, it is possible to establish whether any system is compatible or incompatible. n linear equations with n variables.

    Gauss method and systems of linear equations with an infinite set of solutions

    The next example is a consistent, but undefined system of linear equations, that is, having an infinite set of solutions.

    After performing transformations in the expanded matrix of the system (rearranging rows, multiplying and dividing rows by some number, adding to one row another), rows of the form

    If in all equations having the form

    Free terms are equal to zero, this means that the system is indefinite, that is, it has an infinite set of solutions, and equations of this type are "superfluous" and we exclude them from the system.

    Example 6.

    Solution. Let's compose an extended matrix of the system. Then, using the first equation, we exclude the variable from the subsequent equations. To do this, add the first to the second, third and fourth lines, multiplied by:

    Now add the second line to the third and fourth.

    As a result, we arrive at the system

    The last two equations turned into equations of the form. These equations are satisfied for any values ​​of the unknowns and they can be discarded.

    To satisfy the second equation, we can choose for and arbitrary values, then the value for is already determined unambiguously: ... From the first equation, the value for is also found unambiguously: .

    Both the given and the latter systems are compatible, but undefined, and the formulas

    for arbitrary and give us all the solutions of a given system.

    Gauss method and systems of linear equations without solutions

    The next example is an inconsistent system of linear equations, that is, it has no solutions. The answer to such problems is formulated as follows: the system has no solutions.

    As already mentioned in connection with the first example, after performing transformations in the extended matrix of the system, rows of the form

    corresponding to an equation of the form

    If among them there is at least one equation with a nonzero free term (i.e.), then this system of equations is inconsistent, that is, it has no solutions, and this completes its solution.

    Example 7. Solve the system of linear equations by the Gauss method:

    Solution. We compose an extended matrix of the system. Using the first equation, we exclude the variable from the subsequent equations. To do this, add to the second line the first, multiplied by, to the third line - the first, multiplied by, to the fourth - the first, multiplied by.

    Now you need to use the second equation to exclude the variable from the subsequent equations. To obtain integer ratios of the coefficients, we swap the second and third rows of the extended matrix of the system.

    To eliminate from the third and fourth equations, add the second, multiplied by, to the third row, and the second, multiplied by.

    Now, using the third equation, we eliminate the variable from the fourth equation. To do this, add to the fourth line the third, multiplied by.

    Preset system is thus equivalent to the following:

    The resulting system is inconsistent, since its last equation cannot be satisfied by any values ​​of the unknowns. Therefore, this system has no solutions.

    One of the universal and effective methods for solving linear algebraic systems is Gauss method , consisting in the successive elimination of unknowns.

    Recall that two systems are called equivalent (equivalent) if the sets of their solutions coincide. In other words, systems are equivalent if each solution to one of them is a solution to the other and vice versa. Equivalent systems are obtained when elementary transformations equations of the system:

      multiplying both sides of the equation by a number other than zero;

      adding to some equation the corresponding parts of another equation, multiplied by a number other than zero;

      permutation of two equations.

    Let a system of equations be given

    The process of solving this system by the Gauss method consists of two stages. At the first stage (direct run), the system is reduced by elementary transformations to stepwise , or triangular mind, and at the second stage (reverse) there is a sequential, starting with the last variable by number, the determination of the unknowns from the resulting step system.

    Suppose that the coefficient of the given system
    , otherwise in the system the first row can be swapped with any other row so that the coefficient at was nonzero.

    We transform the system by eliminating the unknown in all equations except the first. To do this, multiply both sides of the first equation by and add it term by term with the second equation of the system. Then we multiply both sides of the first equation by and add it to the third equation of the system. Continuing this process, we obtain an equivalent system

    Here
    - new values ​​of coefficients and free terms, which are obtained after the first step.

    Similarly, considering the main element
    , exclude the unknown from all equations of the system, except for the first and second. We will continue this process as long as possible, as a result we will receive a stepwise system

    ,

    where ,
    ,…,- the main elements of the system
    .

    If, in the process of reducing the system to a stepwise form, equations appear, i.e., equalities of the form
    , they are discarded, since they are satisfied by any sets of numbers
    ... If at
    will appear equation of the form, which has no solutions, then this indicates the incompatibility of the system.

    At reverse course from the last equation of the transformed step system, the first unknown is expressed through all the other unknowns
    who call free . Then the variable expression from the last equation of the system is substituted into the penultimate equation and from it the variable is expressed
    ... In a similar way, the variables are defined sequentially
    ... Variables
    expressed in terms of free variables are called basic (addicted). The result is a general solution to a system of linear equations.

    To find private solution system, free unknown
    v general decision arbitrary values ​​are assigned and values ​​of variables are calculated
    .

    It is technically more convenient to subject to elementary transformations not the equations of the system themselves, but the extended matrix of the system

    .

    Gauss's method is a universal method that allows you to solve not only square, but also rectangular systems in which the number of unknowns
    not equal to the number of equations
    .

    The advantage of this method also lies in the fact that in the process of solving we simultaneously investigate the system for compatibility, since, giving the extended matrix
    stepwise, it is easy to determine the ranks of the matrix and extended matrix
    and apply the Kronecker - Capelli theorem .

    Example 2.1 Using the Gauss method, solve the system

    Solution... Number of Equations
    and the number of unknowns
    .

    Let us compose the extended matrix of the system by assigning to the right of the matrix of coefficients free member column .

    Let's give a matrix to a triangular view; for this we will get "0" below the elements on the main diagonal using elementary transformations.

    To get "0" in the second position of the first column, multiply the first row by (-1) and add to the second row.

    We write this transformation as a number (-1) against the first line and denote it by an arrow going from the first line to the second line.

    To get "0" in the third position of the first column, multiply the first row by (-3) and add to the third row; show this action with an arrow going from the first line to the third.




    .

    In the resulting matrix, written as the second in the chain of matrices, we get "0" in the second column in the third position. To do this, multiply the second line by (-4) and add to the third. In the resulting matrix, the second row is multiplied by (-1), and the third is divided by (-8). All elements of this matrix lying below the diagonal elements are zeros.

    Because , the system is collaborative and specific.

    The system of equations corresponding to the last matrix has a triangular form:

    From the last (third) equation
    ... Substitute in the second equation and get
    .

    Substitute
    and
    into the first equation, we find


    .