Recurrence partition basic

112 Views Asked by At

I have some questions regarding (recurrence relation) for partitions, actually I do not know what is the exact term called (it was stated as partitions only in my guide book and upon doing some searches, it seems that the formula is somewhat different).

But I was taught this formula called Recurrence Relation for Partitions and my lecturer only gave 1 such example for such scenario: formula

Anyway, while trying out some exercises such as finding P(10,2), I am able to write out/ break down using the formula as follows:

P(10,2) = P(8,1) + P(8,2) = 5
where P(8,2) gives (1+7), (2+6), (3+5), (4+4)

However, I run into some doubts when dealing with bigger numbers such as finding P(18,2). As I was taught writing out the possible steps as shown above, is 9 the maximum number allowed? And are there any simpler ways in getting around with such problems other than writing down all the steps?

1

There are 1 best solutions below

3
On

For your particular case: $p(18,2)=p(16,1)+p(16,2)=1+p(14,1)+p(14,2)$

You see it all reduce to $\frac{18-2}{2}+p(2,2)=9$

r=2 Case

For any even number, $p(2r,2)=r$ because it can be expressed as:

$$p(2,2)+\sum_{i=1}^{r-1}p(2i,1) =1+(r-1)$$

For an odd number: $p(2r+1,2)=[p(2r-1,1)+p(2r-3,1)+...+p(3,1)+p(1,1)]+p(1,2)=r$

Which means for the case $n=2$, $p(r,2)=\lfloor\frac{r}{2}\rfloor$

r=3 Case Now consider $p(r,3)$, let $r=3k+m$, where $0\leq m\leq 2$,

$p(3k+m)=p(3(k-1)+m,1)+p(3(k-1)+m,2)+p(3(k-1)+m,3)=1+\lfloor\frac{3(k-1)+m}{2}\rfloor + p(3(k-1)+m,3)$

Reating k times: $$p(3k+m)=k+\sum_{i=1}^{k}(\lfloor\frac{3(i-1)+m}{2}\rfloor) +p(m,3)$$

So, for the general case for any $r$, it will involve a lot of these floor function and im not sure if there is a nice way to simplify it.