Skip to content
ENExplore Calculators

Stirling Number Calculator

Work out stirling number instantly with clear inputs, formula shown and shareable results.

About Stirling Number Calculator

The Stirling number of the second kind S(n, k) counts ways to partition n labelled items into k non-empty unlabelled blocks. The recurrence S(n,k) = k·S(n−1,k) + S(n−1,k−1) asks whether the new item joins an existing block or starts its own.

Formulas

Stirling recurrence

S(n, k) = k·S(n−1, k) + S(n−1, k−1), S(0,0) = 1

Surjections

onto functions = k! · S(n, k)

Worked example

With the default values below, Stirling Number Calculator returns Stirling number S(n, k) of 90. Change any input above and every figure here is recalculated in your browser.

Inputs used

Number of items naccepts 0–25
6
Number of non-empty blocks kaccepts 0–25
3

Results

Stirling number S(n, k)
90
Bell number (all partitions)
203
Onto functions from n items to k labels
540
Blocks requested
3

Step by step

  1. 1Values used
  2. 2Stirling recurrence
  3. 3Surjections
  4. 4Stirling number S(n, k)= 90
  5. 5Bell number (all partitions)= 203
  6. 6Onto functions from n items to k labels= 540
  7. 7Blocks requested= 3

Assumptions and limits

  • The result is derived only from the 2 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
  • Figures are rounded for display to whole numbers, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

What is S(6, 3)?

90, and multiplying by 3! gives 540 onto functions from 6 items to 3 labels.

How does it relate to Bell numbers?

Summing S(n, k) over all k gives the Bell number, the total number of partitions of the set.

Stirling Number Calculator | Calcrivo