[Date Index] [Thread Index] [Author Index]
REQ:Algorythm for combinations
On September 2, 1997, Marc Borms asked for a program to generate all combinations of a set "v". The question is susceptible of many interpretations, If it means that one is looking for a program to generate all subsets of "v" containing a prescribed number "k" of elements, the answer to the question is the function KSubsets[v,k] in the package Combinatorica of the folder DiscreteMath within the StandardPackages among the AddOns. Observe, however, that KSubsets does not check whether "v" is made of distinct elements.