# Does this solution imply that $x(x^Tw) = (xx^T)w$?

I'm following the solution to exercise 4.6 from https://tommyodland.com/files/edu/bishop_solutions.pdf

The equality $$\Sigma_n(w^Tx_n -w^Tm)x_n = \Sigma_n(x_nx_n^T -x_nm^T)w$$ doesn't make sense to me. I understand that one can write $$(w^Tx_n)x_n = x_n(w^Tx_n) = x_n(x_n^Tw)$$, but the step $$x_n(x_n^Tw) = (x_nx_n^T)w$$ should be false.

• Why should it be false? Isn't it simply associativity of matrix multiplication? – Bungo Sep 16 at 7:37
• $(w^Tx_n) x_n=x_n(w^Tx_n)$ is more confusing to me, because you don't have commutativity of matrices in general, you always have associativity though. – kingW3 Sep 16 at 9:47
• @kingW3 $(w^T x_n)$ is presumably a scalar, so it commutes with any matrix, and associativity works as long as the dimensions are compatible. Also because it is a (presumably real) scalar, it equals its own transpose, which is why $w^T x_n = x_n^T w$. – Bungo Sep 16 at 21:39