# How can we convert the dot product of 3 vectors to a matrix form?

How can we convert the dot product of 3 vectors to a matrix form?

In particular, We have $$\sum_{i=1}^m (\langle \vec{w},\vec{x_i}\rangle -y_i)\vec{x_i} = 0$$, how and why can we convert it to the following matrix form?

$$Aw = b$$ where $$A = (\sum_{i=1}^m x_i x_i^T)$$ and $$b = \sum_{i=1}^{m} y_i \vec{x_i}$$

Detailed derivation will be welcome! Thank you!

• An attempted derivation on your part will also be welcome. Oct 19 '19 at 9:12
• Thanks, I have got the correct answer by my effort.
– Ben
Oct 15 '20 at 1:15

First, $$\sum_{i=1}^m \langle \vec{w},\vec{x_i}\rangle \vec{x_i}$$ can be referred to the following form:
$$(\vec{x_1}, \vec{x_2},\dots, \vec{x_m})\left[\begin{array}{c} \langle \vec{w},\vec{x_1}\rangle \\ \langle \vec{w},\vec{x_2}\rangle \\ \dots \\ \langle \vec{w},\vec{x_m}\rangle \\\end{array}\right]$$
Then $$\left[\begin{array}{c} \langle \vec{w},\vec{x_1}\rangle \\ \langle \vec{w},\vec{x_2}\rangle \\ \dots \\ \langle \vec{w},\vec{x_m}\rangle \\\end{array}\right]$$ can be reformulated as
$$\left[\begin{array}{c} \vec{x_1^T} \\ \vec{x_2^T} \\ \dots \\ \vec{x_m^T} \\\end{array}\right] w$$
$$(\sum_{i=1}^m x_i x_i^T) w$$