can sympy do this

39 views
Skip to first unread message

Martin Chan

unread,
Sep 12, 2014, 3:21:03 AM9/12/14
to sy...@googlegroups.com
since out of memory, 

i hope sympy can do this, but i can not find this function

http://www.mapleprimes.com/questions/202338-Error-in-Combinatpermute-Maple

how to do the same as in above link,  my post

Aaron Meurer

unread,
Sep 12, 2014, 12:08:20 PM9/12/14
to sy...@googlegroups.com
SymPy can make use of Python's generators, which compute things like
this one at a time, rather than all at once (which would indeed fill
all your memory). For instance in the Python standard library

from itertools import permutations

computes permutations as a generator.

Of course, any computation you do will still need to not store every
permutation in memory, which will necessarily use more memory than you
have due to the large number of combinations.

Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+un...@googlegroups.com.
> To post to this group, send email to sy...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/308ec4b0-89c5-47ad-949b-659b737ba71a%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Christophe Bal

unread,
Sep 12, 2014, 1:20:29 PM9/12/14
to sympy-list
Hello.

There is n! permutations of a set of n elements and n! ~ sqrt(2 pi n) (n/e)^n due to the Stirling's approximation. So you can expect to have all the permuations with not small value of n.

Christophe BAL

Reply all
Reply to author
Forward
0 new messages