Given a vector $v \in \mathbb{R}^n$ then show that we can express $\sum_{k} \omega_kv^2_k$ as a matrix product of the form $v^TMv$. Give an expression for $M$ in terms of $\omega = [\omega_1 ... \omega_n]^T$.
I understand that here, the product of a row vector, matrix, and column vector (in that order) is a scalar. However, how do I write $M$ in terms of $\omega = [\omega_1 ... \omega_n]^T$?
Hint: Note that in general, we have $$ v^TMv = \sum_{i=1}^n \sum_{j=1}^n m_{ij} v_i v_j. $$ I would recommend that you verify this for the cases $n = 2,3$. Now, notice that the expression $\sum_k \omega_k v_k^2$ contains no terms of the form $\alpha\,v_iv_j$ (for a scalar $\alpha$).