Stirling2nd: Stirling2nd function computes the Stirling numbers of the...

View source: R/ClusterStability.R

Stirling2ndR Documentation

Stirling2nd function computes the Stirling numbers of the second kind.

Description

This function returns the estimated Stirling numbers of the second kind i.e., the number of ways of partitioning a set of n objects into k nonempty groups.

Usage

Stirling2nd(n,k)

Arguments

n

number of objects.

k

number of groups (i.e. classes).

Value

The Stirling number of the 2nd kind for n elements and k groups or NaN (if the Stirling number for those n and k is greater than 1e300).

Examples

  Stirling2nd(n=3,k=2)
  # Expected value=3
  Stirling2nd(n=300,k=20)
  # Expected value=NaN  

ClusterStability documentation built on March 31, 2023, 9:40 p.m.