A derangement is a permutation which leaves no element fixed.
is.derangement(x)
A vector of Booleans corresponding to whether the permutations are derangements or not.
Object to be tested
Robin K. S. Hankin
id
is.derangement(rperm(16,4))
Run the code above in your browser using DataLab