Combinatorics
Last updated
Last updated
Combination when the order does not matter
Permutation when the order does matter
If we wish to know the number of combinations of a PIN number, we have 10 chances per digit (due to numbers from 0 to 9).
So, we got possibilities (). Thus, generalizing we get the formula:
Generalizing, we get:
In the particular case, that R is equal to N, we get up to N! possibilities.
Here, we can discover the number of possible results in lotteries. We take R from N unique items. However, we don't mind the order of the taken items.
I want to distribute 5 balls into 3 urns. As before, take 5 balls and 2 dividers. Visually:
|ooo|oo
In this order, we'd have nothing in the first urn, three in the second urn and two balls in the third urn. The question then is how many ways can we arrange these 5 balls and two dividers?
If what to know all the order of N pool balls be in, for each ball taken we have possibilities.
We have to divide the possible elements by the possible repetitions and the possible combination of the taken items. This is expressed as:
This problem comes by many names - stars and stripes, balls and urns - it's basically a question of how to distribute objects (call them "balls") into categories (call them "urns"). We can think of it as follows.
Take balls and dividers. If a ball falls between two dividers, it goes into the corresponding urn. If there's nothing between two dividers, then there's nothing in the corresponding urn. Let's look at this with a concrete example.