PrepRung

JEE Advanced 2018 Paper 2 · Mathematics · Permutations and Combinations · medium

Find the number of 7-digit strings formed using only the digits 1,2,3, in which each of the three digits appears at least once and the sum of all the…

Numerical answer

Find the number of 77-digit strings formed using only the digits 1,2,31,2,3, in which each of the three digits appears at least once and the sum of all the digits is divisible by 33.
Show answer and solution

Answer: 602

Let (a,b,c)(a,b,c) be the numbers of 11s, 22s, 33s, with a+b+c=7a+b+c=7 and each at least 11. The digit sum is a+2b+3c≡a+2b≡a−b(mod3)a+2b+3c\equiv a+2b\equiv a-b\pmod 3, so we need a≡b(mod3)a\equiv b\pmod3. The admissible triples are (1,1,5),(1,4,2),(4,1,2),(2,2,3),(3,3,1)(1,1,5),(1,4,2),(4,1,2),(2,2,3),(3,3,1), contributing 7!a! b! c!=42,105,105,210,140\frac{7!}{a!\,b!\,c!}=42,105,105,210,140 arrangements respectively, which total 602602. As a cross-check, a complete brute-force enumeration of all 37=21873^{7}=2187 strings, keeping those that use all three digits with digit sum divisible by 33, returns exactly 602602 strings. The answer is 602602. The congruence argument is shorter than a roots-of-unity filter, and the surjectivity condition is built in because every composition has each part at least one. A common slip is to forget that the multinomial coefficient must be used for arrangements, not just the number of compositions, which would give only five.
Report a mistake

Original question written in the JEE Advanced 2018 Paper 2 pattern and checked twice for the correct answer. Not an official question paper. How we write and check questions · Corrections policy · Report a mistake