Page 1 of 1

Kanonický tvar

Posted: Sun May 21, 2017 9:33 am
by Martin Sleziak
Vo všetkých skupinách bola zadaná matica kladne definitná a kanonický tvar bolo $y_1^2+y_2^2+y_3^2$ resp. $\operatorname{diag}(1,1,1)$.

Napíšem sem riešenie aspoň pre jednu skupinu.
Nájdite kanonický tvar kvadratickej formy
$$3x_1^2+6x_1x_2+2x_1x_3+4x_2^2+2x_2x_3+x_3^2.$$
Cez kladnú definitnosť
Asi najrýchlejšie to išlo, ak ste si všimli, že pre maticu tejto kvadratickej formy $A=\begin{pmatrix}
3 & 3 & 1 \\
3 & 4 & 1 \\
1 & 1 & 1
\end{pmatrix}$ platí:
$D_1=3$,
$D_2=
\begin{vmatrix}
3 & 3 \\
3 & 4
\end{vmatrix}=3\cdot4-3\cdot3=3
$,
$D_3=\begin{vmatrix}
3 & 3 & 1 \\
3 & 4 & 1 \\
1 & 1 & 1
\end{vmatrix}=12+3+3-4-3-9=2$.

Pretože $D_1,D_2,D_3>0$, táto matica (resp. táto kvadratická forma) je kladne definitná.
Z toho už viem povedať, že kanonický tvar je $\underline{\underline{y_1^2+y_2^2+y_3^2}}$.

Oplatí sa pozrieť aj na iné možnosti riešenia - lebo takýto postup nefunguje vždy. (Zhodou okolností boli matice vo všetkých skupinách zadané tak, že boli kladne definitné. Ešte by sa niečo podobné dalo použiť, ak sú záporne definitné. Ak by to tak nebolo, tak treba rátať inak.)
A navyše človeku nemusí napadnúť začať tým, že skontroluje kladnú definitnosť.

Cez dopĺňanie na štvorec
\begin{align*}
K(x_1,x_2,x_3)
&=3x_1^2+6x_1x_2+2x_1x_3+4x_2^2+2x_2x_3+x_3^2\\
&=(x_3+x_2+x_1)^2+2x_1^2+4x_1x_2+3x_2^2=\\
&=(x_3+x_2+x_1)^2+2(x_1+x_2)^2+x_2^2
\end{align*}
Vidíme, že diagonálny tvar bude $y_1^2+y_2^2+y_3^2$.

Ak by sme chceli zapísať aj maticovú identitu, tak dostaneme $A=PDP^T$ pre $P=
\begin{pmatrix}
1 & 1 & 0 \\
1 & 1 & 1 \\
1 & 0 & 0
\end{pmatrix}
$ a $D=\operatorname{diag}(1,2,1)$.
Spoiler:
$$
\begin{pmatrix}
1 & 1 & 0 \\
1 & 1 & 1 \\
1 & 0 & 0
\end{pmatrix}
\begin{pmatrix}
1 & 0 & 0 \\
0 & 2 & 0 \\
0 & 0 & 1
\end{pmatrix}
\begin{pmatrix}
1 & 1 & 1 \\
1 & 1 & 0 \\
0 & 1 & 0
\end{pmatrix}=
\begin{pmatrix}
1 & 1 & 0 \\
1 & 1 & 1 \\
1 & 0 & 0
\end{pmatrix}
\begin{pmatrix}
1 & 1 & 1 \\
2 & 2 & 0 \\
0 & 1 & 0
\end{pmatrix}=
\begin{pmatrix}
3 & 3 & 1 \\
3 & 4 & 1 \\
1 & 1 & 1
\end{pmatrix}
$$
To isté trochu inak. (V predošlom postupe som sa snažil vyhnúť zlomkom.)
\begin{align*}
K(x_1,x_2,x_3)
&=3x_1^2+6x_1x_2+2x_1x_3+4x_2^2+2x_2x_3+x_3^2\\
&=3(x_1^2+2x_1x_2+\frac23x_1x_3)+4x_2^2+2x_2x_3+x_3^2\\
&=3(x_1+x_2+\frac13x_3)^2+x_2^2+\frac23x_3^2
\end{align*}
Spoiler:
Ak by sme chceli zapísať aj maticovú identitu, tak dostaneme $A=PDP^T$ pre $P=
\begin{pmatrix}
1 & 0 & 0 \\
1 & 1 & 0 \\
\frac13 & 0 & 1
\end{pmatrix}
$ a $D=\operatorname{diag}(3,1,\frac23)$.
$$\begin{pmatrix}
1 & 0 & 0 \\
1 & 1 & 0 \\
\frac13 & 0 & 1
\end{pmatrix}
\begin{pmatrix}
3 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & \frac23
\end{pmatrix}
\begin{pmatrix}
1 & 1 & \frac13 \\
0 & 1 & 0 \\
0 & 0 & 1
\end{pmatrix}=
\begin{pmatrix}
1 & 0 & 0 \\
1 & 1 & 0 \\
\frac13 & 0 & 1
\end{pmatrix}
\begin{pmatrix}
3 & 3 & 1 \\
0 & 1 & 0 \\
0 & 0 & \frac23
\end{pmatrix}=
\begin{pmatrix}
3 & 3 & 1 \\
3 & 4 & 1 \\
1 & 1 & 1
\end{pmatrix}
$$

