Given we have an unlimited supply of types of fruit:
- A: apples
- O: oranges
- P: peaches
How many ways are there to select pieces of fruit, if the order of selection does not matter, only the type of fruit / not the individual piece matters?
We could consider a box which can store 4 pieces of fruit, the box can have 3 compartments, each can store one of 3 types of fruit. Compartments are divided by 2 movable dividers that can be shifted depending on how many types of each fruit we want to store. For example:
- 2 apples, 1 orange, 1 peach:
- 4 oranges:
- 1 apple, 3 peaches:
- 4 apples:
So if we have to choose objects from a set of objects, with repetition allowed, we need a box with places for the chosen object and places for the dividers dividing the box into compartments.
Given any random box: , we have places.
The number of ways we can choose our objects is the number of ways we can distribute the dividers in the box. Out of the places, we hace to choose for the dividers. The number of ways of doing this is:
This formula should be remembered!
Going back to the example, we find that: