# How to compute distance with respect to inner product?

Suppose $$A$$ is the invertible matrix :

$$A= \begin{pmatrix} 2 & 0 & 1\\ 0 & 1 & -1\\ 1 & 0 & 1 \end{pmatrix}$$

We know that the function given by $$\langle u,v\rangle = (Au)\cdot (Av)$$ is an inner product on $$\mathbb{R}^3$$. Compute the distance between $$(1,0,0)$$ and $$(0,1,0)$$ with respect to this inner product.

How would you go about solving this?

An inner product $$\langle\cdot\rangle$$ defines a norm by $$\|x\|^2= \langle x,x\rangle$$, or equivalently, $$\|x\|=\sqrt{\langle x,x\rangle}$$. A norm defines a distance by $$d(x,y)=\|x-y\|$$.

So the distance is $$\|(1,0,0)-(0,1,0)\|= \|(1,-1,0)\|= \sqrt{\langle (1,-1,0),(1,-1,0)\rangle} = \sqrt{A(1,-1,0)\cdot A(1,-1,0)}$$

Now compute the matrix product etc.

Notice that $$Ae_i$$ is the $$i$$-th column of $$A$$ so

$$\|e_1-e_2\|^2 = \|A(e_1 - e_2)\|_2^2 = \|Ae_1 - Ae_2\|_2^2 = \left\|\begin{pmatrix} 2 \\ -1 \\ 1\end{pmatrix}\right\|^2 = 2^2 + (-1)^2 + 1^2 = 6$$

and therefore $$\|e_1-e_2\| = \sqrt6$$.

• The answer should be root 6 not root 5? Unless I am missing something your vector should be (2,-1,1) not (2,-1,0) – Forextrader Jul 11 at 19:48
• @Forextrader Oh my. Thanks, fixed. – mechanodroid Jul 11 at 19:51

Hint: How would you usually calculate the distance between the two points? Can you formulate that in terms of the standard inner product? Now do the calculation with this new inner product instead of the standard one.

If $$x=(1,0,0)$$ and $$y=(0,1,0)$$, the distance between them is given by $$\| x-y\|$$. And recall that, the norm is defined by $$\| v\|=\sqrt{\langle v,v\rangle}$$. Thus $$\| x-y\|=\| (1,-1,0)\|=\sqrt{\langle (1,-1,0),(1,-1,0)\rangle }=\cdots$$

• Thank you, I did actually get that far (which I should have stated in the original post) but how does matrix A tie into the result? – Forextrader Jul 11 at 19:25
• @Forextrader You are told that $\langle u,v\rangle = (Au)\cdot (Av)$. In the final expression given here, you have two vectors in angle brackets (the two vectors happen to be equal, but that's inconsequential). How do you think the matrix $A$ ties into the result? – Arthur Jul 11 at 19:32