# Thread: Find the number of pairs (x,y)

1. ## Find the number of pairs (x,y)

Good night

Let n be an odd integer >=5.

1) Find the number of pairs (x,y) of positive integers which satisfy the equation x+2y=n.

2) Find the number of triples (x,y,z) of positive integers which satisfy the equation x+y+2z=n.

I put
x+2y=n

y = (n-x)/2

the n is odd then n= 2k + 1 and
x+2y=n then x = 1

y = (n-1)/2

???

2. ## Re: Find the number of pairs (x,y)

Originally Posted by webster
Let n be an odd integer >=5.
1) Find the number of pairs (x,y) of positive integers which satisfy the equation x+2y=n
2) Find the number of triples (x,y,z) of positive integers which satisfy the equation x+y+2z=n.
1) If $n$ is even, say $8$, then $x$ must be even and less than $8$. WHY?
Are there $\left\lfloor {\dfrac{{n - 1}}{2}} \right\rfloor$ (floor function) even integers less the $n$.
How many of those even integers will actually work?

If $n$ is odd then $x$ must be odd less than $n$.

So what is the complete answer to #1 ?.

Now for #2. If $n$ odd then $x+y$ must be even. Now you work it out.

3. ## Re: Find the number of pairs (x,y)

1) if n = 8 for example then x = {0,2,4,6}
if n = 9 then x = {1,3,5,7}

floor function?

4. ## Re: Find the number of pairs (x,y)

Originally Posted by webster
1) if n = 8 for example then x = {0,2,4,6}
if n = 9 then x = {1,3,5,7}
floor function?
What I did was to give you was give in the hope that you would explore this for yourself.
In $x+2y$ that sum is odd only if x is odd. Working with the set of positive integers
if $x+2y=n$ then if $n$ is odd, $\left(\forall y\le\left\lfloor {\frac{n}{2}} \right\rfloor\right))(\exists x)[x+2y=n]$. Can you prove that?
So how many integers, $y$, can paired with some $x$ to solve $x+2y=n~?$

Now is case #2, $x+y+2z=n$ if $n$ is odd then $x+y$ must be odd.
Thus $x~\&~y$ must have different parity, i.e. one is even and one is odd.
Example: Suppose that $n=17$. Because $1\le x,~1\le y,~\&~~1\le z$ .
Here are a few combinations:
$\begin{array}{*{11}{c}} n&z&x&y \\ {17}&7&1&2 \\ {17}&7&2&1 \\ {17}&6&1&2 \\ {17}&6&4&2 \\ {17}&5&5&2 \\ {17}&5&4&3 \\ {17}&5&3&4 \\ {17}&5&6&1 \\ {17}&4&4&5 \end{array}$

How many more can you find?

5. ## Re: Find the number of pairs (x,y)

2)

The problem is equivalent to solving a system of 2 equations

$t+2z=n$

and

$x+y=t$

The first equation has $(n-1)/2$ solutions namely

$t=n-2z$ for each $z$, $1\leq z\leq \frac{n-1}{2}$

The second equation has $t-1$ solutions ${(1,t-1),(2,t-2),...,(t-1,1)}$ for a given $t$

Therefore the total number of solutions is

$\sum _{z=1}^{(n-1)/2} (n-2z-1)$

6. ## Re: Find the number of pairs (x,y)

Can I use this

$\binom{n-1}{2-1}=\left ( n-1 \right )!\\\\\\\frac{\left ( n-1 \right) }{1.2}$

or

x + 2y = n
one solution is (-n, n)
(x - (-n)) + 2(y-n) = 0

all the solutions are given by (x,y)= (-n+2t, n-t)

-n+2t>0
t>n/2

n-t>0
t<n

n/2<t<n

?? and now?