|
EXAMPLE
|
Let S={1,2,3,...,n} be a set of n elements and let SU be the set of all subsets of S including the empty set. The number of elements of SU is |SU| = 2^n. Now form all possible set partitions from SU including the empty set. This gives a set W and its number of elements is |W| = sum((stirling2(2^n,k)), k=0..2^n) = Bell(2^n).
For S={1,2} we have SU = { {}, {1}, {2}, {1,2} } and W =
{
{{{}}, {1}, {2}, {1, 2}},
{{2}, {1, 2}, {{}, {1}}},
{{1}, {1, 2}, {{}, {2}}},
{{1}, {2}, {{}, {1, 2}}},
{{{}}, {1, 2}, {{1}, {2}}},
{{{1}, {2}}, {{}, {1, 2}}},
{{1, 2}, {{}, {1}, {2}}},
{{{}}, {2}, {{1}, {1, 2}}},
{{{1}, {1, 2}}, {{}, {2}}},
{{2}, {{}, {1}, {1, 2}}},
{{{}}, {1}, {{2}, {1, 2}}},
{{{2}, {1, 2}}, {{}, {1}}},
{{1}, {{}, {2}, {1, 2}}},
{{{}}, {{1}, {2}, {1, 2}}},
{{{}, {1}, {2}, {1, 2}}}
}
and |W| = 15.
|
|
MAPLE
|
ZahlDerMengenAusMengeDerZerlegungenEinerMenge:=proc() local n, nend, arg, k, w; nend:=5; for n from 0 to nend do arg:=2^n; w[n]:=sum((stirling2(arg, k)), k=0..arg); od; print(w[0], w[1], w[2], w[3], w[4], w[5], w[6], w[7], w[8], w[9], w[10]); end proc;
|