I have 20 iron bars. Some are 3 kg, some are 8 kg and the rest are 14 kg. The total mass of all twenty is 183 kg. Determine the number of each bar.
Let number of 3kg bars = x, 8kg bars = y, 14kg bars = z
So,
$x + y + z = 20\\3x + 8y + 14z = 183$
To solve, "Intelligent trial and error" from here?
Try x=1,x=2,x=3,x=4,x=5 and solve simultaneously for y and z.
Yields x = 5, y = 7, z = 8
i.e. 5x3kg bars, 7x8kg bars, 8x14kg bars
Is it a case of trial and error or is there a "smart solution"?
Best Answer
As a first step we can eliminate a variable
and subtracting the first one from the other one we obtain
$$5y + 11z = 123$$
which by inspection leads to integer solutions for $z=3$ and $z=8$.
Finally from the first original equation we obtain $(x,y,z)=(5,7,8)$.