Maths & numbers

Stars and bars distribution calculator

Count nonnegative allocations of identical items to distinct boxes.

Your numbers

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

If each box must receive at least one item, assign those items first and use the remaining items in the nonnegative allocation.

THE FORMULAC(items + boxes − 1, boxes − 1)

A worked example

Seven items into four labeled boxes yield C(10,3) = 120 allocations.

Good to know

Empty boxes are allowed.

Read the result

Count nonnegative allocations of identical items to distinct boxes.

The primary result is labeled “Distributions”. Keep the input definitions in view when comparing this result with another method.

Try a related calculation

Empty boxes are allowed.

For a related exercise, try the greatest common divisor.

A few questions, answered

How can I check the default inputs by hand?

Seven items into four labeled boxes yield C(10,3) = 120 allocations.

Which rule does this calculator apply?

C(items + boxes − 1, boxes − 1)

Find your calculator

Start typing to explore the library.