# Some combinatorial lists related to partitions.

I want to generate the lists on the right hand side of the arrow.

P (partitions)        --> D (no name?)
[1, 1, 1, 1, 1, 1, 1] --> [0, 0, 0, 0, 0, 0, 1]
[2, 2, 2, 1]          --> [0, 0, 1, 1]
[2, 2, 1, 1, 1]       --> [0, 1, 0, 0, 1]
[2, 1, 1, 1, 1, 1]    --> [1, 0, 0, 0, 0, 1]
[3, 3, 1]             --> [0, 2, 1]
[3, 2, 2]             --> [1, 0, 2]
[3, 2, 1, 1]          --> [1, 1, 0, 1]
[3, 1, 1, 1, 1]       --> [2, 0, 0, 0, 1]
[4, 3]                --> [1, 3]
[4, 2, 1]             --> [2, 1, 1]
[4, 1, 1, 1]          --> [3, 0, 0, 1]
[5, 2]                --> [3, 2]
[5, 1, 1]             --> [4, 0, 1]
[6, 1]                --> [5, 1]
[7]                   --> [7]


Assume 1-based lists. They have the properties:

   P[1]   = sum(D)
sum(P) = sum(i*t for (i,t) in enumerate(D))


My questions: is there a method in Sage which returns these lists? If not, what is the best method to generate them given the other methods of Sage? What is the name of these lists if they have one?

edit retag close merge delete

Sort by ยป oldest newest most voted

I am not familiar with partitions, so i do not know if this has a name. However, if i understand correctly, P is a kind of discrete integral of D, so D is a kind of discrete derivative, that is defined by first differences. So, you can do something like:

sage: for p in Partitions(7):
....:    print p, [p[i]-p[i+1] for i in range(len(p)-1)] + [p[-1]]
....:
[7] [7]
[6, 1] [5, 1]
[5, 2] [3, 2]
[5, 1, 1] [4, 0, 1]
[4, 3] [1, 3]
[4, 2, 1] [2, 1, 1]
[4, 1, 1, 1] [3, 0, 0, 1]
[3, 3, 1] [0, 2, 1]
[3, 2, 2] [1, 0, 2]
[3, 2, 1, 1] [1, 1, 0, 1]
[3, 1, 1, 1, 1] [2, 0, 0, 0, 1]
[2, 2, 2, 1] [0, 0, 1, 1]
[2, 2, 1, 1, 1] [0, 1, 0, 0, 1]
[2, 1, 1, 1, 1, 1] [1, 0, 0, 0, 0, 1]
[1, 1, 1, 1, 1, 1, 1] [0, 0, 0, 0, 0, 0, 1]

more

Yes, this is also the way I generated the list. So I probably did not miss a standard procedure (sage.combinat is big as a blue whale). I think that also bijectivity is ensured. And "discrete derivative of a partition" sounds interesting :)

( 2015-07-30 23:35:34 +0200 )edit

If you want to know the name, perhaps could you ask on the sage-combinat mailing list.

( 2015-07-31 10:09:41 +0200 )edit