# 2 equations, 3 variables

## Homework Equations

Equation 1: 3x+2y+1/3z=50
Equation 2: x+y+z=100

## The Attempt at a Solution

I know that the variables go like this: x=5, y=2 and z=93. I solved this combining different variables until I got the right "combination". I have to prove these solutions, any ideas how?

Buzz Bloom
Gold Member
Hi Nicola:

Your solution can be proved to be correct by substituting the solution values for x, y, and z into the two equations and doing the arithmetic to end up with 50=50 and 100=100.

You should be aware that the solution you have is not the only solution. Chose any arbitrary value for one of the variable, say for example, z=30. Substitute this value into the two equations and you get two equations in x and y which you can then solve. For z = 30 you get x = -100, y = 170.

Regards,
Buzz

blue_leaf77
Homework Helper
Your system of equation does not have a unique solution. Perform row reduction on the augmented matrix between the coefficients and the RHS matrices to get the general expression of the solution.

Delta2
Homework Helper
Gold Member
Something tells me that the OP wanted to say that x,y,z are positive integers. If this is the case, the system seem to have unique solutions , for sure it has a finite set of solutions.

Chestermiller
blue_leaf77
Homework Helper
If this is the case, the system seem to have unique solutions , for sure it has a finite set of solutions.
Manipulating the general form of the solution by requiring it to satisfy ##x,y,z>0## still results in an interval of one parameter, so the solution is still of infinite numbers.

Yes, thank you for the fast replays. What Delta said is correct, variables must be positive integers.
Blue leaf, I don't quite manipulate well with matrices, I didn't really get what you said but thanks.
Buzz bloom, I expressed myself wrong. By saying "prove" I meant to find a way of finding the variables that I did in logical non-guessing way that is verifiable by the others. Thanks guys, I hope you get what I'm saying. To elaborate more my task is to think of a real life problem that would lead to these equations, and I have to show the way of solving it myself. It is kind of a essay about designing problems.

blue_leaf77
Homework Helper
I don't quite manipulate well with matrices, I didn't really get what you said but thanks.
Here's a tutorial about solving a system of equations using row reduction technique. Implementing this method for your problem, you should get for the solution
$$\left( \begin{array}{c} x \\ y \\ z \\ \end{array} \right) = \left( \begin{array}{c} -150 \\ 250 \\ 0\\ \end{array} \right) + z\left( \begin{array}{c} 5/3 \\ -8/3 \\ 1\\ \end{array} \right)$$
The solution you found is obtained by setting ##z=93##. But as you see, any value of ##z## will actually give you a solution. If you want to restrict variables further to be positive, you can just use the above equation with an inequality so that
$$\left( \begin{array}{c} -150 +z5/3\\ 250 - z8/3 \\ z\\ \end{array} \right) > \left( \begin{array}{c} 0 \\ 0 \\ 0 \\ \end{array} \right)$$
But as it should turn out, there are still many possible solutions.

