Skip to content

Linear Permutations, Factorials, and Restricted Arrangements

In Sections 01 and 02, we counted ordered arrangements directly using the Multiplication Principle. We now formalize the concept of a linear permutation, introduce factorial, falling factorial, and rising factorial notations, develop three core strategies for constrained arrangements, and learn how to find the dictionary (lexicographical) rank of a word with distinct letters.


Permutations of Distinct Objects and Factorial Notation

Look back at three counting results we already obtained in Sections 01 and 02 using the Multiplication Principle:

  • Choosing a captain and a monitor from \(60\) students: \(60 \times 59\).
  • Forming a \(4\)-digit number from \(\{1, 2, \dots, 9\}\) without repetition: \(9 \times 8 \times 7 \times 6\).
  • Forming a \(7\)-letter password with no repeated letters from \(26\) letters: \(26 \times 25 \times 24 \times 23 \times 22 \times 21 \times 20\).

Every one of these problems shares the exact same underlying structure: we have \(n\) distinct objects and \(r\) distinct positions in a row (\(0 \le r \le n\)), and we arrange \(r\) of those objects into the \(r\) positions without repetition.

Such an ordered arrangement is called an \(r\)-permutation of \(n\) distinct objects, and the total number of such arrangements is denoted by \({}^n P_r\) (or \(P(n, r)\)).

To derive a single general formula for \({}^n P_r\), fill the \(r\) distinct positions one by one from left to right. Because repetition is not allowed, each filled position reduces the pool of remaining objects by \(1\), while keeping the count of remaining choices independent of which particular objects were placed earlier:

  • The \(1\)-st position can be filled in \(n = n - 0\) ways.
  • The \(2\)-nd position can be filled in \(n - 1\) ways.
  • The \(3\)-rd position can be filled in \(n - 2\) ways.
  • Following this pattern, the \(k\)-th position can be filled in \(n - (k - 1) = n - k + 1\) ways, so the \(r\)-th (last) position can be filled in \(n - r + 1\) ways.

By the Multiplication Principle:

\[{}^n P_r = n(n - 1)(n - 2) \cdots (n - r + 1)\]

Slot-by-Slot Derivation of the r-Permutation Formula

Factorial Notation

For any natural number \(n \in \mathbb{N}\), the product of all natural numbers from \(1\) to \(n\) is called the factorial of \(n\), denoted \(n!\):

\[n! = 1 \times 2 \times 3 \times \dots \times n\]

Multiplying and dividing our expression for \({}^n P_r\) by \((n - r)(n - r - 1) \cdots 3 \cdot 2 \cdot 1 = (n - r)!\) compresses it into a compact fraction:

\[{}^n P_r = \frac{n(n - 1)(n - 2) \cdots (n - r + 1) \cdot (n - r)(n - r - 1) \cdots 3 \cdot 2 \cdot 1}{(n - r)(n - r - 1) \cdots 3 \cdot 2 \cdot 1} = \frac{n!}{(n - r)!}\]

Let us test this formula on boundary values of \(r\):

  • For \(r = 1\): \({}^n P_1 = \frac{n!}{(n - 1)!} = n\). This makes immediate sense—there are \(n\) ways to place one of \(n\) objects into a single spot.
  • For \(r = 2\): \({}^n P_2 = \frac{n!}{(n - 2)!} = n(n - 1)\).
  • For \(r = 0\): \({}^n P_0 = \frac{n!}{(n - 0)!} = 1\). Though unusual at first glance, this says there is exactly one way to arrange \(n\) objects in zero places—namely, do nothing (the empty arrangement).

Why Zero Factorial Equals One

Now test \(r = n\) in our formula:

\[{}^n P_n = \frac{n!}{(n - n)!} = \frac{n!}{0!}\]

Here we hit a snag: our original definition of \(n!\) applies only to natural numbers \(n \in \mathbb{N}\), and \(0\) is not a natural number! Does that mean \({}^n P_n\) is meaningless? Not at all. Physically, \({}^n P_n\) simply means arranging \(n\) distinct objects in \(n\) distinct places: \(n\) choices for the first place, \(n - 1\) for the second, ..., down to \(1\) choice for the last place. Directly from the Multiplication Principle:

\[{}^n P_n = n(n - 1)(n - 2) \cdots 3 \cdot 2 \cdot 1 = n!\]

For the general formula \({}^n P_r = \frac{n!}{(n - r)!}\) to hold seamlessly at \(r = n\), we require \(\frac{n!}{0!} = n!\). Therefore, by mathematical definition:

\[0! = 1\]