Cez riadkové a stĺpcové úpravy
$A=
\begin{pmatrix}
3 & 3 & 1 \\
3 & 4 & 1 \\
1 & 1 & 1
\end{pmatrix}\overset{r_1}\sim$ $
\begin{pmatrix}
2 & 2 & 0 \\
2 & 3 & 0 \\
1 & 1 & 1
\end{pmatrix}\overset{s_1}\sim$ $
\begin{pmatrix}
2 & 2 & 0 \\
2 & 3 & 0 \\
0 & 0 & 1
\end{pmatrix}\overset{r_2}\sim$ $
\begin{pmatrix}
2 & 2 & 0 \\
0 & 1 & 0 \\
0 & 0 & 1
\end{pmatrix}\overset{s_2}\sim$ $
\begin{pmatrix}
2 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & 1
\end{pmatrix}$
$\begin{pmatrix}
1 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & 1
\end{pmatrix}\overset{r_1}\sim$ $
\begin{pmatrix}
1 & 0 &-1 \\
0 & 1 &-1 \\
0 & 0 & 1
\end{pmatrix}\overset{r_2}\sim$ $
\begin{pmatrix}
1 & 0 &-1 \\
-1 & 1 & 0 \\
0 & 0 & 1
\end{pmatrix}$.

Upravil som to iba na diagonálny tvar, ale už vidno, že v ďalšom kroku by sme dostali kanonický tvar $\operatorname{diag}(1,1,1)$.

