derangement

0th

Percentile

Tests for a permutation being a derangement

A derangement is a permutation which leaves no element fixed.

Usage
is.derangement(x)
Arguments
x

Object to be tested

Value

A vector of Booleans corresponding to whether the permutations are derangements or not.

Note

The identity permutation is problematic because it potentially has zero size.

The identity element is not a derangement, although the (zero-size) identity cycle and permutation both return TRUE under the natural R idiom all(P != seq_len(size(P))).

See Also

id

Aliases
  • derangement
  • is.derangement
Examples
# NOT RUN {
is.derangement(rperm(16,4))
# }
Documentation reproduced from package permutations, version 1.0-5, License: GPL-2

Community examples

Looks like there are no examples yet.