PYQ Vault

JEE Mains Maths · Permutations and Combinations

Dictionary Order and Ranks

Finding the position of a word in the dictionary list of all arrangements of its letters, or the word at a given position; and the same for numbers listed in increasing or decreasing order.

Why this matters

Fourteen PYQs, and 2023 alone has seven. Each is one procedure: go letter by letter, and at every position count the words that start with a smaller letter. Eleven rank words; three rank numbers. Two ideas cover the page.

Concept 1 of 2: The rank of a word

Sort the letters alphabetically. For the first position, every smaller letter that could stand there starts a block of (n−1)!(n-1)! words (divided by the factorials of any letters still repeated). Add those blocks, fix the actual first letter, and repeat with what is left. The rank is the total plus one. To find the word at a given position, do the same in reverse: subtract whole blocks until the position falls inside one.

Definition

  • Rank =1+∑=1+\sum (words beginning with a smaller choice at each step).
  • A block after fixing kk letters has (n−k)!(n-k)! words, divided by factorials of letters repeated in the remainder.
  • Word at position NN: subtract full blocks in order until NN lies within one.

Rank

rank=1+∑i=1nci (n−i)!(ci=smaller unused letters at step i)\text{rank}=1+\sum_{i=1}^{n}c_i\,(n-i)!\quad(c_i=\text{smaller unused letters at step }i)

Worked example

Find the rank of CAT among the arrangements of A, C, T.
Practice this conceptself-check · 4 quick reps

The same idea in a real exam question:

JEE Mains · 2023 · 6 April 2023 · Q161Moderate

Example 1 · Permutations and Combinations · Dictionary Order and Ranks

All the letters of the word PUBLIC are written in all possible orders and these words are written as in a dictionary with serial numbers. Then the serial number of the word PUBLIC is

Repeated letters change the block size

With a letter still repeated among the unused ones, a block has (n−k)!p!\frac{(n-k)!}{p!} words, not (n−k)!(n-k)!. Recompute the divisor at each step, since using up one copy of a repeated letter changes it.

Concept 2 of 2: Numbers listed in order

Numbers with a fixed number of digits are listed exactly like words, with the allowed digits as the alphabet. With repetition allowed, each block after fixing kk digits has d n−kd^{\,n-k} numbers, where dd is the number of allowed digits. For numbers with strictly increasing digits, each is a choice of digits, so blocks are counted with combinations.

Definition

  • Repetition allowed, dd digits: a block has d n−kd^{\,n-k} numbers.
  • Leading digit cannot be 0.
  • Descending order: count the numbers larger than the given one.
  • Strictly increasing digits from {1,…,9}\{1,\dots,9\}: numbers starting with aa number (9−an−1)\binom{9-a}{n-1}.

Block size with repetition

numbers after fixing k of n digits=d n−k\text{numbers after fixing }k\text{ of }n\text{ digits}=d^{\,n-k}

Worked example

3-digit numbers are formed from the digits 1, 2, 3 with repetition and listed in increasing order. Find the position of 231.
Practice this conceptself-check · 4 quick reps

The same idea in a real exam question:

JEE Mains · 2023 · 31 January 2023 · Q86Moderate

Example 2 · Permutations and Combinations · Dictionary Order and Ranks

Let 5-digit numbers be constructed using the digits 0,2,3,4,7,90,2,3,4,7,9 with repetition allowed, and are arranged in ascending order with serial numbers. Then the serial number of the number 42923 is

Zero is allowed after the first digit

When 0 is among the digits, it cannot lead but can appear anywhere else. Blocks for the first digit use d−1d-1 choices; later blocks use all dd.

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 (2)

  • The rank of a word

    Rank

    rank=1+∑i=1nci (n−i)!(ci=smaller unused letters at step i)\text{rank}=1+\sum_{i=1}^{n}c_i\,(n-i)!\quad(c_i=\text{smaller unused letters at step }i)
  • Numbers listed in order

    Block size with repetition

    numbers after fixing k of n digits=d n−k\text{numbers after fixing }k\text{ of }n\text{ digits}=d^{\,n-k}

Watch out for (2)

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.