Computes a random ("shuffled") permutation
of the sequence of the integers from 1 to n. Gives some simple
functions of the sequence obtained: positions of 1 and n,
verification of the minimum (1) and the maximum (n) in the sequence,
and its sum [which must be n(n + 1) / 2].
The procedure constitutes the extraction of a sample
without replacement.
The computation follows Algorithm 3.4.2P from Knuth
[1981, p 139]. |
• Knuth, Donald E., 1981,
"The art of computer programming", vol. 2 (Seminumerical algorithms),
2.nd ed., Addison-Wesley, Chichester (UK), xiv+688 pp (ISBN 978-0-470-01427-1).
• 1903-12-28: von Neumann, John (1957-02-08). |