Abstract
We prove correct an algorithm that, givenn>0, stores in arrayb[0..n−1] a random cyclic permutation of the integers in 0..n−1, with each cyclic permutation having equal probability of being stored inb. The algorithm was developed by Sattolo; our contribution is to present a more convincing proof using standard program-proving methods.
Similar content being viewed by others
References
S. Sattolo,An algorithm to generate a random cyclic permutation, IPL 22 (May 1986), 315–317.
C. Berge,Principles of Combinatorics, Academic Press, New York and London, 1971.
Author information
Authors and Affiliations
Additional information
Dedicated to Peter Naur on the occasion of his 60th birthday
This research was supported by the NSF under grant DCR-8320274.
Visiting Cornell from the Computer Science Department, Jiangxi Normal University, Nanchang, People's Republic of China.