& is divisible by 3.
then the number of elements in the set S=?
Hi adhyeta.
Let
$\displaystyle S_1=\{0,3,6,9\}$
$\displaystyle S_2=\{1,4,7\}$
$\displaystyle S_3=\{2,5,8\}$
Then there are four possibilities for $\displaystyle a_1+a_2+a_3$ to be divisible by 3:
(a) $\displaystyle a_1,a_2,a_3\in S_1.$ There are $\displaystyle 4\times4\times4=64$ choices for this.
(b) $\displaystyle a_1,a_2,a_3\in S_2.$ There are $\displaystyle 3\times3\times3=27$ choices here.
(c) $\displaystyle a_1,a_2,a_3\in S_3.$ Also 27 choices here.
(d) $\displaystyle a_1,a_2,a_3$ belong to different $\displaystyle S_1,S_2,S_3.$ Here there are $\displaystyle 3!\times4\times3\times3=216$ choices.
So the total number of elements in $\displaystyle S$ is $\displaystyle 64+27+27+216=334.$