Solve a system of linear algebraic equations using the Gaussian method. Gauss method for dummies: solving slough easily

Definition and description of the Gauss method

Gaussian transformation method (also known as the method of sequential elimination of unknown variables from an equation or matrix) for solving systems linear equations is a classical method for solving a system of algebraic equations (SLAE). Also, this classical method is used to solve problems such as obtaining inverse matrices and determining the rank of the matrix.

The transformation using the Gauss method consists in making small (elementary) successive changes in the system of linear algebraic equations, leading to the elimination of variables from it from top to bottom with the formation of a new triangular system of equations, which is equivalent to the original one.

Definition 1

This part of the solution is called the Gaussian forward solution, since the whole process is carried out from top to bottom.

After bringing the original system of equations to a triangular one, all the variables of the system are found from the bottom up (that is, the first variables found are located exactly on the last lines of the system or matrix). This part of the solution is also known as the reverse Gauss solution. Its algorithm consists in the following: first, the variables that are closest to the bottom of the system of equations or a matrix are calculated, then the obtained values ​​are substituted above and thus another variable is found, and so on.

Description of the Gauss method algorithm

The sequence of actions for the general solution of the system of equations by the Gauss method consists in alternately applying the forward and backward strokes to the matrix based on the SLAE. Let the original system of equations have the following form:

$\begin(cases) a_(11) \cdot x_1 +...+ a_(1n) \cdot x_n = b_1 \\ ... \\ a_(m1) \cdot x_1 + a_(mn) \cdot x_n = b_m \end(cases)$

To solve SLAE by the Gauss method, it is necessary to write down the initial system of equations in the form of a matrix:

$A = \begin(pmatrix) a_(11) & … & a_(1n) \\ \vdots & … & \vdots \\ a_(m1) & … & a_(mn) \end(pmatrix)$, $b =\begin(pmatrix) b_1 \\ \vdots \\ b_m \end(pmatrix)$

The matrix $A$ is called the main matrix and represents the coefficients of the variables written in order, and $b$ is called the column of its free terms. The matrix $A$ written through the line with a column of free members is called the augmented matrix:

$A = \begin(array)(ccc|c) a_(11) & … & a_(1n) & b_1 \\ \vdots & … & \vdots & ...\\ a_(m1) & … & a_( mn) & b_m \end(array)$

Now, using elementary transformations over the system of equations (or over the matrix, as it is more convenient), it is necessary to bring it to the following form:

$\begin(cases) α_(1j_(1)) \cdot x_(j_(1)) + α_(1j_(2)) \cdot x_(j_(2))...+ α_(1j_(r)) \cdot x_(j_(r)) +... α_(1j_(n)) \cdot x_(j_(n)) = β_1 \\ α_(2j_(2)) \cdot x_(j_(2)). ..+ α_(2j_(r)) \cdot x_(j_(r)) +... α_(2j_(n)) \cdot x_(j_(n)) = β_2 \\ ...\\ α_( rj_(r)) \cdot x_(j_(r)) +... α_(rj_(n)) \cdot x_(j_(n)) = β_r \\ 0 = β_(r+1) \\ … \ \ 0 = β_m \end(cases)$ (1)

The matrix obtained from the coefficients of the transformed system of equation (1) is called a step matrix, this is how step matrices usually look like:

$A = \begin(array)(ccc|c) a_(11) & a_(12) & a_(13) & b_1 \\ 0 & a_(22) & a_(23) & b_2\\ 0 & 0 & a_(33) & b_3 \end(array)$

These matrices are characterized by the following set of properties:

  1. All its zero rows come after non-zero ones
  2. If some row of the matrix with index $k$ is non-zero, then there are fewer zeros in the previous row of the same matrix than in this row with index $k$.

After obtaining the step matrix, it is necessary to substitute the obtained variables into the remaining equations (starting from the end) and obtain the remaining values ​​of the variables.

Basic rules and permitted transformations when using the Gauss method

When simplifying a matrix or a system of equations by this method, only elementary transformations should be used.

Such transformations are operations that can be applied to a matrix or system of equations without changing its meaning:

  • permutation of several lines in places,
  • adding or subtracting from one line of the matrix another line from it,
  • multiplying or dividing a string by a constant that is not equal to zero,
  • a line consisting of only zeros, obtained in the process of calculating and simplifying the system, must be deleted,
  • You also need to remove unnecessary proportional lines, choosing for the system the only one with coefficients that are more suitable and convenient for further calculations.

