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!

5.6 Change the cubic form to the standard form by means of collocation

In addition to converting the quadratic form to the standard form by an orthogonal transformation, the Lagrange method can also be used.

Subject to a

Type HuaEr time


f = x 1 2 + 2 x 2 2 + 5 x 3 2 + 2 x 1 x 2 + 2 x 1 x 3 + 6 x 2 x 3 f=x_1^2+2x_2^2+5x_3^2+2x_1x_2+2x_1x_3+6x_2x_3

Is the standard type, and find the transformation matrix used

Answer:


f = x 1 2 + 2 x 2 2 + 5 x 3 2 + 2 x 1 x 2 + 2 x 1 x 3 + 6 x 2 x 3 = ( x 1 + x 2 + x 3 ) 2 x 2 2 x 3 2 2 x 2 x 3 + 2 x 2 2 + 5 x 3 2 + 6 x 2 x 3 = ( x 1 + x 2 + x 3 ) 2 + x 2 2 + 4 x 2 x 3 + 4 x 3 2 = ( x 1 + x 2 + x 3 ) 2 + ( x 2 + 2 x 3 ) 2 f=x_1^2+2x_2^2+5x_3^2+2x_1x_2+2x_1x_3+6x_2x_3\\ \quad \\ \quad =(x_1+x_2+x_3)^2-x_2^2-x_3^2-2x_2x_3+2x_2^2+5x_3^2+6x_2x_3\\ \quad \\ \quad=(x_1+x_2+x_3)^2+x_2^2+4x_2x_3+4x_3^2\\ \quad \\ \quad =(x_1+x_2+x_3)^2+(x_2+2x_3)^2

make


{ y 1 = x 1 + x 2 + x 3 y 2 = x 2 + 2 x 3 y 3 = x 3 \begin{cases} y_1=x_1+x_2+x_3\\ y_2=x_2+2x_3\\ y_3=x_3 \end{cases}

namely


{ x 1 = y 1 y 2 + y 3 x 2 = y 2 2 y 3 x 3 = y 3 \begin{cases} x_1=y_1-y_2+y_3\\ x_2=y_2-2y_3\\ x_3=y_3 \end{cases}

FFF can be converted to the standard form f=y12+y22f=y_1^2+y_2^2f=y12+y22, and the transformation matrix used is


C = [ 1 1 1 0 1 2 0 0 1 ] ( C = 1 indicates 0 ) C=\begin{bmatrix} 1 & -1 & 1\\ 0 & 1 & -2\\ 0 & 0 & 1 \end{bmatrix}(|C|=1\neq0)

Topic 2

Type HuaEr time


f = 2 x 1 x 2 + 2 x 1 x 3 6 x 2 x 3 f=2x_1x_2+2x_1x_3-6x_2x_3

Is the canonical form, and find the transformation matrix used

Answer:

If you look at FFF, it doesn’t have a square term, it has an x1x2x_1x_2x1x2 product term

make


{ x 1 = y 1 + y 2 x 2 = y 1 y 2 x 3 = y 3 \begin{cases} x_1=y_1+y_2\\ x_2=y_1-y_2\\ x_3=y_3 \end{cases}

I get the standard form


f = 2 y 1 2 2 y 2 2 4 y 1 y 3 + 8 y 2 y 3 f=2y_1^2-2y_2^2-4y_1y_3+8y_2y_3

Formula to


f = 2 ( y 1 y 3 ) 2 2 ( y 2 2 y 3 ) 2 + 6 y 3 2 f=2(y_1-y_3)^2-2(y_2-2y_3)^2+6y_3^2

I’m going to convert it to a normal form

make


{ z 1 = 2 ( y 1 y 3 ) z 2 = 2 ( y 2 2 y 3 ) z 3 = 6 y 3 \begin{cases} z_1=\sqrt{2}(y_1-y_3)\\ z_2=\sqrt{2}(y_2-2y_3)\\ z_3=\sqrt{6}y_3 \end{cases}

namely


{ y 1 = 1 2 z 1 + 1 6 z 3 y 2 = 1 2 z 2 + 2 6 z 3 y 3 = 1 6 z 3 \begin{cases} y_1=\frac{1}{\sqrt{2}}z_1+\frac{1}{\sqrt{6}}z_3\\ y_2=\frac{1}{\sqrt{2}}z_2+\frac{2}{\sqrt{6}}z_3\\ y_3=\frac{1}{\sqrt{6}}z_3 \end{cases}

Get the gauge form


f = z 1 2 z 2 2 + z 3 2 f=z_1^2-z_2^2+z_3^2

The transformation matrix used is


C = [ 1 0 1 1 1 0 0 0 1 ] [ 1 2 0 1 6 0 1 2 2 6 0 0 1 6 ] = [ 1 2 1 2 3 6 1 2 1 2 1 6 0 0 1 6 ] ( C indicates 1 6 ) C=\begin{bmatrix} 1 & 0 & 1\\ 1 & -1 & 0\\ 0 & 0 & -1 \end{bmatrix}\begin{bmatrix} \frac{1}{\sqrt{2}} & 0 & \frac{1}{\sqrt{6}} \\ 0 & \frac{1}{\sqrt{2}} & \frac{2}{\sqrt{6}} \\ 0 & 0 & \frac{1}{\sqrt{6}} \end{bmatrix}=\begin{bmatrix} \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} & \frac{3}{\sqrt{6}}\\ \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{6}}\\ 0 & 0 & \frac{1}{\sqrt{6}} \end{bmatrix}(|C|\neq-\frac{1}{6})

Conclusion:

  • By making a recipe with a square term, creating a square term without a square term, and then making a recipe again and again, you can turn the quadratic form into a canonical form
  • Notice that the final transformation matrix is the product of each change matrix

conclusion

Description:

  • Refer to textbook “linear algebra” fifth edition tongji University mathematics department
  • With the book concept explanation combined with some of their own understanding and thinking

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 ❤️