0
$\begingroup$

I noticed that for any vectors $\mathbf{a},\mathbf{b},\mathbf{c}$ where $\mathbf{a},\mathbf{b}\in \mathbb{R}^{m\times 1}$ and $\mathbf{c}\in \mathbb{R}^{n\times 1}$, there exists the equality that

$$\mathbf{a}^\top \mathbf{b} \mathbf{c}=\mathbf{c}\mathbf{b}^\top \mathbf{a}$$

I can prove it as follows,

Denote the left side as vector $\mathbf{l}=\mathbf{a}^\top \mathbf{b} \mathbf{c}$ and the right side $\mathbf{r}=\mathbf{c}\mathbf{b}^\top \mathbf{a}$, then

$$l_j=\left(\sum_{i=1}^m{a_i b_i}\right)c_j$$

and

$$r_j=\sum_ {i=1}^m{c_j b_i a_i}$$

Since $l_j=r_j$, hence it is proved.

It's an element-based proof. I was wondering if there is any other method that can prove it very simply and if this equality is an existing property of vector operations?

$\endgroup$
2
  • $\begingroup$ If I denote the inner product of two vectors by $(a , b)$, then you are saying that $(a ,b)c=c(b , a)$, which is obviously true because $(a ,b)=(b , a)$ and because the inner product is a scalar. $\endgroup$ Commented Dec 3, 2019 at 9:27
  • $\begingroup$ @carlo-beenakker I see. I now realize my confusion arose b/c of the mixture of the dot product and matrix product which makes the associative property kind of tricky to apply. $\endgroup$ Commented Dec 3, 2019 at 10:33

1 Answer 1

1
$\begingroup$

$\mathbf{a}^\top \mathbf{b}$ is a scalar, so $\mathbf{a}^\top \mathbf{b} = (\mathbf{a}^\top \mathbf{b})^\top = \mathbf{b}^\top \mathbf{a}$ and the term can be moved to the other side of $\mathbf{c}$ (again because it's a scalar).

General remark: the second product in your LHS is a scalar-vector multiplication, which is a tricky thing to handle in these chains of computations because it is not associative. I suggest you to try to get the habit to write $\text{vector} \cdot \text{scalar}$ rather than $\text{scalar} \cdot \text{vector}$ if you can, because that's associative.

$\endgroup$
6
  • $\begingroup$ Oops, sorry mods, I didn't notice this was on MO rather than MSE, probably I shouldn't have answered. I see no point in deleting this now anyway. $\endgroup$ Commented Dec 3, 2019 at 9:33
  • $\begingroup$ Thanks. It also answers an implicit question that puzzled me - the ambiguity of a scalar and a $1\times 1$ matrix with the same value. Writing as $vector \cdot scalar$ is indeed a great tip, since one can take the scalar as a $1\times 1$ matrix, and then they will become associative. But how about $matrix \cdot scalar$? I feel this is somewhat a consistency issue of scalar multiplication broadcasting vs. matrix product. It seems the former cannot be fully compatibilized into the latter. $\endgroup$ Commented Dec 3, 2019 at 10:41
  • $\begingroup$ @GuoyangQin Various $matrix\cdot scalar$ operations can be considered as $matrix \otimes scalar$, if I get what you mean. $\endgroup$ Commented Dec 3, 2019 at 12:28
  • 1
    $\begingroup$ (Incidentally, I think that many of these apparent discrepancies arise from the habit to write in first-year linear algebra courses $\alpha v + \beta w$ for linear combinations rather than $v\alpha + w\beta$...) $\endgroup$ Commented Dec 3, 2019 at 12:31
  • 1
    $\begingroup$ Yes, that's it! $\endgroup$ Commented Dec 3, 2019 at 15:26

Not the answer you're looking for? Browse other questions tagged .