Integer Partition

Problem 1 

Suppose p(n,k) means the number of partition of an integer into parts the largest of which is k (this problem are always equivalent to the number of the partition of an integer into no more than k parts )

p(n,k)=p(n-k,k)+p(n,k-1) (some of the parts appear more than once)

p(n,k)=p(n-k,k-1)+p(n,k-1) (None of the part appears more than once) 

Boundary: n==0||k==1  p(n,k)=1


Problem 2 

Suppose p(n,k) means the number of partition of an integer into exactly k parts

p(n,k)=p(n-k,1)+p(n-k,2)+...+p(n-k,k)=p(n-1,k-1)+p(n-k,k)

Boundary: k==1  p(n,k)=1


Problem 3

Generating function,so many classical problems

For example,we are supposed to get the number of partition of an integer into parts which have at most one of each distinct even part,we may get the generating function like this : G(x)=(1+x+x^2+x^3...)*(1+x^2)*(1+x^3+x^6+...)*(1+x^4)*...

We may simplify the function G(x)=(1+x^2)/(1-x) *(1+x^4)/(1-x^2) *...

then G(x)=(1-x^4)/(1-x)/(1-x^2) * (1-x^8)/(1-x^4)/(1-x^2) * ...

then G(x)=(1-x^4)/(1-x) *(1-x^8)/(1-x^2) * (1-x^12)/(1-x^3) * ...

then G(x)=(1+x+x^2+x^3) * (1+x^2+x^4+x^6) * (1+x^3+x^6+x^9)*..

It seems like we change the problem to get the number of partition of an integer into parts which have at most three times (though we may not simplify the origin problem,we just proof these two problem are equivalent)


Problem 4 

There are many other types of the problems,I can't write all of it down.Like getting the number of partition of an integer into parts which are the sum of some continuous number,we may list the equation and make some simplification,or the problem to get the number of partition of an integer into parts which only contains even numbers,we may solve it using the dynamic algorithm


Problem 5 

In number theory,the partition function p(n) represents the number of possible partitions of a number n,which is to say the number of distinct ways of representing n as a sum of natural numbers 

Formula:p(n)=p(n-1)+p(n-2)-p(n-5)-p(n-7)+...

p(n)=Sigma((-1)^k * p(n-k*(3*k-1)/2)) (k can be positive or negative)



Exercises:


poj1283.cpp water

poj1664.cpp water 

poj3181.java water 

nbut1046.cpp output the ways of partition

hit1402.cpp classical

hdu4651.cpp formula

smart1101.cpp a funny dynamic problem 




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值