> For the complete documentation index, see [llms.txt](https://stephanosterburg.gitbook.io/scrapbook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://stephanosterburg.gitbook.io/scrapbook/math/udacity/linear-algebra-refresher-w-python.md).

# Linear Algebra Refresher /w Python

Points written as $$(x, y ,z)$$

Vectors written as $$\begin{bmatrix} x \ y \ z \end{bmatrix}$$

Magnitude and Direction:

$$3-D$$imensions

$$| \vec{v}| = \sqrt{v\_x^2 + v\_y^2+v\_z^2}$$

$$n-D$$imensions

$$|\vec{v}| = \sqrt{v\_1^2 + v\_2^2+v\_3^2+....+v\_n^2}$$

Normalization: process of finding a unit vector in the same direction as a given vector

$$\frac{1}{|\vec{v}|}\vec{v}=\text{unit vector in direction of } \vec{v}$$

Example:&#x20;

$$\begin{aligned}\vec{v}&=\begin{bmatrix}-1\1\1 \end{bmatrix} \\\ |\vec{v}| &= \sqrt{(-1)^2+(1)^2+(1)^2} \\\\&= \sqrt{3} \\\ \vec{u}&=\frac{1}{|\vec{v}|}\vec{v} \\\\&=\frac{1}{\sqrt{3}}\begin{bmatrix}-1\1\1\end{bmatrix} \\\\&=\begin{bmatrix}-1/\sqrt{3}\1/\sqrt{3}\1/\sqrt{3} \end{bmatrix} \end{aligned}$$

$$\begin{aligned}|\vec{u}| &= \sqrt{(\frac{-1}{\sqrt{3}})^2 + (\frac{1}{\sqrt{3}})^2 + (\frac{1}{\sqrt{3}})^2 } \\\\&=\sqrt{\frac{1}{3}+\frac{1}{3}+\frac{1}{3}} \\\\&= 1\end{aligned}$$