Môžeme aj prekontrolovať maticovú rovnosť $QAQ^T=D$
Spoiler:
$$\begin{pmatrix}
1 & 0 &-1 \\
-1 & 1 & 0 \\
0 & 0 & 1
\end{pmatrix}
\begin{pmatrix}
3 & 3 & 1 \\
3 & 4 & 1 \\
1 & 1 & 1
\end{pmatrix}
\begin{pmatrix}
1 &-1 & 0 \\
0 & 1 & 0 \\
-1 & 0 & 1
\end{pmatrix}=
\begin{pmatrix}
2 & 2 & 0 \\
0 & 1 & 0 \\
1 & 1 & 1
\end{pmatrix}
\begin{pmatrix}
1 &-1 & 0 \\
0 & 1 & 0 \\
-1 & 0 & 1
\end{pmatrix}=
\begin{pmatrix}
2 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & 1 \\
\end{pmatrix}
$$
V predošlom postupe som naschvál začal tak, že som používal posledný riadok - vyhol som sa počítaniu so zlomkami. Ak by som začal s prvým riadkom, tak by som dotal toto:
$A=\begin{pmatrix}
3 & 3 & 1 \\
3 & 4 & 1 \\
1 & 1 & 1
\end{pmatrix}\overset{r_1}\sim$ $
\begin{pmatrix}
3 & 3 & 1 \\
0 & 1 & 0 \\
0 & 0 & \frac23
\end{pmatrix}\overset{s_1}\sim$ $
\begin{pmatrix}
3 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & \frac23
\end{pmatrix}
$
$I=
\begin{pmatrix}
1 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & 1
\end{pmatrix}
\overset{r_1}\sim$ $
\begin{pmatrix}
1 & 0 & 0 \\
-1 & 1 & 0 \\
-\frac13 & 0 & 1
\end{pmatrix}
$
Opäť som to upravil iba na diagonálny tvar, ale je už jasné ako bude vyzerať kanonický tvar, ktorý dostaneme v ďalšom kroku.
Ako skúšku správnosti môžeme skontrolovať rovnosť $QAQ^T=D$.
Spoiler:
$$\begin{pmatrix}
1 & 0 & 0 \\
-1 & 1 & 0 \\
-\frac13 & 0 & 1
\end{pmatrix}
\begin{pmatrix}
3 & 3 & 1 \\
3 & 4 & 1 \\
1 & 1 & 1
\end{pmatrix}
\begin{pmatrix}
1 &-1 &-\frac13 \\
0 & 1 & 0 \\
0 & 0 & 1
\end{pmatrix}=
\begin{pmatrix}
3 & 3 & 1 \\
0 & 1 & 0 \\
0 & 0 & \frac23
\end{pmatrix}
\begin{pmatrix}
1 &-1 &-\frac13 \\
0 & 1 & 0 \\
0 & 0 & 1
\end{pmatrix}=
\begin{pmatrix}
3 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & \frac23
\end{pmatrix}
$$

Re: Kanonický tvar

Posted: Sun May 21, 2017 9:33 am
by Martin Sleziak
Komentáre k riešeniam z písomiek, chyby ktoré sa vyskytovali

V jednej z písomiek bol správny výpočet diagonálneho tvaru a aj príslušnej matice pre $A=\begin{pmatrix}
3 & 3 & 1 \\
3 & 4 & 1 \\
1 & 1 & 1
\end{pmatrix}$, konkrétne $Q=\begin{pmatrix}
\frac1{\sqrt2} & 0 &-\frac1{\sqrt2} \\
-1 & 1 & 0 \\
0 & 0 & 1
\end{pmatrix}$ a $D=
\begin{pmatrix}
1 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & 1
\end{pmatrix}$

Potom bolo napísané, že sme tým dostali takúto transformáciu premenných.
$$(y_1,y_2,y_3)=(x_1,x_2,x_3)\begin{pmatrix}
\frac1{\sqrt2} & 0 &-\frac1{\sqrt2} \\
-1 & 1 & 0 \\
0 & 0 & 1
\end{pmatrix}=
(\frac1{\sqrt2}x_1-x_2,x_2,-\frac1{\sqrt2}x_1+x_3)$$
t.j.
\begin{align*}
y_1&=\frac1{\sqrt2}x_1-x_2\\
y_2&=x_2\\
y_3&=-\frac1{\sqrt2}x_1+x_3
\end{align*}
Ľahko sa dá skontrolovať, že to nefunguje. Ak skutočne dosadíme túto transformáciu premenných, vyjde nám celkom iná kvadratická forma:
\begin{align*}
y_1^2+y_2^2+y_3^2
&= (\frac1{\sqrt2}x_1-x_2)^2+ x_2^2+(-\frac1{\sqrt2}x_1+x_3)^2\\
&= (\frac12 x_1^2 -\sqrt2x_1x_2 + x_2^2) + x_2^2+ (\frac12x_1^2+\sqrt2x_1x_3+x_3^2)\\
&= x_1^2-\sqrt2x_1x_2+\sqrt2x_1x_3+2x_2^2+x_3^2
\end{align*}

