# QR decomposition with linearly dependent vectors

Can I calculate the QR-decomposition of the matrix below, even if there are 2 linearly dependent column vectors? Or should I form the QR-decomposition of those 2 vectors, which are linearly independent to each other.

$$\begin{bmatrix}0 & 0 & 4\\6 & 3 & 1\\-2 & -1 & -1\\2 & 1 & 5\\2 & 1 & 3\end{bmatrix}$$

• Welcome to math SE. Have a look at mathjax to help you with mathematical expression. With mathjax, you will be able to include the matrix directly instead of a picture. – Alain Remillard Jan 16 at 14:26

Your matrix is of the form of $$\begin{bmatrix} v_1, \frac12v_1, v_2\end{bmatrix}$$

We can find an orthogonal basis for $$\operatorname{Span}\{v_1, v_2\}$$, let it be $$w_1, w_2$$ where $$v_1=\|v_1\|w_1$$ and $$v_2=r_{13}w_1+r_{23}w_2$$.

We let $$Q=\begin{bmatrix} w_1 & w_2, & \ldots, &w_5\end{bmatrix}$$ be an orthogonal matrix and let $$\hat{Q}$$ be the matrix that only consists of the first two columns of $$Q$$.

Then we have

$$\begin{bmatrix}v_1 & v_2 & v_3 \end{bmatrix}=Q\begin{bmatrix} \|v_1\| & \frac12\|v_1\| & r_{13}\\ 0 & 0 & r_{23} \\ 0 & 0 & 0 \\ 0 & 0 & 0\\ 0 & 0 & 0\end{bmatrix}$$

The thin QR decomposition can be written as

$$\begin{bmatrix}v_1 & v_2 & v_3 \end{bmatrix}=\hat{Q}\begin{bmatrix} \|v_1\| & \frac12\|v_1\| & r_{13}\\ 0 & 0 & r_{23} \end{bmatrix}$$