I was wondering if someone could help clear my mind on a simple problem. If we consider that $\bf{a}=\begin{pmatrix} 1 \\ 0 \\ 0 \end{pmatrix}$
and $\bf{b}=\begin{pmatrix} 3 \\ 2 \\ 1 \end{pmatrix}$ then $\mathbf{a}^{t}\mathbf{b}=3$
If we multiply both sides by $\mathbf{a}$ then we obtain
$\mathbf{a}\mathbf{a}^{t}\mathbf{b}=3\mathbf{a}$.
Here I would think that one could first calculate $\mathbf{a}\mathbf{a^{t}}$ in which case we obtain
$\mathbf{b}=3\mathbf{a}$ which is clearly not the case.
Matrix multiplication is associative, but it is in general not commutative. The error you’re making is in saying that $\mathbf a\mathbf a^t=\mathbf a^t\mathbf a = 3$. It doesn’t. The order matters. The two products don’t even have the same dimensions: the first product is a $3\times3$ matrix, but the second is a $1\times1$ matrix, which is conventionally treated as if it were a scalar.
In detail: $$\mathbf a\mathbf a^t\mathbf b = \begin{bmatrix}1\\0\\0\end{bmatrix}\begin{bmatrix}1&0&0\end{bmatrix}\begin{bmatrix}3\\2\\1\end{bmatrix}.$$ Grouping the first two multiplicands we get $$(\mathbf a\mathbf a^t)\mathbf b = \begin{bmatrix}1&0&0\\0&0&0\\0&0&0\end{bmatrix}\begin{bmatrix}3\\2\\1\end{bmatrix} = \begin{bmatrix}3\\0\\0\end{bmatrix}.$$ Grouping the other way, $$\mathbf a(\mathbf a^t\mathbf b) = \begin{bmatrix}1\\0\\0\end{bmatrix}\cdot 3 = \begin{bmatrix}3\\0\\0\end{bmatrix}.$$