Learn R Programming

salso (version 0.1.9)

bell: Compute the Bell Number

Description

These functions compute the Bell number (the number of partitions of a set) or its natural logarithm.

Usage

bell(nItems)

lbell(nItems)

Arguments

nItems

The size of the set {1, 2, ..., n}.

Value

A numeric vector of length one giving the Bell number or its natural logarithm.

Examples

Run this code
# NOT RUN {
bell(12)
lbell(300)
all.equal( bell(5), exp(lbell(5)) )

# }

Run the code above in your browser using DataLab