A permutation is an arrangement of all the members of a set into a sequence or order. When the elements are all different (no repetitions), the counting is especially simple and forms the basis for much of elementary combinatorics.
Suppose we have a set with n distinct objects. To form a permutation we must decide which object occupies the first position, then which occupies the second, and so on.
n choices for the first position.n1 objects remain, giving n1 choices for the second position.n2 choices, etc.Multiplying these choices together (the multiplication principle) yields the total number of permutations:
Formula: n! = n (n1) (n2) 2 1
3! = 6 permutations: 5! = 120 ways. Sometimes we are interested in ordering only a subset of the elements. The number of ways to choose and order k items from n distinct items is called a partial permutation or arrangement:
Formula: P(n,k) = n (n1) (nk+1) = \frac{n!}{(nk)!}
Example: From 8 different players, we want to pick a starting lineup of 5 in order of batting. The number of possible lineups is P(8,5) = 8! / 3! = 6720.
If some objects are identical, the simple n! count overestimates the true number of distinguishable permutations. In that case we divide by the factorial of the multiplicities:
Formula for repeated elements: \frac{n!}{n_1! \, n_2! \, \, n_r!} where n_i is the count of the ith identical type.
When all elements are different, each n_i = 1 and the denominator equals 1, reducing the formula to n!.
In many programming languages, generating all permutations of a distinct list is straightforward. Below is a concise example in Python using itertools.permutations:
import itertoolsitems = ['A', 'B', 'C']for p in itertools.permutations(items): print(p) The output matches the six permutations listed earlier.
n objects forms the symmetric group S_n, a fundamental object in abstract algebra.7!)P(6,4) = 360)P(10,3) = 720)Permutations of distinct elements are a cornerstone of combinatorial reasoning. The simple factorial formula captures the intuition that each new position reduces the pool of available choices by one. Mastery of this concept opens the door to more advanced topics such as combinations, the inclusionexclusion principle, and the study of symmetric groups.
