TESTS:
sage: a = MultichooseNK(3,2)
sage: a == loads(dumps(a))
True
An iterator for all multichoices of k things from range(n).
EXAMPLES:
sage: [c for c in MultichooseNK(3,2)]
[[0, 0], [0, 1], [0, 2], [1, 1], [1, 2], [2, 2]]
Returns the number of multichoices of k things from a list of n things.
EXAMPLES:
sage: MultichooseNK(3,2).cardinality()
6
Returns a random multichoice of k things from range(n).
EXAMPLES:
sage: MultichooseNK(5,2).random_element()
[0, 2]
sage: MultichooseNK(5,2).random_element()
[0, 1]