# Multivar equation help

## Recommended Posts

Can anyone solve or help me find solutions for:

x + z - y = (0 or 15)

with x, y, and z ranging between 0 - 15?

##### Share on other sites
17 minutes ago, Endy0816 said:

Can anyone solve or help me find solutions for:

x + z - y = (0 or 15)

with x, y, and z ranging between 0 - 15?

Why not write C/C++ program?

#include <stdio.h>

int main( void )
{
int counter = 1;
for( int x = 0; x <= 15; x++ )
{
for( int y = 0; y <= 15; y++ )
{
for( int z = 0; z <= 15; z++ )
{
int result = x + z - y;
if( ( result == 0 ) || ( result == 15 ) )
{
printf( "%d. X=%d Y=%d Z=%d\n", counter, x, y, z );
counter++;
}
}
}
}
return( 0 );
}



It generated 272 results, check results.txt in Release folder.

Edited by Sensei

##### Share on other sites
49 minutes ago, Sensei said:

Why not write C/C++ program?


#include <stdio.h>

int main( void )
{
int counter = 1;
for( int x = 0; x <= 15; x++ )
{
for( int y = 0; y <= 15; y++ )
{
for( int z = 0; z <= 15; z++ )
{
int result = x + z - y;
if( ( result == 0 ) || ( result == 15 ) )
{
printf( "%d. X=%d Y=%d Z=%d\n", counter, x, y, z );
counter++;
}
}
}
}
return( 0 );
}



It generated 272 results, check results.txt in Release folder.

Thank you. Seemed relatively simple at first. I was able to find a number of solutions myself, but the inner positions where no coordinate is zero or 15 were giving me a headache.

Edited by Endy0816

##### Share on other sites
On 2/18/2018 at 5:02 PM, Sensei said:

It generated 272 results, check results.txt in Release folder.

272 integer results... do x, y, and z have to be integers? The original problem statement did not state that.

##### Share on other sites

Yes, only needed the integers.

Somewhat embarrassed to say its for Minecraft. The normal order of events can alter at these particular coordinates. They repeat nigh infinitely across the world too, so should be extremely  useful.

##### Share on other sites
On ‎2‎/‎18‎/‎2018 at 4:45 PM, Endy0816 said:

Can anyone solve or help me find solutions for:

x + z - y = (0 or 15)

with x, y, and z ranging between 0 - 15?

I assume x, y, and z must be integers.

First x+ z- y= 0.

If x= 0 then z-  y= 0 so z= y.

(0, 0, 0), (0, 1, 1), (0, 2, 2), ..., (0, 15, 15)

If x= 1 then z- y= -1 so z= y- 1

(1, 1, 0), (1, 2, 1), (1, 3, 2), ..., (1, 15, 14)

If x= 2 then z- y= 2 so z= y- 2

(2, 2, 0), (2, 3, 1), (2,  4, 2), ...., (2, 14, 12)

continue.

,