# How many buckets options are there for putting N balls in the buckets?

N balls and how many buckets you want. You want to put the N balls into buckets. How many buckets options are there?

For example, (N=)4 balls can be put in the following ways:

• {1,1,1,1} - 1 ball into each bucket
• {1,1,2} - 2 buckets with 1 ball and 1 bucket with 2 balls
• {2,2} - 2 buckets with 2 balls
• {1,3} - 1 bucket with 1 ball and 1 bucket with 3 balls.
• {4} - 1 bucket with all 4 balls.

So the answer here is 5 different bucket options.

• Take a look here: en.wikipedia.org/wiki/Partition_(number_theory) – Vitaly B Nov 29 '13 at 22:00
• It's like asking for the number of all possible combinations of numbers that add up to N (order doesn't matter). – AlikElzin-kilaka Nov 29 '13 at 22:06
• @VitalyB, your comment sounds like an answer - p(n), right? – AlikElzin-kilaka Nov 29 '13 at 22:20
• Yes, in the general case the answer is given by $p(n)$ – Vitaly B Nov 29 '13 at 22:34
• You also need to have at least one ball in each bucket, right? – John Nov 29 '13 at 22:57