# Problems with determining the orthonormal basis regarding an inner product $B$

Can somebody tell me where I made a mistake? How would you approach such an exercise? Was my way too complicated?

$$B:\mathbb{R}^3\times \mathbb{R}^3\to \mathbb{R},\quad B(x,y)=\sum \limits_{i\neq j}^{}x_{i}y_{j}+2\sum \limits_{i=1}^{3}x_{i}y_{i}=x_{1}\cdot (2y_{1}+y_{2}+y_{3})+x_{2}\cdot (y_{1}+2y_{2}+y_{3}) +x_{3}\cdot (y_{1}+y_{2}+2y_{3})$$

The exercise was to first determine an orthonormal basis for $$(1,1,1)^{\perp }$$ ( the orthogonal complement of (1,1,1)) regarding $$B$$.

So I guessed $$v:=(-1,1,0)^T$$ as one orthogonal vector of $$(1,1,1)$$, which is true because $$B(\begin{pmatrix} 1\\1\\1 \end{pmatrix}, \begin{pmatrix} -1\\1\\0 \end{pmatrix}) =0$$

Then I did the following:

(i) $$B(\begin{pmatrix} 1\\1\\1 \end{pmatrix}, \begin{pmatrix} y_{1}\\y_{2}\\y_{3} \end{pmatrix}) = 4y_{1}+4y_{2}+4y_{3} =0$$

(ii) $$B(\begin{pmatrix} -1\\1\\0 \end{pmatrix}, \begin{pmatrix} y_{1}\\y_{2}\\y_{3} \end{pmatrix})= -y_{1}+y_{2} =0 \leftrightarrow y_{1}=y_{2}$$

So I defined $$y_{1}=y_{2}=\mu$$ with $$\mu\in \mathbb{R}$$. If you put that value in (i) you get $$y_{3}=-2\mu$$, $$w:= \mu \begin{pmatrix} 1\\1\\-2 \end{pmatrix})$$

Now I calculated $$B(\begin{pmatrix} 1\\1\\1 \end{pmatrix}, \begin{pmatrix} 1\\1\\1 \end{pmatrix}) =12, B(\begin{pmatrix} -1\\1\\0\end{pmatrix}, \begin{pmatrix} -1\\1\\0 \end{pmatrix}) =2, B(\begin{pmatrix} 1\\1\\-2 \end{pmatrix}, \begin{pmatrix} 1\\1\\-2 \end{pmatrix}) =6\\ \rightarrow\Vert (1,1,1)^T \| =\sqrt{12}, \quad \Vert (-1,1,0)^T \| =\sqrt{2},\quad \Vert (1,1,-2)^T \| =\sqrt{6}$$

So $$C=(\frac{(-1,1,0)^T}{\sqrt{2}}, \frac{(1,1,-2)^T}{\sqrt{6}})$$ is an orthonormal basis for $$(1,1,1)^{\perp }$$ regarding B.

The next exercise was to determine a orthonormal basis of $$\mathbb{R}^3$$ regarding $$B$$.

Since $$D=(\frac{(1,1,1)^T}{\sqrt{12}},\frac{(-1,1,0)^T}{\sqrt{2}}, \frac{(1,1,-2)^T}{\sqrt{6}})$$are linear independent, D should be a orthonormal basis of $$\mathbb{R}^3$$ regarding $$B$$.

But then $$Q$$ with the vectors of $$D$$ as rows should be an orthogonal matrix, so that $$Q\cdot Q^{T}=E_{3}$$, with $$E_{3}$$ being the 3x3 identity matrix.

$$\begin{pmatrix} \frac{\sqrt{12}}{12} & \frac{-\sqrt{2}}{2} & \frac{\sqrt{6}}{6} \\ \frac{\sqrt{12}}{12} &\frac{\sqrt{2}}{2} &\frac{\sqrt{6}}{6} \\\frac{\sqrt{12}}{12}&0&\frac{-\sqrt{6}}{3} \end{pmatrix}\cdot \begin{pmatrix} \frac{\sqrt{12}}{12} &\frac{\sqrt{12}}{12} &\frac{\sqrt{12}}{12} \\ \frac{-\sqrt{2}}{2} &\frac{\sqrt{2}}{2} &0 \\\ \frac{\sqrt{6}}{6}& \frac{\sqrt{6}}{6}&\frac{-\sqrt{6}}{3} \end{pmatrix} \neq E_{3}$$

That is the reason why I think that I made a mistake.

PS: I'm not used to writing about math in English; please ask if something doesn't make sense to you.

