Mathematical Foundation of Artificial Intelligence-Linear Algebra 5: Determinant to Solve Linear Equations and Laplace's Theorem

☞ ░ old ape Python Bowen directory

1. Reverse order and reverse number

In an arrangement, if the front and back positions of a pair of numbers are in the opposite order of magnitude, that is, the front number is greater than the back number, then they are called a reverse order . The total number of inverse orders in an arrangement is called the inverse number of the arrangement . That is to say, for n different elements, first stipulate that there is a standard order between each element (for example, n different natural numbers, the standard order from small to large can be specified), so in any permutation of these n elements , When the actual order of two elements is different from the standard order, it is said that there is a reverse order. The total number of all inverse sequences in an arrangement is called the inverse number of the arrangement.

For example, in 2431, 21, 43, 41, 31 are inverse order, and the inverse number is 4. The calculation process is as follows: 2 inverse ordinal number 1 (1 row behind), 4 inverse ordinal number 2 (3, 1 row behind), 3 inverse ordinal number 1 (after row 1).

Two, even arrangement and odd arrangement

An arrangement with an even number in the reverse order is called an even arrangement; an arrangement with an odd number in the reverse order is called an odd arrangement.
For example, in 2431, 21, 43, 41, and 31 are in reverse order, and the reverse number is 4, which is an even arrangement.

Three, linear equations

3.1. Concept

The linear equation system is a system of equations in which the unknowns are all first-order. The following figure shows a typical linear equation system:
Insert picture description here
1), where x1, x2,..., xn represent unknown quantities, αij(1≤i≤m,1 ≤j≤n) is called the coefficient of the equation, and bi(1≤i≤m) is called the constant term . The coefficients and constant terms are arbitrary complex numbers or elements of a certain domain.
2) When the constant terms b1, b2,..., bn are all equal to zero, the equations are called homogeneous linear equations .

The matrix A formed by the coefficients in front of the variables in the above equations:
Insert picture description here
called the coefficient matrix of the equation . Add a column consisting of constant terms to A to get a matrix of m rows and n+1 columns:
Insert picture description here
called an augmented matrix of equations .

3.2, the solution of linear equations

  • If x1=c1, x2=c2,..., xn=cn are substituted into the equations of the given linear equation, all equations are established, then (c1, c2,..., cn) is a solution of the linear equation
  • If the solutions c1, c2,..., cn of the linear equations are not all 0, then (c1, c2,..., cn) is called the non-zero solution of the linear equations
  • Homogeneous linear equations always zero solution (0,0, ..., 0)
  • A system of linear equations has a solution, which is called compatible , otherwise it is called incompatible
  • Two systems of equations, if they have the same number of unknowns and the same set of solutions, are called the same solution equation system or equivalent equation system
  • When the number of equations of a linear equation system is lower than the number of unknowns, this linear equation system has no unique solution, and this equation system has an infinite number of solutions. If you want to solve n unknowns with certainty and require the result to be unique, you need at least n equations, but n equations may not be able to confirm the unique solution, because some of them may be useless, for example, the first An equation constructed by adding two equations to the second equation, or an equation constructed by directly multiplying the coefficients at both ends of the equation.

3.3 Main problems in the study of linear equations

The main issues discussed in linear equations are:

  • Whether a system of equations has a solution and when there is a solution is the existence of the solution
  • There is the number of solutions to the system of equations, whether there is only one, that is, the uniqueness of the solution.
  • For solving equations with solutions, if there are multiple solutions, whether each solution can be found and the relationship between different solutions can be explained. This is the study of the structure of linear equations.

Fourth, the n-order determinant

4.1. Definition

According to certain rules, the algebraic sum formed by the product of a set of (n) numbers (called elements) arranged in a square is called the n-th order determinant.
For a square matrix:
Insert picture description here
define its determinant as:
Insert picture description here
aij is called the number or element of the i-th row and j column .
The result of the determinant is a scalar, where j1, j2,...,jn is a permutation of 1, 2,..., n (a total of n! permutations), so the n-order determinant is composed of n! terms, where :
Insert picture description here
That is, each item has a sign according to the following rules: when j1, j2,...,jn are even arranged, it has a positive sign, and when j1, j2,...,jn is an odd arrangement, it has a negative sign.

There is another way to confirm the sign of each term in the determinant algebra and calculation formula: arrange the position of the term in the determinant, swap two rows or two columns at a time, and move all the elements in the term to the determinant If the number to be exchanged is an even number, the sign of the corresponding item is a positive sign, otherwise it is a negative sign.

Case 1: 2*2 order determinant
Insert picture description here
Case 2: 3*3 order determinant
Insert picture description here

4.2. The main diagonal and the secondary diagonal of the determinant

The diagonal line from the upper left corner to the lower right corner in the determinant is called the main diagonal , and the diagonal line from the upper right corner to the lower left corner is called the secondary diagonal .

4.3, transpose the determinant

Turn the rows of the determinant D into columns and the columns into rows, without changing the order between them, then the new determinant is called the transposed determinant, which is D'.

4.4. Symmetrical and antisymmetric determinants

