# Question:

In how many ways can three different integers be selected from the numbers $1$ to $12$,so that their sum can be exactly divided by $3$?

## Solution:

if order is not important (as i am not sure about this) total ways= $4\cdot3\cdot2 + (4\cdot4\cdot4)\cdot 3!= 24 + 192 = 216$

if order is important, total ways = $\binom{4}{3} + \binom{4}{1}\cdot\binom{4}{1}\cdot\binom{4}{1} = 4 + 64 = 68$

Is my solution correct?

• You should perhaps explain where your calculations are coming from. I would suspect that you are missing a factor of $3$ in the $4 * 3 * 2$ term. – Shagnik Aug 18 '16 at 10:22
• I considered three groups: (group a: 3, 6, 9, 12) (group b: 1, 4, 7,10) (group c: 2, 5, 8, 11) now, i can select either 3 from group a, or 1 each from 3 group. so, i can select 3 numbers from group a = 4c3 = 4 ways 1 from each 3 group= 4c1* 4c1* 4c1= 64 Total= 64+4 = 68 ways – Mahmudul Hasan Aug 18 '16 at 10:35
• thank you @Shagnik i understand now. i only considered 3 number that are o module 3, but missed out 3 numbers that are 1 modulo 3 and 3 numbers that are 2 modulo 3 – Mahmudul Hasan Aug 18 '16 at 10:52

Note that in order that the sum of $3$ number will be divided by $3$, you have that their sum modulo $3$ will be $0$, therefore you could have the next possibilities:

• $3$ numbers that are $0$ modulo $3$
• $3$ numbers that are $1$ modulo $3$
• $3$ numbers that are $2$ modulo $3$
• $3$ numbers such that one is $0$ modulo $3$, one is $1$ modulo $3$ and one is $2$ modulo $3$

it's not hard to calculate each one of those cases, and since they are disjoint the sum of them to get the wanted result.

• thank you, now i get it. i didn't consider 3 numbers that are 1 modulo 3 and 3 numbers that are 2 modulo 3 – Mahmudul Hasan Aug 18 '16 at 10:39

In the range $[1,12]$ we have:

• Exactly $4$ values of $n$ such that $n\equiv0\pmod3$
• Exactly $4$ values of $n$ such that $n\equiv1\pmod3$
• Exactly $4$ values of $n$ such that $n\equiv2\pmod3$

Therefore we can split it into the following disjoint cases:

• $a,b,c\equiv0,0,0\pmod3\implies\binom43=4$ combinations
• $a,b,c\equiv1,1,1\pmod3\implies\binom43=4$ combinations
• $a,b,c\equiv2,2,2\pmod3\implies\binom43=4$ combinations
• $a,b,c\equiv0,1,2\pmod3\implies4^3=64$ combinations

Therefore we have $4+4+4+64=76$ combinations altogether.