How to Decompose a matrix (in cases rank=1) into two row vectors?

475 Views Asked by At

Suppose I have matrix A. rank=1. how can I decompose it into to row vectors? meaning that A=u*v(transpose) I have found a way to do it when the matrix only has 1 row or 1 column, but how can I do it in other cases as well? (I am trying to do it on python but I need to understand the math behind it as well). Thanks!

1

There are 1 best solutions below

0
On BEST ANSWER

The rank of a matrix $A$ is the dimension of the vector space spanned by its columns. So, if a matrix has rank one, the vector space spanned by its columns is spanned by one vector $\mathbf v = \begin{pmatrix}v_1\\ \vdots\\ v_n \end{pmatrix}$. We can always take $\mathbf v$ to be the first column of $A$.

By the definition of span, this means that the $i^{th}$ column of the matrix can be written as $a_i \mathbf v$, where $a_i$ is a scalar. Writing this out, we have that the $i^{th}$ column is $\begin{pmatrix}a_iv_1\\ \vdots\\ a_iv_n \end{pmatrix}$. Thus, the $(j, i)$ entry of the matrix is $a_i v_j$.

Now, we can put all of the scalars $a_1, ..., a_m$ into a vector $\mathbf a = \begin{pmatrix}a_1\\ \vdots\\ a_m\end{pmatrix}$. Then we can write $A$ as $\mathbf v \cdot \mathbf a^T $, where $\mathbf a^T$ is the transpose of $\mathbf a$.

Here's an example: let $A = \begin{pmatrix} 2 & 3 \\ 4 & 6 \end{pmatrix}$. We take $\mathbf v = \begin{pmatrix} 2 \\ 4 \end{pmatrix}$. Now, we need to find $\mathbf a = \begin{pmatrix} a_1 \\ a_2 \end{pmatrix}$. Since we choose $\mathbf v$ to be the first column, $a_1 = 1$. Now, we need to find $a_2$ such that $a_2 \begin{pmatrix} 2 \\ 4 \end{pmatrix} = \begin{pmatrix} 3 \\ 6 \end{pmatrix}$. We can compute this by making the first entries match up by solving $2a_2 = 3$, $a_2 = 3/2$. This must work to make the second entry match up as well--otherwise, the second column wouldn't really be in the span of the first column, and the matrix wouldn't really be rank one. Thus, we have $\mathbf a = \begin{pmatrix} 1 \\ 3/2\end{pmatrix}$. Thus, we have $$A = \mathbf v \cdot \mathbf a^T =\begin{pmatrix} 2 \\ 4 \end{pmatrix}\begin{pmatrix} 1 &3/2\end{pmatrix}. $$