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 am working with granular materials (seeds). I am looking for a way to correctly scale the amount of different particles in one batch using weight only. I have worked with the problem a bit and instead of going in detail with the applied problem, I will try to present the problem more generally.

Let's say I have the following equation: $\sum_{i=1}^{n} x_i = 1$, for all $x_i \in \mathbb{R}$ and $x_i > 0$. I would like to solve for all $x_i$. Solving this problem, solves the applied problem.

I have the following constraints: $x_i / x_j = a_i b_i / a_j b_j $, for all $i,j = 1, 2, \ldots, n$.

Also, for all $a_i \in \mathbb{R}$, $a_j > 0$, $b_i \in \mathbb{R}$, $b_j > 0$, $\sum_{i=1}^{n} a_i = k$, and $k > 0$ (where usually $k = 1$).

All $a_i$, $b_i$ and $k$ are given as input to the the problem.

For $n=1$ and $n=2$ the problem is trivial (or atleast easy). But I am not sure about $n>2$. Is there a general solution?

share|cite|improve this question
up vote 2 down vote accepted

Let $$S = \sum_{i=1}^{n} a_i b_i$$

then $$x_i = \frac{a_ib_i}{S}$$

is a solution.

Note that $$\sum_{i=1}^{n} x_i = \sum_{i=1}^{n} \frac{a_i b_i}{S} = \frac{\sum_{i=1}^{n} a_i b_i}{S} = \frac{S}{S} = 1$$

$$\frac{x_i}{x_j} = \frac{a_ib_i/S}{a_jb_j/S} = \frac{a_ib_i}{a_jb_j}$$

Also note that $x_i \gt 0$.

share|cite|improve this answer
Your answer seems to work very well indeed. It is identical with my own answer for n=2. I will check later for n=3, but I am betting it will work out correctly for all n :) Thanks! This solves a lot for me. – Ole Thomsen Buus Jan 19 '11 at 12:04
@kofler: I have added some more explanation :-) – Aryabhata Jan 19 '11 at 12:05
Funny, had not really seen those equalities before now. Ofcourse! My own battle was with actually converting the applied problem to math. In that process certain things can be overlooked. Thanks again. – Ole Thomsen Buus Jan 19 '11 at 12:16
@kohler: You are welcome! – Aryabhata Jan 19 '11 at 12:23

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.