combinat::bell
--
Bell numbers
combinat::bell
(n) computes the n-th Bell number.
combinat::bell(n)
combinat::bell(expression)
n | - | nonnegative integer |
expression | - | An expression of type Type::Arithmetical which must be
a nonnegative integer if it is a number. |
A positive integer value if n
was a nonnegative
integer. Otherwise combinat::bell
returns the unevaluated
function call.
exp(exp(x) - 1) = sum(bell(n)/n! * x^n, n = 0..infinity)Often another definition is used. The n-th Bell number is the number of different ways of partitioning the set 1, 2, ..., n into disjoint nonempty subsets, and bell(0) is defined to be 1.
bell(0) = 1 bell(n+1) = sum(binomial(n,i)*bell(i), i=0..n), n > 0
>> combinat::bell(3)
5
This means that you can partition the set 1,2,3 into disjoint subsets in 5 different ways. These are {{1,2,3}}, {{1},{2,3}}, {{2},{1,3}}, {{3},{1,2}}, and {{1},{2},{3}}. Or, that you can write 105 = 3*5*7 as 5 different products. These are 105 = 3*5*7 = 15*7 = 21*5 = 3*35 = 105*1.
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)
combinat::bell(x)
>> x :=4
4
>> a ; delete a:
15
MuPAD Combinat, an open source algebraic combinatorics package