ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 01 Jan 2021 21:52:11 +0100Multipartitions of a multiset in Sagehttps://ask.sagemath.org/question/53756/multipartitions-of-a-multiset-in-sage/ Let L = [0,1,1,2,2,2,2,]. I want to generate all the multi-partitions of L in which each part can have repeated entries and the parts themselves can repeat in the partition.
For example, [[0],[1,2],[1,2],[2,2]] is one such partition of L.
Kindly help me with this.
Thank you.Wed, 07 Oct 2020 12:37:40 +0200https://ask.sagemath.org/question/53756/multipartitions-of-a-multiset-in-sage/Answer by rburing for <p>Let L = [0,1,1,2,2,2,2,]. I want to generate all the multi-partitions of L in which each part can have repeated entries and the parts themselves can repeat in the partition. </p>
<p>For example, [[0],[1,2],[1,2],[2,2]] is one such partition of L. </p>
<p>Kindly help me with this.
Thank you.</p>
https://ask.sagemath.org/question/53756/multipartitions-of-a-multiset-in-sage/?answer=53766#post-id-53766Generate partitions of `list(range(len(L)))` and apply $k \mapsto L[k]$ to each element in each part?Wed, 07 Oct 2020 20:36:14 +0200https://ask.sagemath.org/question/53756/multipartitions-of-a-multiset-in-sage/?answer=53766#post-id-53766Comment by GA3165 for <p>Generate partitions of <code>list(range(len(L)))</code> and apply $k \mapsto L[k]$ to each element in each part?</p>
https://ask.sagemath.org/question/53756/multipartitions-of-a-multiset-in-sage/?comment=53774#post-id-53774@rburing. Thank you. It works. Cute idea.Thu, 08 Oct 2020 05:23:09 +0200https://ask.sagemath.org/question/53756/multipartitions-of-a-multiset-in-sage/?comment=53774#post-id-53774Comment by slelievre for <p>Generate partitions of <code>list(range(len(L)))</code> and apply $k \mapsto L[k]$ to each element in each part?</p>
https://ask.sagemath.org/question/53756/multipartitions-of-a-multiset-in-sage/?comment=55065#post-id-55065@GA3165 -- I turned @rburing's comment into an answer.
You can accept it to mark the question as solved.Fri, 01 Jan 2021 21:52:11 +0100https://ask.sagemath.org/question/53756/multipartitions-of-a-multiset-in-sage/?comment=55065#post-id-55065