Re: permutations

• To: mathgroup at smc.vnet.net
• Subject: [mg62473] Re: permutations
• From: "Dana" <Dana.OnTheBeach at comcastl.com>
• Date: Fri, 25 Nov 2005 02:25:28 -0500 (EST)
• Sender: owner-wri-mathgroup at wolfram.com

```> I would need to do permutations of lists of Length 20, perhaps 25.

Here are some other ideas.

lst = Range[25];

The size is too big to do anything meaningful:

n = 25!

15,511,210,043,330,985,984,000,000

Perhaps you just want to work with a random sample from that "large" list:

Table[RandomPermutation[lst], {3}];

If you would like to see the Permutation that is half-way in that "large"
list, perhaps more efficiently would be:

NthPermutation[n/2, lst]

{13,14,1,2,3,4,5,6,7,8,9,10,11,12,15,16,
17,18,19,20,21,22,23,24,25}

The 2nd from the end of that "large" list:

NthPermutation[n - 2, lst]

{25,24,23,22,21,20,19,18,17,16,15,14,13,12,
11,10,9,8,7,6,5,4,3,1,2}

HTH.  :>)
--
Dana DeLouis
Mathematica Windows, 5.2

"Francisco Gutierrez" <fgutiers2002 at yahoo.com> wrote in message
news:dm1jov\$n4c\$1 at smc.vnet.net...
>
> Dear Group:
>  If I do for example:
>  Permutations[{x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12}],
>  my computer runs out of memory.
>  This is not such a poor computer.  Actually, I would need to do
permutations of lists of Length 20, perhaps 25.  I am aware these
calculations are big (Length[x]!), but I wonder if there is some way around
the problem. Compilating Permutations? But then how? Can somebody help me?
>  Francisco Gutiérrez

```

• Prev by Date: Re: How to print on paper big matrixes ?
• Next by Date: Re: How does NIntegrate suppress messages?
• Previous by thread: Re: permutations
• Next by thread: Re: permutations