CS202 – Subunit 6.2.6 The Saylor Foundation`s “Combinations

advertisement
CS202 – Subunit 6.2.6
The Saylor Foundation’s “Combinations"
Combinations are written as
n, where n and k are integers and k <= n.
k
For convenience, we will write this as (n k). This is referred to as ' n select k' and is the
number of k element subsets of a set of n elements. In algebra, it is a binomial
coefficient defined as
n! / k! (n - k)! Recall that a permutation is a sequence of elements. A combination is a
list, or equivalently a subset of elements. Thus, in a combination, order does not matter;
in a permutation, order does matter. If you change the order in a permutation, you get a
different permutation. If you change the order in a combination, you do not change the
combination, for example, (a, b, c) = (b, a, c), as combinations of 3 elements, a, b, c.
Moving over to the world of algebra, we can obtain many valid formulas
involving binomial coefficients. For example: (we relax out notation for combinations,
and write them as (n , k) )
For positive integers (this restriction is not necessary, but it is our assumption for
this course).
•(n k) = (n - 1 k) + (n - 1 k - 1) - basic recursion
•(n 0) = 1 - take this as an axiom
•(n n + m) = 0 - take this as an axiom
•(n m) = (n , n - m)
•(n m) (m p) = (n p) (n - p m - p)
Some simple values for combinations include:
•(n n) = 1 - note that 0! = 1
n
•If a set S has n elements, then S has 2 subsets.
•(n 1) = n
•(0 0) = 1
Organizing the results of (n, k) for n, k = 1, ..., 5, in a table, gives:
0
1
2
3
4
5
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
Saylor URL: www.saylor.org/cs202 6.2.6
The Saylor Foundation
Saylor.org
Page 1 of 1
Download