Part I: Vectors and Matrices
334×500 Matrix{Float64}:
0.490196 0.490196 0.490196 … 0.443137 0.443137 0.443137
0.490196 0.490196 0.494118 0.447059 0.447059 0.447059
0.494118 0.494118 0.494118 0.447059 0.447059 0.447059
0.498039 0.498039 0.498039 0.45098 0.45098 0.45098
0.501961 0.501961 0.501961 0.454902 0.454902 0.454902
0.505882 0.505882 0.505882 … 0.458824 0.458824 0.458824
0.509804 0.509804 0.509804 0.458824 0.458824 0.458824
0.509804 0.509804 0.513725 0.462745 0.462745 0.462745
0.513725 0.513725 0.513725 0.462745 0.462745 0.462745
0.517647 0.517647 0.517647 0.462745 0.462745 0.462745
0.521569 0.521569 0.517647 … 0.466667 0.466667 0.466667
0.52549 0.52549 0.521569 0.466667 0.466667 0.466667
0.529412 0.529412 0.52549 0.470588 0.470588 0.470588
⋮ ⋱
0.054902 0.0117647 0.0627451 0.423529 0.54902 0.243137
0.152941 0.0666667 0.0705882 0.466667 0.52549 0.478431
0.360784 0.196078 0.101961 0.141176 0.152941 0.203922
0.341176 0.164706 0.0745098 … 0.0235294 0.152941 0.27451
0.176471 0.0509804 0.027451 0.00392157 0.0745098 0.164706
0.133333 0.0313725 0.0313725 0.0627451 0.0235294 0.0941176
0.0588235 0.0862745 0.0156863 0.113725 0.0745098 0.0352941
0.423529 0.388235 0.0627451 0.184314 0.105882 0.00392157
0.333333 0.184314 0.0666667 … 0.243137 0.321569 0.105882
0.298039 0.34902 0.235294 0.164706 0.423529 0.541176
0.364706 0.235294 0.403922 0.180392 0.478431 0.321569
0.196078 0.27451 0.258824 0.141176 0.521569 0.470588
Matrices, \[\mathbf{A} = \begin{bmatrix} a_{11} & a_{12} & c_{13} \\ a_{21} & a_{22} & a_{23}\\ \end{bmatrix}\]
Tensors,
\(\mathbf{x} = [4,7]\)
\(\mathbf{x} \times 0.2 = [4*0.2, 7*0.2] = [0.8, 1.4]\)
\(\mathbf{x} = [4,7]\)
\(\mathbf{x} \times -1 = [4* -1, 7* -1] = [-4, -7]\)
\(\mathbf{x} = [1,2]\)
\(\mathbf{y} = [3,1]\)
There are several ways to multiply two vectors:
Note: These are not the same! Each method gives you a different output.
\[ \mathbf{a} \cdot \mathbf{b} = \begin{bmatrix} a_{1} \\ \vdots \\ a_{n} \end{bmatrix} \boldsymbol{\bullet} \begin{bmatrix} b_{1} \\ \vdots \\ b_{n} \end{bmatrix} = \sum_{i=1}^{n} a_i b_i \]
Consider two vectors, \(\mathbf{v} = \begin{bmatrix} 3 \\ -1 \\ 2 \end{bmatrix}\), \(\mathbf{w} = \begin{bmatrix} 1 \\ 2 \\ 1 \end{bmatrix}\)
\[ \mathbf{v} \cdot \mathbf{w} = (3 \times 1) + (-1 \times 2) + (2 \times 1) \\ = 3 \]
Alternatively,
\[\cos \theta = \frac{\mathbf{u} \cdot \mathbf{v}}{||\mathbf{u}|| ||\mathbf{v}||} = \] \(\frac{(1 \times 3) + (2 \times 1)}{\sqrt{(1)^1+(2)^2} \times \sqrt{(3)^2+(1)^2}} = \frac{1}{\sqrt{2}}\)
\(\theta = \cos^{-1} (\frac{1}{\sqrt{2}}) = \\ 45^{\circ}\)
\(\begin{bmatrix}1 & -3 \\1 & -1 \end{bmatrix} \begin{bmatrix} 4 \\ 1 \end{bmatrix} =\) \[ 4 \begin{bmatrix} 1 \\ 1 \end{bmatrix} + 1 \begin{bmatrix} -3 \\ - 1\end{bmatrix} =\]
\[\begin{bmatrix} 1 \\ 3 \end{bmatrix}\]
What is the value of \(\mathbf{u}\)? \[\mathbf{u} = \begin{bmatrix} 3 & 4 & 5 \\ 1 & 0 & 1 \end{bmatrix} \begin{bmatrix} 1 \\ 0 \\ 2\end{bmatrix}\]
What is the value of \(\mathbf{u}\)? \[\mathbf{u} = \begin{bmatrix} 3 & 4 & 5 \\ 1 & 0 & 1 \end{bmatrix} \begin{bmatrix} 1 \\ 0 \\ 2\end{bmatrix}\]
\(= 1 \begin{bmatrix} 3 \\ 1 \end{bmatrix} + 0 \begin{bmatrix} 4 \\ 0 \end{bmatrix} + 2 \begin{bmatrix} 5 \\ 1 \end{bmatrix}\)
\(= \begin{bmatrix} 13 \\ 3 \end{bmatrix}\)
\[ \begin{bmatrix} w_{11} & w_{12} & w_{13} & w_{14} \\ w_{21} & w_{22} & w_{23} & w_{24}\\ w_{31} & w_{32} & w_{33} & w_{34}\\ \end{bmatrix} \]
\[ \mathbf{r} = \mathbf{W} \mathbf{x} \]
\[ \begin{bmatrix} w_{11} & w_{12} & w_{13} & 0 \\ 0 & 0 & 0 & w_{24}\\ 0 & 0 & w_{33} & w_{34}\\ \end{bmatrix} \]
\[ \mathbf{r} = \mathbf{W} \mathbf{x} \]
\[ \begin{bmatrix} w_{11} & w_{12} & w_{13} & 0 \\ 0 & 0 & 0 & w_{24}\\ 0 & 0 & w_{33} & w_{34}\\ \end{bmatrix} \]
\[ \mathbf{r} = \mathbf{W} \mathbf{x} \]
\[ \mathbf{y} = \mathbf{H} \mathbf{r} \]
\(\begin{bmatrix} 1 & 2 \\ 3 & 1 \\ 1 & -1 \\ \end{bmatrix} \begin{bmatrix} 3 & 1 \\ 1 & 2 \\ \end{bmatrix} =\)
\[\begin{bmatrix} \begin{bmatrix} 1 & 2 \end{bmatrix} \cdot \begin{bmatrix} 3 \\ 1\end{bmatrix} & \begin{bmatrix} 1 & 2 \end{bmatrix} \cdot \begin{bmatrix} 1 \\ 2\end{bmatrix} \\ \begin{bmatrix} 3 & 1 \end{bmatrix} \cdot \begin{bmatrix} 3 \\ 1\end{bmatrix} & \begin{bmatrix} 3 & 1 \end{bmatrix} \cdot \begin{bmatrix} 1 \\ 2\end{bmatrix} \\ \begin{bmatrix} 1 & -1 \end{bmatrix} \cdot \begin{bmatrix} 3 \\ 1\end{bmatrix} & \begin{bmatrix} 1 & -1 \end{bmatrix} \cdot \begin{bmatrix} 1 \\ 2\end{bmatrix} \\ \end{bmatrix} = \]
\[\begin{bmatrix} 5 & 5 \\ 10 & 5 \\ 2 & - 1 \end{bmatrix}\]