Comment #23 on issue 3501 by [email protected]: Missing partitions in sympy.utilities.iterables.multiset_partitions
http://code.google.com/p/sympy/issues/detail?id=3501

    git checkout -b kbins smichr/kbins


That's what I would do...looks good.


You *might* consider adding something like the following to the
comments/doc:


I added the excellent comments (with very minor modification) to the notes
of `_set_partitions`.


The helper function _partition provides similar, but lighter-weight
functionality to that provided by the classmethod
combinatorics.partitions.**Partition.from_rgs(). Perhaps worth a
cross-reference?

I added it as a See Also


I also wrote a tester to sanity check.  I am attaching it to this
post. Perhaps something like test_partitions() is worth incorporating
into the tests?  The one-off tests at the bottom of this most
likely duplicate tests you already have.

-----------------
multiset_partitions

--> docstring

The analytical discussion under "Counting"

These formulas only apply in the set case.  Multisets are more
complicated... perhaps:


done


If the input is a set (no repeated elements), the number of partitions
returned is given by the bell number ...

----------------

I looked briefly at the new multiset_combinations and
multiset_permutations and didn't see anything to argue with.  (Except
of course the TODO comment in multiset_combinations).


The TODO is done, too, and now my brain is mush.


Misc - combinatorics.RGS_enum() seems to be computing the same thing
as bell()?  Worth a cleanup or cross reference?


Other than the calculation for numbers < 1, it appears to be the same and
much faster, so I imported and used bell there:

RGS_enum(16)
10480142147
bell(16)
10480142147
from timeit import timeit
timeit('RGS_enum(23)','from sympy.combinatorics import *', number=100)
0.46608495712280273
timeit('RGS_enum(23)','from sympy import bell as RGS_enum', number=100)

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to