All elementary transformations are reversible.

Analysis of the three main cases that arise when solving linear equations using the method of simple Gaussian transformations

There are three cases that arise when using the Gauss method to solve systems:

  1. When the system is inconsistent, that is, it does not have any solutions
  2. The system of equations has a solution, and the only one, and the number of non-zero rows and columns in the matrix is ​​equal to each other.
  3. The system has a certain number or set of possible solutions, and the number of rows in it is less than the number of columns.

Solution outcome with inconsistent system

For this variant, when solving a matrix equation by the Gauss method, it is typical to obtain some line with the impossibility of fulfilling the equality. Therefore, if at least one incorrect equality occurs, the resulting and original systems have no solutions, regardless of the other equations they contain. An example of an inconsistent matrix:

$\begin(array)(ccc|c) 2 & -1 & 3 & 0 \\ 1 & 0 & 2 & 0\\ 0 & 0 & 0 & 1 \end(array)$

An unsatisfied equality appeared in the last line: $0 \cdot x_(31) + 0 \cdot x_(32) + 0 \cdot x_(33) = 1$.

A system of equations that has only one solution

The data of the system after reduction to a stepped matrix and deletion of rows with zeros have the same number of rows and columns in the main matrix. Here is a simple example of such a system:

$\begin(cases) x_1 - x_2 = -5 \\ 2 \cdot x_1 + x_2 = -7 \end(cases)$

Let's write it in the form of a matrix:

$\begin(array)(cc|c) 1 & -1 & -5 \\ 2 & 1 & -7 \end(array)$

To bring the first cell of the second row to zero, multiply the top row by $-2$ and subtract it from the bottom row of the matrix, and leave the top row in its original form, as a result we have the following:

$\begin(array)(cc|c) 1 & -1 & -5 \\ 0 & 3 & 10 \end(array)$

This example can be written as a system:

$\begin(cases) x_1 - x_2 = -5 \\ 3 \cdot x_2 = 10 \end(cases)$

The following value of $x$ comes out of the lower equation: $x_2 = 3 \frac(1)(3)$. Substituting this value into the upper equation: $x_1 – 3 \frac(1)(3)$, we get $x_1 = 1 \frac(2)(3)$.

A system with many possible solutions

This system is characterized by a smaller number of significant rows than the number of columns in it (the rows of the main matrix are taken into account).

Variables in such a system are divided into two types: basic and free. When transforming such a system, the main variables contained in it must be left in the left area before the “=” sign, and the remaining variables should be transferred to the right side of the equality.

Such a system has only some common decision.

Let's analyze the following system of equations:

$\begin(cases) 2y_1 + 3y_2 + x_4 = 1 \\ 5y_3 - 4y_4 = 1 \end(cases)$

Let's write it in the form of a matrix:

$\begin(array)(cccc|c) 2 & 3 & 0 & 1 & 1 \\ 0 & 0 & 5 & 4 & 1 \\ \end(array)$

Our task is to find a general solution to the system. For this matrix, the basic variables will be $y_1$ and $y_3$ (for $y_1$ - since it is in the first place, and in the case of $y_3$ - it is located after the zeros).

As basic variables, we choose exactly those that are not equal to zero first in the row.

The remaining variables are called free, through them we need to express the basic ones.

Using the so-called reverse move, we disassemble the system from the bottom up, for this we first express $y_3$ from the bottom line of the system:

$5y_3 – 4y_4 = 1$

$5y_3 = 4y_4 + 1$

$y_3 = \frac(4/5)y_4 + \frac(1)(5)$.

Now we substitute the expressed $y_3$ into the upper equation of the system $2y_1 + 3y_2 + y_4 = 1$: $2y_1 + 3y_2 - (\frac(4)(5)y_4 + \frac(1)(5)) + y_4 = 1$

We express $y_1$ in terms of free variables $y_2$ and $y_4$:

$2y_1 + 3y_2 - \frac(4)(5)y_4 - \frac(1)(5) + y_4 = 1$

