MathGroup Archive 2007

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

Search the Archive

Re: obtaining an ordered subset of k elements

  • To: mathgroup at smc.vnet.net
  • Subject: [mg73498] Re: obtaining an ordered subset of k elements
  • From: "digrpat" <digrpat at AOL.com>
  • Date: Tue, 20 Feb 2007 06:18:59 -0500 (EST)
  • References: <cFfCh.12521$aF5.12165@tornado.fastwebnet.it>

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]]



"GiulioC" <giulio.castorinaNOSPAM at fastwebnet.it> wrote in message 
news:cFfCh.12521$aF5.12165 at tornado.fastwebnet.it...
> Hello All,
>
> I am in trouble as I cannot find no way to obtain an ordered subsets of k 
> elements with mathematica 5.2. I didnt find any solutions...Mathematica 
> seems hadle just Permutations (n=r) or unordered subsets of k elements 
> (KSubsets). What I want is what is explained here 
> (http://mathworld.wolfram.com/Permutation.html)  at the 8th text row 
> ...but no Mathematica function is showed :(
> Please note I dont want just the "number" of total rearrangement but I 
> want a named list of all subsets of k elements
>
> Any solutions? I hope yes...
>
> Cheers
>
> Giulio
>
>
>
> 



 Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
    ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------        
                http://www.usenet.com


  • Prev by Date: Re: Left-aligned PlotLabel
  • Next by Date: FullGraphics question
  • Previous by thread: Re: Find index of maximal element in multi-dimensional array
  • Next by thread: Re: Re: obtaining an ordered subset of k elements