# Minimisation of fraction

If it is given that $x+y=C$ and $w+z=D$ then how to find the least and maximum value of the expression $x/w + y/z$? $C$ and $D$ are positive integer constants. $x, y, w, z$ are variables taking positive integer values. Also take the case when 0 is also allowed as a value for x, y,w, z. Thanks.

-
You probably don't want to use $0$ for $w$ or $z$. – robjohn Oct 1 '13 at 9:46
@robjohn yeah 0 was only for x and y not w and z. Sorry. – Suy Oct 3 '13 at 4:22

WLOG, let $x \le y, w \le z$. Then $$\frac{x_{min}}{w_{min}}+\frac{C - x_{min}}{D - w_{min}}\le \frac{x}{w}+\frac{y}{z} \le \frac{x_{min}}{z_{max}}+\frac{C - x_{min}}{D - z_{max}}$$

-
Hi, how can I generalize this to more than two fractions. Actually I need to solve a question like: There are 15 red balls and 20 white balls. They have to be distributed among three boxes such that no box remains empty. How can this be done such that i) the probability of randomly drawing a red ball from any box is least (ii) probability of randomly drawing a red ball from any box is Max ? – Suy Oct 3 '13 at 4:35
To generalise, you can use the basic principle of rearrangement inequality (en.wikipedia.org/wiki/Rearrangement_inequality). For the probability problem though I am not sure if this is the right approach. Is the box to draw from chosen randomly, or is it that any box must satisfy the min/max criteria? – Macavity Oct 3 '13 at 5:37
1 ball is randomly drawn from any randomly chosen box. I could solve it for two boxes by using the above fractions (for probabilities) by just putting in the integral values intuitively. But I wanted to know the mathematical basis for what I did and also what if the boxes are more than two? Intuitively filling values for more than two fractions was ot feasible. – Suy Oct 3 '13 at 11:55
If the box is randomly chosen and then the red ball chosen, you maximise the chances by putting exactly one red ball each in two boxes, and all the remaining balls in the third. Same logic as re-arrangement link I gave, to get max, arrange the numerators in ascending order, and denominators in reverse. To get minimum, arrange them both in the same order. The rearrangement inequality, you will notice, is for $n$ terms, not just two. – Macavity Oct 3 '13 at 12:03

You should use the method of Lagrange multipliers.

-
Pre-calculus and Lagrange don't go too well. – Macavity Oct 1 '13 at 9:19
oops! you are right..sorry – Leox Oct 1 '13 at 9:30