# Matrix (vector) multiplication

• May 21st 2011, 02:25 PM
ikkuh
Matrix (vector) multiplication
Hi MHF,

Consider 2 vectors x and m with the same dimension. Is the following condition true?
$(x - m)(x - m)^T == xx^T - mm^T$

It has been a while since I did linear algebra so some help is much appreciated!
• May 21st 2011, 03:00 PM
pickslides
It is true. As x and m have the same dimension say pxq, simply multiply out each side of your equation, you should get pxp in both cases.
• May 21st 2011, 03:14 PM
Plato
Quote:

Originally Posted by ikkuh
Consider 2 vectors x and m with the same dimension. Is the following condition true?
$(x - m)(x - m)^T == xx^T - mm^T$

But I do not agree that it is true.
Consider: $M=<-2,4>~\&~X=<3,-6>$.
Is that a counter-example?
• May 21st 2011, 03:43 PM
pickslides
The dimensions of the solutions may be the same, maybe not the solution itself.
• May 22nd 2011, 04:13 PM
ikkuh
Quote:

Originally Posted by pickslides
The dimensions of the solutions may be the same, maybe not the solution itself.

That is exactly what I was thinking. Unfortunately problem I need to solve is this:
$S = \frac{1}{n-1}\sum\limits_{i=1}^n ({\bf x}_i - {\bf m})({\bf x}_i - {\bf m})^T$ where
${\bf m} = \frac{1}{n}\sum\limits_{i=1}^n x_i$
Prove that the expression for the covariance matrix (above) can be rewritten as:
$S = \frac{(\sum\limits_{i=1}^n {\bf x}_i {\bf x}_i^T) - n {\bf m}{\bf m}^t }{n-1}$

I might have split the question wrong before. Anyone who sees now how you can rewrite the expression?