GenerateRandomSearch

Set Partition Generator

How many ways can five people be split into groups, when the groups have no names and only who-is-with-whom matters? The answer is the Bell number, 52 for five, and it grows faster than exponentially. This enumerates every partition and then counts them independently using the Bell triangle — two routes to the same number, which is what makes the count trustworthy rather than merely computed.

What this generator does

Lists every partition of the set by deciding, for each element in turn, whether it joins an existing group or starts a new one. It then counts them by group count to give the Stirling numbers, and compares the total against the Bell number from the triangle.

How to use this tool

  1. Choose the set size, from two to eight elements.
  2. Predict how many partitions there will be.
  3. Compare against the Bell number shown.
  4. Read the breakdown by group count — those are the Stirling numbers.

Understanding the controls

Set size
Between 2 and 8 elements. Eight already has 4,140 partitions, which is why the ceiling is where it is.
Seed
Chooses which single partition is shown as the example.
Show the answer
Lists every partition in full rather than just the count and one example.

Common use cases

  • Counting problems where groups are unlabelled
  • Showing the difference between partitioning and assigning to named groups
  • Introducing Bell and Stirling numbers through enumeration
  • Test data for grouping algorithms
  • Seeing how fast the count grows with one more element

How this generator works

Enumeration builds partitions element by element, which produces each exactly once. The count is then checked against the Bell number computed from the Bell triangle — an entirely separate calculation. The check also requires every partition to cover the set exactly once, contain no empty group, and appear only once regardless of the order its groups are written in.

Randomness and fairness

Only which partition is shown as the example is random; the enumeration and the counts are fixed for a given size. Seeded runs pick the same example and are therefore explicitly not cryptographically secure; unseeded ones use the browser's cryptographically secure generator to choose it.

For how randomness is produced across the whole site, see how Generate Random works.

Limitations and good to know

  • Eight elements is the ceiling, because the count grows faster than exponentially and nine would be over twenty thousand.
  • Groups are unlabelled, so this counts partitions rather than assignments to named groups.
  • Elements are lettered a to h rather than named.
  • Partitions are listed in enumeration order, not sorted by size.
  • Nothing is stored between visits; seed the example you want back.

Privacy and your data

Partitions are enumerated in your browser. Nothing about the set or your seed is transmitted or kept.