$2y_1 = 1 - 3y_2 + \frac(4)(5)y_4 + \frac(1)(5) - y_4$

$2y_1 = -3y_2 - \frac(1)(5)y_4 + \frac(6)(5)$

$y_1 = -1.5x_2 – 0.1y_4 + 0.6$

The solution is ready.

Example 1

Solve the slough using the Gaussian method. Examples. An example of solving a system of linear equations given by a 3 by 3 matrix using the Gauss method

$\begin(cases) 4x_1 + 2x_2 - x_3 = 1 \\ 5x_1 + 3x_2 - 2x^3 = 2\\ 3x_1 + 2x_2 - 3x_3 = 0 \end(cases)$

We write our system in the form of an augmented matrix:

$\begin(array)(ccc|c) 4 & 2 & -1 & 1 \\ 5 & 3 & -2 & 2 \\ 3 & 2 & -3 & 0\\ \end(array)$

Now, for convenience and practicality, we need to transform the matrix so that $1$ is in the upper corner of the last column.

To do this, we need to add the line from the middle multiplied by $-1$ to the 1st line, and write the middle line itself as it is, it turns out:

$\begin(array)(ccc|c) -1 & -1 & 1 & -1 \\ 5 & 3 & -2 & 2 \\ 3 & 2 & -3 & 0\\ \end(array)$

$\begin(array)(ccc|c) -1 & -1 & 1 & -1 \\ 0 & -2 & 3 & -3 \\ 0 & -1 & 0 & -3\\ \end(array) $

Multiply the top and last rows by $-1$, and swap the last and middle rows:

$\begin(array)(ccc|c) 1 & 1 & -1 & 1 \\ 0 & 1 & 0 & 3 \\ 0 & -2 & 3 & -3\\ \end(array)$

$\begin(array)(ccc|c) 1 & 1 & -1 & 1 \\ 0 & 1 & 0 & 3 \\ 0 & 0 & 3 & 3\\ \end(array)$

And split the last line by $3$:

$\begin(array)(ccc|c) 1 & 1 & -1 & 1 \\ 0 & 1 & 0 & 3 \\ 0 & 0 & 1 & 1\\ \end(array)$

We obtain the following system of equations, equivalent to the original one:

$\begin(cases) x_1 + x_2 – x_3 = 1\\ x_2 = 3 \\ x_3 = 1 \end(cases)$

From the upper equation, we express $x_1$:

$x1 = 1 + x_3 - x_2 = 1 + 1 - 3 = -1$.

Example 2

An example of solving a system defined using a 4 by 4 matrix using the Gaussian method

$\begin(array)(cccc|c) 2 & 5 & 4 & 1 & 20 \\ 1 & 3 & 2 & 1 & 11 \\ 2 & 10 & 9 & 7 & 40\\ 3 & 8 & 9 & 2 & 37 \\ \end(array)$.

At the beginning, we swap the top lines that follow it to get $1$ in the upper left corner:

$\begin(array)(cccc|c) 1 & 3 & 2 & 1 & 11 \\ 2 & 5 & 4 & 1 & 20 \\ 2 & 10 & 9 & 7 & 40\\ 3 & 8 & 9 & 2 & 37 \\ \end(array)$.

Now let's multiply the top line by $-2$ and add to the 2nd and to the 3rd. To the 4th we add the 1st line, multiplied by $-3$:

$\begin(array)(cccc|c) 1 & 3 & 2 & 1 & 11 \\ 0 & -1 & 0 & -1 & -2 \\ 0 & 4 & 5 & 5 & 18\\ 0 & - 1 & 3 & -1 & 4 \\ \end(array)$

Now to line number 3 we add line 2 multiplied by $4$, and to line 4 we add line 2 multiplied by $-1$.

$\begin(array)(cccc|c) 1 & 3 & 2 & 1 & 11 \\ 0 & -1 & 0 & -1 & -2 \\ 0 & 0 & 5 & 1 & 10\\ 0 & 0 & 3 & 0 & 6 \\ \end(array)$

Multiply row 2 by $-1$, divide row 4 by $3$ and replace row 3.

$\begin(array)(cccc|c) 1 & 3 & 2 & 1 & 11 \\ 0 & 1 & 0 & 1 & 2 \\ 0 & 0 & 1 & 0 & 2\\ 0 & 0 & 5 & 1 & 10 \\ \end(array)$

