REQ:Algorythm for combinations
- To: mathgroup at smc.vnet.net
- Subject: [mg8602] REQ:Algorythm for combinations
- From: Andre Deprit <Deprit at his.com>
- Date: Tue, 9 Sep 1997 03:07:17 -0400
- Organization: Heller Information Services, Inc.
- Sender: owner-wri-mathgroup at wolfram.com
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.