Question
Question: Number of ways of selecting three integers from \(\left\\{ 1,2,3,......n \right\\}\) if their sum is...
Number of ways of selecting three integers from \left\\{ 1,2,3,......n \right\\} if their sum is divisible by 3 is
A. 33nC3+(3n)3 if n=3k , k∈N
B. 23n−1C3+3n+2C3+(3(n−1))2(n+2), if n=3k+1 , k∈N
C. 23n−1C3+3n+2C3+(3(n−1))2(n+2) , if n=3k+2 , k∈N
D. Independent of n
Solution
The answer to the question depends on the value of the last element. The answer will be different if the value of n is different. So, to solve this question we will have to proceed according to the options as the value of n in all the options are different. So, we will form cases according to the options and then we will solve each case.
Complete step by step solution:
So, let us start the solution by the cases,
Case I: - Let the value of n=3k . Thus, we are going to divide the set into three sets such that one set contains the numbers which have values only 3P (where P∈N ), the second set contains the numbers which have values of the form (3P+1) , and the last set which has value of the form (3P+2) . Thus, we get three different sets: -
{{S}_{1}}=\left\\{ 3,6,9,12......3k \right\\}$$$$$
{{S}{2}}=\left\{ 1,4,7,10......3k-2 \right\}
${{S}_{3}}=\left\\{ 2,5,8,11......3k-1 \right\\}
The sets S1,S2 and S3 contains 3n elements each. Now we have to make solution such that the sum is divisible by 3. This can be achieved in two ways: - We can select one element from each set, in this way of doing this are given by: - 3nC1×3nC1×3nC1=3nC13=(3n)3 .The other way is selecting all the three numbers from one set. In this case also, the number will be divisible by 3. The way of doing this are 3nC3+3nC3+3nC3=33nC3 .So, the total number of ways we get are: -
=3\left( {}^{\dfrac{n}{3}}{{C}_{3}} \right)+{{\left( \dfrac{n}{3} \right)}^{3}}..........\left( 1 \right)$$$$$
Case II: - Let the value of n=3k+1.Theelementsinthesets{{S}{1}},{{S}{2}}and{{S}{3}}willbeobtainedsimilarlyandwehaddoneincaseI.So,wewillget:−{{S}{1}}=\left\{ 3,6,9,12......3k \right\}
${{S}_{2}}=\left\\{ 1,4,7,10......3k+1 \right\\}
{{S}_{3}}=\left\\{ 2,5,8,11......3k-1 \right\\}$$$$$
Thus, sets {{S}{1}}and{{S}{3}}contain\left( \dfrac{n-1}{3} \right)elementseachwhile{{S}{2}}contain\left( \dfrac{n+2}{3} \right)elements.Inthiscasealso,wehavetomakeselection.Again,therearetwoways:−Wecanselectoneelementfromeachset.Thetotalwaysofdoingthisaregivenby:−{}^{\left( \dfrac{n-1}{3} \right)}{{C}{1}}+{}^{\left( \dfrac{n-1}{3} \right)}{{C}{1}}+{}^{\left( \dfrac{n+2}{3} \right)}{{C}{1}}={{\left( \dfrac{\left( n-1 \right)}{3} \right)}^{2}}\left( \dfrac{\left( n+2 \right)}{3} \right).Theotherwayisselectingallthethreenumbersfromoneset.Thewaysdoingthisare:−{}^{\left( \dfrac{n-1}{3} \right)}{{C}{3}}+{}^{\left( \dfrac{n-1}{3} \right)}{{C}{3}}+{}^{\left( \dfrac{n+2}{3} \right)}{{C}{3}}=2\left( \dfrac{\left( n-1 \right)}{3} \right)+{}^{\dfrac{\left( n+2 \right)}{3}}{{C}{3}}.So,thetotalnumberofwayswegetare={}^{\left( \dfrac{n-1}{3} \right)}{{C}{3}}+{}^{\left( \dfrac{n-1}{3} \right)}{{C}{3}}+{}^{\left( \dfrac{n+2}{3} \right)}{{C}{3}}=2\left( {}^{\dfrac{\left( n-1 \right)}{3}}{{C}{3}} \right)+{}^{\dfrac{\left( n+2 \right)}{3}}{{C}{3}}+{{\left( \dfrac{\left( n-1 \right)}{3} \right)}^{2}}\left( \dfrac{\left( n+2 \right)}{3} \right)......\left( 2 \right)
Case III: - Let the value of $n=3k+2$. Thus, we will get the sets ${{S}_{1}},{{S}_{2}},{{S}_{3}}$ as: - $$$$
${{S}_{1}}=\left\\{ 3,6,9,12......3k \right\\}
{{S}_{2}}=\left\\{ 1,4,7,10......3k+1 \right\\}$$$$$
{{S}_{3}}=\left\{ 2,5,8,11......3k+2 \right\}$$$$$
Thus, sets S1 and S3 contain 3(n+1) elements each while S2 contains 3(n−2) elements since 3k+2≡3k−1(mod3). Now, we will select the elements in this case also . Like case-I and case-II, the total number of ways we get are: -
=23(n+1)C3+3(n−2)C3+(3(n+1))2(3(n−2))......(3)
When n = 3k + 2, the number of selection ways is same as in the case of n = 3k + 1 Hence,thecorrectoptionsfrom(1)(2)and(3)are(a),(b)and(c).
So, the correct answer is “Option A, B and C”.
Note: The method by which you can select the three numbers having sum divisible by 3 in the set S=\left\\{ 1,2,3,.......n \right\\} are only two. Either you can select the three numbers as 3P,3P+1,3P+2 or you can select all three of same type i.e. all 3P or all (3P+1) or all (3P+2) . We should always remember that we can collect r distinct objects from n distinct objects in nCr=r!(n−r)!n! way.