Stars and Bars Calculator

Enter the number of identical items and boxes to count the ways to share them out.

A whole number from 0 to 1000.

A whole number from 1 to 1000.

Each box

Whether a box is allowed to stay empty.

Try

Result

You entered3 items, 5 boxes3\ \text{items},\ 5\ \text{boxes}

(3−15−1)=0\displaystyle \binom{3 - 1}{5 - 1} = 0

There are fewer items than boxes, so some box must be empty.

Show the work
  1. Each box gets at least one

    Giving every one of the 55 boxes an item needs at least 55 items, and there are only 33. So no arrangement works.

    3<53 < 5
  2. Result

    So there are 00 ways to share 33 identical items among 55 boxes with at least one in each.

Worked examples