## Recap Matrix Multiplication
Produces a matrix from two matrices


The number of columns in the first matrix (m) must be equal to the number of rows in the second matrix. The result matrix has the number of rows of the first (l) and the number of columns of the second matrix (n).  


If $\mathbf{A}$ is an $m \times n$ matrix and $\mathbf{B}$ is an $n \times p$ matrix
$$
\mathbf{A}=\begin{pmatrix}
 a_{11} & a_{12} & \cdots & a_{1n} \\
 a_{21} & a_{22} & \cdots & a_{2n} \\
\vdots & \vdots & \ddots & \vdots \\
 a_{m1} & a_{m2} & \cdots & a_{mn} \\
\end{pmatrix},\quad\mathbf{B}=\begin{pmatrix}
 b_{11} & b_{12} & \cdots & b_{1p} \\
 b_{21} & b_{22} & \cdots & b_{2p} \\
\vdots & \vdots & \ddots & \vdots \\
 b_{n1} & b_{n2} & \cdots & b_{np} \\
\end{pmatrix}
$$

the matrix product $\mathbf{C} = \mathbf{AB}$ is defined to be the $m \times p$

$\mathbf{C}=\begin{pmatrix}
 c_{11} & c_{12} & \cdots & c_{1p} \\
 c_{21} & c_{22} & \cdots & c_{2p} \\
\vdots & \vdots & \ddots & \vdots \\
 c_{m1} & c_{m2} & \cdots & c_{mp} \\
\end{pmatrix}$

such that 
$$c_{ij} = a_{i1}b_{1j} + a_{i2}b_{2j} +\cdots + a_{in}b_{nj}= \sum_{k=1}^n a_{ik}b_{kj} \;\;\; \text{for}\ i = 1, ..., m\ \text{and}\ j = 1, ..., p.$$



The corresponding operation on vectors is referred to as dot product or scalar product. If two vectors $\mathbf{\color{red}a} = \left[\color{red}a_\color{red}1, \color{red}a_\color{red}2, ..., \color{red}a_\color{red}n\right]$ and $\mathbf{\color{blue}b} = \left[\color{blue}b_\color{blue}1, \color{blue}b_\color{blue}2, ..., \color{blue}b_\color{blue}n\right]$

are identified as row matrices:

$$\begin{align}
\mathbf{\color{red}a} \cdot \mathbf{\color{blue}b} &= \mathbf{\color{red}a}\mathbf{\color{blue}b}^\top\\
&=\sum_{i=1}^n {\color{red}a}_i{\color{blue}b}_i\\
&={\color{red}a}_1{\color{blue}b}_1+{\color{red}a}_2{\color{blue}b}_2+\cdots+{\color{red}a}_n{\color{blue}b}_n \\
\end{align}$$

Source: https://en.wikipedia.org/wiki/Matrix_multiplication and https://en.wikipedia.org/wiki/Dot_product


```python

```

08bec08f7a67a2ffdd5e4017d81ea6b37c010db5
ipynb
Jupyter Notebook
basic_math/mat_mult.ipynb
phonosync/fromscratch
ab637c50caabca253cee7474c532511d33879cfd
MIT
basic_math/mat_mult.ipynb
phonosync/fromscratch
ab637c50caabca253cee7474c532511d33879cfd
MIT
basic_math/mat_mult.ipynb
phonosync/fromscratch
ab637c50caabca253cee7474c532511d33879cfd
MIT
Qwen/Qwen-72B
1. YES
2. YES