# How can we transform matrices into scalars?

If we have the three matrices:

$$\begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ \end{bmatrix} , \begin{bmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ 1 & 0 & 0 \\ \end{bmatrix} , \text{ and } \begin{bmatrix} 0 & 0 & 1 \\ 1 & 0 & 0 \\ 0 & 1 & 0 \\ \end{bmatrix}$$

How can I transform the matrices so that the first one (the identity) becomes a constant (scalar) $n$, and the other two become 0?

I'm not exactly sure what I'm looking for, but I'm looking for as many ways as possible to do this transformation with the hope that I'll find a way that works. Again, I'm looking for a way to transform the matrices into a scalar.

-

The most obvious one to me seems like the trace operation, i.e. the sum of the elements along the leading diagonal. For example: $$\text{tr}\left(\left[\begin{array}{ccc} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{array}\right]\right) = 1+1+1 = 3$$ $$\text{tr}\left(\left[\begin{array}{ccc} 0 & 1 & 0 \\ 0 & 0 & 1 \\ 1 & 0 & 0 \end{array}\right]\right) = 0+0+0 = 0$$ $$\text{tr}\left(\left[\begin{array}{ccc} 0 & 0 & 1 \\ 1 & 0 & 0 \\ 0 & 1 & 0 \end{array}\right]\right) = 0+0+0 = 0$$ The trace is important for many reasons:

-
Thanks for this answer. +1 Is there any way that we could do something like multiplication by a vector to get similar results? I'm working with a complicated scenario (it's too long to describe in a question), and I can see that I'll run into problems with traces. I'm looking for something multiplicative, not additive, and I'm using zero so that the zero values will cancel. –  Matt Groff Sep 4 '13 at 18:42
@MattGroff If you multiply an n-by-n matrix by a vector, i.e. on the right by an n-by-1 or on the left by a 1-by-n matrix then the result will be a vector and not a number. If you want a number then you'll need to multiply on both the left and the right, e.g. $uXv^{\top}$. –  Fly by Night Sep 4 '13 at 18:46
Multiplying on both sides is ok. I'm not sure how to get the correct scalar values doing this, but it seems to me that that is the solution I'm looking for. I would definitely accept that answer, if we could get the correct scalars. –  Matt Groff Sep 4 '13 at 18:51
@MattGroff Lets say you multiply on the left by $u=[a,b,c]$ and on the right by $v^{\top} = [d,e,f]^{\top}$, then you need to solve the equations $ad+be+cf=n$, $ae+bf+cd=0$ and $af+bd+ce=0$. We can rewrite this as $$\left[\begin{array}{ccc} a & b & c \\ c & a & b \\ b & c & a \end{array}\right]\left[\begin{array}{c} d \\ e \\ f \end{array}\right] = \left[\begin{array}{c} n \\ 0 \\ 0 \end{array}\right].$$ Assuming the 3-by-3 matrix is non-singular, you can solve for $d,$ $e$ and $f$. The matrix is non-singular if $$(a+b+c)(a^2+b^2+c^2-ab-ac-bc) \neq 0$$ –  Fly by Night Sep 4 '13 at 19:07