Stirling(n,r)

Partition of n distinct objects in r non-empty groups
103 Downloads
Updated 21 Jun 2016

View License

This function calculates the total no. of partitions of n distinct object in r groups such that each group as at least one element. This number is also called 'Stirling numbers of the second kind'.
Input:
n -no. of objects
r - no. of partitions
output: no. of permutations
Ex>> Stirling(10,3)=9330;

Cite As

Vikash Sehwag (2026). Stirling(n,r) (https://www.mathworks.com/matlabcentral/fileexchange/57785-stirling-n-r), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2016a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Descriptive Statistics and Visualization in Help Center and MATLAB Answers
Version Published Release Notes
1.0.0.0