You're so close. When you write $$Q^t Q = I,$$ that means that the dot-product of the $$i$$th column of q with the $$j$$th column of $$Q$$ is $$\delta_{ij}$$, the $$ij$$-element of the identity. But the "dot product" here is the ordinary dot product. You want to make this claim using YOUR inner product. For that, you aim to get $$Q^t B Q = I$$ where $$B$$ is the matrix representing your inner product. If you need to do it with rows instead of columnss, then you're hoping for $$Q B Q^t = I.$$

Post-comment additions You've got the matrix $$Q$$ transposed. You said that you wanted the basis vectors as rows of $$Q$$, but your last equation has them as columns. This isn't very important, however.

The matrix $$Q$$ (with your vectors as rows) has the property that $$Q B Q^t = I$$ You can see that here numerically, from a matlab program I wrote. (In matlab, multiplying means "matrix multiply", and A' means "the transpose of matrix A". A semicolon at the end of a line suppresses output.)

B = [2 1 1; 1 2 1; 1 1 2]
d = [1 1 1]
v = [-1 1 0]
v * B * d'
w = [1 1 -2]
w * B * d'
v * B * v'
w * B * w'
d * B * d'
v = v/sqrt(2);
w = w/sqrt(6);
d = d/sqrt(12);
Q = [d;v;w]
Q * B * Q'


The output of this program is just what you'd expect (except that I've added comments after //, and deleted some blanks lines):

B =
2     1     1
1     2     1
1     1     2
d =
1     1     1
v =
-1     1     0
ans =
0  // so inner prod (using B) of d and v is zero
w =
1     1    -2
ans =
0  // same for inner prod of d and w
ans =
2  // v has squared-length 2 (using the B inner product!)
ans =
6  // w has squared-length 6
ans =
12  // d has squared-length 12
// we divide each by its (B-based) length to get rows of Q
// Notice that the length of these rows, with usual dot-prod, is not 1!
Q =
0.2887    0.2887    0.2887
-0.7071    0.7071         0
0.4082    0.4082   -0.8165
ans =    // so Q B Q^t is the identity (up to small numerical differences)
1.0000         0   -0.0000
0    1.0000         0
-0.0000   -0.0000    1.0000


You've raised the concern that "det Q" is not 1, which it should be if $$Q$$ is orthogonal...and that's correct, if it's orthogonal with respect to the usual inner product. But it's actually orthogonal with respect to the inner product defined by $$B$$, which gives an altogether different result, as you discovered.

In short: aside from using columns instead of rows when you built $$Q$$, everything you did is just fine. Your matrix $$Q$$ really is orthogonal (in the $$B$$-metric).

• But the representing Matrix $B$ is the identity matrix, because D is an orthonormal basis, and then there would not be a difference to $QQ^t = I$ since $Q^t B Q =Q^t I Q =Q^t Q = I$, or am I wrong? – CherryBlossom1878 Mar 11 '19 at 19:26
• Yes, you are wrong. In the standard basis, the matrix for your inner product is $\pmatrix{2 & 1 & 1\\ 1 & 2 & 1 \\ 1 & 1 & 2}$; you can read the $ij$ coefficient in this matrix as the coefficient of $x_i y_j$ in your very first displayed equation. – John Hughes Mar 11 '19 at 19:29
• BTW, your question was written really nicely, and your mathematical english was entirely understandable. – John Hughes Mar 11 '19 at 19:29
• One way to check this is the right matrix is to compute $\langle\pmatrix{1&0&0}, \pmatrix{0 & 1 & 0} \rangle$, which I claim is $\pmatrix{1&0&0}\pmatrix{2 & 1 & 1\\ 1 & 2 & 1 \\ 1 & 1 & 2}\pmatrix{0\\1\\0} = 1$, which is the correct value, while the ordinary dot product of these two vectors is $0$. (Of course, to really check, you need to do inner products of all pairs of basis vectors, not just one example!) – John Hughes Mar 11 '19 at 19:32
• Thank you for the positive feedback and your answer :) So M:=$\pmatrix{2 & 1 & 1\\ 1 & 2 & 1 \\ 1 & 1 & 2}$ is a representing Matrix of $B$ in relation to the standard basis of $\mathbb{R}^3$ and I actually computed $Q^tMQ=I$, so my basis D seems to be a orthonormal basis of $\mathbb{R}^3.$ What I don't understand is why you choose M in relation to the standard basis? I thought that I need to choose M in relation to my basis D, so that in this case the gramian matrix M is the identity matrix. – CherryBlossom1878 Mar 11 '19 at 21:00