For the determinant:
Insert picture description here
if for any i, j belongs to [1,n], aij=aji (ij, ji are subscripts), then the determinant is called a symmetric determinant.
If for any i, j belongs to [1, n], aij=-aji (ij, ji are subscripts), at this time aii=0, then the determinant is called the antisymmetric determinant.

4.5, diagonal determinant

The n-th order diagonal determinant refers to a determinant in which the elements outside the main diagonal are all 0 (called the main diagonal determinant ) or the elements outside the sub-diagonal are all 0 (called the sub-diagonal determinant ).

The result of the main diagonal determinant is the product of all the elements of the main diagonal, and the absolute value of the result of the sub-diagonal determinant is the product of all the elements of the sub-diagonal, but its sign bit is minus one n(n-1)/ 2 to the power to confirm. which is:

Insert picture description here

4.6, upper and lower triangular determinants

The upper (lower) triangular determinant refers to the determinant whose elements above (under) the main diagonal are all 0. The results of the upper and lower triangular determinants are equal, which are equal to the product of the elements on the main diagonal. which is:

Insert picture description here

4.7 Vandermonde determinant


Insert picture description here
The determinant of the form: is called the van dermond determinant.

If D n is the van dermond determinant of order n(n>=2), then:

Insert picture description here
Among them: According to
Insert picture description here
the calculation method of Vandermonde determinant, the necessary and sufficient condition for the determinant to be 0 is that at least two of x 1 ,..., x n are equal.

4.8. The nature of the n-order determinant

  1. Property 1: The determinant is interchangeable, and the determinant remains unchanged. Therefore, if the two matrices are transposed to each other, their determinants are equal;
  2. Property 2: Multiplying all elements in a certain row (column) of the determinant by a number K is equivalent to multiplying the determinant by the number K;
  3. Property 3: If each element of a certain row (column) of the determinant is the sum of two elements, then this determinant is equal to the sum of two determinants, that is: if A=[a1,…,ai,…,an] , B=[a1,…,bi,…,an],C=[a1,…,ai+bi,…,an], then |C|=|A|+|B|;
  4. Property 4: If two rows (columns) in the determinant are the same, then the determinant is zero. (The so-called two rows (columns) are identical means that the corresponding elements of the two rows (columns) are equal);
  5. Property 5: If the two rows (columns) in the determinant are proportional, then the determinant is zero;
  6. Property 6: Add the multiple of one row (column) to another row (column), the determinant remains unchanged;
  7. Property 7: For the position of two rows (columns) in the new determinant, the determinant is reversed;
  8. Property 8: If A=[a1,…,ai,…,an], and the vector group a1,…,ai,…,an is linearly related, then |A|=0

5. Sub-determinant and remainder

Delete several rows and the same number of columns from the determinant D. The remaining m rows and m columns still constitute a determinant, which is called the m-th order sub-form of the original determinant , often denoted as:
Insert picture description here
subscript r1...rm Indicates the reserved row, s1...sm indicates the reserved column, the number of the two is the same, but the row number and column number corresponding to the original determinant are not necessarily the same. For example, the row retains even-numbered rows such as 2, 4, and 6, and the column If the odd column is reserved, the two are completely different, but if the reserved subscript satisfies any i∈[1,m], ri = si, that is, the reserved row number and column number are exactly the same, then the reserved sub-formula as principal minor . The elements at the intersection of the deleted row and column also constitute a determinant. If the principal sub-expression is recorded as M, the determinant formed by the deleted part is called the remainder of M , which is recorded as:
Insert picture description here

From another perspective, M is also the remainder of the original determinant with respect to the rest.

Multiply the remainder of M by the coefficient:
Insert picture description here
the value obtained is recorded as:
Insert picture description here

It referred to M corresponding to cofactor .

In particular , in the n-th order determinant D, after the i-th row and j-th column where the element a ij is located, the remaining n-1 order determinant is called the remainder of the element a ij , denoted as M ij , Multiply the remainder M ij by -1 i+j to the power of A ij . A ij is called the algebraic remainder of the element a ij . That is: A ij = (-1) i+j M ij

The remainder of a ij in D is the transposed determinant D'of the remainder in the transposed determinant of D.

6. Determinant expansion and Laplace's theorem

6.1. Theorem 1

n-order determinant D:
Insert picture description here
equal to the sum of the product of all elements in any row and its algebraic remainder, namely:
D = a i1 *A i1 +a i2 *A i2 +…+a in *A in
This theorem is usually Speaking of expanding the determinant according to the i-th row, similarly, we can also expand the determinant according to the column to get:
D = a 1i *A 1i +a 2i *A 2i +…+a ni *A ni

6.2 Theorem 2

The sum of the product of the algebraic remainder of each element in any one row of the n-order determinant and the corresponding element in the other row is equal to 0, that is:
a j1 *A i1 + a j2 *A i2 +…+a jn *A in = 0 ( i≠j)
Similarly, the same holds for changing rows to columns, namely:
a 1j *A 1i +a 2j *A 2i +…+a nj *A ni = 0 (i≠j)

6.3. Combination of theorems

