August 3rd, 2007, 6:38 pm
Balls indistinguishable:Place b black balls in a line. There are remain (a) red balls to be placed in (b+1) locations, of which the two at the end have >=0 red balls, and the other (b-1) in the middle have >=1 red balls.= partition (a+2) into at most (b+1) integers, each >=1.= partition (a+2 + b+1) into exactly (b+1) parts, each >=1So task is to Partition N into exactly R parts, P(N,R)The first part is >1 or =1, so we have:P(N+1,R) = P(N,R) + P(N,R-1) for N>R>1with initial P(x,x) = P(x,1) = 1 That's very basic now, so if that doesn't look familiar, look up gumdrop problem...
Last edited by
ArthurDent on August 4th, 2007, 10:00 pm, edited 1 time in total.