When all \(n\) distinct objects are arranged in \(n\) distinct places, we simply call it a permutation of \(n\) distinct objects, and its count is \(n!\).

Example 1 (Students and Chairs — Including \(r > n\)): Find the number of ways \(10\) students can be seated on: (a) \(6\) chairs, (b) \(9\) chairs, (c) \(10\) chairs, (d) \(15\) chairs.

Solution:

(a) \(6\) chairs: Both students and chairs are distinct, and \(r = 6 \le 10 = n\):

\[{}^{10} P_6 = \frac{10!}{(10 - 6)!} = \frac{10!}{4!} = 10 \times 9 \times 8 \times 7 \times 6 \times 5 = 151{,}200\]

(In every arrangement, \(4\) students remain standing.)

(b) \(9\) chairs: \({}^{10} P_9 = \frac{10!}{1!} = 10!\).

(c) \(10\) chairs: \({}^{10} P_{10} = \frac{10!}{0!} = 10!\).

Pause and ask: Why are the answers to parts (b) and (c) identical? When \(10\) students sit on \(9\) chairs, exactly \(1\) student is always left standing—you can imagine that standing student as occupying an "invisible" \(10\)-th chair! In general:

\[{}^n P_{n - 1} = {}^n P_n = n!\]

(d) \(15\) chairs: Now there are more chairs than students. Can we write \({}^{10} P_{15} = \frac{10!}{(-5)!}\)? No—the factorial of a negative integer is undefined! Yet seating \(10\) students on \(15\) chairs is obviously possible; \(5\) chairs simply stay empty.

Think from the students' perspective instead of the chairs' perspective: the first student can sit on any of the \(15\) chairs (\(15\) ways); independently, the second student has \(14\) remaining chairs; the third has \(13\); ..., and the tenth student has \(6\) choices:

\[15 \times 14 \times 13 \times \dots \times 6 = \frac{15!}{5!} = {}^{15} P_{10}\]

Symmetric Insight:
Seating \(10\) students on \(7\) chairs gives \({}^{10} P_7\) ways (with \(3\) students standing). Seating \(7\) students on \(10\) chairs also gives \({}^{10} P_7\) ways (with \(3\) chairs empty). Always put the larger pool of distinct items in the superscript of \({}^n P_r\)!


Falling Factorials and Rising Factorials

In the product \({}^n P_r = n(n - 1)(n - 2) \cdots (n - r + 1)\), each factor drops by \(1\) from the previous factor. For this reason, \({}^n P_r\) is also called the falling factorial, denoted \(n^{\underline{r}}\).

There is a natural dual concept where each successive factor increases by \(1\): the rising factorial, denoted \(n^{\overline{r}}\). Let us discover it through two concrete problems.

Example 2 (Rings on Fingers): Find the number of ways \(7\) distinct rings can be worn on \(10\) distinct fingers (assuming a finger can hold any number of rings, and the vertical order of rings on a finger matters).

Solution: Place the rings one by one:

  • Ring \(1\): Can go on any of the \(10\) fingers (\(10\) ways).
  • Ring \(2\): Surprisingly, Ring \(2\) has \(11\) ways—not \(10\)! Why? It can go on any of the \(9\) empty fingers, or above Ring \(1\) on its finger, or below Ring \(1\) on its finger (\(9 + 2 = 11\) positions).

Why Ring 2 Has 11 Choices After Ring 1 Is Placed on One of 10 Fingers

  • Ring \(3\): Notice that placing Ring \(2\) eliminated \(1\) empty slot and created \(2\) new slots (above and below Ring \(2\)), increasing the total number of available slots by \(1\)—so Ring \(3\) has \(12\) ways!
  • Continuing inductively, Ring \(7\) has \(10 + 6 = 16\) ways.

By the Multiplication Principle, the total number of ways is:

\[10 \times 11 \times 12 \times 13 \times 14 \times 15 \times 16 = \frac{16!}{9!} = {}^{16} P_7\]

Example 3 (Queues at Bank Cash Counters): A bank has \(n\) distinct cash counters, each able to form a queue. In how many ways can \(r\) distinct people arrange themselves in queues at these \(n\) counters?

Solution: Person \(1\) has \(n\) counters to choose from (\(n\) ways). Person \(2\) can pick any of the \(n - 1\) empty counters, or stand in front of or behind Person \(1\) (\(n + 1\) ways). Person \(3\) has \(n + 2\) positions, and so on until the \(r\)-th person has \(n + r - 1\) positions:

\[n(n + 1)(n + 2) \cdots (n + r - 1) = \frac{(n + r - 1)!}{(n - 1)!} = {}^{n + r - 1} P_r\]

Summary of Falling and Rising Factorial Notation

