2

If this can be solved in a way so that there is a unique value for $x$, $y$, and $z$, is there a name for the method that can be used to solve this problem?

$$x+y+z = 12$$

$$xyz = 60$$

For this example, the values can be $3$,$4$,$5$, but I'm wondering if there is a formula or algorithm I can use to solve this problem. Lets say for our formula or algorithm, x y z can be any unique integer so that the following can be solved:

x+y+z = some constant

xyz = some other constant

2 Answers2

3

Presumably you are restricting $x,y,z$ to be natural numbers. You then need to look at factorization. We have $60=2^2\cdot 3 \cdot 5$ so $x,y,z$ can only have those factors. There are not many possibilities to look at. In larger Diophantine problems you can exclude possibilities based on the factors, but it is not worthwhile here.

Ross Millikan
  • 374,822
3

GENERAL ALGORITHM:

In that case, we can see that we have three variables and two equations. To find values of three variables, we require three equations, but since we don't have that, we must try and reduce the problem to one of two variables and two equations.

To do that, in case of this question, would be to use the equation $xyz=60$

$$60=2^2\cdot 3 \cdot 5$$ The different factors of $60$ are:$$1,2,3,4,5,6,10,12,15,20,30,60$$

But since $x+y+z=12$, $x$ can't be greater than , or equal to $12$.

So, $x$ can take the values: $1,2,3,4,5,6,10$

We now come up with different possibilities of two variable equations. $$[(yz=60,y+z=11),(yz=30,y+z=10),(yz=20,y+z=9),(yz=15,y+z=8),(yz=12, y+z=7),(yz=10,y+z=6),(yz=6,y+z=2)]$$

Obviously, a lot of these combinations won't make sense, so you can easily eliminate them.

Agreed, this will be very lengthy for larger numbers, but this is the general idea behind solving such questions.

  • I really like this response, as it is something I can translate into code. I wonder if the algorithm will be faster with a third equation. I like x+y+z and xyz because the ordering does not matter. If there was another similar equation that can make our algorithm faster, do you know what the equation might look like? I though of something like 5/4/3 = some number, but the ordering matters for this division equation. – Robin Alvarenga Jun 11 '21 at 02:57
  • Yes, if we have the third equation, we will be able to find the value of one of the variables. Thus, you don't have to explore different possibilities, you'll directly be left with two equations in two variables. – Smriti Sivakumar Jun 11 '21 at 03:20
  • If the question was $\frac{xz}{y}=60$, i'll have equations of the form$[(\frac{z}{y}=n),y+z=m]$, that is when I'm factorising $60$ for $x$ – Smriti Sivakumar Jun 11 '21 at 03:21
  • How is this answer different from the earlier answer provided by Ross? – imranfat Jun 11 '21 at 03:22
  • @imranfat giving consideration to the fact that the OP is new to the website, I wanted to give an elaborate answer, understandable easily. – Smriti Sivakumar Jun 11 '21 at 03:24