Now we add to the last line the penultimate one, multiplied by $-5$.

$\begin(array)(cccc|c) 1 & 3 & 2 & 1 & 11 \\ 0 & 1 & 0 & 1 & 2 \\ 0 & 0 & 1 & 0 & 2\\ 0 & 0 & 0 & 1 & 0 \\ \end(array)$

We solve the resulting system of equations:

$\begin(cases) m = 0 \\ g = 2\\ y + m = 2\ \ x + 3y + 2g + m = 11\end(cases)$

1. System of linear algebraic equations

1.1 The concept of a system of linear algebraic equations

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

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

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

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

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

1.2 Solution of a system of linear algebraic equations

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

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

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

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

To solve a system means to find out whether it is compatible or not. If the system is compatible, 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 to one of them is a solution to 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. The following transformations can serve as examples of equivalent transformations: swapping two equations of the system, swapping two unknowns together with the coefficients of all equations, multiplying both parts of any equation of the system by a non-zero number.

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

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

2. Gaussian elimination method

2.1 The essence of the Gaussian elimination method

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

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

1. Direct move.

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

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

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

The system below is stepwise:

,

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

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

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

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

Continuing this process, we get the equivalent system:


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

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

This indicates the incompatibility of the system.

This completes the direct course of the Gauss method.

2. Reverse move.

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

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

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

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

2.2 Examples of solving SLAE by the Gauss method

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

Example 1. Solve SLAE of the 3rd order.

Set the coefficients to zero at

We continue to consider systems of linear equations. This lesson is the third on the topic. If you have a vague idea of ​​what a system of linear equations is in general, you feel like a teapot, then I recommend starting with the basics on the Next page, it is useful to study the lesson.

Gauss method is easy! Why? The famous German mathematician Johann Carl Friedrich Gauss, during his lifetime, received recognition as the greatest mathematician of all time, a genius, and even the nickname "King of Mathematics". And everything ingenious, as you know, is simple! By the way, not only suckers, but also geniuses fall into the money - the portrait of Gauss was flaunted on a bill of 10 Deutschmarks (before the introduction of the euro), and Gauss still mysteriously smiles at the Germans from ordinary postage stamps.

The Gauss method is simple in that it IS ENOUGH THE KNOWLEDGE OF A FIFTH-GRADE STUDENT to master it. Must be able to add and multiply! It is no coincidence that the method of successive elimination of unknowns is often considered by teachers at school mathematical electives. It is a paradox, but the Gauss method causes the greatest difficulties for students. Nothing surprising - it's all about the methodology, and I will try to tell in an accessible form about the algorithm of the method.

First, we systematize the knowledge about systems of linear equations a little. A system of linear equations can:

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

The Gauss method is the most powerful and versatile tool for finding a solution any systems of linear equations. As we remember Cramer's rule and matrix method are unsuitable in cases where the system has infinitely many solutions or is inconsistent. A method of successive elimination of unknowns Anyway lead us to the answer! In this lesson, we will again consider the Gauss method for case No. 1 (the only solution to the system), an article is reserved for the situations of points No. 2-3. I note that the method algorithm itself works in the same way in all three cases.

Let's return to the simplest system from the lesson How to solve a system of linear equations? and solve it using the Gaussian method.

The first step is to write extended matrix system: . By what principle the coefficients are recorded, I think everyone can see. The vertical line inside the matrix does not carry any mathematical meaning - it's just a strikethrough for ease of design.

Reference : I recommend to remember terms linear algebra. System Matrix is a matrix composed only of coefficients for unknowns, in this example, the matrix of the system: . Extended System Matrix is the same matrix of the system plus a column of free members, in this case: . Any of the matrices can be called simply a matrix for brevity.

After the extended matrix of the system is written, it is necessary to perform some actions with it, which are also called elementary transformations.

There are the following elementary transformations:

1) Strings matrices Can rearrange places. For example, in the matrix under consideration, you can safely rearrange the first and second rows:

2) If there are (or appeared) proportional (as a special case - identical) rows in the matrix, then it follows delete from the matrix, all these rows except one. Consider, for example, the matrix . In this matrix, the last three rows are proportional, so it is enough to leave only one of them: .

