### Autor Tema: Positive integer triplets

0 Usuarios y 1 Visitante están viendo este tema.

02 Mayo, 2019, 11:03 am
Leído 1038 veces

#### jacks

• $$\Large \color{#c88359}\pi\,\pi\,\pi\,\pi$$
• Mensajes: 672
• País:
• Karma: +0/-0
• Sexo:
##### Positive integer triplets
Number of positive integer triplets $(x,y,z)$ in $x+y+z=n,$ where $x<y<z$

02 Mayo, 2019, 04:21 pm
Respuesta #1

#### jbgg

• $$\Large \color{#5e8d56}\pi\,\pi\,\pi$$
• Mensajes: 218
• Karma: +0/-0
• Sexo:
##### Re: Positive integer triplets
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.

02 Mayo, 2019, 04:55 pm
Respuesta #2

#### jacks

• $$\Large \color{#c88359}\pi\,\pi\,\pi\,\pi$$
• Mensajes: 672
• País:
• Karma: +0/-0
• Sexo:
##### Re: Positive integer triplets
Thanks Jbgg. but how can i write ordered triplets $(x,y,z)$ in $n$ form.

02 Mayo, 2019, 05:43 pm
Respuesta #3

#### jbgg

• $$\Large \color{#5e8d56}\pi\,\pi\,\pi$$
• Mensajes: 218
• Karma: +0/-0
• Sexo:
##### Re: Positive integer triplets
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\}$

[...]

03 Mayo, 2019, 02:10 am
Respuesta #4

#### jbgg

• $$\Large \color{#5e8d56}\pi\,\pi\,\pi$$
• Mensajes: 218
• Karma: +0/-0
• Sexo:
##### Re: Positive integer triplets
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.

05 Mayo, 2019, 05:20 am
Respuesta #5

#### jacks

• $$\Large \color{#c88359}\pi\,\pi\,\pi\,\pi$$
• Mensajes: 672
• País:
• Karma: +0/-0
• Sexo:
##### Re: Positive integer triplets
Thanks jbgg got it.