V skutočnosti ide o transformáciu premenných opačným smerom. Teda ak chceme zapísať z maticovej rovnosti príslušnú transformáciu premenných, môžeme to urobiť tak, že použijeme $(x_1,x_2,x_3)=(y_1,y_2,y_3)Q$. Z týchto rovníc buď vyjadríme $y_1$, $y_2$, $y_3$ alebo vyrátame $Q^{-1}$ čo nám dá transformáciu opačným smerom.

Konkrétne dostaneme
\begin{align*}
x_1&=\frac1{\sqrt2}y_1-y_2\\
x_2&=y_2\\
x_3&=-\frac1{\sqrt2}y_1+y_3
\end{align*}
čo nám dáva
\begin{align*}
y_1&=\sqrt2x_1+\sqrt2x_2\\
y_2&=x_2\\
y_3&=x_1+x_2+x_3
\end{align*}
Presne tú istú transformáciu premenných by sme dostali, ak by sme vypočítali maticu $Q^{-1}=
\begin{pmatrix}
\sqrt2 & 0 & 1 \\
\sqrt2 & 1 & 1 \\
0 & 0 & 1
\end{pmatrix}$.

Môžeme skontrolovať, že skutočne platí
\begin{align*}
y_1^2+y_2^2+y_3^2
&= (\sqrt2x_1+\sqrt2x_2)^2+x_2^2+(x_1+x_2+x_3)^2\\
&= (2x_1^2+4x_1x_2+2x_2^2)+x_2^2+(x_1^2+2x_1x_2+2x_1x_3+x_2^2+2x_2x_3+x_3^2)\\
&= 3x_1^2+6x_1x_2+2x_1x_3+4x_2^2+2x_2x_3+x_3^2
\end{align*}
Dostali sme teda presne zadanú kvadratickú formu.

Re: Kanonický tvar

Posted: Fri May 18, 2018 12:46 pm
by Martin Sleziak
Nájdite kanonický tvar kvadratickej formy
$$x_1^2+2x_2^2+6x_3^2+2x_1x_2+4x_1x_3+2x_2x_3.$$
Zodpovedajúca symetrická matica je
$$\begin{pmatrix}
1 & 1 & 2 \\
1 & 2 & 1 \\
2 & 1 & 6 \\
\end{pmatrix}
$$

Riešenie 1. Ak si všimneme, že matica je kladne definitná, tak hneď máme kanonický tvar.

$D_1=1$, $D_2=
\begin{vmatrix}
1 & 1 \\
1 & 2 \\
\end{vmatrix}=1
$, $D_3=\begin{vmatrix}
1 & 1 & 2 \\
1 & 2 & 1 \\
2 & 1 & 6 \\
\end{vmatrix}=12+2+2-8-6-1=1$.

Podľa Sylvestrovho kritéria je matica kladne definitná a teda kanonický tvar je $y_1^2+y_2^2+y_3^2$, matica je kongruentná sa jednotkovou maticou.
(Pri tomto postupe sme nezískali príslušnú transformáciu premenných - ale zadanie bolo sformulované tak, že som sa na ňu nepýtal. Samozrejme, ak nájdeme aj tú, máme výhodu že výsledok si vieme skontrolovať.)

Riešenie 2.
\begin{align*}
K(x_1,x_2,x_3)
&=x_1^2+2x_2^2+6x_3^2+2x_1x_2+4x_1x_3+2x_2x_3\\
&=(x_1+x_2+2x_3)^2+x_2^2-2x_2x_3+2x_3^2\\
&=(x_1+x_2+2x_3)^2+(x_2^2-x_3)^2+x_3^2
\end{align*}
Kanonický tvar je $y_1^2+y_2^2+y_3^2$.

