# Permutation Each of the six rows is a different permutation of three distinct balls

Under this assumption, one may omit the first row and write the permutation in one-line notation as

While permutations in general do not commute, disjoint cycles do; for example,

A convenient feature of cycle notation is that cycle notation of the inverse of a permutation is given by reversing the order of the elements in the permutation's cycles. For example,

The concept of a permutation as an ordered arrangement admits several generalizations that are not permutations, but have been called permutations in the literature.

Two circular permutations are equivalent if one can be rotated into the other (that is, cycled without changing the relative positions of the elements). The following four circular permutations on four letters are considered to be the same.

The circular arrangements are to be read counter-clockwise, so the following two are not equivalent since no rotation can bring one to the other.

Composition of permutations corresponding to a multiplication of permutation matrices.

The Cayley table on the right shows these matrices for permutations of 3 elements.

There are a number of properties that are directly related to the total ordering of S.

For example, the permutation 3452167 has ascents (at positions) 1, 2, 5, and 6.

In computing it may be required to generate permutations of a given sequence of values. The methods best adapted to do this depend on whether one wants some randomly chosen permutations, or all permutations, and in the latter case if a specific ordering is required. Another question is whether possible equality among entries in the given sequence is to be taken into account; if so, one should only generate distinct multiset permutations of the sequence.

The following algorithm generates the next permutation lexicographically after a given permutation. It changes the given permutation in-place.

For example, given the sequence [1, 2, 3, 4] (which is in increasing order), and given that the index is zero-based, the steps are as follows:

The algorithm is recursive. The following table exhibits a step in the procedure. In the previous step, all alternate permutations of length 5 have been generated. Three copies of each of these have a "6" added to the right end, and then a different transposition involving this last entry and a previous entry in an even position is applied (including the identity; that is, no transposition).