# Confused with solving a three variable equation

Here is the problem:

A dietitian has 3 supplement products that can be used.

Each dose of Supplement I contains 5 units of Vitamin B, 4 units of calcium and 4 units of iron.

Each dose of Supplement II contains 2 units of Vitamin B, 3 units of calcium and 2 units of iron.

Each dose of Supplement III contains 1 unit of vitamin B, 5 units of calcium and 2 units of iron.

If the patient needs 13 units of Vitamin B, 16 units of calcium and 12 units of iron each week, how many doses of each supplement should the dietitian prescribe?

I've got:

$5x+2y+Z=13$

$4x+3y+5z=16$

$4x+2y+2z=12$

Then: I have $x=1+z,\quad y=4-3z,\quad$ and $(1+z,4-3z,z)$

Now I'm confused on how to interpret this into doses, if this is the right approach. Please help.

-

## 1 Answer

Sure, you can write it as a system of equations: $$\begin{cases} 5x + 2y + z = 13 \\ 4x + 3y + 5z = 16 \\ 4x + 2y + 2y = 12 \end{cases}$$ where $x, y, z$ is the number of doses of supplement I, II, III, respectively.

Use Gaussian elimination to find a solution (if there is one). That, is, write it on matrix form and perform row operations: $$\left( \begin{array}{ccc|c} 5 & 2 & 1 & 13 \\ 4 & 3 & 5 & 16 \\ 4 & 2 & 2 & 12 \end{array} \right) \sim \left( \begin{array}{ccc|c} 5 & 2 & 1 & 13 \\ 0 & \frac{7}{5} & \frac{21}{5} & \frac{28}{5} \\ 0 & \frac{2}{5} & \frac{6}{5} & \frac{8}{5} \end{array} \right)$$

and so on... You might also want to find the possible nullspace of the matrix to find alternative doses.

EDIT: Missed that you already had the solution! You can plug in values of $z$, the desired amount of doses of supplement III, in the solution $(1+z, 4-3z, z)$. $z=0$ yields $(1, 4, 0)$ and $z=1$ yields $(2, 1, 1)$ - the first number is the amount of doses of supplement I, the second supplement II and the third supplement III.

If you plug in $z=2$ you get $(3, -2, 2)$, which contain negative doses of supplement II. This will happen for all $z \geq 2$, so these solutions are dismissed.

-
In fact, if each dosage is meant to be a non-negative integer, only the numbers $z=0$ and $z=1$ can be used. –  Gerry Myerson May 21 '11 at 23:56
Yes, I assumed that the dosages were integers. If other positive values can be used, $z$ should be taken to be in the inerval $[0, \frac{4}{3}]$. –  Calle May 22 '11 at 1:01