multichoose
Thomas Wieder Germany, April 2010 thomas.wieder@t-online.de
Introduction
This worksheet demonstrates the use of the combinatorial subroutine multichoose.
A multiset X is a set where multiple instances of an element x are allowed. In Maple, a multiset is represented as a list.
E.g. X=[1,2,3,3,a] is a multiset since element x=3 occurs two times. Further below X is called ObjectList.
A combination taken from a multiset is itself a multiset. In Maple, all combinations of cardinality k are drawn from X via the command choose.
Often one speaks of a k-combination to emphasize the number of elements. E.g.
A multicombination drawn from a multiset is a set of combinations for a list of cardinalities.
The list of cardinalities [k1,k2,...] is called SelectionList below.
One could speak of a [k1,k2,...]-combination. E.g. for ObjectList = [1,2,3,3,a] and SelectionList = [3,2] one has from multichoose
Implementation
multichoose solves its task by recursive calls.
Two internal parameters restrict the allowed lengthes of ObjectList and SelectionList, namely
If the internal parameter iverbose is set equal to one, then some debugging information will be displayed.
Initialization
Calling Sequence
multichoose(ObjectList,SelectionList);
Parameters
ObjectList
-
list of objects where multiple instances of the same object are allowed, thus ObjectList is a multiset
SelectionList
list of non-negativ integers
Description
Examples
References
none
See Also
combinat[choose]
Legal Notice: ? Maplesoft, a division of Waterloo Maple Inc. 2010. Maplesoft and Maple are trademarks of Waterloo Maple Inc. Neither Maplesoft nor the authors are responsible for any errors contained within and are not liable for any damages resulting from the use of this material. This application is intended for non-commercial, non-profit use only. Contact the authors for permission if you wish to use this application in for-profit activities.