# Given two vectors and Nul A, find Matrix A

I am trying to solve this problem of finding matrix A, given null space.

Let u = $\begin{bmatrix}1 \\1 \\ 2\end{bmatrix}$ and v = $\begin{bmatrix}1 \\0 \\ -1\end{bmatrix}$. Find matrix A such that Nul A = Span {u, v}

I know that if you want to find A given only one vector (e.g. w) in Nul A, you just have to find all solutions Aw = 0. But what about two vectors? Should I find sum of them?

• Do you have any restriction on the size of $A$? – 5xum Apr 10 '17 at 13:48
• Nope. I don't think that it's about size of A. It will probably be 2 by 3 or 1 by 3. – oneturkmen Apr 10 '17 at 13:57

If the size doesn't matter, then let's look for a matrix $\begin{bmatrix}x & y &z\end{bmatrix}$ such that:

$$\begin{bmatrix}x & y &z\end{bmatrix}\begin{bmatrix}1 \\1 \\ 2\end{bmatrix}=0$$ $$\begin{bmatrix}x & y &z\end{bmatrix}\begin{bmatrix}1 \\0 \\ -1\end{bmatrix}=0$$

We get:

$$\begin{cases} x+y+2z=0 \\ x-z=0 \end{cases}$$ The solution of that system is $\text{sp}\{(1,-3,1)\}$.

So we can choose $A=\begin{bmatrix}1 & -3 &1\end{bmatrix}$

• Thank you very much! I did not know that you can combine them under the system and just find x, y, z through row reduction. – oneturkmen Apr 10 '17 at 14:08
• @alwaysone No problem. You should just remember what we're looking for: a matrix (vector in that case) such that the product of multiplication in the two vectors given will get us $0$. – Itay4 Apr 10 '17 at 14:11
• Why not directly take for $A$ the cross product of $u$ and $v$ ? – Jean Marie Apr 10 '17 at 14:18

A solution is

$$P=\begin{pmatrix}\ \ 1&-3&\ \ 1\\ -3& \ \ \ 9&-3\\ \ \ 1&-3&\ \ 1\end{pmatrix}.$$

I obtained it as (a multiple of) the matrix of orthogonal projection on the line defined by vector $w=u \times v$ using the following (apparently complicated) formula:

$$P=I_3-M(M^TM)^{-1}M^T$$

(where $M:=(u|v)$ is the $3 \times 2$ matrix with columns $u$ and $v$).

Proof: We are going to prove that $Pu=0$ and $Pv=0$ at the same time by proving that $P(u|v)=0$ i.e. by proving that $PM=0$. The proof is straightforward:

$$PM=(I_3-M(M^TM)^{-1}M^T)M=I_3M-M(M^TM)^{-1}(M^TM)=M-M=0$$

• This also works, but we did not reach that point in the course, where we cover orthogonality. Thanks anyway! I saved this method as well - might need it in future. – oneturkmen Apr 10 '17 at 14:14
• This kind of matrix is very well known in the framework of what is called "least squares methods" – Jean Marie Apr 10 '17 at 14:17
• Is it somehow related to "OLS" - "Ordinary Least Squares", from Statistics (regression)? – oneturkmen Apr 10 '17 at 14:18
• I see our remarks have been sent almost at the same time... – Jean Marie Apr 10 '17 at 14:19

The vectors given are in the 3d-space, and they are linearly independent. So their span is some plane passing through the origin. Geometrically there is a unique line passing through the origin that is perpendicular to the plane. Take a point $(a,b,c)$ in that line. So the equation is $ax+by+cz=0$ which will be satisfied precisely by the span of $u$ and $v$. To find the vector $(a,b,c)$ perpendicular to given vectors $u$ and $v$ take their cross-product $u\times v$ as in JeanMarie's answer.