LESSON 11 COMBINATORICS
LESSON 11 COMBINATORICS In mathematics you don't understand things. You just get used to them.
Johann von Neumann US (Hungarian-born) computer scientist, mathematician (1903 - 1957)
1. STRATEGIES OF COMPUTATION
You think you can count, do you? Answer these: . How many ways can 8 books be arranged on a bookshelf? . If you have 20 employees and you need to form a committee of 5, how many you do it?
ways can
. How many possible ways are there to pick the numbers for the lottery? . How many possible 9-digit phone numbers are there?
To solve these problems there are different strategies The counting principle. Let's figure something out: You are planning a date: dinner, entertainment and dessert. You have two choices for dinner: Happy Meals at McDonald's and microwave burritos at the local Quickymart.Yo have three choices for entertainment: bowling, a movie or watching wrestling on TV. You have two choices for dessert: smorses and pie. How many possible dates are there? To solve it we make a chart. This is called a tree diagram. s B p s MCDonald's
M p s WWE p
date s B p s Quickymart
M p s WWE p
1
LESSON 11 COMBINATORICS
Every possible date is represented here. To count how many possible dates there are, we just count the tips of the last branches. There are 12 possible dates: Q-M-s, Q-WWE-p, MD-B-s, etc. We really don't want to have to draw this tree every time though! What if there were 8 choices for dinner, 13 choices for entertainment and 7 choices for dessert? In this case we can only “imagine” the tree, or drawing it incomplete. The trick is this: From date we get 8 branches (8 choices for dinner). Each one has 13 branches (13 choices for entertainment); that makes 8·13. Each entertainment has 7 choices for dinner. In total 8·13·7=728 possible dates. We generalise:
If we have a list of events (or choices) that occur in order (one after another) and there are m ways to do event 1 n ways to do event 2 … p ways to do last event then the number of ways they can all be done is m·n·...·p Try these: 1. You are buying a new car. You have 3 choices for the model: the Additron, the Subtracto and the Quotient. You have 5 choices for color: red, blue, black, white and piña kolada cream. You have 2 choices for transmission: stick and automatic. How many choices do you have? 2. You are picking an outfit for school. In your closet you find 4 pairs of pants, 8 shirts and 10 belts. Assuming everything matches, how many outfits can you create? Many problems have common characteristics. If we analyse them, we discover that they can groupe in one of the following kinds: variations, permutations or combinations, depending on the number of elements we take, the order and the repetition. Usually, we use the word "combination" loosely, without thinking if the order of things is important. In other words: "My fruit salad is a combination of apples, grapes and bananas" We don't care what order the fruits are in, they could also be "bananas, grapes and apples" or "grapes, apples and bananas", its the same fruit salad. "The combination to the safe was 472". Now we do care about the order. "724" would not work, nor would "247". It has to be exactly 4-7-2.
2
LESSON 11 COMBINATORICS
So, in Mathematics we use more precise language: If the order doesn't matter, it is a Combination. If the order does matter it is a Variation or a Permutation.
2. VARIATIONS AND PERMUTATIONS (In English it is very common to use the word Permutation both for permutations ad variations, as you con see in your calculator). A variation is an ordered combination. There are basically two types of variation: 1. Repetition is Allowed: such as the lock above. It could be "333". 2. No Repetition: for example the first three people in a running race. You can't be first and second. Variation with repetition. A variation with repetition is the choice of r things from a set of n things that can be repeated and where the order matters.
VRm,n=mn Example: How many words of 2 letters can you make with 4 letters a,b,c,d?. The subsets are the following: {aa} {ab} {ac} {ad} {ba} {bb} {bc} {bd} {ca} {cb} {cc} {cd} {da} {db} {dc} {dd} There are 16 total variations on the set. Using the formula: VR4,2=42=16 Variations without repetition. Take a set A of n different elements. Choose m elements in a specific order. Each such choice is called a variation of n elements choose m. How many variations are there? The number of variations is given by the formula:
Vm,n=m路(m-1).(m-2)路... n decreasing factors Example: 1. How many different three-digit numbers can be formed with the digits 1, 2, 3, 4, 5? m=5 n=3. The order of the elementos does matter. The different numbers are 123, 231, 321,... The elements cannot be repeated as the problems states that the figures are different. 3
LESSON 11 COMBINATORICS
V5,3=5·4·3=60
Exercise: 10 candidates have been presented with awards for their novels in a literary contest. The honor roll (list of candidates) is formed by the winner, finalist and runners-up. How many different honor rolls can be formed? Permutations. The difference between Permutations and Variations is the number of elements you take. In Permutations, we have m elements and we take all of them. The number of permutations is given by the formula:
Pm=m·(m-1)·(m-2)·...·3·2·1=m! (Pm=Vm,m) We use the factorial function: The factorial function (symbol: !) just means to multiply a series of descending natural numbers. Examples: • 4! = 4 × 3 × 2 × 1 = 24 • 7! = 7 × 6 × 5 × 4 × 3 × 2 × 1 = 5,040 • 1! = 1 Note: it is generally agreed that 0! = 1. It may seem funny that multiplying no numbers together gets you 1, but it helps simplify a lot of equations. Example: Given three people {Michael, Peter, Rose}, the following is the set of all permutations of that set: {Michael, Peter, Rose}, {Michael, Rose, Peter}, {Peter, Michael, Rose} {Peter, Rose, Michael}, {Rose, Michael, Peter}, {Rose, Peter, Michael} There are no other permutations of this set besides those listed. Using the formula: P3=3!=6 Another example: How many ways can eight people sit in a row of seats? m=8 The order of the elements does matter. There are no repeated elements, as a person cannot be repeated.
P8=8!=40320
4
LESSON 11 COMBINATORICS
Exercise: What is the total number of possible 4-letter arrangements of the letters m, a, t, h, if each letter is used only once in each arrangement?
4. COMBINATIONS A combination is the choice of r things from a set of n things without replacement and where order does not matter. (There are also combinations with repetition, but you will study them later) The number of combinations of m elements is given by the formula:
Cm , n
m ⋅ ( m − 1) ⋅ ... ⋅ ( m − n + 1) = = Pn n! Vm,n
Example: A student council committee of three students has to be selected out of a class or 35 students. How many different committees can be formed? The order of the elements does not matter; the elements cannot be repeated.
Exercise: Jose has 9 friends that he wants to invite to dinner but he can only invite six of them at one time. Out of the nine friends many different groups can he invite?
Combinational numbers The combinations can also be denoted as a combinatioral number or binomial coefficient or number combination
n k
where n is the number of things to choose from, and you choose k of them. It is often called “n choose k”.
n n! = k k !( n − k ) ! Let's calculate some combinatorial numbers: 5
LESSON 11 COMBINATORICS
5 5! 5! = = =1 0 0!( 5 − 0 ) ! 1 ⋅ 5! Does this make sense? Think about it: how many ways can you choose 0 elements from a set of 5? Sure, one way.
0 0! 0! = =1 = 0 0!( 0 − 0 ) ! 0!⋅ 0! How many ways can you choose 0 things from 0 things?
6 6! 6! = = 6 1 = 1!( 6 − 1) ! 1 ⋅ 5! How many ways can you choose 1 things from 6 things? Properties 1.
n n = =1 0 n
n n 2. Simmetry: = k n− k
7 7 Try yourself 4 = 3 3. Recurrence relation:
11 11 12 Try it 4 + 5 = 5 3. Newton's binomy.
n n 0 ( a + b) = a b + 0 n
n n− 1 1 1 a b +
n n− 2 2 n 1 n− 1 2 a b + ... + n − 1 a b +
This formula is very useful. Let's see some examples:
6
n 0 n n a b
LESSON 11 COMBINATORICS
( a + b)
2
2 = a 2b0 + 0
2 1 1 ab + 1
2 0 2 2 2 a b = a + 2ab + b 2
As you can see, for n=2 it is the formula for the square of a binomial. Another example:
( a + b)
3
3 = a 3b 0 + 0
3 2 1 ab + 1
3 2 2 ab + 2
3 0 3 3 2 2 3 a b = a + 3a b + 3ab + b 3
The combinatorial numbers are the coefficients when we expand the power of a binomial. This coefficients can also be calculated through the Pascal's triangle. Pascal's triangle is a triangle of integers which is infinite and symmetrical.
You can evaluate all these combinatorial numbers, but you can also proceed as follows: 1. On the zeroth row, write only the number 1. 2. To construct the elements of following rows, add the number directly above and to the left with the number directly above and to the right to find the new value (If either the number to the right or left is not present, substitute a zero in its place). Let's see the first seven rows of the Pascal's triangle:
Pascal's triangle is very useful for calculating coefficients of the binomial expansions.
7
LESSON 11 COMBINATORICS
The chinese knew about it: This drawing is entitled "The Old Method Chart of the Seven Multiplying Squares". View full image It is from the front of Chu ShiChieh's book "Ssu Yuan Yü Chien" (Precious Mirror of the Four Elements), written in AD 1303 (over 700 years ago, and more than 300 years before Pascal!), and in the book it says the triangle was known about more than two centuries before that.
Exercises: 1. Solve the equations: 25 25 a) = x 7
7 7 8 b) + = 3 x 4 c)
x x = 20 ⋅ 4 2
x x − 1 x − 2 d) + + = 136 2 2 2 2. Expand: ( x + 2 ) = 5
3. Find the 13th term in the expansion of (a+b)15. 4. Find the 9th term in the expansion of (3y-2)14. 5. Find the 4th term in the expansion of (x+4y)10. More exercises1.
1 http://www.regentsprep.org/Regents/math/algtrig/ATS5/PCPrac.htm
8
LESSON 11 COMBINATORICS
FUNNY MATHS Patterns within Pascal's triangle: Diagonals :The first diagonal is, of course, just "1"s, and the next diagonal has the Natural Numbers (1,2,3, etc). The third diagonal has the triangular numbers The fourth diagonal has the tetrahedral numbers.
Odds and Evens If you color the odd and even numbers, you end up with a pattern called the Sierpinski Triangle
Horizontal sums: What do you notice about the horizontal sums? Is there a pattern? Isn't it amazing! It doubles each time (powers of 2).
9
LESSON 11 COMBINATORICS
Fibonacci sequence: Try this: make a pattern by going up and then along, then add up the squares (as illustrated) ... you will get the Fibonacci sequence.
Symmetrical: And the triangle is also symmetrical. The numbers on the left side have identical matching numbers on the right side, like a mirror image.
10