Suppose we have a door with a keypad lock; the lock has five buttons (labelled 1, 2, 3, 4, and 5) and a code for the lock is six digits long.
(a) What is the total number of possible combinations for the door? (b) What does the Pigeonhole Principle tell us about the possible combinations? (c) How many combinations are there that avoid having the same digit twice in a row? (d) Suppose we select a combination for the door at random. What is the probability that it consists only of odd numbers?
If order is not important, for example 135 is the same as 351, then
you want the number of ways of choosing 3 things from 6 things. This is
called "6 choose 3" and it is written
If order is important then these are called permutations. You have 6
choices for the first digit, 5 choices for the second digit and 4
choices for the third digit so you have