Re: obtaining an ordered subset of k elements
- To: mathgroup at smc.vnet.net
- Subject: [mg73525] Re: obtaining an ordered subset of k elements
- From: "Ray Koopman" <koopman at sfu.ca>
- Date: Wed, 21 Feb 2007 01:43:57 -0500 (EST)
- References: <cFfCh.12521$aF5.12165@tornado.fastwebnet.it>
On Feb 20, 3:23 am, "digrpat" <digr... at aol.com> wrote: > an example with 3 elements chosen from a set of 6 > > << DiscreteMath`Combinatorica` > > Sort[Flatten[Map[LexicographicPermutations, KSubsets[{1,2,3,4,5,6}, > 3]], 1]] Use the built-in Subsets instead of the Add-on KSubsets: Sort@Flatten[Permutations/@Subsets[Range@6,{3}],1]