Small knowledge, big challenge! This article is participating in the creation activity of “Essential Tips for Programmers”.

preface

Hello! Friend!!!

Thank you very much for reading haihong’s article, if there are any mistakes in the article, please point out ~

 

Self-introduction ଘ(੭, ᵕ)੭

Nickname: Haihong

Tag: programmer monkey | C++ contestant | student

Introduction: because of C language to get acquainted with programming, then transferred to the computer major, had the honor to get some national awards, provincial awards… Has been confirmed. Currently learning C++/Linux/Python

Learning experience: solid foundation + more notes + more code + more thinking + learn English well!

 

Machine learning little White stage

The article is only used as my own study notes for the establishment of knowledge system and review

Know what is, know why!

1.7 Cramer’s Rule

content

With n unknowns x1,x2… ,xnx_1,x_2,… ,x_nx1,x2,… Xn system of n linear equations


{ a 11 x 1 + a 12 x 2 + . . . + a 1 n x n = b 1 a 21 x 1 + a 22 x 2 + . . . + a 2 n x n = b 2 . . . . . . . . . . . . . . . . . . . . a n 1 x 1 + a n 2 x 2 + . . . + a n n x n = b n (1) \begin{cases} a_{11}x_1+a_{12}x_2+… +a_{1n}x_n=b_1 \\ a_{21}x_1+a_{22}x_2+… +a_{2n}x_n=b_2 \\ ……………….. \\ a_{n1}x_1+a_{n2}x_2+… +a_{nn}x_n=b_n \\ \end{cases} \tag1

Kramer’s law: If the determinant of the coefficients of the system of linear equations (1) is not equal to zero, i.e


D = a 11 . . . a 1 n a 21 . . . a 2 n . . . . a n 1 . . . a n n indicates 0 D=\begin{vmatrix} a_{11} &… & a_{1n}\\ a_{21} & … &a_{2n}\\ . & &. \\ . & & . \\ a_{n1} &… & a_{nn}\\ \end{vmatrix} \neq 0

Then, the system (1) has a unique solution


x 1 = D 1 D . x 2 = D 2 D . . . . . x n = D n D x_1=\frac{D_1}{D},x_2=\frac{D_2}{D},… ,x_n=\frac{D_n}{D}

Among them, the Dj (j = 1, 2,… , n) D_j (j = 1, 2,… , n) Dj (j = 1, 2,… ,n) is the n-order determinant obtained by substituting the JTH column element in the coefficient determinant DDD with the constant term at the right end of the equations.

namely


D j = a 11 . . a 1 . j 1 . . b 1 a 1 . j + 1 . . a 1 n . . . . . . . . . . . . . . . a n 1 . . a n . j 1 . . b n a n . j + 1 . . a n n D_j=\begin{vmatrix} a_{11} &.. & a_{1,j-1}&.. &b_1&a_{1,j+1}&.. & a_{1n}\\ . & &. & & . & .& &. \\ . & &. & & . & .& &. \\ . & &. & & . & .& &. \\ a_{n1} &.. & a_{n,j-1}&.. &b_n&a_{n,j+1}&.. & a_{nn}\\ \end{vmatrix}

Theorem 4

If the determinant of the coefficients of the linear equations (1) is D≠0D \neq 0D=0, then (1) must have a solution and the solution is unique

Inverse negation of theorem 4

If the system of linear equations (1) has no solution or two different solutions, the determinant of its coefficients must be 0

Nonsingular/singular linear equations

Odd degree linear system of equations


{ a 11 x 1 + a 12 x 2 + . . . + a 1 n x n = 0 a 21 x 1 + a 22 x 2 + . . . + a 2 n x n = 0 . . . . . . . . . . . . . . . . . . . . a n 1 x 1 + a n 2 x 2 + . . . + a n n x n = 0 \begin{cases} a_{11}x_1+a_{12}x_2+… +a_{1n}x_n=0 \\ a_{21}x_1+a_{22}x_2+… +a_{2n}x_n=0 \\ ……………….. \\ a_{n1}x_1+a_{n2}x_2+… +a_{nn}x_n=0 \\ \end{cases}

Nonsingular linear equations (B1, B2… Bnb_1 b_2… B_nb1, b2… Bn is not all zero.)


{ a 11 x 1 + a 12 x 2 + . . . + a 1 n x n = b 1 a 21 x 1 + a 22 x 2 + . . . + a 2 n x n = b 2 . . . . . . . . . . . . . . . . . . . . a n 1 x 1 + a n 2 x 2 + . . . + a n n x n = b n \begin{cases} a_{11}x_1+a_{12}x_2+… +a_{1n}x_n=b_1 \\ a_{21}x_1+a_{22}x_2+… +a_{2n}x_n=b_2 \\ ……………….. \\ a_{n1}x_1+a_{n2}x_2+… +a_{nn}x_n=b_n \\ \end{cases}

For singular linear equations


{ a 11 x 1 + a 12 x 2 + . . . + a 1 n x n = 0 a 21 x 1 + a 22 x 2 + . . . + a 2 n x n = 0 . . . . . . . . . . . . . . . . . . . . a n 1 x 1 + a n 2 x 2 + . . . + a n n x n = 0 \begin{cases} a_{11}x_1+a_{12}x_2+… +a_{1n}x_n=0 \\ a_{21}x_1+a_{22}x_2+… +a_{2n}x_n=0 \\ ……………….. \\ a_{n1}x_1+a_{n2}x_2+… +a_{nn}x_n=0 \\ \end{cases}

x1=x2=… =xn=0x_1=x_2=… =x_n=0x1=x2=… Xn equals 0 must be the solution, and the solution is called the zero solution. A set of solutions that are not all zero is said to be nonzero. Singular linear equations must have zero solutions, but not necessarily non-zero solutions.

Theorem 5

If the coefficient determinant of the system of odd linear equations D≠0D \neq0D=0, the system of odd linear equations has no non-zero solution.

Because D≠0D \neq0D=0, it means that there is only one solution, and the zero solution must exist, so the solution can only be zero. If the system of odd linear equations has a non-zero solution, then the determinant of its coefficients D=0D =0D=0

conclusion

The essay is just a study note, recording a process from 0 to 1

Hope to help you, if there is a mistake welcome small partners to correct ~

I am haihong ଘ(੭, ᵕ)੭

If you think it’s ok, please give it a thumbs up

Thanks for your support ❤️