Counting, Permutations & Combinations

Set Partition & Stirling Number Calculator

Count partitions of n labeled objects into exactly k non-empty unlabeled groups.

Counting & Combinatorics

Partition labeled objects into non-empty unlabeled groups

Stirling number S(n,k)
  1. 1EnterProvide the known values
  2. 2CalculateResults update automatically
  3. 3VerifyReview the details and units
Try an example

Exact set partitions

Enter valid values to see the result.

Your entries are calculated in this browser and are not submitted to 365CALCS.COM.

Feedback

Understand the subject

What is a set partition?

A set partition separates labelled objects into nonempty groups, while ignoring the order of the groups themselves.

Use it for grouping distinct objects into unlabeled teams or clusters of an exact count.

The relationship

The counting rule

See the structure

The newest object joins a group or starts one

Worked example

Check the rule with a small case

Four labelled objects into 2 nonempty unlabeled groups: S(4,2) = 7.

Interpret with care

Choose the right counting model

If the groups have names, use a multinomial model instead.

Use the Permutation & Combination Generator when a small case needs to be inspected rather than only counted.

Quick guide

How to use this calculator

  1. Enter the number of labeled objects n.
  2. Enter the exact number of non-empty unlabeled groups k.
  3. Read the Stirling number of the second kind S(n,k).

Calculation method

Build the Stirling recurrence

The newest object either joins one of k existing groups or forms a new group: S(n,k)=kS(n−1,k)+S(n−1,k−1).

Worked example

Partition four objects into two groups

There are seven partitions into exactly two non-empty unlabeled groups.

S(4,2) = 2S(3,2)+S(3,1) = 7

Supported inputs

Precision and limits

Discrete domain

Inputs are whole counts. Negative, fractional, grouped, and scientific-notation inputs are rejected.

Exact integers

Results use arbitrary-precision integers and are never rounded. Inputs and output size are bounded to keep the page responsive.

Maximum n

n is limited to 500 for the exact recurrence table.