Trace of vectors

5.2k Views Asked by At

Does that sound about right?

Given that x is $m\times 1$ and y is $m\times 1$ vectors, show that $ tr(\mathbf{xy'})=\mathbf{x'y}$.

Attempt: By using the property of $tr(\mathbf{A'})=tr(\mathbf{A})$,

$tr[\mathbf{xy'}]=tr[(\mathbf{xy'})']$, which is $tr[\mathbf{x'y}]$. But $\mathbf{x'y}$ is a scalar $1\times1$. Thus, $tr[\mathbf{xy'}]=\mathbf{x'y}$.

1

There are 1 best solutions below

2
On

I don't think what you want to do works. It is true that the trace preserves the transpose of a square matrix. But $xy'$ is an $m\times m$ matrix and you are saying that the transpose is $1\times1$?

What is at play here is the fact that $\text{Tr}(AB)=\text{Tr}(BA)$ even if $A$ and $B$ are not square. Indeed, if $A$ is $m\times n$ and $B$ is $n\times m$, $$ \text{Tr}(AB)=\sum_{k=1}^m(AB)_{kk}=\sum_{k=1}^m\sum_{j=1}^nA_{kj}B_{jk} =\sum_{j=1}^m\sum_{k=1}^nB_{jk}A_{kj} =\sum_{j=1}^n(BA)_{jj}=\text{Tr}(BA). $$