0

How to find an invertible matrix $P$ given $A$ such that $A=P^tXP?$ I am given a matrix $A$ and a matrix $B$ and I supposed to check whether $A$ is congruent to $B$, which basically requires me to find an invertible matrix $P$ such that $A=P^tBP.$ How do I do this?

Edit:

Here is the problem:

enter image description here

Student
  • 9,196
  • 8
  • 35
  • 81
  • 1
    The most direct way is to solve the system of equations in the coefficients of $P=(p_{ij})$ for $A=P^tBP$, where $A$ and $B$ are given. For reasonable small size of the matrices, this is easy. Why don't you give us the matrices $A$ and $B$? – Dietrich Burde Jan 03 '18 at 22:34
  • are $A$ and $B$ symmetric? – Will Jagy Jan 03 '18 at 22:37
  • 1
    "which basically requires..." Not really. There are ways to decide whether two matrices are congruent without having to explicitly solve for the change-of-basis matrix $P$. – symplectomorphic Jan 03 '18 at 22:41
  • @WillJagy Please see the edit. – Student Jan 03 '18 at 22:47
  • @DietrichBurde this is one of the things for which I have I have come across an algorithm, really the same (for real symmetric matrices) as repeated "completing the square" but requiring little, umm, cleverness. I used it in my answer. I do not think this method is commonly taught to undergraduates in the U.S. but certainly is taught in some other countries. Oh, it is usually taught in a single grid with "pivots," which I never liked. I write it all as matrix products. – Will Jagy Jan 03 '18 at 23:17

1 Answers1

1

ADDED: I'm just answering part (b) about congruence.

Congruence over the real numbers, with real symmetric matrices, is entirely governed by Sylvester's Law of Inertia. Just the signs of the eigenvalues. In turn these may be found without bothering about the eigenvalues themselves. $A$ and $C$ both have eigenvalues in pattern $++-$ and so are congruent over the reals.

However, $B$ has pattern $+++$

$$ E_j^T D_{j-1} E_j = D_j $$ $$ P_{j-1} E_j = P_j $$ $$ E_j^{-1} Q_{j-1} = Q_j $$ $$ P_j Q_j = I $$ $$ P_j^T H P_j = D_j $$ $$ Q_j^T D_j Q_j = H $$

$$ H = \left( \begin{array}{rrr} 1 & - 1 & 0 \\ - 1 & 2 & 0 \\ 0 & 0 & 3 \\ \end{array} \right) $$

==============================================

$$ E_{1} = \left( \begin{array}{rrr} 1 & 1 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ \end{array} \right) $$ $$ P_{1} = \left( \begin{array}{rrr} 1 & 1 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ \end{array} \right) , \; \; \; Q_{1} = \left( \begin{array}{rrr} 1 & - 1 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ \end{array} \right) , \; \; \; D_{1} = \left( \begin{array}{rrr} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 3 \\ \end{array} \right) $$

==============================================

$$ P^T H P = D $$ $$\left( \begin{array}{rrr} 1 & 0 & 0 \\ 1 & 1 & 0 \\ 0 & 0 & 1 \\ \end{array} \right) \left( \begin{array}{rrr} 1 & - 1 & 0 \\ - 1 & 2 & 0 \\ 0 & 0 & 3 \\ \end{array} \right) \left( \begin{array}{rrr} 1 & 1 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ \end{array} \right) = \left( \begin{array}{rrr} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 3 \\ \end{array} \right) $$ $$ Q^T D Q = H $$ $$\left( \begin{array}{rrr} 1 & 0 & 0 \\ - 1 & 1 & 0 \\ 0 & 0 & 1 \\ \end{array} \right) \left( \begin{array}{rrr} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 3 \\ \end{array} \right) \left( \begin{array}{rrr} 1 & - 1 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ \end{array} \right) = \left( \begin{array}{rrr} 1 & - 1 & 0 \\ - 1 & 2 & 0 \\ 0 & 0 & 3 \\ \end{array} \right) $$

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

your $D$ is back to $++-$ I call it $H,$ which stands for Hessian.

$$ E_j^T D_{j-1} E_j = D_j $$ $$ P_{j-1} E_j = P_j $$ $$ E_j^{-1} Q_{j-1} = Q_j $$ $$ P_j Q_j = I $$ $$ P_j^T H P_j = D_j $$ $$ Q_j^T D_j Q_j = H $$

$$ H = \left( \begin{array}{rrr} 0 & 1 & 0 \\ 1 & 0 & 0 \\ 0 & 0 & 2 \\ \end{array} \right) $$