The Theorems 1 and 2 were combined to obtain the following two important formulas:
Insert picture description here
introducing EK Nike symbol :
Insert picture description here
The above two equations can be written:
Insert picture description here

6.4, Laplace's theorem

Laplace's theorem is a method to calculate the reduced order determinant.

Theorem :
In the n-th order determinant D=|a ij |, arbitrarily take k rows (columns), 1≤k≤n, all k-th order subforms and their algebraic remainders formed by the elements of these k rows (columns) The sum of the products of the formula is equal to the value of the determinant D. This exhibition is called Laplace exhibition.

This theorem is also called the determinant, which expands by a certain k rows (columns).

Seven, use the determinant to solve linear equations

7.1. Solving binary linear equations

For
Insert picture description here
the linear equations of the second hospital: the augmented matrix corresponding to the linear equations is:
Insert picture description here

The corresponding solution is:
Insert picture description here
Remember:
Insert picture description here

Insert picture description here
Insert picture description here
Then the solution of the above-mentioned linear equations is recorded as:
Insert picture description here
This kind of representation method has a simple shape and is easy to remember.

7.2. Solving ternary linear equations

Suppose the ternary linear equation system is:
Insert picture description here
Let:
Insert picture description here
Insert picture description here
if D ≠ 0, the above linear equation system has a unique solution:
Insert picture description here

7.3. Solving n-ary linear equations

There are the following important theorems about the solution of n-ary linear equations. Suppose the linear equation system is:
Insert picture description here
its coefficient determinant D:
Insert picture description here
If the coefficient determinant corresponding to the coefficient matrix of the linear equation D≠0, the linear equation system has a unique solution, and the solution is:
Insert picture description here
where Dj corresponds to the element in the jth column of D The determinant obtained by replacing the ground with a constant term and keeping the remaining columns unchanged.

The above theorem is called Cramer's Theorem or Cramer's Law .

According to Cramer's theorem, if the equation system has no solution or two different solutions, then the coefficient determinant of the equation system must be equal to zero.

8. Summary

This section introduces the concepts related to the solution of linear equations, such as reverse order and reverse number, even arrangement and odd arrangement, and determinant, and introduces the method of using determinant to solve linear equations. Clem's theorem can be used to solve the solution of a linear equation system with a unique solution. However, when the linear equation system has many variables, this method requires a lot of calculation. To solve an N-order linear equation system, N+1 N-order Determinant. In addition, when the determinant of the coefficients of the equation system is equal to zero, Cramer's law fails.

Reference materials:

1. An introduction to the knowledge of Baidu Encyclopedia's n-order determinant
2. An introduction to the knowledge of Baidu Encyclopedia 's Clem theorem

Blogging is not easy, please support:

If you have gained something from reading this article, please like, comment, bookmark, thank you for your support!

For more introduction to the mathematical foundations of artificial intelligence, please refer to the
column website of the column "Basics of Artificial Intelligence" : https://blog.csdn.net/laoyuanpython/category_10382948.html

Paid column about the old ape

  1. The paid column " https://blog.csdn.net/laoyuanpython/category_9607725.html Using PyQt to Develop Graphical Interface Python Applications" specifically introduces the basic tutorials for Python-based PyQt graphical interface development. The corresponding article directory is " https://blog.csdn .net/LaoYuanPython/article/details/107580932 Use PyQt to develop a graphical interface Python application column directory ";
  2. The paid column " https://blog.csdn.net/laoyuanpython/category_10232926.html moviepy audio and video development column ) details the related methods of moviepy audio and video editing and synthesis processing and the use of related methods to process related editing and synthesis scenes, corresponding to the article The directory is " https://blog.csdn.net/LaoYuanPython/article/details/107574583 moviepy audio and video development column article directory ";
  3. The paid column " https://blog.csdn.net/laoyuanpython/category_10581071.html OpenCV-Python Difficult Questions for Beginners " is " https://blog.csdn.net/laoyuanpython/category_9979286.html OpenCV-Python graphics and image processing "The companion column" is an integration of the author’s personal perceptions of some of the problems encountered in the learning of OpenCV-Python graphics and image processing. The relevant information is basically the result of repeated research by the old ape, which helps OpenCV-Python beginners to more in-depth To understand OpenCV, the corresponding article directory is " https://blog.csdn.net/LaoYuanPython/article/details/109713407 OpenCV-Python Beginners Difficult Question Collection Column Directory ".

The first two columns are suitable for novice readers who have a certain Python foundation but no relevant knowledge. The third column, please combine " https://blog.csdn.net/laoyuanpython/category_9979286.html OpenCV-Python graphics and image processing " Learning to use.

For those who lack Python foundation, you can learn Python from scratch through Lao Yuan’s free column " https://blog.csdn.net/laoyuanpython/category_9831699.html column: Python basic tutorial directory ).

If you are interested and willing to support the readers of Old Ape, welcome to buy paid columns.

Learn Python from the old ape!

☞ ░Go to LaoYuanPython blog post directory https://blog.csdn.net/LaoYuanPython

Guess you like

Origin blog.csdn.net/LaoYuanPython/article/details/112500570