Conversation

Anyone know of a simple algorithm to systematically enumerate all the partitions of a set? (Ie all ways in which a set can be exhaustively partitioned into subsets)? Here for eg is me merely trying to count all the partitions of a set of 7. Probably some mistakes here.
Image
11
8
Replying to
So if you had a bit for each of the N elements then subset-1 would be all numbers from 1 to the N bit "all 1s" number, and for each subset-1 with n bits in the number the combinatorial subset-2s would be 1 to the (N-n) "all 1s" number, and so on. Like think of them as mask bits.
1
Replying to
Sure, and I could EASILY be wrong, but it's like… number defines subset including n set members (ie 1 bits) and then all the zero bits are the remainder subset so we just start from the beginning with the remainder set, N - n instead of N, recursively until N - n = 1.