# A = QR Decomposition

## Homework Statement

Decompose the following matrix using QR decomposition
\begin{bmatrix}
4 & 1 \\
3 & -1
\end{bmatrix}
\begin{bmatrix}
.8 & .6 \\
.6 & .8
\end{bmatrix}
The following matrix is supposed to be next to the previous but I can't figure out how to do that. Any help in that area would be appreciated.
\begin{bmatrix}
5 & .2 \\
0 & 1.4
\end{bmatrix}

## Homework Equations

$$c_2 = (v_2 * u_1)q_1 + \parallel w_2 \parallel q_2$$

## The Attempt at a Solution

I was able to get the first part of the answer
\begin{bmatrix}
.8 & \\
.6 &
\end{bmatrix}
It's the second part
\begin{bmatrix}
.6 & \\
-.8 &
\end{bmatrix}
that i'm having trouble with. I'm also not worried about the R part right now.
Ok, let's plug the numbers into this equation:
$$c_2 = (v_2 * u_1)q_1 + \parallel w_2 \parallel q_2$$
$$v_2 * u_1 = .2$$
$$c_2 = \begin{bmatrix} 1 & \\ -1 & \end{bmatrix}$$
$$\parallel w_2 \parallel = -49/25$$
Therefore,
$$\begin{bmatrix} 1 & \\ -1 & \end{bmatrix} = .2 \begin{bmatrix} .8 & \\ .6 & \end{bmatrix} - 49/25q_2$$
step two
$$\begin{bmatrix} 1 & \\ -1 & \end{bmatrix} = \begin{bmatrix} 4/25 & \\ 3/25 & \end{bmatrix} - 49/25q_2$$
step three
$$\begin{bmatrix} (25-4)/25 & \\ (-25-3)/25 & \end{bmatrix} = 49/25q_2$$
step four
$$\begin{bmatrix} 21/49 & \\ -28/49 & \end{bmatrix} = q_2$$
The answer is supposed to be
$$\begin{bmatrix} .6 & \\ -.8 & \end{bmatrix} = q_2$$
So I made an error somewhere.

Last edited:

fzero
Homework Helper
Gold Member
It's tough to follow because you haven't defined every symbol, but ##q_2## should have unit norm. If you properly normalize your result, you'll find that it agrees with the solution.

It's tough to follow because you haven't defined every symbol, but ##q_2## should have unit norm. If you properly normalize your result, you'll find that it agrees with the solution.

what do you mean by properly normalize.

To normalize a vector q is to find q / ||q||. Bascially, it means to scale the vector so that it lies on the unit sphere.

amazing it worked! i was skeptical that it would but it did!
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "https://www.physicsforums.com/threads/a-qr-decomposition.623743/", "fetch_time": 1638538607000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2021-49/segments/1637964362879.45/warc/CC-MAIN-20211203121459-20211203151459-00411.warc.gz", "warc_record_offset": 1004425002, "warc_record_length": 15410, "token_count": 711, "char_count": 2080, "score": 4.125, "int_score": 4, "crawl": "CC-MAIN-2021-49", "snapshot_type": "latest", "language": "en", "language_score": 0.8024291396141052, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00062-of-00064.parquet"}