# Thread: how to solve this?

1. ## how to solve this?

How to solve this?

"If a farmer buys chicken feed for £1.26 per tonne, pig feed for £2.74 per tonne and cattle feed for 78p per tonne. How much of each would he have if he had 100 tonnes for £100?"

the equations to solve become:

x+y+z = 100
x*1.26+y*2.74+z*0.78 = 100

Now if there three equations for 3 variables then it would be easy to solve this problem using standard equations solving technique such as substitution method or so on.

But with only 2 equations how to solve three variables?

If I start guessing then how to make educated and smart guess so that I don't have to go through the excruciating process of choosing x=1,2,3,... etc? I am hoping there are some techniques such as bisection method, newton-raphson method for solving problems numerically (and iteratively) to apply to this problem.

Some help would be greatly appreciated.

Thanks.

2. Wouldn't know where to start, but I'd have a go at seeing what we've got by attacking it like this.

I would eliminate one of the variables and so get an equation in 2 variables. This will be linear. I would then experiment with plotting it, or something, and see whether there is a constraint that forces a certain solution upon me. Otherwise, you would see there is no unique solution. Unless there is a diophantine equation lurking at the bottom here, in which case I've got this page here:

Solution of Linear Diophantine Equation - ProofWiki

but I don't know whether this will help or if it's way off beam.

I tried to reduce it to one equation getting something like this:

1.48x+1.96z=1.74

then

x = (174-1.96z)/1.48

then I applied bisection method between z = 0 to 88 and finally reaching the value of z=85 giving x = 5.

I am not sure this 'bisection' method of mine is standard way or there is better way (didnt get your plotting technique). But I am not sure how to apply this with a tri-variable single equation like this:

1.26x+2.74y+0.78z = 100

Even if there are multiple solutions for such equation how to enumerate them all? You know for linear algebra problems it happens quite often that some sort of matrix equation like XU = V is given and after applying multiple matrix operations we might reach one or two equations with more than 2 variables and the question asks for finding solutions. If given in a linear algebra test trying to find solutions for such equations starting from x = 1 to 100 (say) exhaustively would not be practical (you would run out entire test time solving one such problem).

4. Originally Posted by amishera
How to solve this?

"If a farmer buys chicken feed for £1.26 per tonne, pig feed for £2.74 per tonne and cattle feed for 78p per tonne. How much of each would he have if he had 100 tonnes for £100?"

the equations to solve become:

x+y+z = 100
x*1.26+y*2.74+z*0.78 = 100

Now if there three equations for 3 variables then it would be easy to solve this problem using standard equations solving technique such as substitution method or so on.

But with only 2 equations how to solve three variables?

If I start guessing then how to make educated and smart guess so that I don't have to go through the excruciating process of choosing x=1,2,3,... etc? I am hoping there are some techniques such as bisection method, newton-raphson method for solving problems numerically (and iteratively) to apply to this problem.

Some help would be greatly appreciated.

Thanks.

Nothing elaborate.
BUT this assumes that the tonnes CANNOT be partial.
That is the sale must be for a whole tonne.
-------------------------------------------
x+y+z=100 [EQUATION 1]

For Eq.2 remove the decimals (multiply by 100)
126x + 274y + 78z = 10000 [EQUATION 2]

from first equation:
z = 100 - x -y
substituting into 2nd equation
126x + 274y + 78(100 -x -y) = 10000
which is
126x + 274y + 7800 -78x -78y = 10000
&
48x + 196y = 2200
divide through by 4
12x + 49y = 550

from this 550/12 = 45.8, therefore x < 46

also

550/49 = 11.22, therefore y < 12

That is where I would start:
y must be in the range 1 to 12.
You have 12 guesses to get the result
x = (550 - 49*y)/12

(550 - 49y) MUST be divisible by 12

550 - 49 = 501 ; 501 is NOT divisible by 12, so y cannot be 1

550 - 49*2 = 452 ; 452 is NOT divisible by 12, so y cannot be 2

etc.

at most ten more guesses to get the answer.

5. Originally Posted by amishera

I tried to reduce it to one equation getting something like this:

1.48x+1.96z=1.74

then

x = (174-1.96z)/1.48

then I applied bisection method between z = 0 to 88 and finally reaching the value of z=85 giving x = 5.

I am not sure this 'bisection' method of mine is standard way or there is better way (didnt get your plotting technique). But I am not sure how to apply this with a tri-variable single equation like this:

1.26x+2.74y+0.78z = 100

Even if there are multiple solutions for such equation how to enumerate them all? You know for linear algebra problems it happens quite often that some sort of matrix equation like XU = V is given and after applying multiple matrix operations we might reach one or two equations with more than 2 variables and the question asks for finding solutions. If given in a linear algebra test trying to find solutions for such equations starting from x = 1 to 100 (say) exhaustively would not be practical (you would run out entire test time solving one such problem).
What I meant by "plotting it" was: take the equation 1.48x+1.96z=1.74 (or whatever you've got in 2 dimensions) and using x and z as coordinate axes, and drawing a line corresponding to the points satisfying the above equation. It's just a technique that might help for this sort of exercise.

6. Originally Posted by Matt Westwood
What I meant by "plotting it" was: take the equation 1.48x+1.96z=1.74 (or whatever you've got in 2 dimensions) and using x and z as coordinate axes, and drawing a line corresponding to the points satisfying the above equation. It's just a technique that might help for this sort of exercise.
Hello I'have this solution :

$\begin{array}{l}
12x + 49y = 550 \Leftrightarrow 49y \equiv 550\left[ {\bmod 12} \right] \\
12x + 49y = 550 \Leftrightarrow y \equiv 10\left[ {\bmod 12} \right]....\left( {49 \equiv 1\left[ {\bmod 12} \right]and550 \equiv 10\left[ {\bmod 12} \right]} \right) \\
conclusion:y = 12k + 10....\left( {k \in {\rm N}} \right) \\
\end{array}$

substituting into equation 12x + 49y = 550 : $x = - 49k +5
$

$\left\{ \begin{array}{l}
x \in {\rm N} \\
y \in {\rm N} \\
\end{array} \right. \Leftrightarrow k = 0$

$\left\{ \begin{array}{l}
x = 5 \\
y = 10 \\
z = 85 \\
\end{array} \right.
$