3) If a zero row appeared in the matrix during the transformations, then it also follows delete. I will not draw, of course, the zero line is the line in which only zeros.

4) The row of the matrix can be multiply (divide) for any number non-zero. Consider, for example, the matrix . Here it is advisable to divide the first line by -3, and multiply the second line by 2: . This action is very useful, as it simplifies further transformations of the matrix.

5) This transformation causes the most difficulties, but in fact there is nothing complicated either. To the row of the matrix, you can add another string multiplied by a number, different from zero. Consider our matrix from a practical example: . First, I will describe the transformation in great detail. Multiply the first row by -2: , And to the second line we add the first line multiplied by -2: . Now the first line can be divided "back" by -2: . As you can see, the line that is ADDED LIhasn't changed. Always the line is changed, TO WHICH ADDED UT.

In practice, of course, they don’t paint in such detail, but write shorter: Once again: to the second line added the first row multiplied by -2. The line is usually multiplied orally or on a draft, while the mental course of calculations is something like this:

“I rewrite the matrix and rewrite the first row: »

First column first. Below I need to get zero. Therefore, I multiply the unit above by -2:, and add the first to the second line: 2 + (-2) = 0. I write the result in the second line: »

“Now the second column. Above -1 times -2: . I add the first to the second line: 1 + 2 = 3. I write the result to the second line: »

“And the third column. Above -5 times -2: . I add the first line to the second line: -7 + 10 = 3. I write the result in the second line: »

Please think carefully about this example and understand the sequential calculation algorithm, if you understand this, then the Gauss method is practically "in your pocket". But, of course, we are still working on this transformation.

Elementary transformations do not change the solution of the system of equations

! ATTENTION: considered manipulations can not use, if you are offered a task where the matrices are given "by themselves". For example, with "classic" matrices in no case should you rearrange something inside the matrices! Let's return to our system. She's practically broken into pieces.

Let us write the augmented matrix of the system and, using elementary transformations, reduce it to stepped view:

(1) The first row was added to the second row, multiplied by -2. And again: why do we multiply the first row by -2? In order to get zero at the bottom, which means getting rid of one variable in the second line.

(2) Divide the second row by 3.

The purpose of elementary transformations convert the matrix to step form: . In the design of the task, they directly draw out the “ladder” with a simple pencil, and also circle the numbers that are located on the “steps”. The term "stepped view" itself is not entirely theoretical; in the scientific and educational literature, it is often called trapezoidal view or triangular view.

As a result of elementary transformations, we have obtained equivalent original system of equations:

Now the system needs to be "untwisted" in the opposite direction - from the bottom up, this process is called reverse Gauss method.

In the lower equation, we already have the finished result: .

Consider the first equation of the system and substitute the already known value of “y” into it:

Let us consider the most common situation, when the Gaussian method is required to solve a system of three linear equations with three unknowns.

Example 1

Solve the system of equations using the Gauss method:

Let's write the augmented matrix of the system:

Now I will immediately draw the result that we will come to in the course of the solution: And I repeat, our goal is to bring the matrix to a stepped form using elementary transformations. Where to start taking action?

First, look at the top left number: Should almost always be here unit. Generally speaking, -1 (and sometimes other numbers) will also suit, but somehow it has traditionally happened that a unit is usually placed there. How to organize a unit? We look at the first column - we have a finished unit! Transformation one: swap the first and third lines:

Now the first line will remain unchanged until the end of the solution. Now fine.

The unit in the top left is organized. Now you need to get zeros in these places:

Zeros are obtained just with the help of a "difficult" transformation. First, we deal with the second line (2, -1, 3, 13). What needs to be done to get zero in the first position? Need to to the second line add the first line multiplied by -2. Mentally or on a draft, we multiply the first line by -2: (-2, -4, 2, -18). And we consistently carry out (again mentally or on a draft) addition, to the second line we add the first line, already multiplied by -2:

The result is written in the second line:

Similarly, we deal with the third line (3, 2, -5, -1). To get zero in the first position, you need to the third line add the first line multiplied by -3. Mentally or on a draft, we multiply the first line by -3: (-3, -6, 3, -27). AND to the third line we add the first line multiplied by -3:

The result is written in the third line:

