Tightness of a linear relationship between random variables. Properties of Operations for Calculating Quantitative Characteristics of Random Variables
Solving systems of linear algebraic equations by the matrix method (using the inverse matrix).
Let the system of linear algebraic equations be given in matrix form , where the matrix A has the dimension n on the n and its determinant is non-zero.
Since , then the matrix BUT is invertible, that is, there is an inverse matrix. If we multiply both sides of the equality to the left, we get a formula for finding the column matrix of unknown variables. So we got the solution of the system of linear algebraic equations by the matrix method.
matrix method.
Let's rewrite the system of equations in matrix form:
As then the SLAE can be solved by the matrix method. Using the inverse matrix, the solution to this system can be found as .
We construct an inverse matrix using a matrix of algebraic complements of matrix elements BUT(if necessary, see the article methods for finding the inverse matrix):
It remains to calculate - the matrix of unknown variables by multiplying the inverse matrix on a matrix-column of free members (if necessary, see the article on operations on matrices):
or in another entry x 1 = 4, x 2 = 0, x 3 = -1 .
The main problem in finding solutions to systems of linear algebraic equations by the matrix method is the complexity of finding the inverse matrix, especially for square matrices of order higher than the third.
For a more detailed description of the theory and additional examples, see the article matrix method for solving systems of linear equations.
Top of page
Solving systems of linear equations by the Gauss method.
Suppose we need to find a solution to the system from n linear equations with n unknown variables the determinant of the main matrix of which is different from zero.
The essence of the Gauss method consists in the successive exclusion of unknown variables: first, the x 1 from all equations of the system, starting from the second, then x 2 of all equations, starting with the third, and so on, until only the unknown variable remains in the last equation x n. Such a process of transforming the equations of the system for the successive elimination of unknown variables is called direct Gauss method. After the completion of the forward move of the Gauss method, from the last equation we find x n, using this value from the penultimate equation is calculated x n-1, and so on, from the first equation is found x 1 . The process of calculating unknown variables when moving from the last equation of the system to the first is called reverse Gauss method.
Let us briefly describe the algorithm for eliminating unknown variables.
We will assume that , since we can always achieve this by rearranging the equations of the system. Eliminate the unknown variable x 1 from all equations of the system, starting from the second. To do this, add the first equation multiplied by to the second equation of the system, add the first multiplied by the third equation, and so on, to n-th add the first equation, multiplied by . The system of equations after such transformations will take the form where, a .
We would arrive at the same result if we expressed x 1 through other unknown variables in the first equation of the system and the resulting expression was substituted into all other equations. So the variable x 1 excluded from all equations, starting with the second.
Next, we act similarly, but only with a part of the resulting system, which is marked in the figure
To do this, add the second multiplied by to the third equation of the system, add the second multiplied by to the fourth equation, and so on, to n-th add the second equation, multiplied by. The system of equations after such transformations will take the form where, a . So the variable x 2 excluded from all equations, starting with the third.
Next, we proceed to the elimination of the unknown x 3 , while we act similarly with the part of the system marked in the figure
So we continue the direct course of the Gauss method until the system takes the form
From this moment, we begin the reverse course of the Gauss method: we calculate x n from the last equation as, using the obtained value x n find x n-1 from the penultimate equation, and so on, we find x 1 from the first equation.
Solve System of Linear Equations Gaussian method.
Eliminate the unknown variable x 1
from the second and third equations of the system. To do this, to both parts of the second and third equations, we add the corresponding parts of the first equation, multiplied by and by, respectively:
Now we eliminate from the third equation x 2
, adding to its left and right parts the left and right parts of the second equation, multiplied by:
On this, the forward course of the Gauss method is completed, we begin the reverse course.
From the last equation of the resulting system of equations, we find x 3 :
From the second equation we get .
From the first equation we find the remaining unknown variable and this completes the reverse course of the Gauss method.
x 1 = 4, x 2 = 0, x 3 = -1 .
For more detailed information and additional examples, see the section on solving elementary systems of linear algebraic equations using the Gauss method.
Top of page
" |
Let a system of linear equations be given with unknown:
We will assume that the main matrix non-degenerate. Then, by Theorem 3.1, there exists an inverse matrix
Multiplying the matrix equation
to matrix
on the left, using Definition 3.2, as well as assertion 8) of Theorem 1.1, we obtain the formula on which the matrix method for solving systems of linear equations is based:
Comment. Note that the matrix method for solving systems of linear equations, in contrast to the Gauss method, has limited application: this method can only solve systems of linear equations for which, firstly, the number of unknowns is equal to the number of equations, and secondly, the main matrix is nonsingular .
Example. Solve the system of linear equations by the matrix method.
Given a system of three linear equations with three unknowns
where
The main matrix of the system of equations is nondegenerate, since its determinant is nonzero:
inverse matrix
compose by one of the methods described in paragraph 3.
According to the formula of the matrix method for solving systems of linear equations, we obtain
5.3. Cramer method
This method, like the matrix method, is applicable only for systems of linear equations in which the number of unknowns coincides with the number of equations. Cramer's method is based on the theorem of the same name:
Theorem 5.2. System linear equations with unknown
the main matrix of which is nonsingular, has a unique solution, which can be obtained from the formulas
where
determinant of a matrix derived from the main matrix system of equations by replacing it
th column by a column of free members.
Example.
Let's find a solution to the system of linear equations considered in the previous example using the Cramer method. The main matrix of the system of equations is nondegenerate, since
Calculate the determinants
Using the formulas presented in Theorem 5.2, we calculate the values of the unknowns:
6. Study of systems of linear equations.
Basic Solution
To investigate a system of linear equations means to determine whether this system is compatible or inconsistent, and in the case of its compatibility, to find out whether this system is definite or indefinite.
The compatibility condition for a system of linear equations is given by the following theorem
Theorem 6.1 (Kronecker–Capelli).
A system of linear equations is consistent if and only if the rank of the main matrix of the system is equal to the rank of its extended matrix:
For a consistent system of linear equations, the question of its certainty or uncertainty is solved using the following theorems.
Theorem 6.2. If the rank of the main matrix of a joint system is equal to the number of unknowns, then the system is definite
Theorem 6.3. If the rank of the main matrix of a joint system is less than the number of unknowns, then the system is indeterminate.
Thus, the formulated theorems imply a method for studying systems of linear algebraic equations. Let be n is the number of unknowns,
Then:
Definition 6.1. The basic solution of an indefinite system of linear equations is such a solution in which all free unknowns are equal to zero.
Example. Explore a system of linear equations. If the system is uncertain, find its basic solution.
Calculate the ranks of the main and extended matrix of this system of equations, for which we bring the extended (and at the same time the main) matrix of the system to a stepped form:
We add the second row of the matrix with its first row, multiplied by third row - with the first row multiplied by
and the fourth line - with the first, multiplied by we get the matrix
To the third row of this matrix, add the second row, multiplied by
and to the fourth line - the first, multiplied by
As a result, we get the matrix
deleting from which the third and fourth rows we get a step matrix
Thus,
Therefore, this system of linear equations is consistent, and since the rank is less than the number of unknowns, the system is indefinite. The step matrix obtained as a result of elementary transformations corresponds to the system of equations
Unknown and are the main ones, and the unknown and
free. Assigning zero values to the free unknowns, we obtain the basic solution of this system of linear equations.
- the determinant of the matrix A is calculated;
- through algebraic additions, the inverse matrix A -1 is found;
- a solution template is created in Excel;
Instruction. To obtain a solution by the inverse matrix method, it is necessary to specify the dimension of the matrix. Next, in the new dialog box, fill in the matrix A and the result vector B .
Recall that a solution to a system of linear equations is any set of numbers (x 1 , x 2 , ..., x n ) whose substitution into this system instead of the corresponding unknowns turns each equation of the system into an identity.
A system of linear algebraic equations is usually written as (for 3 variables): See also Solution of matrix equations.
Solution algorithm
- The determinant of the matrix A is calculated. If the determinant is zero, then the end of the solution. The system has an infinite number of solutions.
- When the determinant is different from zero, the inverse matrix A -1 is found through algebraic additions.
- The decision vector X =(x 1 , x 2 , ..., x n ) is obtained by multiplying the inverse matrix by the result vector B .
Example #1. Find the solution of the system by the matrix method. We write the matrix in the form:
Algebraic additions.
A 1.1 = (-1) 1+1 |
| ∆ 1,1 = (1 (-2)-0 2) = -2 |
A 1,2 = (-1) 1+2 |
| ∆ 1,2 = -(3 (-2)-1 2) = 8 |
A 1.3 = (-1) 1+3 |
| ∆ 1,3 = (3 0-1 1) = -1 |
A 2.1 = (-1) 2+1 |
| ∆ 2,1 = -(-2 (-2)-0 1) = -4 |
A 2.2 = (-1) 2+2 |
| ∆ 2,2 = (2 (-2)-1 1) = -5 |
A 2.3 = (-1) 2+3 |
| ∆ 2,3 = -(2 0-1 (-2)) = -2 |
A 3.1 = (-1) 3+1 |
| ∆ 3,1 = (-2 2-1 1) = -5 |
A 3.2 = (-1) 3+2 |
| ∆ 3,2 = -(2 2-3 1) = -1 |
3 |
-2 |
-1 |
X T = (1,0,1)
x 1 = -21 / -21 = 1
x 2 = 0 / -21 = 0
x 3 = -21 / -21 = 1
Examination:
2 1+3 0+1 1 = 3
-2 1+1 0+0 1 = -2
1 1+2 0+-2 1 = -1
Example #2. Solve SLAE using the inverse matrix method.
2x1 + 3x2 + 3x3 + x4 = 1
3x1 + 5x2 + 3x3 + 2x4 = 2
5x1 + 7x2 + 6x3 + 2x4 = 3
4x1 + 4x2 + 3x3 + x4 = 4
We write the matrix in the form:
Vector B:
B T = (1,2,3,4)
Main determinant
Minor for (1,1):
= 5 (6 1-3 2)-7 (3 1-3 2)+4 (3 2-6 2) = -3
Minor for (2,1):
= 3 (6 1-3 2)-7 (3 1-3 1)+4 (3 2-6 1) = 0
Minor for (3,1):
= 3 (3 1-3 2)-5 (3 1-3 1)+4 (3 2-3 1) = 3
Minor for (4,1):
= 3 (3 2-6 2)-5 (3 2-6 1)+7 (3 2-3 1) = 3
Minor determinant
∆ = 2 (-3)-3 0+5 3-4 3 = -3
Example #4. Write the system of equations in matrix form and solve using the inverse matrix.
Solution :xls
Example number 5. A system of three linear equations with three unknowns is given. Required: 1) find its solution using Cramer's formulas; 2) write the system in matrix form and solve it using matrix calculus.
Guidelines. After solving by Cramer's method, find the button "Inverse matrix solution for initial data". You will receive an appropriate decision. Thus, the data will not have to be filled in again.
Decision. Denote by A - the matrix of coefficients for unknowns; X - column matrix of unknowns; B - matrix-column of free members:
|
B T =(4,-3,-3)
Given these notations, this system of equations takes the following matrix form: A*X = B.
If the matrix A is non-singular (its determinant is non-zero, then it has an inverse matrix A -1. Multiplying both sides of the equation by A -1, we get: A -1 * A * X \u003d A -1 * B, A -1 * A=E.
This equality is called matrix notation of the solution of the system of linear equations. To find a solution to the system of equations, it is necessary to calculate the inverse matrix A -1 .
The system will have a solution if the determinant of the matrix A is non-zero.
Let's find the main determinant.
∆=-1 (-2 (-1)-1 1)-3 (3 (-1)-1 0)+2 (3 1-(-2 0))=14
So, the determinant is 14 ≠ 0, so we continue the solution. To do this, we find the inverse matrix through algebraic additions.
Let we have a non-singular matrix A:
A 1,1 =(-1) 1+1 |
|
A 1,2 =(-1) 1+2 |
|
A 1,3 =(-1) 1+3 |
|
A 2.1 =(-1) 2+1 |
|
A 2.2 =(-1) 2+2 |
|
A 2.3 =(-1) 2+3 |
|
A 3.1 =(-1) 3+1 |
|
4 |
-3 |
-3 |
X=1/14 |
|
∆=4 (0 1-3 (-2))-2 (1 1-3 (-1))+0 (1 (-2)-0 (-1))=16
Transposed matrix
A 1,2 =(-1) 1+2 |
|
A 1,3 =(-1) 1+3 |
|
A 2.1 =(-1) 2+1 |
|
A 2.2 =(-1) 2+2 |
|
A 2.3 =(-1) 2+3 |
|
A 3.1 =(-1) 3+1 |
|
A 3.2 =(-1) 3+2 |
|
A 3.3 =(-1) 3+3 | 1/16 |
|
(4 6)+(1 (-2))+(-1 6) | (4 (-4))+(1 4)+(-1 (-12)) | (4 (-2))+(1 6)+(-1 (-2)) |
(2 6)+(0 (-2))+(-2 6) | (2 (-4))+(0 4)+(-2 (-12)) | (2 (-2))+(0 6)+(-2 (-2)) |
(0 6)+(3 (-2))+(1 6) | (0 (-4))+(3 4)+(1 (-12)) | (0 (-2))+(3 6)+(1 (-2)) |
=1/16 |
|
A*A -1 = |
|
Example number 7. Solution of matrix equations.
Denote:
A= |
|
A 1.1 = (-1) 1+1 |
|
A 1,2 = (-1) 1+2 |
|
A 1.3 = (-1) 1+3 |
|
A 2.1 = (-1) 2+1 |
|
A 2.2 = (-1) 2+2 |
|
A 2.3 = (-1) 2+3 |
|
A 3.1 = (-1) 3+1 |
|
-12 | 15 | -5 |
-4 | 5 | -2 |
7 | -9 | 3 |
B T =(31,13,10)
X T =(4.05,6.13,7.54)
x 1 \u003d 158 / 39 \u003d 4.05
x 2 \u003d 239 / 39 \u003d 6.13
x 3 \u003d 294 / 39 \u003d 7.54
Examination.
-2 4.05+-1 6.13+6 7.54=31
1 4.05+-1 6.13+2 7.54=13
2 4.05+4 6.13+-3 7.54=10
Example number 9. Denote by A - the matrix of coefficients for unknowns; X - column matrix of unknowns; B - matrix-column of free members:
|
B T =(31,13,10)
X T =(5.21,4.51,6.15)
x 1 \u003d 276 / 53 \u003d 5.21
x 2 \u003d 239 / 53 \u003d 4.51
x 3 \u003d 326 / 53 \u003d 6.15
Examination.
-2 5.21+1 4.51+6 6.15=31
1 5.21+-1 4.51+2 6.15=13
2 5.21+4 4.51+-3 6.15=10
Example #10. Solution of matrix equations.
Denote:
A 11 \u003d (-1) 1 + 1 -3 \u003d -3; A 12 \u003d (-1) 1 + 2 3 \u003d -3; A 21 \u003d (-1) 2 + 1 1 \u003d -1; A 22 \u003d (-1) 2 + 2 2 \u003d 2;
Inverse matrix A -1 .
-3 | -3 |
-1 | 2 |
1 | -2 |
1 | 1 |
X= |
|
According to Cramer's formulas;
Gauss method;
Decision: The Kronecker-Capelli theorem. A system is consistent if and only if the rank of the matrix of this system is equal to the rank of its extended matrix, i.e. r(A)=r(A 1), where
The extended matrix of the system has the form:
Multiply the first row by ( –3 ), and the second on ( 2 ); then add the elements of the first row to the corresponding elements of the second row; Subtract the third line from the second line. In the resulting matrix, the first row is left unchanged.
6 ) and swap the second and third lines:
Multiply the second row by ( –11 ) and add to the corresponding elements of the third row.
Divide the elements of the third row by ( 10 ).
Let's find the matrix determinant BUT.
Hence, r(A)=3 . Extended matrix rank r(A 1) is also equal to 3 , i.e.
r(A)=r(A 1)=3 Þ the system is compatible.
1) Examining the system for compatibility, the augmented matrix was transformed by the Gauss method.
The Gauss method is as follows:
1. Bringing the matrix to a triangular form, i.e., zeros must be below the main diagonal (forward move).
2. From the last equation we find x 3 and substitute it into the second, we find x 2, and knowing x 3, x 2 plugging them into the first equation, we find x 1(reverse move).
Let us write the augmented matrix, transformed by the Gauss method
as a system of three equations:
Þ x 3 \u003d 1
x 2 = x 3Þ x 3 \u003d 1
2x 1 \u003d 4 + x 2 + x 3Þ 2x 1 =4+1+1Þ
Þ 2x 1 =6 Þ x 1 \u003d 3
.
2) We solve the system using Cramer's formulas: if the determinant of the system of equations Δ is different from zero, then the system has a unique solution, which is found by the formulas
Let us calculate the determinant of the system Δ:
Because the determinant of the system is non-zero, then according to Cramer's rule, the system has a unique solution. We calculate the determinants Δ 1 , Δ 2 , Δ 3 . They are obtained from the determinant of the system Δ by replacing the corresponding column with the column of free coefficients.
We find the unknowns using the formulas:
Answer: x 1 \u003d 3, x 2 \u003d 1, x 3 \u003d 1 .
3) We solve the system by means of matrix calculus, i.e., using the inverse matrix.
A×X=B Þ X \u003d A -1 × B, where A -1 is the inverse matrix to BUT,
free members column,
Matrix-column of unknowns.
The inverse matrix is calculated by the formula:
where D- matrix determinant BUT, And ij are the algebraic complements of the element a ij matrices BUT. D= 60 (from the previous paragraph). The determinant is non-zero, therefore, the matrix A is invertible, and the matrix inverse to it can be found by the formula (*). Let's find algebraic additions for all elements of the matrix A by the formula:
And ij =(-1 )i+j M ij .
x 1, x 2, x 3 turned each equation into an identity, then they are found correctly.
Example 6. Solve the system using the Gauss method and find any two basic solutions of the system.