# Math Help - number of elements

1. ## number of elements

$S={(a_{1},a_{2},a_{3})}|0\leq a_{i}\leq 9$

& $(a_{1}+a_{2}+a_{3})$ is divisible by 3.

then the number of elements in the set S=?

$S={(a_{1},a_{2},a_{3})}|0\leq a_{i}\leq 9$

& $(a_{1}+a_{2}+a_{3})$ is divisible by 3.

then the number of elements in the set S=?

Let

$S_1=\{0,3,6,9\}$
$S_2=\{1,4,7\}$
$S_3=\{2,5,8\}$

Then there are four possibilities for $a_1+a_2+a_3$ to be divisible by 3:

(a) $a_1,a_2,a_3\in S_1.$ There are $4\times4\times4=64$ choices for this.

(b) $a_1,a_2,a_3\in S_2.$ There are $3\times3\times3=27$ choices here.

(c) $a_1,a_2,a_3\in S_3.$ Also 27 choices here.

(d) $a_1,a_2,a_3$ belong to different $S_1,S_2,S_3.$ Here there are $3!\times4\times3\times3=216$ choices.

So the total number of elements in $S$ is $64+27+27+216=334.$