MathGroup Archive 1999

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

Search the Archive

Re: Permutations & Computer capacity

  • To: mathgroup at
  • Subject: [mg17005] Re: Permutations & Computer capacity
  • From: "vdmcc" <w.meeussen.vdmcc at>
  • Date: Sat, 10 Apr 1999 02:13:37 -0400
  • Organization: EUnet Belgium, Leuven, Belgium
  • References: <7ec4ji$>
  • Sender: owner-wri-mathgroup at

hi Francisco,

if you go beyond 8! elements, it might be wise to try and write a short Do
loop to evaluate the permutations one at a time, and only keep the result (a
running weighted average, a running sum or an extremum value, whatever you
are calculating).

You can avoid having to generate all n! permutations at once by using
NextPermutation from the DiscreteMath`Combinatoria`  add-on.

In this way, only your patience will be tested, not your memory (;-)).

hope this helps,


Francisco Gutierrez wrote in message <7ec4ji$alq at>...
>I developed a notebook to evaluate the Shapley value (votation power) of
>a list of parties in a committee.  A list to be evaluated looks like:
>{{partyA, 5}, {partyB, 8}...{partyn, X}}
>Everything works ok but...disgracefully producing the Shapley value implies
>working with permutations.  This means making n! evaluations (n the length
>of the list).
>And when I have a list of more than 8-9 parties, the program gets stuck.
>Now, 9! is not such a big number.
>I thought that perhaps my programming was not efficient enough, so I made
>the following try:
>After a couple of minutes, I got the answer "Exiting-out of memory"
>I have a Pentium II with 128 RAM, 4 free gigas in hard disk and a 300 and
>something processor (my platform is windows 95).
>Is there something wrong with my computer? Is there a way to overcome this
>Many thanks
>Francisco Gutierrez

  • Prev by Date: Re: SetDirectory Problems
  • Next by Date: Re: Evaluation of args in pure functions
  • Previous by thread: Re: Permutations & Computer capacity
  • Next by thread: Re: Permutations & Computer capacity