lsubfactorial: Logarithm of the subfactorial numbers

Description Usage Arguments Details Value Examples

View source: R/lsubfactorial.R

Description

lsubfactorial returns the logarithms of the subfactorial numbers.

Usage

1

Arguments

x

A vector of non-negative integers

Details

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.

Value

If the input is a vector of non-negative integers, the output will be a vector of the logarithms of the corresponding subfactorial numbers.

Examples

1
2
3
# In the limit n! / !n goes to e
# so limit of differences of logs is 1
lfactorial(1000) - lsubfactorial(1000)

stat.extend documentation built on Nov. 23, 2021, 5:06 p.m.