3 31 14
play

3/31/14 Counting counting is hard with only 10 fingers How many - PDF document

3/31/14 Counting counting is hard with only 10 fingers How many ways to do X ? X = Choose an integer between one and ten. X = Walk from 1 st and Spring to 5 th and Pine. Pine Pike Union Spring 1 st 2 nd 3 rd 4 th 5 th counting is


  1. 3/31/14 Counting counting is hard with only 10 fingers How many ways to do X ? X = “Choose an integer between one and ten.” X = “Walk from 1 st and Spring to 5 th and Pine.” Pine Pike Union Spring 1 st 2 nd 3 rd 4 th 5 th counting is hard with only 10 fingers the basic principle of counting (product rule) How many ways to do X ? If there are m outcomes from some event A , followed sequentially by n outcomes from some event B , then there X = “Choose an integer between one and ten.” are … m x n outcomes overall. X = “Walk from 1 st and Spring to 5 th and Pine.” A, m=4 Pine B, n=2 Pike Counting is hard when numbers are large or 4 x 2 = 8 outcomes constraints are complex. Union We need a systematic approach. Spring Generalizes to more 1 st 2 nd 3 rd 4 th 5 th events. examples examples How many n-bit numbers are there? How many 4-character passwords are there if each character must be one of 2 • 2 • ... • 2 = 2 n a, b, c, … , z, 0 , 1 , 2 , … , 9 ? How many subsets of a set of size n are there? { 1 , 2 , 3 , … , n} 36 • 36 • 36 • 36 = 1,679,616 ≈ 1.7 million Set contains 1 or doesn’t contain 1 . Set contains 2 or doesn’t contain 2 . Same question, but now characters cannot be repeated … Set contains 3 or doesn’t contain 3… 2 • 2 • ... • 2 = 2 n 36 • 35 • 34 • 33 = 1,413,720 ≈ 1.4 million 1

  2. 3/31/14 permutations permutations How many arrangements of the letters {a,b,c} Q. How many permutations of DOGIE are there? are possible 5! = 120 (using each once, no repeat, order matters)? a b c b a c c a b Q. How many of DOGGY ? DOG 1 G 2 Y a c b b c a c b a 5!/2! = 60 DOG 2 G 1 Y More generally, how many arrangements of n distinct items are possible? Q. How many of GODOGGY ? n • (n-1) • (n-1) • ... • 1 = n! (n factorial) combinations combinations Combinations: Number of ways to choose r Your dark elf avatar can carry three objects chosen things from n things from: Pronounced “n choose r” aka “binomial coefficients” E.g., ← by symmetry of definition identities: How many ways can he/she be equipped? Many ← 1st object either in or out ← team + captain the binomial theorem an identity with binomial coefficients Proof 1: Induction … Proof: Proof 2: Counting (x+y) • (x+y) • (x+y) • ... • (x+y) Pick either x or y from first factor Pick either x or y from second factor … Pick either x or y from nth factor How many ways to get exactly k x’s? 2

  3. 3/31/14 counting paths counting paths How many ways to walk from 1 st and Spring to 5 th How many ways to walk from 1 st and Spring to 5 th and Pine only going North and East? and Pine only going North and East, if I want to stop at Starbucks on the way? Pine Pike Pine Union Pike Spring 1 st 2 nd 3 rd 4 th 5 th Union A: Changing the visualization often helps. Spring Instead of tracing paths on the grid above, ✓ 7 ◆ 1 st 2 nd 3 rd 4 th 5 th list choices. You walk 7 blocks; at each = 35 3 intersection choose N or E; must choose N exactly 3 times. Other problems Other problems 10 people of different heights . How many ways to line up 5 of # of 7 digit numbers (decimal) with at least one repeating digit? (allowed to have leading zeros). them? Line up 5 of them in height order? # of ways to rearrange letters in word SYSTEMS 3

Recommend


More recommend