# For given column vectors $x$, $y$ how to find an orthogonal matrix $Q$ such that $Qx=y$

Problem: Given $$x=[1,7,2,3,-1]^T$$and $$y=[-4,4,4,0,-4]^T$$, find an orthogonal matrix $$Q$$ such that $$Qx=y$$.

My attempt: I know the definition of an orthogonal matrix. By definition, if $$Q$$ is an orthogonal matrix then $$Q^{-1}=Q^T$$. Further, I know if system of equations $$Ax=b$$ where $$A$$ is square matrix, has a solution if $$b$$ is in column space of $$A$$ i.e. if $$rank(A:b)=rank(A)$$.

I didn't able to solve above problem :-( please help me.

• Look up Householder reflection. – Chris Custer Jan 1 at 7:04
• Sir, I didn't know the notion of the Householder reflection. Can't we solve directly? – Akash Patalwanshi Jan 1 at 7:09

## 1 Answer

If you let $$v=\frac{x-y}{\mid\mid y-x\mid\mid}$$.

$$A=I-2vv^t$$ should do the trick.

This is called the Householder reflection.

• Sir thanks for your answer. Sir your answer shows such matrix exists. but, Why such a matrix exists? and how we know when it doesn't exist? – Akash Patalwanshi Jan 1 at 7:35
• Note that the two vectors have the same norm. – Chris Custer Jan 1 at 7:38
• This shows that it works:math.stackexchange.com/a/1903322 – Chris Custer Jan 1 at 7:44