Solving a three variable equation

103 Views Asked by At

I have three given values, suppose a=1.86, b=2.6 and c=4.2. Now I have to figure out x,y,z such that

  1. $x\gt 0,y\gt 0$ and $z\gt 0$

  2. $x+y+z=1$

  3. $a*x\gt 1, b*y\gt 1$ and $cz\gt 1$

I need a generalized solution steps for this to implement in programming.

Thanks.

3

There are 3 best solutions below

3
On BEST ANSWER

Since we need all of $ax, by, cz$ to be greater than $1$, given a set of $(a,b,c)$ we want $x,y,z$ to be bigger than $\frac{1}{a},\frac{1}{b},\frac{1}{c}$.

To find a generalized set of steps, first calculate $\frac{1}{a}+\frac{1}{b}+\frac{1}{c}$. If this sum is greater than $1$, there are no solutions for $x,y,z$. This makes sense, because if we let $a,b,c$ to be $0.0001$ or some small number, $x,y,z$ would all have to be large and they would not sum to $1$, but we need $x+y+z=1$.

If it is less than or equal to $1$, then simply picking some number larger than $\frac{1}{a},\frac{1}{b},\frac{1}{c}$ for $x,y,z$ will do.

If $\frac{1}{a}+\frac{1}{b}+\frac{1}{c}<1$, we calculate $1-(\frac{1}{a}+\frac{1}{b}+\frac{1}{c})$. Call this value $n$. Find the value of $\frac{n}{3}$ and add it to $\frac{1}{a},\frac{1}{b},\frac{1}{c}$ and you will surely have values of $x,y,z$ that sum to $1$.

3
On

$\left\{ \begin{array}{l} x > \frac{1}{a} \Rightarrow x = \frac{1}{a} + \varepsilon \\ y > \frac{1}{b} \Rightarrow y = \frac{1}{b} + \varepsilon \\ z > \frac{1}{c} \Rightarrow z = \frac{1}{c} + \varepsilon \end{array} \right.$ where $0<\varepsilon$.

$\Rightarrow \frac{1}{a} + \varepsilon + \frac{1}{b} + \varepsilon + \frac{1}{c} + \varepsilon = 1 \Rightarrow \varepsilon = \frac{1}{3} - \frac{1}{{3a}} - \frac{1}{{3b}} - \frac{1}{{3c}} = {\rm{0}}{\rm{.1053}}$

1
On

$\left\{ {\begin{array}{*{20}{l}} {x > \frac{1}{a} \Rightarrow x = \frac{1}{a} + X}\\ {y > \frac{1}{b} \Rightarrow y = \frac{1}{b} + Y}\\ {z > \frac{1}{c} \Rightarrow z = \frac{1}{c} + Z} \end{array}} \right.$ where $0 < X,Y,Z$

$ \Rightarrow \frac{1}{a} + X + \frac{1}{b} + Y + \frac{1}{c} + Z = 1 \Rightarrow X + Y + Z = 1 - \frac{1}{a} - \frac{1}{b} - \frac{1}{c}$ $\hspace{.3cm}$(*)

(*) is an equation of surface where cut each axis in $1 - \frac{1}{a} - \frac{1}{b} - \frac{1}{c}$. Your solution is all the point on this surface which that lie on the first quadrant.