= Solution
Choose the <Givens rotation> convention in which $\Omega^{[p,q]}$ equals the identity outside rows and columns $p,q$, and has block
$$
\begin{pmatrix}\cos\theta&\sin\theta\\-\sin\theta&\cos\theta\end{pmatrix}
$$
in those coordinates. It is an <orthogonal matrix>. For any chosen column $j$, write $u=A_{pj}$, $v=A_{qj}$ and $r=\sqrt{u^2+v^2}$. If $r>0$, take $\cos\theta=u/r$, $\sin\theta=v/r$. Then the new entries are $r$ and $-vu/r+uv/r=0$. If both entries vanish, take $\theta=0$. This proves the requested elimination for each chosen $j$; the angle is allowed to depend on $j$, and one angle need not eliminate an entire arbitrary row.
For the given <matrix>, use $\cos\theta=\sin\theta=1/\sqrt2$ first for $\Omega^{[1,2]}$, obtaining
$$
\Omega^{[1,2]}A=\begin{pmatrix}\sqrt2&7/\sqrt2&3\sqrt2\\0&1/\sqrt2&\sqrt2\\\sqrt2&7/\sqrt2&4\sqrt2\end{pmatrix}.
$$
Use the same cosine and sine for $\Omega^{[1,3]}$. It makes
$$
R=\Omega^{[1,3]}\Omega^{[1,2]}A=\begin{pmatrix}2&7&7\\0&1/\sqrt2&\sqrt2\\0&0&1\end{pmatrix}.
$$
This is already upper triangular, including the zero $(3,2)$ entry, and every leading nonzero row entry is positive. Thus the requested <QR decomposition> is
$$
\boxed{Q=(\Omega^{[1,3]}\Omega^{[1,2]})^T=\begin{pmatrix}1/2&-1/\sqrt2&-1/2\\1/2&1/\sqrt2&-1/2\\1/\sqrt2&0&1/\sqrt2\end{pmatrix},\qquad
R=\begin{pmatrix}2&7&7\\0&1/\sqrt2&\sqrt2\\0&0&1\end{pmatrix}.}
$$
The <orthogonal matrix> property follows from the two rotations, and direct multiplication verifies $A=QR$.
Back to article page