Skip to content

Counting Numbers and Words

Tool topicTool topic: used inside other questions, rarely asked on its own. One short set here; its practice comes inside the topics that use it.

10 lessons · 18 questions · 11 PYQs · ~60 s per question

The idea

A number is a string of digits with one extra rule: the first digit is not 00. Every question adds conditions on some places (last digit even, odd digits at odd places, digit sum fixed). Count by filling places one at a time and multiplying the choices.

Textbook vs exam method

Exam method

  1. Last digit first, then the first digit. even/divisible by 55 from a set with 00: (ends in 0)+(ends in other)\text{(ends in 0)}+\text{(ends in other)}; check one case with m−1Pk−1^{m-1}P_{k-1}.
  2. Bounds. below 30000003000000 with digits 1,31, 3: all lengths 11-66 (126126) plus 77-digit starting with 11 (6464): 190190.Indore 2019
  3. Odd digits at odd places. the first place is odd, so 00 is no problem: 5P3×7P2=2520^5P_3\times{}^7P_2=2520.Indore 2021
  4. Digit sum ss for 3-digit numbers. (s+12)\binom{s+1}{2} for s≤9s\le 9; above 99 subtract the cases where a digit exceeds 99 (or count by the hundreds digit).
  5. Sum of all numbers formed. (n−1)!×(digit sum)×11…1(n-1)!\times(\text{digit sum})\times 11\dots1.

Worked examples

Example 1Sitter

33-digit numbers from 1,2,3,4,51,2,3,4,5 without repetition

Example 2

(d2, JIPMAT 2025) 33-digit even numbers from 11-55, no repetition

Example 3

(d2, Indore 2021 Q23) 55-digit numbers, distinct digits, only odd digits at odd places

Example 4

(d2, Indore 2019 Q54) numbers below 30000003000000 written with 11 and 33 only

Example 5

(d3, Indore 2025 Q12) integers above 50005000, divisible by 55, from 1,3,5,7,8,91,3,5,7,8,9 without repetition

Traps

  • A leading 00; one case of the last digit forgotten; the boundary digit in 'greater than'; numbers of other lengths.

Formulas

Arrangements of r out of n distinct digits

nPr=n!(n−r)!=n(n−1)⋯(n−r+1){}^{n}P_{r}=\dfrac{n!}{(n-r)!}=n(n-1)\cdots(n-r+1)

Fill the restricted places first (box method); the product of the choices is the count.
Strings when repetition is allowed

with repetition: nr strings of length r\text{with repetition: } n^{r}\ \text{strings of length } r

Each place independently has n choices; remember 0 cannot lead.
How many numbers have exactly k digits

#{k-digit numbers}=9⋅10k−1\#\{k\text{-digit numbers}\}=9\cdot10^{k-1}

Use it for every 'at least one' count: total minus the complement.
Sum of all numbers formed from given digits

sum of all numbers from n distinct digits=(n−1)! (∑d) 11⋯1⏟n\text{sum of all numbers from } n \text{ distinct digits}=(n-1)!\,(\textstyle\sum d)\,\underbrace{11\cdots1}_{n}

Each digit appears (n-1)! times in each place; subtract the leading-zero numbers if 0 is a digit.
Numbers with increasing digits

#{k-digit numbers with strictly increasing digits}=(9k)\#\{k\text{-digit numbers with strictly increasing digits}\}=\binom{9}{k}

Choosing the digits fixes the order; 0 cannot appear (it would have to lead). Decreasing digits: C(10, k).

In the exam

Shortcuts
  • Fill the most restricted place first: last digit for 'divisible by 5 / even', first digit for 'no leading zero' or 'greater than'.
  • When 0 is in the set and the last digit is restricted, split into 'ends in 0' and 'ends in a non-zero allowed digit'.
  • 'At least one repeated / at least one 7' = all numbers minus the complement (all distinct / no 7).
  • Below a bound: every shorter number counts; compare the numbers of full length digit by digit (Indore 2019: 190).
  • Divisible by 4: list the allowed last-two-digit endings; divisible by 3: choose the digit set by its digit sum first.
~60 s per question at exam speed
When to skip: Box-method items take 30-60 s - always attempt. Multi-length or divisibility-by-4 casework can take 2 minutes; do it on the second pass.

Before this

What the exams ask here

  • numbers > 5000 divisible by 5 from {1,3,5,7,8,9}
  • three-digit with digit sum 10
  • five-digit numbers with placement rules
Next sub-topicArrangements

Practise this free. Every mistake is saved and comes back until you fix it.

Start free