Artificial intelligent assistant

Algorithm with two unknowns First of all, I am not familiar with mathematics. I am trying to materialize an algorithm to solve a specific need. Let's assume we have $3$ portions of $3$ different vegetables. * 1 portion of courgettes weights $55$g (gramms) * 1 portion of aubergines weights $110$g * 1 portion of carrots weights $90$g Now let's assume that I want to eat for $300$g of vegetables, but still have $3$ portions in total. Can anyone help me figuring out an equation that can find all possible answers? Here is what I know so far: * $x_1 + x_2 + x_3 = 3$ * $55\times x_1 + 110\times x_2 + 90\times x_3 = 300$ $x$ can be fractional numbers.

Note: the previous version of this contained an algebraic error. This version is (hopefully) correct.

If you fix $x_1$ the two conditions become $$x_2+x_3=3-x_1\;\;\&\;\;110x_2+90x_3=300-55x_1$$

Solving then yields: $$x_2=\frac {6+7x_1}{4}\;\;\&\;\;x_3=\frac {6-11x_1}4$$

To see this, rewrite the first of the two equations as $$90x_2+90x_3=270-90x_1$$ Now subtract this equation from the second of the two constraints to get $$20x_2=30+35x_1\implies 4x_2=6+7x_1\implies x_2=\frac {6+7x_1}4$$

To conclude, note that the first constraint tells us $$x_3=3-x_2-x_1=3-\frac {6+7x_1}4-x_1=\frac {12-6-7x_1-4x_1}4=\frac {6-11x_1}4$$

To ensure that these are all strictly positive, note that $x_1>0\implies x_2>0$ but $x_3>0\implies x_1<\frac 6{11}$, so we must have $0

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 7004a532c8698bde1ebf62f2c5f3d8f6