\[n^{\underline{r}} = n(n - 1)(n - 2) \cdots (n - r + 1) = {}^n P_r\]
\[n^{\overline{r}} = n(n + 1)(n + 2) \cdots (n + r - 1) = {}^{n + r - 1} P_r\]

Three Core Strategies for Restricted Permutations

When linear permutations come with extra conditions—objects that must stay together, objects that must stay apart, or objects with positional preferences—three foundational strategies handle them cleanly. (Once we introduce combinations in Section 04, we will add a fourth strategy, Select-and-Arrange, for drawing objects from multiple pools before arranging them.)

1. Tie-and-Arrange (Bundle Method)

When to use: \(k\) particular objects out of \(n\) distinct objects must always appear together as a contiguous block.

Tie the \(k\) objects together into a single indivisible bundle. Together with the remaining \(n - k\) free objects, we now have \((n - k) + 1 = n - k + 1\) units to arrange, which can be done in \((n - k + 1)!\) ways. For each arrangement of the units, the \(k\) distinct objects inside the bundle can be permuted among themselves in \(k!\) ways.

Visualizing the Tie-and-Arrange Bundle Method

By the Multiplication Principle:

\[\text{Total arrangements} = (n - k + 1)! \cdot k!\]

Example 4: In how many ways can \(6\) distinct mathematics books and \(4\) distinct physics books be arranged on a shelf so that (a) all \(4\) physics books stay together, (b) not all \(4\) physics books stay together?

Solution:

(a) All \(4\) physics books together: Bundle the \(4\) physics books into \(1\) unit. We arrange \(6 + 1 = 7\) units in \(7!\) ways, and permute the \(4\) physics books inside the bundle in \(4!\) ways:

\[7! \times 4! = 5040 \times 24 = 120{,}960\]

(b) Not all \(4\) physics books together: By the Subtraction Principle, subtract part (a) from all \(10!\) unrestricted arrangements:

\[10! - 7! \times 4! = 3{,}628{,}800 - 120{,}960 = 3{,}507{,}840\]

2. The Gap Method (No Two Adjacent)

When to use: No two objects from a restricted group of size \(k\) may stand next to each other.

First arrange the \(m\) unrestricted objects in a row in \(m!\) ways. Observe that these \(m\) objects create exactly \(m + 1\) gaps—\(m - 1\) interior gaps between consecutive objects, plus \(2\) outer positions at the very front and very end of the row:

Gap Method Diagram Showing m Objects Creating m+1 Gaps

Now place the \(k\) restricted objects (\(k \le m + 1\)) into \(k\) of these \(m + 1\) distinct gaps in \({}^{m + 1} P_k\) ways. Because at least one unrestricted object sits between any two distinct gaps, no two restricted objects can ever be adjacent. By the Multiplication Principle:

\[\text{Total arrangements} = m! \cdot {}^{m + 1} P_k\]

Example 5: In how many ways can \(10\) boys and \(5\) girls stand in a queue so that no two girls are next to each other?

Solution: Arrange the \(10\) boys in \(10!\) ways, creating \(9\) interior gaps plus \(2\) end positions \(= 11\) gaps. Place the \(5\) distinct girls into these \(11\) gaps in \({}^{11} P_5\) ways:

\[\text{Total ways} = 10! \cdot {}^{11} P_5\]

Critical Warning — "Not All Together" vs. "No Two Together":
For \(k \ge 3\) restricted objects, "not all \(k\) together" (Example 4b, solved by subtracting the bundle from the total) is completely different from "no two together" (Example 5, solved by the Gap Method). Subtracting "all \(5\) girls together" still leaves arrangements where \(2\), \(3\), or \(4\) girls stand side by side!

3. Positional Preferences (Fulfill Preferences First)

When to use: Specific objects restrict themselves to specific subsets of positions. Just as in Section 01, fulfill the preferences first so the remaining counts stay independent!

Example 6: A classroom has a front row and a back row, each containing \(10\) distinct chairs. Eight students enter: \(3\) particular students insist on sitting in the front row, \(2\) particular students are shy and prefer the back row, and the remaining \(3\) students have no preference. In how many ways can they sit?

Solution: Fulfill the strict preferences before seating the unrestricted students:

  1. Seat the \(3\) front-row students on the \(10\) front-row chairs: \({}^{10} P_3\) ways.
  2. Seat the \(2\) back-row students on the \(10\) back-row chairs: \({}^{10} P_2\) ways (completely independent of Step 1).
  3. Seat the remaining \(3\) unrestricted students on the \(20 - 5 = 15\) remaining chairs: \({}^{15} P_3\) ways.