In practice, these actions are usually performed verbally and written down in one step:

No need to count everything at once and at the same time. The order of calculations and "insertion" of results consistent and usually like this: first we rewrite the first line, and puff ourselves quietly - CONSISTENTLY and ATTENTIVELY:
And I have already considered the mental course of the calculations themselves above.

IN this example this is easy to do, we divide the second line by -5 (since all numbers there are divisible by 5 without a remainder). At the same time, we divide the third line by -2, because the smaller the number, the simpler the solution:

At the final stage of elementary transformations, one more zero must be obtained here:

For this to the third line we add the second line, multiplied by -2:
Try to parse this action yourself - mentally multiply the second line by -2 and carry out the addition.

The last action performed is the hairstyle of the result, divide the third line by 3.

As a result of elementary transformations, an equivalent initial system of linear equations was obtained: Cool.

Now the reverse course of the Gaussian method comes into play. The equations "unwind" from the bottom up.

In the third equation, we already have the finished result:

Let's look at the second equation: . The meaning of "z" is already known, thus:

And finally, the first equation: . "Y" and "Z" are known, the matter is small:

Answer:

As has been repeatedly noted, for any system of equations, it is possible and necessary to check the found solution, fortunately, this is not difficult and fast.

Example 2

This is an example for self-decision, a sample of finishing and an answer at the end of the lesson.

It should be noted that your course of action may not coincide with my course of action, and this is a feature of the Gauss method. But the answers must be the same!

Example 3

Solve a system of linear equations using the Gauss method

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

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

(2) The first row multiplied by 5 was added to the second row. The first row multiplied by 3 was added to the third row.

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

(4) The second line multiplied by 2 was added to the third line.

(5) The third row was divided by 3.

A bad sign that indicates a calculation error (less often a typo) is a “bad” bottom line. That is, if we got something like below, and, accordingly, , then with a high degree of probability it can be argued that an error was made in the course of elementary transformations.

We charge 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. Yes, here is a gift:

Answer: .

Example 4

Solve a system of linear equations using the Gauss method

This is an example for an independent solution, it is somewhat more complicated. It's okay if someone gets confused. Full solution and design sample at the end of the lesson. Your solution may differ from mine.

In the last part, we consider some features of the Gauss algorithm. The first feature is that sometimes some variables are missing in the equations of the system, for example: How to correctly write the augmented matrix of the system? I already talked about this moment in the lesson. Cramer's rule. Matrix method. In the expanded matrix of the system, we put zeros in place of the missing variables: By the way, this is a fairly easy example, since there is already one zero in the first column, and there are fewer elementary transformations to perform.

The second feature is this. In all the examples considered, we placed either –1 or +1 on the “steps”. Could there be other numbers? In some cases they can. Consider the system: .

Here on the upper left "step" we have a deuce. But we notice the fact that all the numbers in the first column are divisible by 2 without a remainder - and another two and six. And the deuce at the top left will suit us! At the first step, you need to perform the following transformations: add the first line multiplied by -1 to the second line; to the third line add the first line multiplied by -3. Thus, we will get the desired zeros in the first column.

Or another hypothetical example: . Here, the triple on the second “rung” also suits us, since 12 (the place where we need to get zero) is divisible by 3 without a remainder. It is necessary to carry out the following transformation: to the third line, add the second line, multiplied by -4, as a result of which the zero we need will be obtained.

