# Find the QR factorization of the matrix $$\begin{bmatrix}2 & 1\\ 3 & -1\end{bmatrix}$$

LEt the columns of A is x1, x2. So, x1 = (2, 3) and x2 = (1, -1)

Let v1 = x1 = (2, 3)

v2 = x2 – $$\frac{x_2 . v_1}{v_1 . v_2}$$ . v1

= (1, -1) – $$\frac{(1, -1) . (2, 3)}{(2, 3) (2, 3)}$$ (2, 3)

= (1, -1) – $$\frac{-1}{13}$$ (2, 3)

= $$\left ( 1 + \frac{2}{13}, -1 + \frac{3}{13}\right )$$

= $$\left ( \frac{15}{13}, \frac{-10}{13} \right )$$

= $$\frac{5}{13}$$ (3, -2)

set v2 = (3, -2)

Thus, {v1, v2 } be an orthogonal basis. Let {u1, u2} be normalize of the orthogonal basis.

so, u1 = $$\frac{v_1}{||v_1||}$$ = $$\frac{(2, 3)}{13}$$

u2 = $$\frac{v_2}{||v_2||}$$ = $$\frac{(3, -2)}{13}$$

Let ! be a matrix whose columns are u1 , u2

Q = $$\begin{bmatrix}\frac{2}{\sqrt{13}} & \frac{3}{\sqrt{13}}\\ \frac{3}{\sqrt{13}} & \frac{-2}{\sqrt{13}}\end{bmatrix}$$

since, we have

A = QR (by QR – Factorization theorem)

then

QTA = QT(QR)

QTA = R

R = QTA

= $$\begin{bmatrix}\frac{2}{\sqrt{13}} & \frac{3}{\sqrt{13}}\\ \frac{3}{\sqrt{13}} & \frac{-2}{\sqrt{13}}\end{bmatrix}$$ $$\begin{bmatrix}2 & 1\\ 3 & -1\end{bmatrix}$$

=$$\begin{bmatrix}2 & 1\\ 3 & -1\end{bmatrix}$$

= $$\begin{bmatrix}\frac{4}{\sqrt{13}} + \frac{4}{\sqrt{13}} & \frac{2}{\sqrt{13}} -\frac{3}{\sqrt{13}}\\ \frac{6}{\sqrt{13}} – \frac{6}{\sqrt{13}} & \frac{3}{\sqrt{13}} + \frac{2}{\sqrt{13}}\end{bmatrix}$$

= $$\begin{bmatrix}\frac{13}{\sqrt{13}} & \frac{-1}{\sqrt{13}}\\ 0 & \frac{5}{\sqrt{13}}\end{bmatrix}$$

= $$\begin{bmatrix}\sqrt{13} & \frac{-1}{\sqrt{13}}\\ 0 & \frac{5}{\sqrt{13}}\end{bmatrix}$$