Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have N equations and am having trouble with finding a solution.

$$\left\{\begin{matrix} x_1 y_1 = \sum_{i=1}^N x_i\\ x_2 y_2 = \sum_{i=1}^N x_i\\ \vdots\\ x_N y_N = \sum_{i=1}^N x_i \end{matrix}\right.$$

where $x_i$, ($i = 1, 2, \cdots, N$) is an unknown and $y_i$, ($i = 1, 2, \cdots, N$) is a known variable.

Given $y_i$'s, I have to find $x_i$'s but, I don't know where to start and even if it has a solution.

share|cite|improve this question
Well, you see tha $x_i=0$ is a solution – leonbloy Jun 4 '12 at 3:21
up vote 4 down vote accepted

You can rewrite the system in the following form:

$$\left\{\begin{align*} &(1-y_1)x_1+x_2+x_3+\ldots+x_N=0\\ &x_1+(1-y_2)x_2+x+3+\ldots+x_N=0\\ &x_1+x_2+(1-y_3)x_3+\ldots+x_N=0\\ &\qquad\qquad\qquad\qquad\vdots\\ &x_1+x+2+x+3+\ldots+(1-y_N)x_N=0\;, \end{align*}\right.$$

or in matrix form as


Solving this homogeneous linear system is in principal completely straightforward.

share|cite|improve this answer
  1. $x_i= 0$ $\forall i$ is always a solution.

2 Suppose that $y_i \ne 0$ $\forall i$. Then, $x_1 = \frac{1}{y_1} \sum x_i$ and summing over all indexes we get $\sum x_i = \sum \frac{1}{y_i} \sum x_i$ So we must either have $\sum x_i = 0$ or $\sum \frac{1}{y_i} = 1$

2.a The case $\sum x_i = 0$ gives only the trivial solution $x_i=0 $

2.b Elsewhere, if we are given $\sum \frac{1}{y_i} = 1$, then any $x_i = \frac{\alpha}{y_i}$ is a solution, for any $\alpha$

3 If some $y_j=0$ for some $j$, then we must have $\sum x_i =0$ and $x_i=0$ for all $i$ with $y_i\ne 0$. This provides extra solutions if there are more than one zero-valued $y_j$. Eg, say $y_1=y_2=y_3=0$ and $y_j \ne 0$ for $j>3$; then any ${\bf x}$ with $x_j=0$ for $j>3$ and $x_1+x_2+x_3=0$ is a solution.

share|cite|improve this answer
Clever solution! – process91 Jun 4 '12 at 3:41

We have that for each $j$

$$ x_j(1-y_j) + \sum_{i=1}^{j-1} x_i + \sum_{i=j+1}^{N} x_i = 0 $$

Given that the $y_i$'s are known, we can just use Gaussian elimination to solve this.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.