auxiliary {randtoolbox} | R Documentation |
Auxiliary functions for 'randtoolbox' package.
Description
Stirling numbers of the second kind and permutation of positive integers.
Usage
stirling(n)
permut(n)
Arguments
n |
a positive integer. |
Details
stirling
computes stirling numbers of second kind i.e.
with .
e.g.
, returns 1
, returns a vector with 0,1
, returns a vector with 0,1,1
, returns a vector with 0,1,3,1
, returns a vector with 0,1,7,6,1...
Go to wikipedia for more details.
permut
compute permutation of and store it
in a matrix.
e.g.
, returns a matrix with
1 , returns a matrix with
1 2 2 1 returns a matrix with
3 1 2 3 2 1 1 3 2 2 3 1 1 2 3 2 1 3
Value
a vector with stirling numbers.
Author(s)
Christophe Dutang.
See Also
choose
for combination numbers.
Examples
# should be 1
stirling(0)
# should be 0,1,7,6,1
stirling(4)
[Package randtoolbox version 2.0.4 Index]