Changeset 8006:90d75762f161 for sage/combinat/set_partition.py
- Timestamp:
- 01/04/08 15:35:20 (5 years ago)
- Branch:
- default
- File:
-
- 1 edited
-
sage/combinat/set_partition.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
sage/combinat/set_partition.py
r7279 r8006 1 1 r""" 2 2 Set Partitions 3 4 A set partition s of a set set is a partition of set, into subsets called parts and represented as a set of sets. By extension, a set partition of a nonnegative integer n is the set partition of the integers from 1 to n. The number of set partitions of n is called the n-th Bell number. 5 6 There is a natural integer partition associated with a set partition, that is the non-decreasing sequence of sizes of all its parts. 7 8 There is a classical lattice associated with all set partitions of n. The infimum of two set partitions is the set partition obtained by intersecting all the parts of both set partitions. The supremum is obtained by transitive closure of the relation i related to j iff they are in the same part in at least one of the set partitions. 9 10 EXAMPLES: 11 There are 5 set partitions of the set {1,2,3}. 12 13 sage: SetPartitions(3).count() 14 5 15 16 Here is the list of them: 17 18 sage: SetPartitions(3).list() #random due to the sets 19 [{{1, 2, 3}}, {{2, 3}, {1}}, {{1, 3}, {2}}, {{1, 2}, {3}}, {{2}, {3}, {1}}] 20 21 There are 6 set partitions of {1,2,3,4} whose underlying partition 22 is [2, 1, 1]: 23 24 sage: SetPartitions(4, [2,1,1]).list() #random due to the sets 25 [{{3, 4}, {2}, {1}}, 26 {{2, 4}, {3}, {1}}, 27 {{4}, {2, 3}, {1}}, 28 {{1, 4}, {2}, {3}}, 29 {{1, 3}, {4}, {2}}, 30 {{1, 2}, {4}, {3}}] 31 32 AUTHORS: 33 --Mike Hansen 34 --MuPAD-Combinat developers (for algorithms and design inspiration). 35 3 36 """ 4 37 #*****************************************************************************
Note: See TracChangeset
for help on using the changeset viewer.
