# Euclidean norm and matrix questions

Let $A$ be an $n×m$ real matrix and define $\vert A \vert_{2}^{2}={\rm tr}(A^tA)$.

1)Show that $|A|_2$ is the Euclidean norm of $A$, when we view $A$ as a vector in $R^{nm}$ by stacking the columns of $A$.

2)Find the cosine of the angle between $A=\begin{bmatrix} 1 & 1 & 1\\ 1& 0 & 1 \end{bmatrix}$, and $B=\begin{bmatrix} 4 & 0 & 0\\ 1& 0 & 0 \end{bmatrix}$

(Here what stacking the columns of $A$ means?)

-
About 2), $cos\theta =\frac{a\cdot b}{||a||||b||}$, is $a\cdot b$ here 1*4+1*0+1*0+1*1+0*0+1*0? – i_a_n Jan 12 '13 at 3:01
@i_a_n: yes. Look at ncmathsadist's answer -or mine. Without looking at matrices as vectors, a dot product on matrices can be defined as $A\cdot B = \mathrm{tr}(A^tB)$. – a.r. Jan 12 '13 at 16:22

Notice that $$(A^t A)_{ij} = \sum_{k=1}^m (A^t)_{ik}A_{kj} = \sum_{k=1}^m A_{ki}A_{kj}$$ Now compute the trace. $${\rm tr}(A^tA) = \sum_{i=1}^n (A^tA)_{ii} = \sum_{i-1}^n\sum_{k=1}^m A_{ki}^2,$$ which gives you the Euclidean norm of an $mn$-dimensional vector.

-
But when m>n, $(A^t)_{ik}$ can't reach $(A^t)_{im}$ – i_a_n Jan 12 '13 at 3:17
Ican't understand why $(A^t A)_{ij} = \sum_{k=1}^m (A^t)_{ik}A_{kj}$ – i_a_n Jan 12 '13 at 3:24

This: if

$$A = \begin{pmatrix} 1 & 3 & 5 \\ 2 & 4 & 6 \end{pmatrix}$$

then, as a vector of $\mathbb{R}^{3\cdot 2}$, we view it like

$$\begin{pmatrix} 1 \\ 2 \\ 3 \\ 4 \\ 5 \\ 6 \end{pmatrix}$$

and the square of its norm is

$$\vert A \vert_2^2 = \mathrm{tr} \left[ \begin{pmatrix} 1 & 2 \\ 3 & 4 \\ 5 & 6 \end{pmatrix} \begin{pmatrix} 1 & 3 & 5 \\ 2 & 4 & 6 \end{pmatrix} \right] = \mathrm{tr} \begin{pmatrix} 1+4 & 11 & 17 \\ 11 & 9+16 & 39 \\ 17 & 39 & 25 + 36 \end{pmatrix} = 1 + 4 + 9 + 16 + 25 + 36$$

Which happens to be the same as

$$(1,2,3,4,5,6) \begin{pmatrix} 1 \\ 2 \\ 3 \\ 4 \\ 5 \\ 6 \end{pmatrix} = 1 + 4 + 9 + 16+ 25 + 36 \ .$$

-