==============================================

$$ E_{1} = \left( \begin{array}{rrr} 0 & 0 & 1 \\ 0 & 1 & 0 \\ 1 & 0 & 0 \\ \end{array} \right) $$ $$ P_{1} = \left( \begin{array}{rrr} 0 & 0 & 1 \\ 0 & 1 & 0 \\ 1 & 0 & 0 \\ \end{array} \right) , \; \; \; Q_{1} = \left( \begin{array}{rrr} 0 & 0 & 1 \\ 0 & 1 & 0 \\ 1 & 0 & 0 \\ \end{array} \right) , \; \; \; D_{1} = \left( \begin{array}{rrr} 2 & 0 & 0 \\ 0 & 0 & 1 \\ 0 & 1 & 0 \\ \end{array} \right) $$

==============================================

$$ E_{2} = \left( \begin{array}{rrr} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 1 & 1 \\ \end{array} \right) $$ $$ P_{2} = \left( \begin{array}{rrr} 0 & 1 & 1 \\ 0 & 1 & 0 \\ 1 & 0 & 0 \\ \end{array} \right) , \; \; \; Q_{2} = \left( \begin{array}{rrr} 0 & 0 & 1 \\ 0 & 1 & 0 \\ 1 & - 1 & 0 \\ \end{array} \right) , \; \; \; D_{2} = \left( \begin{array}{rrr} 2 & 0 & 0 \\ 0 & 2 & 1 \\ 0 & 1 & 0 \\ \end{array} \right) $$

==============================================

$$ E_{3} = \left( \begin{array}{rrr} 1 & 0 & 0 \\ 0 & 1 & - \frac{ 1 }{ 2 } \\ 0 & 0 & 1 \\ \end{array} \right) $$ $$ P_{3} = \left( \begin{array}{rrr} 0 & 1 & \frac{ 1 }{ 2 } \\ 0 & 1 & - \frac{ 1 }{ 2 } \\ 1 & 0 & 0 \\ \end{array} \right) , \; \; \; Q_{3} = \left( \begin{array}{rrr} 0 & 0 & 1 \\ \frac{ 1 }{ 2 } & \frac{ 1 }{ 2 } & 0 \\ 1 & - 1 & 0 \\ \end{array} \right) , \; \; \; D_{3} = \left( \begin{array}{rrr} 2 & 0 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & - \frac{ 1 }{ 2 } \\ \end{array} \right) $$

==============================================

$$ P^T H P = D $$ $$\left( \begin{array}{rrr} 0 & 0 & 1 \\ 1 & 1 & 0 \\ \frac{ 1 }{ 2 } & - \frac{ 1 }{ 2 } & 0 \\ \end{array} \right) \left( \begin{array}{rrr} 0 & 1 & 0 \\ 1 & 0 & 0 \\ 0 & 0 & 2 \\ \end{array} \right) \left( \begin{array}{rrr} 0 & 1 & \frac{ 1 }{ 2 } \\ 0 & 1 & - \frac{ 1 }{ 2 } \\ 1 & 0 & 0 \\ \end{array} \right) = \left( \begin{array}{rrr} 2 & 0 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & - \frac{ 1 }{ 2 } \\ \end{array} \right) $$ $$ Q^T D Q = H $$ $$\left( \begin{array}{rrr} 0 & \frac{ 1 }{ 2 } & 1 \\ 0 & \frac{ 1 }{ 2 } & - 1 \\ 1 & 0 & 0 \\ \end{array} \right) \left( \begin{array}{rrr} 2 & 0 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & - \frac{ 1 }{ 2 } \\ \end{array} \right) \left( \begin{array}{rrr} 0 & 0 & 1 \\ \frac{ 1 }{ 2 } & \frac{ 1 }{ 2 } & 0 \\ 1 & - 1 & 0 \\ \end{array} \right) = \left( \begin{array}{rrr} 0 & 1 & 0 \\ 1 & 0 & 0 \\ 0 & 0 & 2 \\ \end{array} \right) $$

Will Jagy
  • 139,541
  • Hey, thanks for answering, is there any book that you know which contains more information about this stuff. Like I have been looking at so many books but this thing is not contained in any of them, so I would be grateful if you could recommend a text. – Student Jan 03 '18 at 23:10
  • 1
    @SuperMario see Sylvester Inertia in wikipedia. For the algorithm, see http://math.stackexchange.com/questions/1388421/reference-for-linear-algebra-books-that-teach-reverse-hermite-method-for-symmetr – Will Jagy Jan 03 '18 at 23:12