Matrix and vector multiplication order

2.5k Views Asked by At

Assume $u\in \mathbb{R}^{m\times1}, X\in\mathbb{R}^{m\times m}, v\in\mathbb{R}^{n\times 1}, w\in\mathbb{R}^{n\times 1}$ and $m\neq n$. Then are the expressions $u^TX\,u\in \mathbb{R}$ and $v \cdot w \in \mathbb{R}$ well defined. What about
$$ u^TX\, u\, v\cdot w, $$ which is only defined if we preform the operations in a specific order?

2

There are 2 best solutions below

0
On BEST ANSWER

Assume $\cdot$ denotes standard scalar product $v\cdot w = v^Tw$. Then the product $$ u^TXu v\cdot w = u^TXuv^Tw $$ is a product of matrices / vectors all of compatible size, which enjoys associativity. I.e. $$ u^TXu v\cdot w = u^TXu(v^Tw) = u^TX(uv^T)w $$

0
On

Here, $u^TX\, u\, v\cdot w$ the multiplication is possible.

Also $u^TX\, u\, v\cdot w=u^TX\, u\, (v\cdot w)\\=(\sum_{k=1}^nu_kw_k)~(\sum_{(i,j)}^mx_{ij}u_iu_j)$