ironfern @ docs ~/math/grade-9/combinatorics/permutations $

Fundamental Rules of Combinatorics. Permutations

In how many ways can the students in your class line up one after another in the cafeteria queue? In how many ways can you choose a class president and vice president? In how many ways can gold, silver, and bronze medals be distributed at the FIFA World Cup?

To answer these questions, we need to count how many different combinations, formed according to a certain rule, can be made from elements of a given finite set. The branch of mathematics that deals with such counting problems is called combinatorics.

At the core of solving most combinatorial problems are two rules: the sum rule and the product rule.

The Sum Rule

📐Definition — The Sum Rule

If sets AA and BB are such that n(A)=mn(A) = m, n(B)=kn(B) = k, and AB=A \cap B = \varnothing, then the choice of ”aa or bb”, where aAa \in A, bBb \in B, can be made in m+km + k ways.

This rule can be illustrated using the well-known property: if sets AA and BB are finite and AB=A \cap B = \varnothing, then n(AB)=n(A)+n(B)n(A \cup B) = n(A) + n(B).

The sum rule generalizes naturally. If sets A1,A2,,AmA_1, A_2, \ldots, A_m are pairwise disjoint with n(A1)=k1n(A_1) = k_1, n(A2)=k2n(A_2) = k_2, …, n(Am)=kmn(A_m) = k_m, then the choice of ”a1a_1, or a2a_2, or …, or ama_m” can be made in k1+k2++kmk_1 + k_2 + \ldots + k_m ways.

Example — Tourist Routes

Statement. A tourist is interested in 5 routes through the Dnieper region and 7 routes through the Carpathians. In how many ways can they plan their vacation if they have time for only one route?

Solution. Since there are 5+7=125 + 7 = 12 different routes in total, one of them can be chosen in 12 ways.

Answer: 12 ways.

The Product Rule

📐Definition — The Product Rule

If element aa can be chosen in mm ways, and after each such choice element bb can be chosen in kk ways, then the choice of ”aa and bb” in the specified order, i.e., the choice of the ordered pair (a;b)(a; b), can be made in mkmk ways.

The product rule also generalizes naturally. If element a1a_1 can be chosen in k1k_1 ways, element a2a_2 in k2k_2 ways, and so on, element ama_m in kmk_m ways (with the independence principle), then the choice of the ordered tuple (a1;a2;;am)(a_1; a_2; \ldots; a_m) can be made in k1k2kmk_1 \cdot k_2 \cdot \ldots \cdot k_m ways.

Example 1 — Number of Divisors

Statement. How many natural divisors does the number 2453762^4 \cdot 5^3 \cdot 7^6 have?

Solution. Any divisor of this number has the form 2k15k27k32^{k_1} \cdot 5^{k_2} \cdot 7^{k_3}, where k1,k2,k3k_1, k_2, k_3 are integers satisfying 0k140 \leqslant k_1 \leqslant 4, 0k230 \leqslant k_2 \leqslant 3, 0k360 \leqslant k_3 \leqslant 6.

The number k1k_1 can be chosen in 5 ways, k2k_2 in 4 ways, k3k_3 in 7 ways. By the generalized product rule, the total number of divisors is 547=1405 \cdot 4 \cdot 7 = 140.

Answer: 140 divisors.

Ordered Sets

📐Definition — Ordered Set

A set MM consisting of nn elements (nNn \in \mathbb{N}) is called ordered if a one-to-one correspondence has been established between it and the set of the first nn natural numbers.

Permutations

📐Definition — Permutation

A permutation of a finite set MM is any ordered set formed from all elements of MM.

For example, there are 6 permutations of the set M={a,b,c}M = \{a, b, c\}:

(a;b;c)(a; b; c), (a;c;b)(a; c; b), (b;a;c)(b; a; c), (b;c;a)(b; c; a), (c;a;b)(c; a; b), (c;b;a)(c; b; a).

Permutations of a given finite set differ only in the order of their elements.

The number of permutations of an nn-element set MM is denoted by PnP_n, using the first letter of the French word permutation.

Theorem — Number of Permutations

For any natural number nn, the following formula holds:

Pn=n!P_n = n!

where n!=123nn! = 1 \cdot 2 \cdot 3 \cdot \ldots \cdot n (read: ”nn factorial”). By convention, 0!=10! = 1 and 1!=11! = 1.

Proof. Let the set MM consist of nn elements. Writing any permutation of MM is essentially assigning each element a unique number from 1 to nn. Choose an element aa from MM. There are nn ways to assign it a number. Next, choose element bb — there are n1n - 1 remaining choices. Continuing this reasoning, the last unchosen element has exactly one available number. By the generalized product rule:

Pn=n(n1)(n2)21=n!P_n = n \cdot (n-1) \cdot (n-2) \cdot \ldots \cdot 2 \cdot 1 = n!
Example 2 — Eight Rooks on a Chessboard

Statement. In how many ways can 8 rooks be placed on a chessboard so that no two attack each other?

Solution. For no two rooks to attack each other, there must be exactly one rook on each row and each column. Let a1a_1 be the column number where the rook on the first row stands, a2a_2 be the column for the second row, …, a8a_8 for the eighth row.

Then (a1;a2;;a8)(a_1; a_2; \ldots; a_8) is a permutation of the set {1,2,,8}\{1, 2, \ldots, 8\}. Each such permutation corresponds to a valid placement of rooks.

Therefore, the number of ways is P8=8!=40320P_8 = 8! = 40\,320.

Answer: 8!=403208! = 40\,320.

Exercise — Permutation Problems
  1. In how many ways can 7 different books be arranged on a shelf?

  2. In how many ways can 5 people sit in a car if any of them can be the driver?

  3. A school has 20 classes and 20 class teachers. In how many ways can class supervision be distributed among the teachers?

  4. How many five-digit numbers can be formed using the digits 1, 2, 3, 4, 5 with no digit repeated?