# Linear algebra calculus trick.

I have a matrix and a vector: $$A=\begin{bmatrix} a &b\\ c&d \end{bmatrix},$$

$$\vec v=\begin{bmatrix} a+b\\ c+d \end{bmatrix}$$

Is there an algebraic operation that produce the following matrix:

$$B=\begin{bmatrix} \dfrac{a}{a+b} &\dfrac{b}{a+b}\\ \dfrac{c}{c+d} &\dfrac{d}{c+d} \end{bmatrix}?$$

-
You're thinking of some type of """matrix division""", aren't you? I never saw anything like this. – Ivo Terek Jun 23 '14 at 23:30
What if, say, $a+b=0?$ – mfl Jun 23 '14 at 23:32
No my friend @mfl. This ain't an option. – Kira Jun 23 '14 at 23:36
@IvoTerek There is no such thing? – Kira Jun 23 '14 at 23:40
I never heard of anything like this (which doesn't mean that this cannot exist). But I really doubt it. And various problems could appear, just like @mfl pointed, what if $a+b$ or $c+d$ is zero? Surely, writing a text you could use any symbol, and define it, given nice conditions, like, $A \oslash \vec{v} = B$. Then you would have to see if this operation has nice properties, works well with matrix multiplication, etc? Is it possible to make mathematics with this? – Ivo Terek Jun 23 '14 at 23:44

Inspired by Steven's solution, I have the following one which is a generalization.

As I understand from your matrix, I assume that you want to do the following:

$$A=\begin{pmatrix} a_{11}& \cdots&a_{1n}\\ a_{21}& \cdots&a_{2n}\\ \vdots&\ddots&\vdots\\ a_{n1}& \cdots&a_{nn}\\ \end{pmatrix},$$ and $$b=\begin{pmatrix} \sum_{i=1}^{n}a_{1i}\\ \sum_{i=1}^{n}a_{2i}\\ \vdots\\ \sum_{i=1}^{n}a_{ni}\\\\ \end{pmatrix}.$$ Find the following matrix $B$?

$$B=\begin{pmatrix} \dfrac{a_{11}}{\sum_{i=1}^{n}a_{1i}}& \cdots&\dfrac{a_{1n}}{\sum_{i=1}^{n}a_{1i}}\\ \dfrac{a_{21}}{\sum_{i=1}^{n}a_{2i}}& \cdots&\dfrac{a_{2n}}{\sum_{i=1}^{n}a_{2i}}\\ \vdots&\ddots&\vdots\\ \dfrac{a_{n1}}{\sum_{i=1}^{n}a_{ni}}& \cdots&\dfrac{a_{nn}}{\sum_{i=1}^{n}a_{ni}}\\ \end{pmatrix},$$

Let $C$ be the following matrix, $C=\mathrm{diag}(b)= \begin{pmatrix} \sum_{i=1}^{n}a_{1i}&&&&\huge0\\ & & \ddots\\ \huge0 & & & & \sum_{i=1}^{n}a_{ni} \end{pmatrix},$

Therefore,

$$B=C^{-1}A.$$

$$B=\begin{bmatrix} \dfrac{a}{a+b} &\dfrac{b}{a+b}\\ \dfrac{c}{c+d} &\dfrac{d}{c+d} \end{bmatrix}=\mathrm{diag}(b)^{-1}\cdot A=\begin{bmatrix} \dfrac{1}{a+b} &0\\ 0 &\dfrac{1}{c+d} \end{bmatrix}\cdot\begin{bmatrix} a &b\\ c &d \end{bmatrix}$$
I'm not really sure what you'll consider an "algebraic operation", but I guess there's $$\left( \left[\begin{matrix} 1 & 0 \end{matrix}\right] \vec v \left[\begin{matrix} 1 & 0 \\ 0 & 0 \end{matrix}\right] + \left[\begin{matrix} 0 & 1 \end{matrix}\right] \vec v \left[\begin{matrix} 0 & 0 \\ 0 & 1 \end{matrix}\right] \right)^{-1} A$$