# Rincón Matemático

## Revista, Técnicas, Cursos, Problemas => Problemas y Desafíos => De oposición y olimpíadas => Mensaje iniciado por: jacks en 02 Mayo, 2019, 11:03 am

Título: Positive integer triplets
Publicado por: jacks en 02 Mayo, 2019, 11:03 am
Number of positive integer triplets $(x,y,z)$ in $x+y+z=n,$ where $x<y<z$
Título: Re: Positive integer triplets
Publicado por: jbgg en 02 Mayo, 2019, 04:21 pm
We consider the following sets

$A =\{ (x,y,z) : 0<x<y<z\ \text{ and }\ x+y+z=n\}$

and

$B =\{ (x,y,z) : 0<x,y,z\ \text{ and }\ x\neq y\neq z\neq x\ \text{ and }\ x+y+z=n\}.$

There is a relation between cardinals of both sets, which is

$|B| = 3!\;|A|.$

So we reduce the problem to count the number of element of set $B$. In order to calculate the cardinal of $B$, we decompose the set as

$B = C \setminus (C_{12}\cup C_{13}\cup C_{23}\cup C_{123}),$

where

$C = \{ (x,y,z) : 0<x,y,z\ \text{ and }\ x+y+z=n\},$

$C_{12} = \{ (x,y,z) : 0<x,y,z\ \text{ and }\ x=y\neq z\ \text{ and }\ x+y+z=n\},$

$C_{13} = \{ (x,y,z) : 0<x,y,z\ \text{ and }\ x=z\neq y\ \text{ and }\ x+y+z=n\},$

$C_{23} = \{ (x,y,z) : 0<x,y,z\ \text{ and }\ y=z\neq x\ \text{ and }\ x+y+z=n\},$

and

$C_{123} = \{ (x,y,z) : 0<x=y=z\ \text{ and }\ x+y+z=n\}.$

We note that $C_{12},C_{13},C_{23},C_{123}\subset C$ and the sets $C_{12},C_{13},C_{23},C_{123}$ are pairwise disjoint sets.

It turns out that $|B| = |C| - |C_{12}| - |C_{13}| - |C_{23}| - |C_{123}|$.

We have to count the cardinal of $B, C_{12},C_{13},C_{23}$ and $C_{123}$.

It is easy (if not you can ask) to see that $|C| = \binom{n-1}{2}$,

$|C_{12}| = |C_{13}| = |C_{23}| = \left\{\begin{array}{ll} k-1 & \text{ if } n\equiv 0 \pmod{2},\\ k & \text{ if } n\not\equiv 0 \pmod{2},\\\end{array}\right.$

and

$|C_{123}| = \left\{\begin{array}{ll} 1 & \text{ if } n\equiv 0 \pmod{3},\\0 & \text{ if } n\not\equiv 0 \pmod{3},\\\end{array}\right.$

where $n = 2k + r$ with $r=0,1$.

NOTE: $|C_{12}|$ is incorrect, see the answer #4.
Título: Re: Positive integer triplets
Publicado por: jacks en 02 Mayo, 2019, 04:55 pm
Thanks Jbgg. but how can i write ordered triplets $(x,y,z)$ in $n$ form.

Título: Re: Positive integer triplets
Publicado por: jbgg en 02 Mayo, 2019, 05:43 pm
Thanks Jbgg. but how can i write ordered triplets $(x,y,z)$ in $n$ form.

Sorry, I don't get your question.

In order to solve the problem (number of triples) it must be calculated the number of elements of set $A$ as defined in
We consider the following sets

$A =\{ (x,y,z) : 0<x<y<z\ \text{ and }\ x+y+z=n\}$

[...]
Título: Re: Positive integer triplets
Publicado por: jbgg en 03 Mayo, 2019, 02:10 am
Sorry, I made a mistake. I have just check it since I thought very fast.

Now I can confirm the solution is correct if the following is changed.

[...]

$|C_{12}| = |C_{13}| = |C_{23}| = \left\{\begin{array}{ll} n/2-2 & \text{ if } n\equiv 0 \pmod{2} \text{ and }n\equiv 0 \pmod{3},\\ n/2-1 & \text{ if } n\equiv 0 \pmod{2} \text{ and }n\not\equiv 0 \pmod{3},\\ (n-1)/2-1 & \text{ if } n\not\equiv 0 \pmod{2} \text{ and }n\equiv 0 \pmod{3},\\ (n-1)/2 & \text{ if } n\not\equiv 0 \pmod{2} \text{ and }n\not\equiv 0 \pmod{3},\\ \end{array}\right.$

[...]

Sorry for the inconvenience.
Título: Re: Positive integer triplets
Publicado por: jacks en 05 Mayo, 2019, 05:20 am
Thanks jbgg got it.