PYQ Vault

JEE Mains Maths · Permutations and Combinations

Forming Numbers from Digits

Counting numbers built from a given set of digits: with a range or position condition, with a divisibility condition, or with a condition on the sum or product of the digits.

Why this matters

Thirty-seven PYQs, the largest page in the chapter, and twenty-seven of them numerical answer. Sixteen fill positions under a range or no-repetition rule, fourteen need a divisibility test, and seven fix the sum or product of the digits. Three ideas cover the page.

Concept 1 of 3: Filling positions: ranges, leading digits and no repetition

Fill the most restricted position first — the leading digit (never 0, bounded by the range), the last digit (parity) — then the rest. A range like 'between 5000 and 9000' fixes the leading digit's choices. To add all the numbers formed, find how often each digit sits in each place: by symmetry, every place carries the same digit total.

Definition

  • Restricted positions first, then the rest in order.
  • No repetition: choices drop by one at each step.
  • Sum of all numbers from nn distinct digits (all used): (n−1)! (digit sum) (11…1)(n-1)!\,(\text{digit sum})\,(11\dots1).
  • Three-digit numbers with exactly one digit repeated twice: all, minus all digits equal, minus all digits distinct.

Sum of all arrangements

∑=(number of arrangements)×(digit sum)n×11⋯1⏟n\sum=\frac{(\text{number of arrangements})\times(\text{digit sum})}{n}\times\underbrace{11\cdots1}_{n}

Worked example

How many 4-digit numbers greater than 6000 can be formed from 2, 4, 6, 8, 9 without repetition?
Practice this conceptself-check · 4 quick reps

The same idea in a real exam question:

JEE Mains · 2023 · 24 Jan 2023 · Q169Moderate

Example 1 · Permutations and Combinations · Forming Numbers from Digits

The number of integers, greater than 7000 that can be formed, using the digits 3,5,6,7,83,5,6,7,8 without repetition, is

Zero in the leading place

When 0 is available, the leading digit has one fewer choice. If the last digit is also restricted (say even, and 0 is even), split into cases 'last digit 0' and 'last digit not 0'.

Concept 2 of 3: Divisibility conditions

Turn each divisibility rule into a condition on digits: by 5, last digit 0 or 5; by 4, the last two digits; by 3, the digit sum; by 11, the alternating sum. For 'divisible by 3' with repetition allowed, group the digits by remainder mod 3 and count the combinations of remainders that add to a multiple of 3. Combined divisors (6, 15, 55) need both tests.

Definition

  • By 3 or 9: digit sum. By 4: last two digits. By 5: last digit 0 or 5.
  • By 11: (sum of odd places) −- (sum of even places) is a multiple of 11.
  • Six-digit palindromes abccba‾\overline{abccba} are all multiples of 11.
  • With repetition, if the allowed digits are spread evenly over remainders mod 3, exactly a third of the free choices work.

Digit-sum test

3∣d1d2⋯dn‾ exactly when 3∣d1+d2+⋯+dn3\mid\overline{d_1d_2\cdots d_n}\ \text{exactly when}\ 3\mid d_1+d_2+\cdots+d_n

Worked example

How many 4-digit numbers divisible by 4 can be formed from 1, 6, 8, 9 without repetition?
Practice this conceptself-check · 4 quick reps

The same idea in a real exam question:

JEE Mains · 2024 · 8 April 2024 · Q84Moderate

Example 2 · Permutations and Combinations · Forming Numbers from Digits

The number of 3-digit numbers, formed using the digits 2,3,4,52,3,4,5 and 7 , when the repetition of digits is not allowed, and which are not divisible by 3 , is equal to

Count the complement when it is smaller

'Not divisible by 3' is usually easier as total minus divisible. Listing the digit triples whose sum is a multiple of 3 is short; listing the others is long.

Concept 3 of 3: Fixed digit sum or product

A fixed digit sum is an equation d1+⋯+dn=Sd_1+\dots+d_n=S in bounded integers: substitute to remove the lower bounds, count with stars and bars, then subtract the cases where a digit exceeds 9. A fixed product is a factorisation: list the multisets of digits with that product, then count arrangements of each.

Definition

  • a+b+c=Sa+b+c=S, a≥1a\ge1, b,c≥0b,c\ge0: put a′=a−1a'=a-1, then (S−1+22)\binom{S-1+2}{2} before bounds.
  • Subtract each case with a digit ≥10\ge10 (put d′=d−10d'=d-10).
  • Digits from {1,2,3}\{1,2,3\} with sum SS: solve for the counts of each digit, then n!a! b! c!\frac{n!}{a!\,b!\,c!}.
  • Product kk: list digit multisets whose product is kk.

Stars and bars

x1+⋯+xk=S, xi≥0: (S+k−1k−1)x_1+\cdots+x_k=S,\ x_i\ge0:\ \binom{S+k-1}{k-1}

Worked example

How many 3-digit numbers have digit sum 5?
Practice this conceptself-check · 4 quick reps

The same idea in a real exam question:

JEE Mains · 2024 · 9 April 2024 · Q174Moderate

Example 3 · Permutations and Combinations · Forming Numbers from Digits

The number of integers, between 100 and 1000 having the sum of their digits equals to 14 , is

Digits stop at 9

Stars and bars counts solutions with any size of digit. For a sum above 9, remove the solutions where some digit is 10 or more before answering.

Summary — formulas & gotchas at a glance

A revision cheat-sheet for the formulas and gotchas above. Click any concept name to jump back to its full explanation.

Formulas (3)

  • Filling positions: ranges, leading digits and no repetition

    Sum of all arrangements

    ∑=(number of arrangements)×(digit sum)n×11⋯1⏟n\sum=\frac{(\text{number of arrangements})\times(\text{digit sum})}{n}\times\underbrace{11\cdots1}_{n}
  • Divisibility conditions

    Digit-sum test

    3∣d1d2⋯dn‾ exactly when 3∣d1+d2+⋯+dn3\mid\overline{d_1d_2\cdots d_n}\ \text{exactly when}\ 3\mid d_1+d_2+\cdots+d_n
  • Fixed digit sum or product

    Stars and bars

    x1+⋯+xk=S, xi≥0: (S+k−1k−1)x_1+\cdots+x_k=S,\ x_i\ge0:\ \binom{S+k-1}{k-1}

Watch out for (3)

Test yourself on Permutations and Combinations

20 past JEE Mains questions from this chapter, timed at 48 minutes and marked the way the exam marks it. You see your score and every answer the moment you finish. Free to start.