Hello everybody, Looking at the combinatorial functions page (http://www.sagemath.org/ doc/reference/sage/combinat/combinat.html), I see that there exists a union function, but no intersection function?
This would be useful to find the probability of joint sets. Also, I found after a few hours of searching everywhere that the union function would only work alright when the type of class used is of the 'set_object_enumerated_with_category' type. For example, doing: S1 = Permutations(2).union(Permutations(2)); S1.list() # will produce something like: -> [[1, 2], [2, 1], [1, 2], [2, 1]] To get a correct result (without repeated identical results), one needs to force the correct "enumerated with category" type using: S2 = Set(Permutations(2)).union(Set(Permutations(2))); S2.list() # will produce the correct result -> [[1, 2], [2, 1]] Maybe this could be documented somewhere... If it already is, I couldn't find it. Thanks, Maxim -- To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
