Definition: A rearrangement of elements, where none are lost, added, or changed. The Fisher-Yates shuffle randomly permutes elements.

Also known as shuffle.

Generalization (I am a kind of ...)

Specialization (... is a kind of me.)
ideal random shuffle, Fisher-Yates shuffle, Johnson-Trotter, sort, derangement.

Aggregate parent (I am a part of or used in ...)
American flag sort.

See also pseudo-random number generator.

Note: A sort is a permutation where the items are arranged in some order. A derangement is a permutation where no item is in its original position.

There are n! permutations of n (distinguishable) elements.

Author: PEB


(Pascal, Fortran, Mathematica, and C); (Fortran). Mike Bostock's animations of different permutation algorithms with code (JavaScript). Perfect shuffle (Haskell).
Go to the Dictionary of Algorithms and Data Structures home page.

If you have suggestions, corrections, or comments, please get in touch with Paul Black.

Entry modified 9 March 2015.
HTML page formatted Fri Feb 23 10:06:08 2018.

Cite this as:
Paul E. Black, "permutation", in Dictionary of Algorithms and Data Structures [online], Vreda Pieterse and Paul E. Black, eds. 9 March 2015. (accessed TODAY) Available from: