On Mon, 23 Apr 2007 at 04:36PM -0700, Stefan O'Rear wrote:
> > I'm finding the number of set partitions that correspond to a certain
> > integer partition. If p = p_1, p_2,...,p_k is an integer partition of n,
> > then there are
> > 
> >                                    n!
> >              ----------------------------------------------
> >              p_1! * p_2! * ... * p_k! * 1^c_1 * ... * k^c_k
> 
> That formula isn't even correct.  Consider p = replicate n 1, that is
> n partitions each of size 1.  There is only one way to do this - put
> each element in its own partition.  However, your formula gives:

Correct, the formula is incorrect. :)  The "i^c_i" terms need to be
c_i!.

(I got it right in my code, though.)

Dan

-- 
Ceci n'est pas une .signature.

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to