Back to Math Tools

Bell Numbers Calculator

Calculate Bell numbers with BigInt support for large values. Bell numbers count the number of ways to partition a set into non-empty subsets.

Enter Position (n)

Enter a position n (0 to 200) to calculate B(n)

How It Works

Bell numbers count the number of ways to partition a set of n elements into non-empty subsets, where the order of subsets does not matter. The nth Bell number B(n) equals the sum of all Stirling numbers of the second kind: B(n) = S(n,1) + S(n,2) + ... + S(n,n).

The Sequence: 1, 1, 2, 5, 15, 52, 203, 877, 4140, 21147, 115975, 678570, 4213597...

Example for B(3) = 5: The set {a, b, c} can be partitioned in 5 ways: {a, b, c} (1 subset), {a}{b, c}, {b}{a, c}, {c}{a, b} (2 subsets), and {a}{b}{c} (3 subsets).

Bell Triangle: Bell numbers can be computed using the Bell triangle (similar to Pascal's triangle). Start with B(0)=1, then each row begins with the last element of the previous row, and subsequent elements are the sum of the element to the left and the element above it.

Relationship to Stirling Numbers: B(n) = sum of S(n,k) for k from 1 to n, where S(n,k) counts partitions into exactly k subsets. This calculator shows this breakdown for small values of n.

Applications: Bell numbers appear in combinatorics, set theory, probability (random partitions), and computer science (equivalence relations, clustering algorithms).

Frequently Asked Questions

What do Bell numbers count?

Bell numbers count the total number of ways to partition a set of n elements into non-empty subsets, where the order of subsets does not matter. For example, B(3) = 5 because a 3-element set {a, b, c} can be partitioned in 5 ways: one 3-element subset, three ways with one 2-element and one 1-element subset, and one way with three 1-element subsets.

How are Bell numbers related to Stirling numbers?

Bell numbers are the sum of Stirling numbers of the second kind. Specifically, B(n) = S(n,1) + S(n,2) + ... + S(n,n), where S(n,k) counts partitions into exactly k subsets. This relationship shows that Bell numbers count all possible partitions regardless of the number of subsets.

What is the Bell triangle?

The Bell triangle (also called Aitken's array or Peirce triangle) is a triangular array used to compute Bell numbers. Start with 1, then each row begins with the last element of the previous row. Each subsequent element is the sum of the element to its left and the element above that. The first element of each row gives the Bell numbers.

Where are Bell numbers used in practice?

Bell numbers appear in combinatorics for counting equivalence relations, in probability theory for random partitions, in computer science for analyzing clustering algorithms and hash functions, and in set theory. They also count the number of rhyme schemes for poems with n lines.