A derangement is a permutation of the elements of a set, such that no element appears in its original position.
The code use non rejection method for better predictable runtime.
Bruno Luong (2021). Random derangement (https://www.mathworks.com/matlabcentral/fileexchange/87994-random-derangement), MATLAB Central File Exchange. Retrieved .
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!