permutation
A permutation is a rearrangement of the elements of a set into a new order. Equivalently, it is a bijection from the set to itself that reassigns each element to a unique position. For a finite set with n elements, the total number of distinct permutations is n!, the product of all positive integers up to n.
When the elements are distinct, permutations count all possible orderings of those elements. For example, the
In algebra, the set of all permutations of n elements forms the symmetric group S_n under composition
If repetitions are allowed, or the set contains repeated elements (a multiset), the number of distinct permutations
Applications of permutations appear in counting problems, sorting and searching algorithms, cryptography, and the study of