MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: obtaining an ordered subset of k elements


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]



  • Prev by Date: Re: Showing that ArcSinh[2]/ArcCsch[2] is 3?
  • Next by Date: Creating a Listable Function
  • Previous by thread: Re: Re: obtaining an ordered subset of k elements
  • Next by thread: FullGraphics question