Home
Permutations and Combinations Generalized Permutations and Combinations Generating Permutations and Combinations
|
Computer Science 235 Project
Permutations & Combinations Patrick McAtee, Tom Rice, and Jesse Whidden |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Example |
Calculate the following r-permutations:
a) P(6, 3) Solutions: a) P(6, 3) = 6 * 5 * 4 = 120 NOTE: Answers b and c point out that a (n -1)-permutation of n is the same as the n-permutation of n. |
P(n, r) = n(n - 1)(n - 2)
(n - r + 1)
Theorem
Combinations are unordered sets of elements. A combination is taken from a set of distinct elements and can have any number of those elements in it. For this reason, combinations are also referred to as r-combinations.
The only combination of the set {1, 2, 3} is {1, 2 ,3}. That is, {1, 2 ,3}, {1 ,3, 2}, {2, 1, 3}, {2, 3, 1}, {3, 1, 2}, and {3 ,2, 1} are all the same as far as combinations are concerned. They are the same because they all contain the same elements when order is not considered (which combinations do not). This holds true even if the combination is only of two things when picking from a set of three. Some two-combinations of the set {1, 2, 3} are {2, 1}, {1, 2}, {3, 2}, and {1, 3}. The two-combinations {2, 1} and {1, 2} are the same since the elements within the sets are identical.
Because order is not considered for combinations, calculating them is not as simple. Combinations ask the question "How many sets of size r can be made when picking from a set of size n?" Combinations also have a notation; C(n, r), and a theorem that helps to compute C(n, r).
Solution: Assume that a combination is called for, not a permutation since the problem asks to select a set rather than arrange a set. This involves choosing four things from 12, so there are C(12, 5) = 495 ways to do so.
Example
C(n, r) = n!/[r!(n r)]!
Theorem
Notice that the difference between a permutation and a combination is that a permutation recognizes different orderings as distinct. It is possible to have permutations and combinations with repetition. It will depend on the situation as to whether repetition among elements will be allowed. This topic is covered elsewhere in the tutorial.
If a permutation is taken from the same a set of objects, and no object in the permutation is in the same place that it was in the original arrangment, it is known as a derangement of the original order.
For instance, the permutation 36972 is a derangement of 23697. However, 73926 is NOT a derangment of 23967 because the 3 occupies the same spot.
Example
Let Dn denote the number of derangements of n objects. For instance, D3 = 2, since the derangements of 123 are 231 and 312. We will evaluate Dn, for all positive integers n, using the principle of inclusion-exclusion.
Dn = n![1 - (1/1!) + (1/2!) - (1/3!) + ... + (-1)n(1/n!)]
Theorem