18.440: Lecture 1 Permutations and combinations, Pascal s triangle, learning to count Scott Sheffield MIT 1
Outline Remark, just for fun Permutations Counting tricks Binomial coefficients Problems 2
Outline Remark, just for fun Permutations Counting tricks Binomial coefficients Problems 3
Politics Suppose that betting markets place the probability that your favorite presidential candidates will be elected at 58 percent. Price of a contact that pays 100 dollars if your candidate wins is 58 dollars. Market seems to say that your candidate will probably win, if probably means with probability greater than.5. The price of such a contract may fluctuate in time. Let X (t) denote the price at time t. Suppose X (t) is known to vary continuously in time. What is the probability it will reach 59 before reaching 57? Efficient market hypothesis suggests about.5. Reasonable model: use sequence of fair coin tosses to decide the order in which X (t) passes through different integers. 4
Which of these statements is probably true? 1. X (t) will go below 50 at some future point. 2. X (t) will get all the way below 20 at some point 3. X (t) will reach both 70 and 30, at different future times. 4. X (t) will reach both 65 and 35 at different future times. 5. X (t) will hit 65, then 50, then 60, then 55. Answers: 1, 2, 4. Full explanations coming at the end of the course. Point for now is that probability is everywhere: politics, military, finance and economics, all kinds of science and engineering, philosophy, religion, making cool new cell phone features work, social networking, dating websites, etc. All of the math in this course has a lot of applications. 5
Outline Remark, just for fun Permutations Counting tricks Binomial coefficients Problems 6
Outline Remark, just for fun Permutations Counting tricks Binomial coefficients Problems 7
Permutations How many ways to order 52 cards? Answer: 52 51 50... 1 = 52! = 80658175170943878571660636856403766975289505440883277824 10 12 n hats, n people, how many ways to assign each person a hat? Answer: n! n hats, k < n people, how many ways to assign each person a hat? n (n 1) (n 2)... (n k + 1) = n!/(n k)! A permutation is a map from {1, 2,..., n} to {1, 2,..., n}. There are n! permutations of n elements. 8
Permutation notation A permutation is a function from {1, 2,..., n} to {1, 2,..., n} whose range is the whole set {1, 2,..., n}. If σ is a permutation then for each j between 1 and n, the the value σ(j) is the number that j gets mapped to. For example, if n = 3, then σ could be a function such that σ(1) = 3, σ(2) = 2, and σ(3) = 1. If you have n cards with labels 1 through n and you shuffle them, then you can let σ(j) denote the label of the card in the jth position. Thus orderings of n cards are in one-to-one correspondence with permutations of n elements. One way to represent σ is to list the values σ(1), σ(2),..., σ(n) in order. The σ above is represented as {3, 2, 1}. If σ and ρ are both permutations, write σ ρ for their composition. That is, σ ρ(j) = σ(ρ(j)). 9
Cycle decomposition Another way to write a permutation is to describe its cycles: For example, taking n = 7, we write (2, 3, 5), (1, 7), (4, 6) for the permutation σ such that σ(2) = 3, σ(3) = 5, σ(5) = 2 and σ(1) = 7, σ(7) = 1, and σ(4) = 6, σ(6) = 4. If you pick some j and repeatedly apply σ to it, it will cycle through the numbers in its cycle. Generally, a function is called an involution if f (f (x)) = x for all x. A permutation is an involution if all cycles have length one or two. A permutation is fixed point free if there are no cycles of length one. 10
Outline Remark, just for fun Permutations Counting tricks Binomial coefficients Problems 11
Outline Remark, just for fun Permutations Counting tricks Binomial coefficients Problems 12
Fundamental counting trick n ways to assign hat for the first person. No matter what choice I make, there will remain n 1 was to assign hat to the second person. No matter what choice I make there, there will remain n 2 ways to assign a hat to the third person, etc. This is a useful trick: break counting problem into a sequence of stages so that one always has the same number of choices to make at each stage. Then the total count becomes a product of number of choices available at each stage. Easy to make mistakes. For example, maybe in your problem, the number of choices at one stage actually does depend on choices made during earlier stages. 13
Another trick: overcount by a fixed factor If you have 5 indistinguishable black cards, 2 indistinguishable red cards, and three indistinguishable green cards, how many distinct shuffle patterns of the ten cards are there? Answer: if the cards were distinguishable, we d have 10!. But we re overcounting by a factor of 5!2!3!, so the answer is 10!/(5!2!3!). 14
Outline Remark, just for fun Permutations Counting tricks Binomial coefficients Problems 15
Outline Remark, just for fun Permutations Counting tricks Binomial coefficients Problems 16
( n ) notation n k How many ways to choose an ordered sequence of k elements from a list of n elements, with repeats allowed? Answer: nk How many ways to choose an ordered sequence of k elements from a list of n elements, with repeats forbidden? Answer: n!/(n k)! How many way to choose (unordered) k elements from a list of n without repeats? Answer: := n n! k k!(n k)! What is the coefficient in front of x k in the expansion of (x + 1) n? n Answer:. k 17
Pascal s triangle Arnold principle. ( ) ( ) ( ) n n 1 n 1 A simple recursion: k = k 1 + k. What is the coefficient in front of x k in the expansion of (x + 1) n? ( ) n Answer: k. ( ) ( ) ( ) ( ) ( ) n n n n n 1 n (x + 1) n = 1 + x 1 + x 2 +... + x + x n 0 1 2 n 1 n. n ( ) n Question: what is k=0? Answer: (1 + 1) n = 2 n. k 18
Outline Remark, just for fun Permutations Counting tricks Binomial coefficients Problems 19
Outline Remark, just for fun Permutations Counting tricks Binomial coefficients Problems 20
More problems How many full house hands in poker? ( 13 4 ) ( 3 12 4 ) 2 How many 2 pair hands? ( 13 4 ) ( 2 12 4 ) ( 2 11 4 ) 1 /2 How many royal flush hands? 4 21
More problems How many hands that have four cards of the same suit, one card of another suit? 4 ( 13 ) 3 ( 13 ) 4 1 How many 10 digit numbers with no consecutive digits that agree? If initial digit can be zero, have 10 9 9 ten-digit sequences. If initial digit required to be non-zero, have 9 10. How many 10 digit numbers (allowing initial digit to be zero) in which only 5 of the 10 possible digits are represented? This is one is tricky, can be solved with inclusion-exclusion (to come later in the course). How many ways to assign a birthday to each of 23 distinct people? What if no birthday can be repeated? 366 23 if repeats allowed. 366!/343! if repeats not allowed. 22
MIT OpenCourseWare http://ocw.mit.edu 18.440 Probability and Random Variables Spring 2014 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.