stirling2(m, n)

Stirling numbers of the 2nd kind: the number of ways to partition n elements into k groups
63 Downloads
Updated 29 May 2016

View License

Stirling numbers of the 2nd kind show the number of ways in which a set of m elements can be clustered to form n groups. This algorithm uses a recursive formula that is exact up to intmax('uint64'). Stirling numbers under this will be represented exactly and any number larger than this but less than realmax will be approximated using double precision (16-digits). Exact solutions are available for any n in S(26,n), and for select n in S(>26,n) for select n. Solutions are available for S(<220,n) for all n, and S(>=220,n) for select n.

Cite As

Michael Boedigheimer (2024). stirling2(m, n) (https://www.mathworks.com/matlabcentral/fileexchange/57412-stirling2-m-n), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2014b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Statistics and Machine Learning Toolbox in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0