Divide elements of a matrix by row

53 Views Asked by At

Suppose I have a matrix that looks like this:

$$A=\begin{bmatrix} 1 & 1 & 0 & 0 \\ 1 & 0 & 1 & 1 \end{bmatrix}$$

I want to divide each term by the sum of terms in that row, i.e.

$$C=\begin{bmatrix} 1/2 & 1/2 & 0 & 0 \\ 1/3 & 0 & 1/3 & 1/3 \end{bmatrix}$$

but I don't know how to show this in matrix notation,

I was able to get the sum of each row as

$$A\begin{bmatrix} 1 \\ 1 \\ 1 \\ 1 \end{bmatrix}=\begin{bmatrix}2\\3\end{bmatrix}.$$

but I'm not sure where to go from here.

2

There are 2 best solutions below

0
On BEST ANSWER

Building on @Henning Makholm's approach, here's what I did:

$$\left(\begin{bmatrix}1&0\\0&1\end{bmatrix}\begin{bmatrix}2\\3\end{bmatrix}\right)^{-1} \begin{bmatrix}1&1&0&0\\1&0&1&1\end{bmatrix} =\begin{bmatrix}1/2&1/2&0&0\\1/3&0&1/3&1/3\end{bmatrix}$$

0
On

In linear matrix notation, I think the closest you get to describing what you want is that you want to find $\Delta A$ where $\Delta$ is a diagonal matrix such that $$ \Delta A \begin{bmatrix}1\\1\\1\\1\\1\end{bmatrix} = \begin{bmatrix}1\\1\end{bmatrix} $$