> 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/math-for-ml/linear-algebra/wk4.md).

# Wk4

## **Introduction: Einstein summation convention and the symmetry of the dot product**

$$
AB = C \newline
C\_{ik} = a\_{ij}b\_{jk}
$$

Multiplying a 2x3 matrix with a 3x4 matrix results in a 2x4 matrix; by first row times each columns&#x20;

$$
\begin{pmatrix}u\_i\\\vdots\end{pmatrix}\cdot\begin{pmatrix}v\_i\\\vdots\end{pmatrix}
$$

$$
\[u\_1 u\_2 ... u\_n]\begin{bmatrix}v\_1\v\_2\\\vdots\v\_n\end{bmatrix}
$$

$$
\begin{pmatrix}a\_{11} \cdots a\_{1n}\\\vdots\a\_{n1} \cdots a\_{nn}\end{pmatrix} \begin{pmatrix}b\_{11} \cdots b\_{1n}\\\vdots\b\_{n1} \cdots b\_{nn}\end{pmatrix}
$$

$$
(ab)*{23} = a*{21}b\_{13} + a\_{22}b\_{23} + \cdots + a\_{2n}b\_{n3} \newline
ab\_{ik} = \sum\_{j} a\_{ij}b\_{jk} = a\_{ij}b\_{jk}
$$

## Matrices changing basis

![](https://3501392451-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LLZ89zzVxrdnG1RG6CA%2F-LkAWgpKfxBK7eT8yBep%2F-LkAyv51-sYbc0Clpi0m%2FScreen%20Shot%202019-07-19%20at%201.31.20%20PM.png?alt=media\&token=5aafd999-acf4-44d4-9569-f8051d283657)

![](https://3501392451-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LLZ89zzVxrdnG1RG6CA%2F-LkAWgpKfxBK7eT8yBep%2F-LkBVBPUsrd8S7TvcupS%2FScreen%20Shot%202019-07-19%20at%204.09.14%20PM.png?alt=media\&token=a0133df6-4d42-4187-9632-1508dc1d736d)

NOTE: Projection only works if orthogonal unit space

### **Doing a transformation in a changed basis**&#x20;

Bears basis had a first axis of three, one and a second axis of one, one. Let's say I have a vector x, y defined in bears basis. As I want to transform it by doing something like a rotation of 45 degrees.

![](https://3501392451-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LLZ89zzVxrdnG1RG6CA%2F-LkAWgpKfxBK7eT8yBep%2F-LkBWZyj8e1RYkzZiGbr%2FScreen%20Shot%202019-07-19%20at%204.16.53%20PM.png?alt=media\&token=83419458-a6ca-45f5-9299-f60bc1a8c6a7)

![](https://3501392451-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LLZ89zzVxrdnG1RG6CA%2F-LkAWgpKfxBK7eT8yBep%2F-LkBZFEPDVyB-9bgFnxy%2Fimage.png?alt=media\&token=df0945a7-5ca4-4259-8403-c563e03ca3ed)

$$
\frac{1}{\sqrt{2}} \begin{pmatrix} 1 & -1 \ 1 & 1 \end{pmatrix}
$$

## **Orthogonal matrices**

$$
A\_{ij}^T = A\_{ji}
\newline
\begin{pmatrix} 1 & 2 \ 3 & 4 \end{pmatrix}^T = \begin{pmatrix} 1 & 3 \ 2 & 4 \end{pmatrix}
$$

![](https://3501392451-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LLZ89zzVxrdnG1RG6CA%2F-LkAWgpKfxBK7eT8yBep%2F-LkBbXUSxesLfQRgk_uZ%2FScreen%20Shot%202019-07-19%20at%204.40.34%20PM.png?alt=media\&token=bce3ffeb-7580-47d9-a25c-e615e114caab)

## **The Gram–Schmidt process**

![](https://3501392451-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LLZ89zzVxrdnG1RG6CA%2F-LkAWgpKfxBK7eT8yBep%2F-LkBdIDrWH3HUaZsgxZc%2FScreen%20Shot%202019-07-19%20at%204.50.40%20PM.png?alt=media\&token=b88b0dea-f222-451b-a69f-4565f42d7ea0)

## **Example: Reflecting in a plane**
