combinat::bell(n) computes the n-th Bell number.
Calls:
combinat::bell(n)
combinat::bell(expression)
Parameters:
n: |
nonnegative integer |
expression: |
An expression of type Type::Arithmetical which must be a nonnegative integer if it is a number. |
Return Value:
A positive integer value if n was a nonnegative integer. Otherwise combinat::bell returns the unevaluated function call.
Details:
The n-th Bell number is defined by the exponential generating function:
Often another definition is used. The n-th Bell number is the number of different ways of partitioning the set into disjoint nonempty subsets, and is defined to be 1.
Bell numbers are computed using the formula:
for
The third Bell number is :
combinat::bell(3)
This means that you can partition the set into disjoint subsets in different ways. These are , , , , and . Or, that you can write as different products. These are .
If one uses a wrong argument, an error message is returned.
combinat::bell(3.4)
Error: Nonnegative integer expected [combinat::bell]
It can be useful to return the unevaluated function call.
a := combinat::bell(x);
x := 4;
a ;
delete(a);