Code covered by the BSD License  

Highlights from
Set partition

5.0

5.0 | 2 ratings Rate this file 18 Downloads (last 30 days) File Size: 6.99 KB File ID: #24133

Set partition

by Bruno Luong

 

16 May 2009 (Updated 02 Jun 2009)

List all partitions a set n elements

| Watch this File

File Information
Description

A set of of n elements can be partitioned in non empty subsets.

This package provide function to list all possible partitions. The number of partition is Bell's number.

The number of subsets that composed the partitions can be optionally specified. The number of partition is Stirling's number of the second kind.

Acknowledgements
This submission has inspired the following:
PARTITIONS
MATLAB release MATLAB 7.8 (R2009a)
Other requirements Should work on most recent MATLAB releases
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (3)
17 May 2009 Darren Rowland

At last someone has implemented this functionality. Excellent!
I would only suggest that an example of usage and output could be helpful in the SetPartition file and that the first few lines of Bell and Stirling2nd could be rearranged to give meaningful H1 lines.

18 May 2009 Bruno Luong

Darren, thank you for the suggestion. I'll add an example of usage. Functions with more efficient engine will be soon upgraded.

18 May 2009 Matt Fig

Very nice: smartly coded, fast, well implemented.

Please login to add a comment or rating.
Updates
17 May 2009

Improve engine and example usage in the help as suggested Darren Rowland

19 May 2009

Correct a BUG for N=0. Minor speed improvement.

23 May 2009

Possibility to partition generic set elements (following Matt Fig's idea). New function to replace elements of a standard set partitioning list

02 Jun 2009

Partitions display function

Tag Activity for this File
Tag Applied By Date/Time
combination Bruno Luong 17 May 2009 19:22:18
bell Bruno Luong 17 May 2009 19:22:18
stirling Bruno Luong 17 May 2009 19:22:18
equivalence relation Bruno Luong 17 May 2009 19:22:18
permutation Bruno Luong 17 May 2009 19:22:18
bell AMVR 29 Aug 2011 15:02:35

Contact us at files@mathworks.com