Low-level multichoose¶
-
class
sage.combinat.multichoose_nk.
MultichooseNK
(n, k)¶ Bases:
sage.combinat.combinat.CombinatorialClass
-
cardinality
()¶ Returns the number of multichoices of k things from a list of n things.
EXAMPLES:
sage: MultichooseNK(3,2).cardinality() doctest:...: DeprecationWarning: MultichooseNK should be replaced by itertools.combinations_with_replacement See http://trac.sagemath.org/16473 for details. 6
-
random_element
()¶ Returns a random multichoice of k things from range(n).
EXAMPLES:
sage: MultichooseNK(5,2).random_element() doctest:...: DeprecationWarning: MultichooseNK should be replaced by itertools.combinations_with_replacement See http://trac.sagemath.org/16473 for details. [0, 2] sage: MultichooseNK(5,2).random_element() [0, 1]
-