Description Usage Arguments Details Value Examples
View source: R/lsubfactorial.R
lsubfactorial
returns the logarithms of the subfactorial numbers.
1 |
x |
A vector of non-negative integers |
The subfactorial numbers count the number of derangements of a set of objects (permutations in which no element appears in its original position). This function computes the logarithms of the subfactorial numbers for a given input vector specifying the numbers of interest.
If the input is a vector of non-negative integers, the output will be a vector of the logarithms of the corresponding subfactorial numbers.
1 2 3 | # In the limit n! / !n goes to e
# so limit of differences of logs is 1
lfactorial(1000) - lsubfactorial(1000)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.