combiatorics
combiatorics
combiatorics
E N D
Presentation Transcript
INTRODUCTION TO COMBINATORICS 1 Combinatorics, also called combinatorial mathematics. The field of mathematics concerned with problems of selection, arrangement. 2 Operation within a finite or discrete system. 3
INDEPENDENT V.S. DEPENDENT EVENT Independent means the outcome of one event does not affect the outcome of the other event. Example : Pick out a ball from a basket (containing 10 balls) as the first event then put it back and pick out a ball again as the second time. The outcome of the first pick and the second pick are independent. But if you do not put the first ball back in the basket, then the two events are dependent.
MUTUALLY EXCLUSIVE EVENTS Two or more events are said to be mutually exclusive if the occurrence of any one of them means the others will not occur (That is, we cannot have 2 or more such events occurring at the same time). For example: if we throw a 6-sided die, the events "4" and "5" are mutually exclusive. We cannot get both 4 and 5 at the same time when we throw one die.
MUTUALLY EXCLUSIVE EVENTS If E1 and E2 are mutually exclusive events, then E1 and E2 will not happen together. So the probability of the 2 events will be zero: P(E1 and E2) = 0. S E1 E2
NOTMUTUALLY EXCLUSIVE EVENTS S E1 E2 E1 and E2 are not mutually exclusive events
TWO MAIN RULES
Sum Rule If two events are mutually exclusive, that is, they cannot be done at the same time , then we must apply the sum rule.
- Let us consider two tasks: ◦ m is the number of ways to do task 1 ◦ n is the number of ways to do task 2 ◦ Tasks are independent of each other, i.e., Performing task 1 does not accomplish task 2 and vice versa. - Sum rule: the number of ways that “either task 1 or task 2 can be done, but not both”, is m+n.
Generalizes to multiple tasks ... There is a natural generalization to any sequence of m tasks; namely the number of ways m mutually exclusive events can occur is n 1 + n 2 + ···n m−1 + n m We can give another formulation in terms of sets. Let A 1 , A 2 , . . . , Am be pairwise disjoint sets. Then |A 1 ∪A 2 ∪···∪A m |= |A1 |+ |A2 |+ ···+ |A m |
Example: If A is the set of ways to do task 1, and B the set of ways to do task 2, and if A and B are disjoint, then: The ways to do either task 1 or 2 are : AUB, and |AUB|=|A|+|B|
Example: A student can choose a computer project from one of three lists. The three lists contain 23, 15, and 19 possible projects respectively. How many possible projects are there to choose from? Solution: Assuming there are no projects common to any pair of lists, a student can choose a project from the first list in 23 ways, from the second list in 15 ways and from the third list in 19 ways. Hence, there are 23 + 15 + 19 = 57 ways in which a project can be chosen by a student or 57 possible projects to choose from.
Product Rule Product Rule: If two events are not mutually exclusive (that is, we do them separately), then we apply the product rule .
Let us consider two tasks: ◦ m is the number of ways to do task 1 ◦ n is the number of ways to do task 2 ◦ Tasks are independent of each other, i.e., Performing task 1does not accomplish task 2 and vice versa. Product rule : the number of ways that “both tasks 1 and 2 can be done” in mn.
Example: If A is the set of ways to do task 1, and B the set of ways to do task 2, and if A and B are disjoint, then: Sol : The ways to do both task 1 and 2 can be represented as AxB, and |AxB|=|A|·|B|
Example: How many different bit strings are there of length seven? Sol : There are two choices for each of the seven positions in the string: thus there are 2 =2x2x2x2x2x2x2 = 128 different 7-bit (binary digit) strings. 7
GENERAL TECHNIQUES
FACTORIAL The factorial function (symbol: !) means to multiply a series of descending natural numbers. Note that: n! = n x (n-1)! Examples : 4! = 4 x 3 x 2 x 1 =24 7! = 7 x 6 x 5 x 4 x 3 x 2 x 1 x = 5040 1! = 1 by definition
PERMUTATION A permutation of a set S of objects is an ordered arrangement of the elements of S where each element appears only once: e.g., 1 2 3, 2 1 3, 3 1 2 An ordered arrangement of r distinct elements of S is called an r-permutation. The number of r-permutations of a set S with n elements is P(n,r) = n(n−1)…(n−r+1) = n!/(n−r)!
Let’s start with permutations, or all possible ways of doing something. Let’s say we have 8 people: 1: Alice 2: Bob 3: Charlie 4: David 5: Eve 6: Frank 7: George 8: Horatio How many ways can we award a 1st, 2nd and 3rd place prize among eight contestants? (Gold / Silver / Bronze) The total number of options was 8 x 7 x 6 = 336.
The total number of options was 8 · 7 · 6 = 336. We know the factorial is: We only want 8 · 7 · 6. How can we “stop” the factorial at 6 ? if we do 8!/5! we get: Or, we can say that n = Number of element k = order number
Example: A terrorist has planted a bomb in your city, and it is your job to disable it by cutting wires to the trigger device. There are 10 wires to the device. If you cut exactly the right three wires, in exactly the right order, you will disable the bomb, otherwise it will explode! If the wires all look the same, what are your chances of survival? Answer : Note that total arrangements of 3 wires out of 10 wires is: P(10,3) = 10·9·8 = 720, so there is a 1 in 720 chances that you’ll survive!
COMBINATORICS TECHNIQUES
It follows that In particular, Again, note that the order is important. It is necessary to distinguish in what cases order is important and in which it is not.
The first woman can be partnered with any of the 20 men. The second with any of there remaining 19, etc. To partner all 12 women, we have P (20, 12)
COMBINATIONS Where as permutations consider order, combinations are used when order does not matter .
A useful fact about combinations is that they are symmetric. This is formalized in the following corollary.
PERMUTATION VS COMBINATION Permutation : Order does matter. = Two arrangements Combination : Order does not matter. = One arrangement
Here’s a few examples of permutations (order matters) from combinations (order doesn’t matter). Permutation: Picking a President, VP and Secretary from a group of 10. P(10,3) = 10!/7! = 10 · 9 · 8 = 720. Combination: Picking a team of 3 people from a group of 10. C(10,3) = 10!/(7! · 3!) = 10 · 9 · 8 / (3 · 2 · 1) = 120. Permutation: Listing your 3 favorite desserts, in order, from a menu of 10. P(10,3) = 720. Combination: Choosing 3 desserts from a menu of 10. C(10,3) = 120.
Example: How many distinct 7-card hands can be drawn from a standard 52-card deck? ◦ The order of cards in a hand doesn’t matter. Answer: C(52,7) = P(52,7)/P(7,7)
Here n = 30 and we wish to choose r = 12. Order does not matter and repetitions are possible , so we apply the previous theorem to get that there are Possible orders.
An equivalent way of interpreting this theorem is the number of ways to distribute n distinguishable objects into k distinguishable boxes so that ni objects are placed into box i for i = 1, 2 , . . . , k .
Example: How many unique ways are there to arrange the letters in the word “ASSET” Sol, “ASSET” contains 4 distinct letters, A , S, E and T ; Assume that all the 5 letters were unique, then total arrangements is 5! But notice that ETSSA and ETSSA is the same i.e there are only 4 unique characters that mean we overcount, we need to divide the total arrangement above by 2! Therefore total unique ways = 5! / 2!
Example: How many permutations of word “Mississippi” are there? Sol, “Mississippi” contains 4 distinct letters, M , i, s and p ; with1 , 4 , 4 , 2 Occurrences respectively. Therefore there are permutations.
BINOMIALCOEFFICIENTS They are the coefficients in the expansion of the expression (multivariate polynomial), (x + y ) . A binomial is a sum of two terms. n
BINOMIALCOEFFICIENTS From : The number (n/r) is called a binomial coefficient because it occurs as the coefficient of p q in the binomial expansion—that is, the re-expression of (q + p) in a linear combination of products of p and q n- r r n
BINOMIALCOEFFICIENTS Expanding the summation, we have For example,
BINOMIALCOEFFICIENTS By the Binomial Theorem , we have So when j = 12, we have 20 so the coefficient is