[seqfan] Re: ranking of partitions
wouter meeussen
wouter.meeussen at pandora.be
Sun Oct 3 14:40:43 CEST 2010
thanks Max,
wouldn't have found it without your hint:
Mma v4:
qbinomial[n_Integer,m_Integer]:=Product[(1-q^(n-j)) /(1-q^(j+1)),{j,0,m-1}]
//Together//Expand;
integerpartitions[n_,m_]:=Coefficient[qbinomial[n+1+m,m] ,q^n];
(* newer versions of Mma have the above functions pre-definded *)
rankpartition[p_?PartitionQ]:=PartitionsP[Tr[p]] -
Sum[integerpartitions[Tr[#],First[#]-1]& @ Drop[p,k] ,
{k,0,Length[p]-1}]
rankpartition[{7,4,3,2,2,2,1,1,1,1}]
1000
Wouter.
----- Original Message -----
From: "Max Alekseyev" <maxale at gmail.com>
To: "Sequence Fanatics Discussion list" <seqfan at list.seqfan.eu>
Sent: Saturday, October 02, 2010 7:01 PM
Subject: [seqfan] Re: ranking of partitions
>
> > can anyone point me to an explanation why there seems to be no algorithm
to
> > identify the ranking of a partition like
>
> Who said that?
>
> It is easy to design such an algorithm, using the values of the
> partition function q:
> http://mathworld.wolfram.com/PartitionFunctionq.html
> which in turn can be precomputed using dynamic programming.
>
More information about the SeqFan
mailing list