Class BellSequence
java.lang.Object
org.episteme.core.mathematics.analysis.series.BellSequence
- All Implemented Interfaces:
Function<Natural,Integer>, Function<Natural, Integer>, Relation<Natural, Integer>, IntegerSequence, Sequence<Integer>
Bell numbers sequence (OEIS A000110).
The Bell number B(n) counts the number of partitions of a set with n elements. For example:
- B(0) = 1: {{}} (empty set has 1 partition)
- B(1) = 1: {{1}}
- B(2) = 2: {{1,2}}, {{1},{2}}
- B(3) = 5: {{1,2,3}}, {{1,2},{3}}, {{1,3},{2}}, {{2,3},{1}}, {{1},{2},{3}}
Recurrence Relations
Bell numbers satisfy several recurrence relations:
B(n+1) = Σ(k=0 to n) C(n,k) * B(k)where C(n,k) is the binomial coefficient "n choose k".
They can also be computed using the Bell triangle (Aitken's array):
1 1 2 2 3 5 5 7 10 15 15 20 27 37 52Each row starts with the last element of the previous row, and each element is the sum of the element to its left and the element above-left.
Properties
- Exponential generating function: exp(e^x - 1)
- Asymptotic behavior: B(n) ~ (n/log n)^n / e^(n/log n - n)
- Growth rate: faster than exponential
OEIS Reference
A000110References
- Bell, E. T. (1934). "Exponential polynomials"
- Comtet, L. (1974). "Advanced Combinatorics"
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncomputeBellExplicit(int n) Computes Bell number using the explicit summation formula.Returns the n-th term of the sequence (0-indexed).getFirstN(int count) Returns the first n Bell numbers.Returns the OEIS (Online Encyclopedia of Integer Sequences) identifier.toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Function
andThen, compose, contains, evaluate, getBackend, isContinuous, isDifferentiable, setBackendMethods inherited from interface IntegerSequence
getLong, getLongMethods inherited from interface Relation
getCodomain
-
Constructor Details
-
BellSequence
public BellSequence()
-
-
Method Details
-
get
-
computeBellExplicit
Computes Bell number using the explicit summation formula. Less efficient but useful for verification.- Parameters:
n- the index- Returns:
- B(n)
-
getOEISId
-
getFirstN
Returns the first n Bell numbers.- Parameters:
count- number of terms- Returns:
- array of Bell numbers [B(0), B(1), ..., B(n-1)]
-
toString
-