matrix: solve for square matrix with 0 diagonal

311 Views Asked by At

I have an equation of $XI = Y$, where I know $I$ (vector of 1s) and $Y$ (vector of positive integers). I want to find positive square matrix $X$, I also know that the diagonal entries of $X$ are all 0.

So example is $X$ is 3x3, $I$ is 3x1 and $Y$ is 3x1.

How can I solve this? There could be multiple solutions.

2

There are 2 best solutions below

0
On

Let $X=(x_{jk})_{j,k=1}^3$ and $Y=(l,m,n)^T$ with $l,m,n \in \mathbb N.$ Since $x_{11}=x_{22}=x_{33}=0$, we get from $XI=Y$ the equations

$x_{12}+x_{13}=l, x_{21}+x_{23}=m$ and $x_{31}+x_{32}=n.$

Can you proceed ?

0
On

The Moore-Penrose inverse can be used to write the general solution to any linear equation, i.e. $$(XA = Y) \implies X = YA^+ + C - CAA^+$$ where $C$ is an arbitrary matrix.

In the current problem the matrices $(A,Y)$ are replaced by the vectors $(1,y)$, yielding $$\eqalign{ X &= y1^+ + C - C11^+ \cr }$$ For a real vector, the MP-inverse can be written in terms of the transpose $$a^+ = \frac{a^T}{a^Ta}$$ so we can write $$1^+ = \tfrac{1}{3}1^T$$ Extract the $k^{th}$ diagonal element of the matrix by multiplying from the left with $e_k^T$ and from the right with $e_k$, and set it to zero. $$\eqalign{ X_{kk} &= e_k^TXe_k \cr 0 &= \tfrac{1}{3}y_k + C_{kk} - \tfrac{1}{3}e_k^TC1 \cr 0 &= y_k + 3C_{kk} - e_k^TC1 \cr }$$ There are more unknowns than equations, so let's constrain the matrix to $C={\rm Diag}(c).$ $$\eqalign{ 0 &= y_k + 3c_{k} - e_k^Tc \cr c_k &= -\tfrac{1}{2}y_k &\implies C &= -\tfrac{1}{2}{\rm Diag}(y) \cr }$$ Putting it all together, and generalizing the dimensions from $(3\to n)$ yields $$\eqalign{ X &= \tfrac{1}{n}y1^T - \tfrac{1}{n-1}{\rm Diag}(y) + \tfrac{1}{n(n-1)}{\rm Diag}(y)11^T \cr }$$