Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1998
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1998

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

Search the Archive

Re: Permutations.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg14829] Re: Permutations.
  • From: "vdmcc" <w.meeussen.vdmcc at vandemoortele.be>
  • Date: Wed, 18 Nov 1998 01:29:33 -0500
  • Organization: EUnet Belgium, Leuven, Belgium
  • References: <72jefh$3fn@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Alan,
I don't see the problem :
first you should use the KSubsets[list,k], and then map the Permutations
into that :

Flatten[  Permutations/@KSubsets[ yourlist, k ]  ,  1]

or am I missing the point?

wouter

w.meeussen.vdmcc at vandemoortele.be

***************************************************

Alan W.Hopper wrote in message <72jefh$3fn at smc.vnet.net>...
>Greetings,
>
>
>For the combinations of n objects taken k at a time, (where order counts
>and there is no duplication), the function KSubsets is the one to use.
>e.g.
>      In[1]:= <<DiscreteMath`Combinatorica`
>
>      In[2]:= Table[KSubsets[{a,b,c,d}, k], {k, 4}]
>
>     Out[3]= {{{a}, {b}, {c}, {d}},
>              {{a,b}, {a,c}, {b,c}, {b,d}, {c,d}},
>              {{a,b,c}, {a,b,d}, {a,c,d}, {b,c,d}},
>              {{a,b,c,d}}}
>
>But likewise in wanting to find all the permutation subsets (with no
>duplication and order not counting), of a numerical or symbolic list,
>there does not seem to be a function anywhere (including the packages),
>to achieve this goal.
>
>(By n!/(n-k)!, there will be be; 4, 12, 24, 24  permutations  taken k =
>1, 2, 3, 4  at a time, for a 4 element list).
>
>The built-in function Permutations and also LexicographicPermutations
>(from Combinatorica) do not take a second argument, as KSubsets does,
>and so only the (n, k=n) permutations (24 in the example ) can be
>found.
>
>I would appreciate some assistance to find a way to generate all of the
>permutation subsets, in List, Table or Column form.
>
>
>Alan W.Hopper
>awhopper at hermes.net.au
>



  • Prev by Date: A problem about Integration:
  • Next by Date: Re: Levy Distribution
  • Previous by thread: Re: Permutations.
  • Next by thread: splines and interpolation