Pri tomto postupe vieme vyčítať aj maticovú rovnosť maticovú rovnosť $PP^T=A$ pre
$$P=
\begin{pmatrix}
1 & 0 & 0 \\
1 & 1 & 0 \\
2 &-1 & 1 \\
\end{pmatrix}
$$
Spoiler:
Môžeme overiť roznásobením
$$
PP^T=
\begin{pmatrix}
1 & 0 & 0 \\
1 & 1 & 0 \\
2 &-1 & 1 \\
\end{pmatrix}
\begin{pmatrix}
1 & 1 & 2 \\
0 & 1 &-1 \\
0 & 0 & 1 \\
\end{pmatrix}=
\begin{pmatrix}
1 & 1 & 2 \\
1 & 2 & 1 \\
2 & 1 & 6 \\
\end{pmatrix}
$$
Riešenie 3.
$A=
\begin{pmatrix}
1 & 1 & 2 \\
1 & 2 & 1 \\
2 & 1 & 6 \\
\end{pmatrix}\overset{(1)}\sim$ $
\begin{pmatrix}
1 & 1 & 2 \\
0 & 1 &-1 \\
0 &-1 & 2 \\
\end{pmatrix}\overset{(1')}\sim$ $
\begin{pmatrix}
1 & 0 & 0 \\
0 & 1 &-1 \\
0 &-1 & 2 \\
\end{pmatrix}\overset{(2)}\sim$ $
\begin{pmatrix}
1 & 0 & 0 \\
0 & 1 &-1 \\
0 & 0 & 1 \\
\end{pmatrix}\overset{(2')}\sim$ $
\begin{pmatrix}
1 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & 1 \\
\end{pmatrix}
$

$I=
\begin{pmatrix}
1 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & 1 \\
\end{pmatrix}\overset{(1)}\sim$ $
\begin{pmatrix}
1 & 0 & 0 \\
-1 & 1 & 0 \\
-2 & 0 & 1 \\
\end{pmatrix}\overset{(2)}\sim$ $
\begin{pmatrix}
1 & 0 & 0 \\
-1 & 1 & 0 \\
-3 & 1 & 1 \\
\end{pmatrix}
$

Teraz dostávame maticovú rovnosť v inom poradí: $PAP^T=I$. Opäť sa dá skontrolovať vynásobením že skutočne platí.
Spoiler:
$PAP^T=$ $
\begin{pmatrix}
1 & 0 & 0 \\
-1 & 1 & 0 \\
-3 & 1 & 1 \\
\end{pmatrix}
\begin{pmatrix}
1 & 1 & 2 \\
1 & 2 & 1 \\
2 & 1 & 6 \\
\end{pmatrix}
\begin{pmatrix}
1 &-1 &-3 \\
0 & 1 & 1 \\
0 & 0 & 1 \\
\end{pmatrix}=$ $
\begin{pmatrix}
1 & 1 & 2 \\
0 & 1 &-1 \\
0 & 0 & 1 \\
\end{pmatrix}
\begin{pmatrix}
1 &-1 &-3 \\
0 & 1 & 1 \\
0 & 0 & 1 \\
\end{pmatrix}=$ $
\begin{pmatrix}
1 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & 1 \\
\end{pmatrix}
$

Re: Kanonický tvar

Posted: Wed May 20, 2020 3:25 pm
by Martin Sleziak
Nájdite kanonický tvar danej kvadratickej formy. Uveďte aj transformáciu premenných, ktorá ju prevedie na kanonický tvar:
$$x_1^2+2x_2^2+6x_3^2-2x_1x_2+2x_1x_3+2x_2x_3.$$
Ak preferujete maticový zápis, môžete úlohu riešiť pomocou neho. V~takom prípade sa ako riešenie očakáva vyjadrenie v~tvare $A=PDP^T$ alebo v tvare $D=QAQ^T$, kde $A$ je matica danej kvadratickej formy, $D$ je diagonálna matica a $P$ resp. $Q$ je nejaká regulárna matica. (Nežiadame, aby matica $P$ bola ortogonálna.)
Riešenie úpravou na kanonický tvar.

\begin{align*}
K(x_1,x_2,x_3)
&=x_1^2+2x_2^2+6x_3^2-2x_1x_2+2x_1x_3+2x_2x_3\\
&=(x_1-x_2+x_3)^2+x_2^2+4x_2x_3+5x_3^2\\
&=(x_1-x_2+x_3)^2+(x_2+2x_3)^2+x_3^2
\end{align*}

Teda máme zmenu premenných:
\begin{align*}
y_1&=x_1-x_2+x_3\\
y_2&=x_2+2x_3\\
y_3&=x_3
\end{align*}
$$(y_1,y_2,y_3)=(x_1,x_2,x_3)
\begin{pmatrix}
1 & 0 & 0 \\
-1 & 1 & 0 \\
1 & 2 & 1 \\
\end{pmatrix}
$$

Pre $P=
\begin{pmatrix}
1 & 0 & 0 \\
-1 & 1 & 0 \\
1 & 2 & 1 \\
\end{pmatrix}
$ máme
$$PDP^T=PP^T=
\begin{pmatrix}
1 & 0 & 0 \\
-1 & 1 & 0 \\
1 & 2 & 1 \\
\end{pmatrix}
\begin{pmatrix}
1 &-1 & 1 \\
0 & 1 & 2 \\
0 & 0 & 1 \\
\end{pmatrix}=
\begin{pmatrix}
1 &-1 & 1 \\
-1 & 2 & 1 \\
1 & 1 & 6 \\
\end{pmatrix}
$$

Riešenie riadkovými a stĺpcovými úpravami

$$A=
\begin{pmatrix}
1 &-1 & 1 \\
-1 & 2 & 1 \\
1 & 1 & 6 \\
\end{pmatrix}\overset{(1)}\sim
\begin{pmatrix}
1 &-1 & 1 \\
0 & 1 & 2 \\
0 & 2 & 5 \\
\end{pmatrix}\overset{(1')}\sim
\begin{pmatrix}
1 & 0 & 0 \\
0 & 1 & 2 \\
0 & 2 & 5 \\
\end{pmatrix}\overset{(2)}\sim
\begin{pmatrix}
1 & 0 & 0 \\
0 & 1 & 2 \\
0 & 0 & 1 \\
\end{pmatrix}\overset{(2')}\sim
\begin{pmatrix}
1 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & 1 \\
\end{pmatrix}
$$

$$I=
\begin{pmatrix}
1 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & 1 \\
\end{pmatrix}\overset{(1)}\sim
\begin{pmatrix}
1 & 0 & 0 \\
1 & 1 & 0 \\
-1 & 0 & 1 \\
\end{pmatrix}\overset{(2)}\sim
\begin{pmatrix}
1 & 0 & 0 \\
1 & 1 & 0 \\
-3 &-2 & 1 \\
\end{pmatrix}
$$

Pre maticu $Q=
\begin{pmatrix}
1 & 0 & 0 \\
1 & 1 & 0 \\
-3 &-2 & 1 \\
\end{pmatrix}$ máme
$$QAQ^T=
\begin{pmatrix}
1 & 0 & 0 \\
1 & 1 & 0 \\
-3 &-2 & 1 \\
\end{pmatrix}
\begin{pmatrix}
1 &-1 & 1 \\
-1 & 2 & 1 \\
1 & 1 & 6 \\
\end{pmatrix}
\begin{pmatrix}
1 & 1 &-3 \\
0 & 1 &-2 \\
0 & 0 & 1 \\
\end{pmatrix}=
\begin{pmatrix}
1 &-1 & 1 \\
0 & 1 & 2 \\
0 & 0 & 1 \\
\end{pmatrix}
\begin{pmatrix}
1 & 1 &-3 \\
0 & 1 &-2 \\
0 & 0 & 1 \\
\end{pmatrix}=
\begin{pmatrix}
1 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & 1 \\
\end{pmatrix}
$$
Môžeme si všimnúť, že pre matice ktoré nám vyšli platí $P=Q^{-1}$.

Sylvestrovo kritérium: Môžeme overiť aj kladnú definitnosť:
\begin{align*}
D_1&=1\\
D_2&=
\begin{vmatrix}
1 &-1 \\
-1 & 2 \\
\end{vmatrix}=2-1=1\\
D_3&=
\begin{pmatrix}
1 &-1 & 1 \\
-1 & 2 & 1 \\
1 & 1 & 6 \\
\end{pmatrix}=
12-1-1-2-1-6=1
\end{align*}