The Gauss method is universal, but there is one peculiarity. You can confidently learn how to solve systems by other methods (Cramer's method, matrix method) literally from the first time - there is a very rigid algorithm. But in order to feel confident in the Gauss method, you should “fill your hand” and solve at least 5-10 ten systems. Therefore, at first there may be confusion, errors in calculations, and there is nothing unusual or tragic in this.

Rainy autumn weather outside the window .... Therefore, for everyone more complex example for independent solution:

Example 5

Solve a system of 4 linear equations with four unknowns using the Gauss method.

Such a task in practice is not so rare. I think that even a teapot who has studied this page in detail understands the algorithm for solving such a system intuitively. Basically the same - just more action.

The cases when the system has no solutions (inconsistent) or has infinitely many solutions are considered in the lesson. Incompatible systems and systems with a common solution. The considered algorithm of the Gauss method can also be fixed there.

I wish you success!

Solutions and answers:

Example 2: Solution : Let us write down the extended matrix of the system and, using elementary transformations, bring it to a stepped form.
Performed elementary transformations: (1) The first row was added to the second row, multiplied by -2. The first line was added to the third line, multiplied by -1. Attention! Here it may be tempting to subtract the first from the third line, I strongly do not recommend subtracting - the risk of error greatly increases. We just fold! (2) The sign of the second line was changed (multiplied by -1). The second and third lines have been swapped. note that on the “steps” we are satisfied not only with one, but also with -1, which is even more convenient. (3) To the third line, add the second line, multiplied by 5. (4) The sign of the second line was changed (multiplied by -1). The third line was divided by 14.

Reverse move:

Answer : .

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

Conversions performed: (1) The second line was added to the first line. Thus, the desired unit is organized on the upper left “step”. (2) The first row multiplied by 7 was added to the second row. The first row multiplied by 6 was added to the third row.

With the second "step" everything is worse , the "candidates" for it are the numbers 17 and 23, and we need either one or -1. Transformations (3) and (4) will be aimed at obtaining the desired unit (3) The second line was added to the third line, multiplied by -1. (4) The third line, multiplied by -3, was added to the second line. The necessary thing on the second step is received . (5) To the third line added the second, multiplied by 6. (6) The second row was multiplied by -1, the third row was divided by -83.

Reverse move:

Answer :

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

Conversions performed: (1) The first and second lines have been swapped. (2) The first row was added to the second row, multiplied by -2. The first line was added to the third line, multiplied by -2. The first line was added to the fourth line, multiplied by -3. (3) The second line multiplied by 4 was added to the third line. The second line multiplied by -1 was added to the fourth line. (4) The sign of the second line has been changed. The fourth line was divided by 3 and placed instead of the third line. (5) The third line was added to the fourth line, multiplied by -5.

Reverse move:

Answer :

Two systems of linear equations are said to be equivalent if the set of all their solutions is the same.

Elementary transformations of the system of equations are:

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

The variable x i is called free if this variable is not allowed, and the whole system of equations is allowed.

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

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

So, the Gauss method consists of the following steps:

  1. Consider the first equation. We choose the first non-zero coefficient and divide the whole 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 numbers such that the coefficients for the variable x i in the remaining equations are set to zero. We get a system that is resolved with respect to the variable x i and is equivalent to the original one;
  3. If trivial equations arise (rarely, but it happens; for example, 0 = 0), we delete them from the system. As a result, the equations become one less;
  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 conflicting equations arise (for example, 0 = 8), the system is inconsistent.

As a result, after a few steps we obtain either an allowed 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. So the system is defined;
  2. The number of variables is greater than the number of equations. We collect all free variables on the right - we get formulas for allowed variables. These formulas are written in the answer.

That's all! The system of linear equations is solved! This is a fairly simple algorithm, and to master it, you do not need to contact a tutor in mathematics. Consider an example:

Task. Solve the system of equations:

Description of steps:

  1. We 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. Let's 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 authorized system, we write down the answer.

The general solution of a joint 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 in total). However, the reasons why the process ends at some step l< k , может быть две:

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

It is important to understand that the appearance of an inconsistent equation by the Gauss method is a sufficient reason for inconsistency. At the same time, we note that as a result of the l -th step, trivial equations cannot remain - all of them are deleted directly in the process.

Description of steps:

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

So, the system is inconsistent, since an inconsistent equation has been found.

Task. Investigate compatibility and find the general solution of 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 becomes trivial. At the same time, we multiply the second equation by (−1);
  3. We subtract the second equation 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 joint and indefinite, since there are two allowed variables (x 1 and x 2) and two free ones (x 3 and x 4).

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

We know that a system of linear algebraic equations can:

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

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

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

1) With troky matrices Can rearrange places.

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

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

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

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

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

The Gauss method consists of two stages:

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

To do this, perform the following steps:

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

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

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

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

Example.

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

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

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

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

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

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

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

5 step . The third line is divided by 3.

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

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

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

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

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

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

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

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

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

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

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

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

Divide the third equation by 0.64:

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

Multiply the third equation by 0.4

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

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

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

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

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

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

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

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

Loading...
Top