derangement: Tests for a permutation being a derangement

Description Usage Arguments Value Note Author(s) See Also Examples

Description

A derangement is a permutation which leaves no element fixed.

Usage

1

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))).

Author(s)

Robin K. S. Hankin

See Also

id

Examples

1

Example output

Attaching package: 'permutations'

The following object is masked from 'package:stats':

    cycle

 [1] FALSE FALSE  TRUE FALSE FALSE FALSE FALSE  TRUE FALSE  TRUE FALSE FALSE
[13] FALSE  TRUE FALSE FALSE

permutations documentation built on Nov. 13, 2020, 1:14 a.m.