multiSubsets(L,n) yields all multisets of cardinality $n$ with element from $L$. multiSubsets(m,n) yields all multisets of cardinality $n$ with elements in the list $\{0,\dots,m-1\}$.
i1 : L={a,b,c}
o1 = {a, b, c}
o1 : List
|
i2 : multiSubsets(L,2)
o2 = {{a, a}, {a, b}, {b, b}, {a, c}, {b, c}, {c, c}}
o2 : List
|
i3 : multiSubsets(3,2)
o3 = {{0, 0}, {0, 1}, {1, 1}, {0, 2}, {1, 2}, {2, 2}}
o3 : List
|
The object multiSubsets is a method function.