# Multiplying three matrices together (example formulae included)

If you take a look at the following URL and do ctrl+f for "w’ is the transpose vector of w":

https://www.jpmorgan.com/tss/General/email/1159360877242

You should see three matrices are being multiplied together. I am a little unsure how I should proceed with this?

Could somebody please provide a simple example, say a 3x1 matrix, multiplied by a 3x3 matrix, multiplied by a 1x3 matrix (similar to the one in the link I provided)? I can then extend that to whatever value of n I require.

(I weren't sure how to represent the formulae in the web link in this question, if anyone could edit my question to include it- would be appreciated)

-

If: $$\sigma_p^2 = \begin{matrix}(w_1 \ w_2 \ \ldots w_n)\end{matrix}\cdot \left(\begin{matrix}\sigma_{11} \ \sigma_{12} \ \ldots \ \sigma_{1n} \\ \ldots \\\sigma_{n1} \ \sigma_{n2} \ \ldots \ \sigma_{1n} \end{matrix}\right)\cdot \left(\begin{matrix}w_1 \\ w_2 \\ \ldots \\ w_n\end{matrix}\right)$$
$$\sigma_p^2 = \sum_{i=1}^n w_i\left(\sum_{j=1}^n \sigma_{ji} w_j\right) = w_1(\sigma_{11} w_1 + \sigma_{21} w_2 + \ldots + \sigma_{n1} w_n) + \ldots + w_n(\sigma_{1n} w_1 + \ldots + \sigma_{nn} w_n)$$