Last edited:
Thank you, I will check that out, I hope it's in detail because I studied only basic operations with matrices this year in my high school, here in Europe.
My friends generated the variables and equations via their own algorithm in Lazarus, I don't quite remember if the solutions are unique (still figuring out second part of your post, I will have to do some revising). It's pretty hard for me to comprehend university studies in my own language, even harder in english :( Thank you for your time

Ray Vickson
Homework Helper
Dearly Missed
Here's a tutorial about solving a system of equations using row reduction technique. Implementing this method for your problem, you should get for the solution
$$\left( \begin{array}{c} x \\ y \\ z \\ \end{array} \right) = \left( \begin{array}{c} -150 \\ 250 \\ 0\\ \end{array} \right) + z\left( \begin{array}{c} 5/3 \\ -8/3 \\ 1\\ \end{array} \right)$$
The solution you found is obtained by setting ##z=93##. But as you see, any value of ##z## will actually give you a solution. If you want to restrict variables further to be positive, you can just use the above equation with an inequality so that
$$\left( \begin{array}{c} -150 +z5/3\\ 250 - z8/3 \\ z\\ \end{array} \right) > \left( \begin{array}{c} 0 \\ 0 \\ 0 \\ \end{array} \right)$$
But as it should turn out, there are still many possible solutions.

There are exactly two solutions in non-negative integers, but exactly one in positive integers.

From what you wrote above we see that getting integers x and y requires z to be a multiple of 3, and x ≥ 0 requires z ≥ 90.

Also I did something simmilar but coudn't figure how to proceed

So I have to set assumption that z=93?

blue_leaf77
Homework Helper
There are exactly two solutions in non-negative integers, but exactly one in positive integers.

From what you wrote above we see that getting integers x and y requires z to be a multiple of 3, and x ≥ 0 requires z ≥ 90.
My bad, I was sloppy in reading @Delta² 's post, missed the "integer". Sorry @Delta² . So, yes he is right there is one positive integer solution.

blue_leaf77
Homework Helper
Also I did something simmilar but coudn't figure how to proceed

So I have to set assumption that z=93?
You have to find the range of ##z## (or ##a##) for which all solutions are positive.

Aand I can find the range of z (a) only by guessing?

blue_leaf77
Homework Helper
Aand I can find the range of z (a) only by guessing?
Of course not, you can start from the system of inequalities from the second part of post#7. There are three inequalities, find the intersection of all of them. Do you know how to work with inequalities?

Ray Vickson
Homework Helper
Dearly Missed
Aand I can find the range of z (a) only by guessing?

No, of course not.Begin by actually reading what I wrote in #9, and proceed from there.

Oh ok, I didn't go through your whole post that is more in-depth yet, I have that in mind. I have to check out terminology to know if I know what you are talking about (inequalities). I won't ask any more stupid questions, after I observe the materials you gave me in complete tomorrow, I will state the situation

Ray Vickson, I didn't understand where u got the condition that x variable has to be 3 times bigger then z variable? Do you conclude that from Equation 2? I don't see the connection, am I missing something out?

Ray Vickson
Homework Helper
Dearly Missed
Ray Vickson, I didn't understand where u got the condition that x variable has to be 3 times bigger then z variable? Do you conclude that from Equation 2? I don't see the connection, am I missing something out?

Well, never said that. I said that z must be a multiple of 3; it could be 0, or 3, or 6, or,... Why? Well, look at the formula in equation (1) of post #7:
$$x = -150 + \frac{5}{3}z$$
If ##z## is an integer that is not a multiple of 3, the value of ##x## will be a non-integer with a remainder of 1/3 or 2/3. The only way to have ##x## come out as an integer is to have ##z## be an (integer) multiple of 3, so that there will not be any remainder when you compute ##x##.

Next: in order to have ##x = -150 + (5/3)z \geq 0## you need to have ##(5/3)z \geq 150##. What does that tell you about ##z##?

I did some work on matrices but I managed to do similar as I sad using basic algebra already, but nevertheless now knowing how to reduce matrice to reduced row echoleon form is useful, I will add that to my final paper for sure.
blue_leaf77 and Ray Vickson, so there are two non-positive integer solutions (containing 0) and unique positive (x=5, y=2, z=93). So by the setting of the problem one will conclude that the x,y,z>0. Next, in equation x=−150+5/3z, by the condition x,y>0 follows 98<z>90, also for x to be integer z must be multiple of 3 so that leads us to only two numbers possible; 93 and 96. Is that all there is to it for positive integer solution?
Other thing, how did you read that there are only two non-positive integer solutions? I really know little about matrices, I know how to reduce the matrice, but the record in the video later, explaining as the solution can be specified as vectors confused me a little. What inequalities are set then and how to read them? (this is not really important because I only need positive solutions, but it's nice to know)

Last edited:
blue_leaf77
Homework Helper
non-positive
Non-negative.
98<z>90
##z>90## is correct but ##z>98## is not, let alone this mistake that's not how you combine two inequalities into a single one.
that leads us to only two numbers possible; 93 and 96
96 shouldn't be in the range where the solution is positive, this is because you calculated one of the inequalities wrongly.
two non-positive
Again, non-negative. You can deduce that there are only two non-negative integer solutions after you correctly calculate the required range for ##z##.

My bad, I mixed the term with something else, I'm looking into different stuff simultaniesly... But still I got the correct meaning? x=0 => z(a)=90 and y=10, also y=0 => z(a)=93.75 and x=6.25? that would be the 2 cases?

Also the second part, it is not entirely false that a<98, from Equation 2, the sum of all three variables has to be 100, so x and y each respectively have smallest possible value of 1. Later on I get to the part where z can be either 93 or 96, but by substituting I eliminate 96.

blue_leaf77
Homework Helper
that would be the 2 cases?
Two cases of what? The first solution set is the non-negative integer one but the second set is clearly not integer. Are we actually still in the same goal of obtaining positive integer solution?
it is not entirely false that a<98
Try setting ##z=98## in the general form of the solution in post #7, will it give positive values for ##x,y,z##?

Take a look again at the second part of post #7. In the upper row you have ##-150+(5/3)z>0## and upon simplifying you get ##z>90##. The second row gives you ##250-(8/3)z>0##, how does it simplify?

Well non-negative means the number is 0 or greater. I assumed the two cases where when either x or y had to be 0. Why you didn't use term positive then? It's true, if y is set to 0 solutions aren't positive integer.
Ok, so regarding the Equation 2, I still can't say that the solution z(a)<98?

blue_leaf77
Homework Helper
I still can't say that the solution z(a)<98?
Have you tried plugging in, e.g. ##z=97##, into the general equation of the solution? Are the solution set all positive?

I know it's not correct, the only solution is 93 for z(a), but is it defining it before conclusion a mistake (based on equation at the start)? it just seems more precise, if it's dumb please say it, because I don't have the knowledge to tell.

blue_leaf77
Homework Helper
is it defining it before conclusion a mistake
In math, the solution of a problem is not to be defined, it's to be found by any feasible formal way. You define something when you want to introduce a new object. I don't know how you came up with z < 98 for the upper limit, but if you did your work systematically you should have ended up with the correct upper limit.

SammyS
Staff Emeritus
Homework Helper
Gold Member
I did some work on matrices but I managed to do similar as I said using basic algebra already, but nevertheless now knowing how to reduce a matrix to reduced row echelon form is useful, I will add that to my final paper for sure.
...
Using basic algebra, you can eliminate any one variable from one equation.

Eliminating x gives:
3y + 8z = 750 ##\ \ \ ## (A)​
Eliminating z gives:
-3x + 5z = 450 ##\ \ ## (B)​
Eliminating z gives:
8x + 5y = 50 ##\ \ \ \ ## (C)
Any two of these can be used to replace the original two equations, Equations (1) and (2) in the OP. Alternatively, Any one of the above may be used with either of the original equations to define this system.

In addition, the above Equations, (A), (B), and (C) can give you information regarding what allowed range of values are required for any of the variables so that all of the variables are positive or alternatively non-negative.

If x > 0, then Eq. (B) gives that z > 90 and Eq. (C) gives that y < 10 .

If y > 0, then Eq. (A) gives that z < 93.75 and Eq. (C) gives that x < 6.25 .

If z > 0, then Eq. (A) gives that y < 250 and Eq. (B) gives that x > -150 . But, of course we need x > 0.

Putting these together we have:
0 < x < 6.25
0 < y < 10
90 < z < 90.75​

Additionally, Equations A, B, and C tell us that x is a multiple of 5, y is even, and z is a multiple of 3 .

Consideration of the restrictions on x or z give the fewest number of cases to consider.

(I know this post is late, but I started it this morning and then got side-tracked.)

Nikola276
ehild
Homework Helper

## Homework Equations

Equation 1: 3x+2y+1/3z=50
Equation 2: x+y+z=100

## The Attempt at a Solution

I know that the variables go like this: x=5, y=2 and z=93. I solved this combining different variables until I got the right "combination". I have to prove these solutions, any ideas how?
You can solve the problem systematically without matrices, as @SammyS said, by elimination. x, y, z are all positive integers. Because of equation 1, z must be a multiple of 3. Assume it in the form z=3u, with u positive integer.
Changing the variable z to u,
1) 3x+2y+u=50
2) x+y+3u=100.
Isolate x fom 2):
3) x=100-3u-y,
and substute it for x in 1)
3(100-3u-y)+2y+u=50
Expand the parentheses and simplify: 300-9u -3y +2y +u =50 ----> y = 250 - 8u
Substitute y into 3)
x=100-3u-(250-8u) --->
x = 5u - 150
x, y, and u have to be positive integers.
So u > 0 , 5u-150 >0, 250-8u>0. What limits do you get for u?

u> 30, u<31,2

What is the solution for u? For x, y, z?

Thank you all, I understand it know :)
just one more question, can solution be found somehow in 3-axis coordinate system like in video of the posts before using matrices? what software should I use?

blue_leaf77
Homework Helper
They are not axis, they are vectors whose number turns out to be three. In that video the solution turns out to be a sum between a fixed vector and a linear combination of the vectors denoted by ##\vec a## and ##\vec b## (just for your information the last two vectors form the basis in the so-called null space of the coefficient matrix). In your problem the solution is a sum between a fixed vector ##(-150,250,0)^T## and a linear combination of a single vector ##(5/3,-8/3,1)^T## (the last vector is a basis for the null space of the coefficient matrix in your problem).

Buzz Bloom
Gold Member
Hi @Nicola276:

I agree with Delta.
Something tells me that the OP wanted to say that x,y,z are positive integers.
Equations seeking integer solutions are called Diophantine equations.

There is a discussion of these equations in

You may also find the following helpful. It is about a method for solving a single linear Diophantine equation.
Your problem involves two equations, but it is easy to transform it into one by eliminating one variable as shown by SammyS in post #28.

Regards,
Buzz

Nikola276