Learn R Programming

PerMallows (version 1.8)

count.derangements: Count derangements

Description

Given the number of items in the permutations, how many permutations are there with no fixed point?

Usage

count.derangements(perm.length)

Arguments

perm.length
number of items in the permutations

Value

  • The number of derangements of the specified length

Examples

Run this code
count.derangements(4)

Run the code above in your browser using DataLab