By the Multiplication Principle:

\[\text{Total ways} = {}^{10} P_3 \cdot {}^{10} P_2 \cdot {}^{15} P_3\]

(Notice: if you had tried to seat the \(3\) unrestricted students first, the number of chairs left in the front and back rows would depend on where they sat, destroying independence!)


Lexicographical (Dictionary) Rank of a Word

If all distinct permutations of the letters of a word are listed in alphabetical order (exactly as in a dictionary), the position of a given word in that list is called its dictionary rank.

Computing Dictionary Rank for Distinct Letters

To find the rank of an \(n\)-letter word with all letters distinct, count how many words come strictly before it by locking letters one by one from left to right:

  1. Write the \(n\) letters in alphabetical order.
  2. At position \(i\) (\(i = 1, 2, \dots, n\)), count how many unused letters appear strictly before the \(i\)-th letter of the target word in the alphabet. Placing any one of those smaller letters at position \(i\) allows the remaining \(n - i\) letters to permute freely in \((n - i)!\) ways—every such word precedes our target word!
  3. Sum these counts over all positions \(i = 1, \dots, n\), and add \(1\) for the target word itself.

Example 7: Find the dictionary rank of the word MOTHER.

Solution: Sort the \(6\) distinct letters alphabetically: E, H, M, O, R, T.

  • Position 1 (M): Unused letters before M are E, H (\(2\) letters) \(\implies 2 \times 5! = 240\) preceding words. Lock M.
  • Position 2 (O): Unused letters are E, H, O, R, T. Letters before O are E, H (\(2\) letters) \(\implies 2 \times 4! = 48\). Lock O.
  • Position 3 (T): Unused letters are E, H, R, T. Letters before T are E, H, R (\(3\) letters) \(\implies 3 \times 3! = 18\). Lock T.
  • Position 4 (H): Unused letters are E, H, R. Letter before H is E (\(1\) letter) \(\implies 1 \times 2! = 2\). Lock H.
  • Position 5 (E): Unused letters are E, R. Letters before E: \(0 \implies 0 \times 1! = 0\). Lock E.
  • Position 6 (R): \(0 \times 0! = 0\).

Adding \(1\) for MOTHER itself:

\[\text{Rank}(\text{MOTHER}) = 240 + 48 + 18 + 2 + 0 + 0 + 1 = 309\]

Example 8: Find the dictionary rank of the word RANDOM.

Solution: Sort the \(6\) distinct letters alphabetically: A, D, M, N, O, R.

  • Position 1 (R): Letters before R are A, D, M, N, O (\(5\)) \(\implies 5 \times 5! = 600\). Lock R.
  • Position 2 (A): Remaining A, D, M, N, O. Letters before A: \(0 \implies 0 \times 4! = 0\). Lock A.
  • Position 3 (N): Remaining D, M, N, O. Letters before N are D, M (\(2\)) \(\implies 2 \times 3! = 12\). Lock N.
  • Position 4 (D): Remaining D, M, O. Letters before D: \(0 \implies 0 \times 2! = 0\). Lock D.
  • Position 5 (O): Remaining M, O. Letter before O is M (\(1\)) \(\implies 1 \times 1! = 1\). Lock O.
  • Position 6 (M): \(0 \times 0! = 0\).

Adding \(1\) for RANDOM itself:

\[\text{Rank}(\text{RANDOM}) = 600 + 0 + 12 + 0 + 1 + 0 + 1 = 614\]

(In Section 06, once we derive permutations of multisets, we will extend this exact algorithm to words containing repeated letters.)


Summary Table

Concept / Strategy Formula When to Apply
\(r\)-Permutation (Falling Factorial) \({}^n P_r = n^{\underline{r}} = \frac{n!}{(n - r)!}\) Arranging \(r\) of \(n\) distinct objects in \(r\) distinct slots without repetition (\(r \le n\))
Rising Factorial \(n^{\overline{r}} = n(n + 1) \cdots (n + r - 1) = {}^{n + r - 1} P_r\) Ordered placements where each placed object creates \(1\) new slot
Tie-and-Arrange (\(k\) together) \((n - k + 1)! \cdot k!\) \(k\) specific objects must form one contiguous block
Gap Method (No two together) \(m! \cdot {}^{m + 1} P_k\) \(k\) restricted objects separated by \(m\) unrestricted objects (\(k \le m + 1\))
Positional Preferences Satisfy strictest preferences first Keeps subsequent counts independent
Dictionary Rank (distinct letters) \(1 + \sum_{i=1}^n (\text{smaller unused at } i) \cdot (n - i)!\) Prefix-by-prefix counting in alphabetical order