Counting and Probability Whats to come? Counting and Probability - - PowerPoint PPT Presentation

counting and probability
SMART_READER_LITE
LIVE PREVIEW

Counting and Probability Whats to come? Counting and Probability - - PowerPoint PPT Presentation

Counting and Probability Whats to come? Counting and Probability Whats to come? Probability. Counting and Probability Whats to come? Probability. A bag contains: Counting and Probability Whats to come? Probability. A bag


slide-1
SLIDE 1

Counting and Probability

What’s to come?

slide-2
SLIDE 2

Counting and Probability

What’s to come? Probability.

slide-3
SLIDE 3

Counting and Probability

What’s to come? Probability. A bag contains:

slide-4
SLIDE 4

Counting and Probability

What’s to come? Probability. A bag contains:

slide-5
SLIDE 5

Counting and Probability

What’s to come? Probability. A bag contains: What is the chance that a ball taken from the bag is blue?

slide-6
SLIDE 6

Counting and Probability

What’s to come? Probability. A bag contains: What is the chance that a ball taken from the bag is blue? Count blue.

slide-7
SLIDE 7

Counting and Probability

What’s to come? Probability. A bag contains: What is the chance that a ball taken from the bag is blue? Count blue. Count total.

slide-8
SLIDE 8

Counting and Probability

What’s to come? Probability. A bag contains: What is the chance that a ball taken from the bag is blue? Count blue. Count total. Divide.

slide-9
SLIDE 9

Counting and Probability

What’s to come? Probability. A bag contains: What is the chance that a ball taken from the bag is blue? Count blue. Count total. Divide. Today:

slide-10
SLIDE 10

Counting and Probability

What’s to come? Probability. A bag contains: What is the chance that a ball taken from the bag is blue? Count blue. Count total. Divide. Today: Counting!

slide-11
SLIDE 11

Counting and Probability

What’s to come? Probability. A bag contains: What is the chance that a ball taken from the bag is blue? Count blue. Count total. Divide. Today: Counting! Later this week: Probability.

slide-12
SLIDE 12

Counting and Probability

What’s to come? Probability. A bag contains: What is the chance that a ball taken from the bag is blue? Count blue. Count total. Divide. Today: Counting! Later this week: Probability. Professor Walrand.

slide-13
SLIDE 13

Outline

  • 1. Counting.
  • 2. Tree
  • 3. Rules of Counting
  • 4. Sample with/without replacement where order does/doesn’t

matter.

slide-14
SLIDE 14

Count?

How many outcomes possible for k coin tosses? How many handshakes for n people? How many 10 digit numbers? How many 10 digit numbers without repeating digits?

slide-15
SLIDE 15

Using a tree of possibilities...

How many 3-bit strings?

slide-16
SLIDE 16

Using a tree of possibilities...

How many 3-bit strings? How many different sequences of three bits from {0,1}?

slide-17
SLIDE 17

Using a tree of possibilities...

How many 3-bit strings? How many different sequences of three bits from {0,1}? How would you make one sequence?

slide-18
SLIDE 18

Using a tree of possibilities...

How many 3-bit strings? How many different sequences of three bits from {0,1}? How would you make one sequence? How many different ways to do that making?

slide-19
SLIDE 19

Using a tree of possibilities...

How many 3-bit strings? How many different sequences of three bits from {0,1}? How would you make one sequence? How many different ways to do that making?

slide-20
SLIDE 20

Using a tree of possibilities...

How many 3-bit strings? How many different sequences of three bits from {0,1}? How would you make one sequence? How many different ways to do that making? 000 001 1 010 011 1 1 100 101 1 110 111 1 1 1

slide-21
SLIDE 21

Using a tree of possibilities...

How many 3-bit strings? How many different sequences of three bits from {0,1}? How would you make one sequence? How many different ways to do that making? 000 001 1 010 011 1 1 100 101 1 110 111 1 1 1

slide-22
SLIDE 22

Using a tree of possibilities...

How many 3-bit strings? How many different sequences of three bits from {0,1}? How would you make one sequence? How many different ways to do that making? 000 001 1 010 011 1 1 100 101 1 110 111 1 1 1

slide-23
SLIDE 23

Using a tree of possibilities...

How many 3-bit strings? How many different sequences of three bits from {0,1}? How would you make one sequence? How many different ways to do that making? 000 001 1 010 011 1 1 100 101 1 110 111 1 1 1

slide-24
SLIDE 24

Using a tree of possibilities...

How many 3-bit strings? How many different sequences of three bits from {0,1}? How would you make one sequence? How many different ways to do that making? 000 001 1 010 011 1 1 100 101 1 110 111 1 1 1 8 leaves which is 2×2×2.

slide-25
SLIDE 25

Using a tree of possibilities...

How many 3-bit strings? How many different sequences of three bits from {0,1}? How would you make one sequence? How many different ways to do that making? 000 001 1 010 011 1 1 100 101 1 110 111 1 1 1 8 leaves which is 2×2×2. One leaf for each string.

slide-26
SLIDE 26

Using a tree of possibilities...

How many 3-bit strings? How many different sequences of three bits from {0,1}? How would you make one sequence? How many different ways to do that making? 000 001 1 010 011 1 1 100 101 1 110 111 1 1 1 8 leaves which is 2×2×2. One leaf for each string.

slide-27
SLIDE 27

Using a tree of possibilities...

How many 3-bit strings? How many different sequences of three bits from {0,1}? How would you make one sequence? How many different ways to do that making? 000 001 1 010 011 1 1 100 101 1 110 111 1 1 1 8 leaves which is 2×2×2. One leaf for each string. 8 3-bit srings!

slide-28
SLIDE 28

First Rule of Counting: Product Rule

Objects made by choosing from n1, then n2, ..., then nk the number of objects is n1 ×n2 ···×nk.

slide-29
SLIDE 29

First Rule of Counting: Product Rule

Objects made by choosing from n1, then n2, ..., then nk the number of objects is n1 ×n2 ···×nk. · · · · · · · · · · · ·

slide-30
SLIDE 30

First Rule of Counting: Product Rule

Objects made by choosing from n1, then n2, ..., then nk the number of objects is n1 ×n2 ···×nk. n1 · · · · · · · · · · · ·

slide-31
SLIDE 31

First Rule of Counting: Product Rule

Objects made by choosing from n1, then n2, ..., then nk the number of objects is n1 ×n2 ···×nk. n1 ×n2 ×n3 · · · · · · · · · · · ·

slide-32
SLIDE 32

First Rule of Counting: Product Rule

Objects made by choosing from n1, then n2, ..., then nk the number of objects is n1 ×n2 ···×nk. n1 ×n2 ×n3 · · · · · · · · · · · ·

slide-33
SLIDE 33

First Rule of Counting: Product Rule

Objects made by choosing from n1, then n2, ..., then nk the number of objects is n1 ×n2 ···×nk. n1 ×n2 ×n3 · · · · · · · · · · · · In picture, 2×2×3 = 12

slide-34
SLIDE 34

First Rule of Counting: Product Rule

Objects made by choosing from n1, then n2, ..., then nk the number of objects is n1 ×n2 ···×nk. n1 ×n2 ×n3 · · · · · · · · · · · · In picture, 2×2×3 = 12

slide-35
SLIDE 35

Using the first rule..

How many outcomes possible for k coin tosses?

slide-36
SLIDE 36

Using the first rule..

How many outcomes possible for k coin tosses? 2 ways for first choice,

slide-37
SLIDE 37

Using the first rule..

How many outcomes possible for k coin tosses? 2 ways for first choice, 2 ways for second choice, ...

slide-38
SLIDE 38

Using the first rule..

How many outcomes possible for k coin tosses? 2 ways for first choice, 2 ways for second choice, ... 2

slide-39
SLIDE 39

Using the first rule..

How many outcomes possible for k coin tosses? 2 ways for first choice, 2 ways for second choice, ... 2×2

slide-40
SLIDE 40

Using the first rule..

How many outcomes possible for k coin tosses? 2 ways for first choice, 2 ways for second choice, ... 2×2···

slide-41
SLIDE 41

Using the first rule..

How many outcomes possible for k coin tosses? 2 ways for first choice, 2 ways for second choice, ... 2×2··· ×2

slide-42
SLIDE 42

Using the first rule..

How many outcomes possible for k coin tosses? 2 ways for first choice, 2 ways for second choice, ... 2×2··· ×2 = 2k

slide-43
SLIDE 43

Using the first rule..

How many outcomes possible for k coin tosses? 2 ways for first choice, 2 ways for second choice, ... 2×2··· ×2 = 2k How many 10 digit numbers?

slide-44
SLIDE 44

Using the first rule..

How many outcomes possible for k coin tosses? 2 ways for first choice, 2 ways for second choice, ... 2×2··· ×2 = 2k How many 10 digit numbers? 10 ways for first choice,

slide-45
SLIDE 45

Using the first rule..

How many outcomes possible for k coin tosses? 2 ways for first choice, 2 ways for second choice, ... 2×2··· ×2 = 2k How many 10 digit numbers? 10 ways for first choice, 10 ways for second choice, ...

slide-46
SLIDE 46

Using the first rule..

How many outcomes possible for k coin tosses? 2 ways for first choice, 2 ways for second choice, ... 2×2··· ×2 = 2k How many 10 digit numbers? 10 ways for first choice, 10 ways for second choice, ... 10

slide-47
SLIDE 47

Using the first rule..

How many outcomes possible for k coin tosses? 2 ways for first choice, 2 ways for second choice, ... 2×2··· ×2 = 2k How many 10 digit numbers? 10 ways for first choice, 10 ways for second choice, ... 10×

slide-48
SLIDE 48

Using the first rule..

How many outcomes possible for k coin tosses? 2 ways for first choice, 2 ways for second choice, ... 2×2··· ×2 = 2k How many 10 digit numbers? 10 ways for first choice, 10 ways for second choice, ... 10×10···

slide-49
SLIDE 49

Using the first rule..

How many outcomes possible for k coin tosses? 2 ways for first choice, 2 ways for second choice, ... 2×2··· ×2 = 2k How many 10 digit numbers? 10 ways for first choice, 10 ways for second choice, ... 10×10··· ×10

slide-50
SLIDE 50

Using the first rule..

How many outcomes possible for k coin tosses? 2 ways for first choice, 2 ways for second choice, ... 2×2··· ×2 = 2k How many 10 digit numbers? 10 ways for first choice, 10 ways for second choice, ... 10×10··· ×10 = 10k

slide-51
SLIDE 51

Using the first rule..

How many outcomes possible for k coin tosses? 2 ways for first choice, 2 ways for second choice, ... 2×2··· ×2 = 2k How many 10 digit numbers? 10 ways for first choice, 10 ways for second choice, ... 10×10··· ×10 = 10k How many n digit base m numbers?

slide-52
SLIDE 52

Using the first rule..

How many outcomes possible for k coin tosses? 2 ways for first choice, 2 ways for second choice, ... 2×2··· ×2 = 2k How many 10 digit numbers? 10 ways for first choice, 10 ways for second choice, ... 10×10··· ×10 = 10k How many n digit base m numbers? m ways for first,

slide-53
SLIDE 53

Using the first rule..

How many outcomes possible for k coin tosses? 2 ways for first choice, 2 ways for second choice, ... 2×2··· ×2 = 2k How many 10 digit numbers? 10 ways for first choice, 10 ways for second choice, ... 10×10··· ×10 = 10k How many n digit base m numbers? m ways for first, m ways for second, ...

slide-54
SLIDE 54

Using the first rule..

How many outcomes possible for k coin tosses? 2 ways for first choice, 2 ways for second choice, ... 2×2··· ×2 = 2k How many 10 digit numbers? 10 ways for first choice, 10 ways for second choice, ... 10×10··· ×10 = 10k How many n digit base m numbers? m ways for first, m ways for second, ... mn

slide-55
SLIDE 55

Functions, polynomials.

How many functions f mapping S to T?

slide-56
SLIDE 56

Functions, polynomials.

How many functions f mapping S to T? |T| ways to choose for f(s1),

slide-57
SLIDE 57

Functions, polynomials.

How many functions f mapping S to T? |T| ways to choose for f(s1), |T| ways to choose for f(s2), ...

slide-58
SLIDE 58

Functions, polynomials.

How many functions f mapping S to T? |T| ways to choose for f(s1), |T| ways to choose for f(s2), ... ....|T||S|

slide-59
SLIDE 59

Functions, polynomials.

How many functions f mapping S to T? |T| ways to choose for f(s1), |T| ways to choose for f(s2), ... ....|T||S| How many polynomials of degree d modulo p?

slide-60
SLIDE 60

Functions, polynomials.

How many functions f mapping S to T? |T| ways to choose for f(s1), |T| ways to choose for f(s2), ... ....|T||S| How many polynomials of degree d modulo p? p ways to choose for first coefficient,

slide-61
SLIDE 61

Functions, polynomials.

How many functions f mapping S to T? |T| ways to choose for f(s1), |T| ways to choose for f(s2), ... ....|T||S| How many polynomials of degree d modulo p? p ways to choose for first coefficient, p ways for second, ...

slide-62
SLIDE 62

Functions, polynomials.

How many functions f mapping S to T? |T| ways to choose for f(s1), |T| ways to choose for f(s2), ... ....|T||S| How many polynomials of degree d modulo p? p ways to choose for first coefficient, p ways for second, ... ...pd+1

slide-63
SLIDE 63

Functions, polynomials.

How many functions f mapping S to T? |T| ways to choose for f(s1), |T| ways to choose for f(s2), ... ....|T||S| How many polynomials of degree d modulo p? p ways to choose for first coefficient, p ways for second, ... ...pd+1 p values for first point,

slide-64
SLIDE 64

Functions, polynomials.

How many functions f mapping S to T? |T| ways to choose for f(s1), |T| ways to choose for f(s2), ... ....|T||S| How many polynomials of degree d modulo p? p ways to choose for first coefficient, p ways for second, ... ...pd+1 p values for first point, p values for second, ...

slide-65
SLIDE 65

Functions, polynomials.

How many functions f mapping S to T? |T| ways to choose for f(s1), |T| ways to choose for f(s2), ... ....|T||S| How many polynomials of degree d modulo p? p ways to choose for first coefficient, p ways for second, ... ...pd+1 p values for first point, p values for second, ... ...pd+1

slide-66
SLIDE 66

Permutations.

1By definition: 0! = 1. n! = n(n −1)(n −2)...1.

slide-67
SLIDE 67

Permutations.

How many 10 digit numbers without repeating a digit?

1By definition: 0! = 1. n! = n(n −1)(n −2)...1.

slide-68
SLIDE 68

Permutations.

How many 10 digit numbers without repeating a digit? 10 ways for first,

1By definition: 0! = 1. n! = n(n −1)(n −2)...1.

slide-69
SLIDE 69

Permutations.

How many 10 digit numbers without repeating a digit? 10 ways for first, 9 ways for second,

1By definition: 0! = 1. n! = n(n −1)(n −2)...1.

slide-70
SLIDE 70

Permutations.

How many 10 digit numbers without repeating a digit? 10 ways for first, 9 ways for second, 8 ways for third,

1By definition: 0! = 1. n! = n(n −1)(n −2)...1.

slide-71
SLIDE 71

Permutations.

How many 10 digit numbers without repeating a digit? 10 ways for first, 9 ways for second, 8 ways for third, ...

1By definition: 0! = 1. n! = n(n −1)(n −2)...1.

slide-72
SLIDE 72

Permutations.

How many 10 digit numbers without repeating a digit? 10 ways for first, 9 ways for second, 8 ways for third, ... ... 10∗9∗8···∗1 = 10!.1

1By definition: 0! = 1. n! = n(n −1)(n −2)...1.

slide-73
SLIDE 73

Permutations.

How many 10 digit numbers without repeating a digit? 10 ways for first, 9 ways for second, 8 ways for third, ... ... 10∗9∗8···∗1 = 10!.1 How many different samples of size k from n numbers without replacement.

1By definition: 0! = 1. n! = n(n −1)(n −2)...1.

slide-74
SLIDE 74

Permutations.

How many 10 digit numbers without repeating a digit? 10 ways for first, 9 ways for second, 8 ways for third, ... ... 10∗9∗8···∗1 = 10!.1 How many different samples of size k from n numbers without replacement. n ways for first choice,

1By definition: 0! = 1. n! = n(n −1)(n −2)...1.

slide-75
SLIDE 75

Permutations.

How many 10 digit numbers without repeating a digit? 10 ways for first, 9 ways for second, 8 ways for third, ... ... 10∗9∗8···∗1 = 10!.1 How many different samples of size k from n numbers without replacement. n ways for first choice, n −1 ways for second,

1By definition: 0! = 1. n! = n(n −1)(n −2)...1.

slide-76
SLIDE 76

Permutations.

How many 10 digit numbers without repeating a digit? 10 ways for first, 9 ways for second, 8 ways for third, ... ... 10∗9∗8···∗1 = 10!.1 How many different samples of size k from n numbers without replacement. n ways for first choice, n −1 ways for second, n −2 choices for third,

1By definition: 0! = 1. n! = n(n −1)(n −2)...1.

slide-77
SLIDE 77

Permutations.

How many 10 digit numbers without repeating a digit? 10 ways for first, 9 ways for second, 8 ways for third, ... ... 10∗9∗8···∗1 = 10!.1 How many different samples of size k from n numbers without replacement. n ways for first choice, n −1 ways for second, n −2 choices for third, ...

1By definition: 0! = 1. n! = n(n −1)(n −2)...1.

slide-78
SLIDE 78

Permutations.

How many 10 digit numbers without repeating a digit? 10 ways for first, 9 ways for second, 8 ways for third, ... ... 10∗9∗8···∗1 = 10!.1 How many different samples of size k from n numbers without replacement. n ways for first choice, n −1 ways for second, n −2 choices for third, ... ... n ∗(n −1)∗(n −2)·∗(n −k +1) =

n! (n−k)!. 1By definition: 0! = 1. n! = n(n −1)(n −2)...1.

slide-79
SLIDE 79

Permutations.

How many 10 digit numbers without repeating a digit? 10 ways for first, 9 ways for second, 8 ways for third, ... ... 10∗9∗8···∗1 = 10!.1 How many different samples of size k from n numbers without replacement. n ways for first choice, n −1 ways for second, n −2 choices for third, ... ... n ∗(n −1)∗(n −2)·∗(n −k +1) =

n! (n−k)!.

How many orderings of n objects are there? Permutations of n objects.

1By definition: 0! = 1. n! = n(n −1)(n −2)...1.

slide-80
SLIDE 80

Permutations.

How many 10 digit numbers without repeating a digit? 10 ways for first, 9 ways for second, 8 ways for third, ... ... 10∗9∗8···∗1 = 10!.1 How many different samples of size k from n numbers without replacement. n ways for first choice, n −1 ways for second, n −2 choices for third, ... ... n ∗(n −1)∗(n −2)·∗(n −k +1) =

n! (n−k)!.

How many orderings of n objects are there? Permutations of n objects. n ways for first,

1By definition: 0! = 1. n! = n(n −1)(n −2)...1.

slide-81
SLIDE 81

Permutations.

How many 10 digit numbers without repeating a digit? 10 ways for first, 9 ways for second, 8 ways for third, ... ... 10∗9∗8···∗1 = 10!.1 How many different samples of size k from n numbers without replacement. n ways for first choice, n −1 ways for second, n −2 choices for third, ... ... n ∗(n −1)∗(n −2)·∗(n −k +1) =

n! (n−k)!.

How many orderings of n objects are there? Permutations of n objects. n ways for first, n −1 ways for second,

1By definition: 0! = 1. n! = n(n −1)(n −2)...1.

slide-82
SLIDE 82

Permutations.

How many 10 digit numbers without repeating a digit? 10 ways for first, 9 ways for second, 8 ways for third, ... ... 10∗9∗8···∗1 = 10!.1 How many different samples of size k from n numbers without replacement. n ways for first choice, n −1 ways for second, n −2 choices for third, ... ... n ∗(n −1)∗(n −2)·∗(n −k +1) =

n! (n−k)!.

How many orderings of n objects are there? Permutations of n objects. n ways for first, n −1 ways for second, n −2 ways for third,

1By definition: 0! = 1. n! = n(n −1)(n −2)...1.

slide-83
SLIDE 83

Permutations.

How many 10 digit numbers without repeating a digit? 10 ways for first, 9 ways for second, 8 ways for third, ... ... 10∗9∗8···∗1 = 10!.1 How many different samples of size k from n numbers without replacement. n ways for first choice, n −1 ways for second, n −2 choices for third, ... ... n ∗(n −1)∗(n −2)·∗(n −k +1) =

n! (n−k)!.

How many orderings of n objects are there? Permutations of n objects. n ways for first, n −1 ways for second, n −2 ways for third, ...

1By definition: 0! = 1. n! = n(n −1)(n −2)...1.

slide-84
SLIDE 84

Permutations.

How many 10 digit numbers without repeating a digit? 10 ways for first, 9 ways for second, 8 ways for third, ... ... 10∗9∗8···∗1 = 10!.1 How many different samples of size k from n numbers without replacement. n ways for first choice, n −1 ways for second, n −2 choices for third, ... ... n ∗(n −1)∗(n −2)·∗(n −k +1) =

n! (n−k)!.

How many orderings of n objects are there? Permutations of n objects. n ways for first, n −1 ways for second, n −2 ways for third, ... ... n ∗(n −1)∗(n −2)·∗1 = n!.

1By definition: 0! = 1. n! = n(n −1)(n −2)...1.

slide-85
SLIDE 85

One-to-One Functions.

slide-86
SLIDE 86

One-to-One Functions.

How many one-to-one functions from S to S.

slide-87
SLIDE 87

One-to-One Functions.

How many one-to-one functions from S to S. |S| choices for f(s1),

slide-88
SLIDE 88

One-to-One Functions.

How many one-to-one functions from S to S. |S| choices for f(s1), |S|−1 choices for f(s2), ...

slide-89
SLIDE 89

One-to-One Functions.

How many one-to-one functions from S to S. |S| choices for f(s1), |S|−1 choices for f(s2), ...

slide-90
SLIDE 90

One-to-One Functions.

How many one-to-one functions from S to S. |S| choices for f(s1), |S|−1 choices for f(s2), ... So total number is |S|×|S|−1···1 = |S|!

slide-91
SLIDE 91

One-to-One Functions.

How many one-to-one functions from S to S. |S| choices for f(s1), |S|−1 choices for f(s2), ... So total number is |S|×|S|−1···1 = |S|! A one-to-one function is a permutation!

slide-92
SLIDE 92

Counting sets..when order doesn’t matter.

How many poker hands?

2When each unordered object corresponds equal numbers of ordered

  • bjects.
slide-93
SLIDE 93

Counting sets..when order doesn’t matter.

How many poker hands? 52×51×50×49×48

2When each unordered object corresponds equal numbers of ordered

  • bjects.
slide-94
SLIDE 94

Counting sets..when order doesn’t matter.

How many poker hands? 52×51×50×49×48 ???

2When each unordered object corresponds equal numbers of ordered

  • bjects.
slide-95
SLIDE 95

Counting sets..when order doesn’t matter.

How many poker hands? 52×51×50×49×48 ??? Are A,K,Q,10,J of spades and 10,J,Q,K,A of spades the same?

2When each unordered object corresponds equal numbers of ordered

  • bjects.
slide-96
SLIDE 96

Counting sets..when order doesn’t matter.

How many poker hands? 52×51×50×49×48 ??? Are A,K,Q,10,J of spades and 10,J,Q,K,A of spades the same? Second Rule of Counting: If order doesn’t matter count ordered

  • bjects and then divide by number of orderings.2

2When each unordered object corresponds equal numbers of ordered

  • bjects.
slide-97
SLIDE 97

Counting sets..when order doesn’t matter.

How many poker hands? 52×51×50×49×48 ??? Are A,K,Q,10,J of spades and 10,J,Q,K,A of spades the same? Second Rule of Counting: If order doesn’t matter count ordered

  • bjects and then divide by number of orderings.2

Number of orderings for a poker hand: 5!.

2When each unordered object corresponds equal numbers of ordered

  • bjects.
slide-98
SLIDE 98

Counting sets..when order doesn’t matter.

How many poker hands? 52×51×50×49×48 ??? Are A,K,Q,10,J of spades and 10,J,Q,K,A of spades the same? Second Rule of Counting: If order doesn’t matter count ordered

  • bjects and then divide by number of orderings.2

Number of orderings for a poker hand: 5!. 52×51×50×49×48 5!

2When each unordered object corresponds equal numbers of ordered

  • bjects.
slide-99
SLIDE 99

Counting sets..when order doesn’t matter.

How many poker hands? 52×51×50×49×48 ??? Are A,K,Q,10,J of spades and 10,J,Q,K,A of spades the same? Second Rule of Counting: If order doesn’t matter count ordered

  • bjects and then divide by number of orderings.2

Number of orderings for a poker hand: 5!. 52×51×50×49×48 5! Can write as... 52! 5!×47!

2When each unordered object corresponds equal numbers of ordered

  • bjects.
slide-100
SLIDE 100

Counting sets..when order doesn’t matter.

How many poker hands? 52×51×50×49×48 ??? Are A,K,Q,10,J of spades and 10,J,Q,K,A of spades the same? Second Rule of Counting: If order doesn’t matter count ordered

  • bjects and then divide by number of orderings.2

Number of orderings for a poker hand: 5!. 52×51×50×49×48 5! Can write as... 52! 5!×47! Generic: ways to choose 5 out of 52 possibilities.

2When each unordered object corresponds equal numbers of ordered

  • bjects.
slide-101
SLIDE 101

When order doesn’t matter.

slide-102
SLIDE 102

When order doesn’t matter.

Choose 2 out of n?

slide-103
SLIDE 103

When order doesn’t matter.

Choose 2 out of n? n ×(n −1)

slide-104
SLIDE 104

When order doesn’t matter.

Choose 2 out of n? n ×(n −1) 2

slide-105
SLIDE 105

When order doesn’t matter.

Choose 2 out of n? n ×(n −1) 2 = n! (n −2)!×2

slide-106
SLIDE 106

When order doesn’t matter.

Choose 2 out of n? n ×(n −1) 2 = n! (n −2)!×2 Choose 3 out of n?

slide-107
SLIDE 107

When order doesn’t matter.

Choose 2 out of n? n ×(n −1) 2 = n! (n −2)!×2 Choose 3 out of n? n ×(n −1)×(n −2)

slide-108
SLIDE 108

When order doesn’t matter.

Choose 2 out of n? n ×(n −1) 2 = n! (n −2)!×2 Choose 3 out of n? n ×(n −1)×(n −2) 3!

slide-109
SLIDE 109

When order doesn’t matter.

Choose 2 out of n? n ×(n −1) 2 = n! (n −2)!×2 Choose 3 out of n? n ×(n −1)×(n −2) 3! = n! (n −3)!×3!

slide-110
SLIDE 110

When order doesn’t matter.

Choose 2 out of n? n ×(n −1) 2 = n! (n −2)!×2 Choose 3 out of n? n ×(n −1)×(n −2) 3! = n! (n −3)!×3! Choose k out of n? n! (n −k)!

slide-111
SLIDE 111

When order doesn’t matter.

Choose 2 out of n? n ×(n −1) 2 = n! (n −2)!×2 Choose 3 out of n? n ×(n −1)×(n −2) 3! = n! (n −3)!×3! Choose k out of n? n! (n −k)!

slide-112
SLIDE 112

When order doesn’t matter.

Choose 2 out of n? n ×(n −1) 2 = n! (n −2)!×2 Choose 3 out of n? n ×(n −1)×(n −2) 3! = n! (n −3)!×3! Choose k out of n? n! (n −k)!×k!

slide-113
SLIDE 113

When order doesn’t matter.

Choose 2 out of n? n ×(n −1) 2 = n! (n −2)!×2 Choose 3 out of n? n ×(n −1)×(n −2) 3! = n! (n −3)!×3! Choose k out of n? n! (n −k)!×k! Notation: n

k

  • and pronounced “n choose k.”
slide-114
SLIDE 114

Simple Practice.

How many orderings of letters of CAT? 3 ways to choose first letter, 2 ways to choose second, 1 for last. = ⇒ 3×2×1 = 3! orderings How many orderings of the letters in ANAGRAM? Ordered, except for A! total orderings of 7 letters. 7! total “extra counts” or orderings of two A’s? 3! Total orderings? 7!

3!

How many orderings of MISSISSIPPI? 4 S’s, 4 I’s, 2 P’s. 11 letters total! 11! ordered objects! 4!×4!×2! ordered objects per “unordered object” = ⇒

11! 4!4!2!.

slide-115
SLIDE 115

Sampling...

Sample k items out of n

slide-116
SLIDE 116

Sampling...

Sample k items out of n Without replacement:

slide-117
SLIDE 117

Sampling...

Sample k items out of n Without replacement: Order matters:

slide-118
SLIDE 118

Sampling...

Sample k items out of n Without replacement: Order matters: n ×

slide-119
SLIDE 119

Sampling...

Sample k items out of n Without replacement: Order matters: n ×n −1×n −2...

slide-120
SLIDE 120

Sampling...

Sample k items out of n Without replacement: Order matters: n ×n −1×n −2... ×n −k +1

slide-121
SLIDE 121

Sampling...

Sample k items out of n Without replacement: Order matters: n ×n −1×n −2... ×n −k +1 =

n! (n−k)!

Order does not matter:

slide-122
SLIDE 122

Sampling...

Sample k items out of n Without replacement: Order matters: n ×n −1×n −2... ×n −k +1 =

n! (n−k)!

Order does not matter: Second Rule: divide by number of orders

slide-123
SLIDE 123

Sampling...

Sample k items out of n Without replacement: Order matters: n ×n −1×n −2... ×n −k +1 =

n! (n−k)!

Order does not matter: Second Rule: divide by number of orders – “k!”

slide-124
SLIDE 124

Sampling...

Sample k items out of n Without replacement: Order matters: n ×n −1×n −2... ×n −k +1 =

n! (n−k)!

Order does not matter: Second Rule: divide by number of orders – “k!” = ⇒

n! (n−k)!k!.

slide-125
SLIDE 125

Sampling...

Sample k items out of n Without replacement: Order matters: n ×n −1×n −2... ×n −k +1 =

n! (n−k)!

Order does not matter: Second Rule: divide by number of orders – “k!” = ⇒

n! (n−k)!k!.

“n choose k”

slide-126
SLIDE 126

Sampling...

Sample k items out of n Without replacement: Order matters: n ×n −1×n −2... ×n −k +1 =

n! (n−k)!

Order does not matter: Second Rule: divide by number of orders – “k!” = ⇒

n! (n−k)!k!.

“n choose k” With Replacement.

slide-127
SLIDE 127

Sampling...

Sample k items out of n Without replacement: Order matters: n ×n −1×n −2... ×n −k +1 =

n! (n−k)!

Order does not matter: Second Rule: divide by number of orders – “k!” = ⇒

n! (n−k)!k!.

“n choose k” With Replacement. Order matters: n

slide-128
SLIDE 128

Sampling...

Sample k items out of n Without replacement: Order matters: n ×n −1×n −2... ×n −k +1 =

n! (n−k)!

Order does not matter: Second Rule: divide by number of orders – “k!” = ⇒

n! (n−k)!k!.

“n choose k” With Replacement. Order matters: n ×n

slide-129
SLIDE 129

Sampling...

Sample k items out of n Without replacement: Order matters: n ×n −1×n −2... ×n −k +1 =

n! (n−k)!

Order does not matter: Second Rule: divide by number of orders – “k!” = ⇒

n! (n−k)!k!.

“n choose k” With Replacement. Order matters: n ×n ×...n

slide-130
SLIDE 130

Sampling...

Sample k items out of n Without replacement: Order matters: n ×n −1×n −2... ×n −k +1 =

n! (n−k)!

Order does not matter: Second Rule: divide by number of orders – “k!” = ⇒

n! (n−k)!k!.

“n choose k” With Replacement. Order matters: n ×n ×...n = nk

slide-131
SLIDE 131

Sampling...

Sample k items out of n Without replacement: Order matters: n ×n −1×n −2... ×n −k +1 =

n! (n−k)!

Order does not matter: Second Rule: divide by number of orders – “k!” = ⇒

n! (n−k)!k!.

“n choose k” With Replacement. Order matters: n ×n ×...n = nk Order does not matter:

slide-132
SLIDE 132

Sampling...

Sample k items out of n Without replacement: Order matters: n ×n −1×n −2... ×n −k +1 =

n! (n−k)!

Order does not matter: Second Rule: divide by number of orders – “k!” = ⇒

n! (n−k)!k!.

“n choose k” With Replacement. Order matters: n ×n ×...n = nk Order does not matter: Second rule

slide-133
SLIDE 133

Sampling...

Sample k items out of n Without replacement: Order matters: n ×n −1×n −2... ×n −k +1 =

n! (n−k)!

Order does not matter: Second Rule: divide by number of orders – “k!” = ⇒

n! (n−k)!k!.

“n choose k” With Replacement. Order matters: n ×n ×...n = nk Order does not matter: Second rule ???

slide-134
SLIDE 134

Sampling...

Sample k items out of n Without replacement: Order matters: n ×n −1×n −2... ×n −k +1 =

n! (n−k)!

Order does not matter: Second Rule: divide by number of orders – “k!” = ⇒

n! (n−k)!k!.

“n choose k” With Replacement. Order matters: n ×n ×...n = nk Order does not matter: Second rule ???

slide-135
SLIDE 135

Sampling...

Sample k items out of n Without replacement: Order matters: n ×n −1×n −2... ×n −k +1 =

n! (n−k)!

Order does not matter: Second Rule: divide by number of orders – “k!” = ⇒

n! (n−k)!k!.

“n choose k” With Replacement. Order matters: n ×n ×...n = nk Order does not matter: Second rule ??? Problem: depends on how many of each item we chose!

slide-136
SLIDE 136

Sampling...

Sample k items out of n Without replacement: Order matters: n ×n −1×n −2... ×n −k +1 =

n! (n−k)!

Order does not matter: Second Rule: divide by number of orders – “k!” = ⇒

n! (n−k)!k!.

“n choose k” With Replacement. Order matters: n ×n ×...n = nk Order does not matter: Second rule ??? Problem: depends on how many of each item we chose!

slide-137
SLIDE 137

Sampling...

Sample k items out of n Without replacement: Order matters: n ×n −1×n −2... ×n −k +1 =

n! (n−k)!

Order does not matter: Second Rule: divide by number of orders – “k!” = ⇒

n! (n−k)!k!.

“n choose k” With Replacement. Order matters: n ×n ×...n = nk Order does not matter: Second rule ??? Problem: depends on how many of each item we chose! Set: 1,2,3

slide-138
SLIDE 138

Sampling...

Sample k items out of n Without replacement: Order matters: n ×n −1×n −2... ×n −k +1 =

n! (n−k)!

Order does not matter: Second Rule: divide by number of orders – “k!” = ⇒

n! (n−k)!k!.

“n choose k” With Replacement. Order matters: n ×n ×...n = nk Order does not matter: Second rule ??? Problem: depends on how many of each item we chose! Set: 1,2,3 3! orderings map to it.

slide-139
SLIDE 139

Sampling...

Sample k items out of n Without replacement: Order matters: n ×n −1×n −2... ×n −k +1 =

n! (n−k)!

Order does not matter: Second Rule: divide by number of orders – “k!” = ⇒

n! (n−k)!k!.

“n choose k” With Replacement. Order matters: n ×n ×...n = nk Order does not matter: Second rule ??? Problem: depends on how many of each item we chose! Set: 1,2,3 3! orderings map to it. Set: 1,2,2

slide-140
SLIDE 140

Sampling...

Sample k items out of n Without replacement: Order matters: n ×n −1×n −2... ×n −k +1 =

n! (n−k)!

Order does not matter: Second Rule: divide by number of orders – “k!” = ⇒

n! (n−k)!k!.

“n choose k” With Replacement. Order matters: n ×n ×...n = nk Order does not matter: Second rule ??? Problem: depends on how many of each item we chose! Set: 1,2,3 3! orderings map to it. Set: 1,2,2

3! 2! orderings map to it.

slide-141
SLIDE 141

Sampling...

Sample k items out of n Without replacement: Order matters: n ×n −1×n −2... ×n −k +1 =

n! (n−k)!

Order does not matter: Second Rule: divide by number of orders – “k!” = ⇒

n! (n−k)!k!.

“n choose k” With Replacement. Order matters: n ×n ×...n = nk Order does not matter: Second rule ??? Problem: depends on how many of each item we chose! Set: 1,2,3 3! orderings map to it. Set: 1,2,2

3! 2! orderings map to it.

slide-142
SLIDE 142

Sampling...

Sample k items out of n Without replacement: Order matters: n ×n −1×n −2... ×n −k +1 =

n! (n−k)!

Order does not matter: Second Rule: divide by number of orders – “k!” = ⇒

n! (n−k)!k!.

“n choose k” With Replacement. Order matters: n ×n ×...n = nk Order does not matter: Second rule ??? Problem: depends on how many of each item we chose! Set: 1,2,3 3! orderings map to it. Set: 1,2,2

3! 2! orderings map to it.

How do we deal with this situation?!?!

slide-143
SLIDE 143

Stars and bars....

How many ways can Bob and Alice split 5 dollars?

slide-144
SLIDE 144

Stars and bars....

How many ways can Bob and Alice split 5 dollars? For each of 5 dollars pick Bob or Alice(25), divide out order

slide-145
SLIDE 145

Stars and bars....

How many ways can Bob and Alice split 5 dollars? For each of 5 dollars pick Bob or Alice(25), divide out order ???

slide-146
SLIDE 146

Stars and bars....

How many ways can Bob and Alice split 5 dollars? For each of 5 dollars pick Bob or Alice(25), divide out order ??? 5 dollars for Bob and 0 for Alice:

slide-147
SLIDE 147

Stars and bars....

How many ways can Bob and Alice split 5 dollars? For each of 5 dollars pick Bob or Alice(25), divide out order ??? 5 dollars for Bob and 0 for Alice:

  • ne ordered set: (B,B,B,B,B).
slide-148
SLIDE 148

Stars and bars....

How many ways can Bob and Alice split 5 dollars? For each of 5 dollars pick Bob or Alice(25), divide out order ??? 5 dollars for Bob and 0 for Alice:

  • ne ordered set: (B,B,B,B,B).

4 for Bob and 1 for Alice:

slide-149
SLIDE 149

Stars and bars....

How many ways can Bob and Alice split 5 dollars? For each of 5 dollars pick Bob or Alice(25), divide out order ??? 5 dollars for Bob and 0 for Alice:

  • ne ordered set: (B,B,B,B,B).

4 for Bob and 1 for Alice: 5 ordered sets: (A,B,B,B,B) ; (B,A,B,B,B); ...

slide-150
SLIDE 150

Stars and bars....

How many ways can Bob and Alice split 5 dollars? For each of 5 dollars pick Bob or Alice(25), divide out order ??? 5 dollars for Bob and 0 for Alice:

  • ne ordered set: (B,B,B,B,B).

4 for Bob and 1 for Alice: 5 ordered sets: (A,B,B,B,B) ; (B,A,B,B,B); ... Well, we can list the possibilities. 0+5, 1+4,2+3, 3+2, 4+1, 5+0.

slide-151
SLIDE 151

Stars and bars....

How many ways can Bob and Alice split 5 dollars? For each of 5 dollars pick Bob or Alice(25), divide out order ??? 5 dollars for Bob and 0 for Alice:

  • ne ordered set: (B,B,B,B,B).

4 for Bob and 1 for Alice: 5 ordered sets: (A,B,B,B,B) ; (B,A,B,B,B); ... Well, we can list the possibilities. 0+5, 1+4,2+3, 3+2, 4+1, 5+0. For 2 numbers adding to k, we get k +1.

slide-152
SLIDE 152

Stars and bars....

How many ways can Bob and Alice split 5 dollars? For each of 5 dollars pick Bob or Alice(25), divide out order ??? 5 dollars for Bob and 0 for Alice:

  • ne ordered set: (B,B,B,B,B).

4 for Bob and 1 for Alice: 5 ordered sets: (A,B,B,B,B) ; (B,A,B,B,B); ... Well, we can list the possibilities. 0+5, 1+4,2+3, 3+2, 4+1, 5+0. For 2 numbers adding to k, we get k +1. For 3 numbers adding to k?

slide-153
SLIDE 153

Stars and Bars.

How many ways to add up n numbers to equal k?

slide-154
SLIDE 154

Stars and Bars.

How many ways to add up n numbers to equal k? Or: k choices from set of n possibilities with replacement. Sample with replacement where order just doesn’t matter.

slide-155
SLIDE 155

Stars and Bars.

How many ways to add up n numbers to equal k? Or: k choices from set of n possibilities with replacement. Sample with replacement where order just doesn’t matter. How many ways can Alice, Bob, and Eve split 5 dollars.

slide-156
SLIDE 156

Stars and Bars.

How many ways to add up n numbers to equal k? Or: k choices from set of n possibilities with replacement. Sample with replacement where order just doesn’t matter. How many ways can Alice, Bob, and Eve split 5 dollars. Think of Five dollars as Five stars: ⋆⋆⋆⋆⋆.

slide-157
SLIDE 157

Stars and Bars.

How many ways to add up n numbers to equal k? Or: k choices from set of n possibilities with replacement. Sample with replacement where order just doesn’t matter. How many ways can Alice, Bob, and Eve split 5 dollars. Think of Five dollars as Five stars: ⋆⋆⋆⋆⋆. Alice: 2, Bob: 1, Eve: 2.

slide-158
SLIDE 158

Stars and Bars.

How many ways to add up n numbers to equal k? Or: k choices from set of n possibilities with replacement. Sample with replacement where order just doesn’t matter. How many ways can Alice, Bob, and Eve split 5 dollars. Think of Five dollars as Five stars: ⋆⋆⋆⋆⋆. Alice: 2, Bob: 1, Eve: 2. Stars and Bars: ⋆⋆|

slide-159
SLIDE 159

Stars and Bars.

How many ways to add up n numbers to equal k? Or: k choices from set of n possibilities with replacement. Sample with replacement where order just doesn’t matter. How many ways can Alice, Bob, and Eve split 5 dollars. Think of Five dollars as Five stars: ⋆⋆⋆⋆⋆. Alice: 2, Bob: 1, Eve: 2. Stars and Bars: ⋆⋆|⋆|

slide-160
SLIDE 160

Stars and Bars.

How many ways to add up n numbers to equal k? Or: k choices from set of n possibilities with replacement. Sample with replacement where order just doesn’t matter. How many ways can Alice, Bob, and Eve split 5 dollars. Think of Five dollars as Five stars: ⋆⋆⋆⋆⋆. Alice: 2, Bob: 1, Eve: 2. Stars and Bars: ⋆⋆|⋆|⋆⋆.

slide-161
SLIDE 161

Stars and Bars.

How many ways to add up n numbers to equal k? Or: k choices from set of n possibilities with replacement. Sample with replacement where order just doesn’t matter. How many ways can Alice, Bob, and Eve split 5 dollars. Think of Five dollars as Five stars: ⋆⋆⋆⋆⋆. Alice: 2, Bob: 1, Eve: 2. Stars and Bars: ⋆⋆|⋆|⋆⋆. Alice: 0, Bob: 1, Eve: 4.

slide-162
SLIDE 162

Stars and Bars.

How many ways to add up n numbers to equal k? Or: k choices from set of n possibilities with replacement. Sample with replacement where order just doesn’t matter. How many ways can Alice, Bob, and Eve split 5 dollars. Think of Five dollars as Five stars: ⋆⋆⋆⋆⋆. Alice: 2, Bob: 1, Eve: 2. Stars and Bars: ⋆⋆|⋆|⋆⋆. Alice: 0, Bob: 1, Eve: 4. Stars and Bars: |

slide-163
SLIDE 163

Stars and Bars.

How many ways to add up n numbers to equal k? Or: k choices from set of n possibilities with replacement. Sample with replacement where order just doesn’t matter. How many ways can Alice, Bob, and Eve split 5 dollars. Think of Five dollars as Five stars: ⋆⋆⋆⋆⋆. Alice: 2, Bob: 1, Eve: 2. Stars and Bars: ⋆⋆|⋆|⋆⋆. Alice: 0, Bob: 1, Eve: 4. Stars and Bars: |⋆|

slide-164
SLIDE 164

Stars and Bars.

How many ways to add up n numbers to equal k? Or: k choices from set of n possibilities with replacement. Sample with replacement where order just doesn’t matter. How many ways can Alice, Bob, and Eve split 5 dollars. Think of Five dollars as Five stars: ⋆⋆⋆⋆⋆. Alice: 2, Bob: 1, Eve: 2. Stars and Bars: ⋆⋆|⋆|⋆⋆. Alice: 0, Bob: 1, Eve: 4. Stars and Bars: |⋆|⋆⋆⋆⋆.

slide-165
SLIDE 165

Stars and Bars.

How many ways to add up n numbers to equal k? Or: k choices from set of n possibilities with replacement. Sample with replacement where order just doesn’t matter. How many ways can Alice, Bob, and Eve split 5 dollars. Think of Five dollars as Five stars: ⋆⋆⋆⋆⋆. Alice: 2, Bob: 1, Eve: 2. Stars and Bars: ⋆⋆|⋆|⋆⋆. Alice: 0, Bob: 1, Eve: 4. Stars and Bars: |⋆|⋆⋆⋆⋆. Each split = ⇒ a sequence of stars and bars.

slide-166
SLIDE 166

Stars and Bars.

How many ways to add up n numbers to equal k? Or: k choices from set of n possibilities with replacement. Sample with replacement where order just doesn’t matter. How many ways can Alice, Bob, and Eve split 5 dollars. Think of Five dollars as Five stars: ⋆⋆⋆⋆⋆. Alice: 2, Bob: 1, Eve: 2. Stars and Bars: ⋆⋆|⋆|⋆⋆. Alice: 0, Bob: 1, Eve: 4. Stars and Bars: |⋆|⋆⋆⋆⋆. Each split = ⇒ a sequence of stars and bars. Each sequence of stars and bars = ⇒ a split.

slide-167
SLIDE 167

Stars and Bars.

How many ways to add up n numbers to equal k? Or: k choices from set of n possibilities with replacement. Sample with replacement where order just doesn’t matter. How many ways can Alice, Bob, and Eve split 5 dollars. Think of Five dollars as Five stars: ⋆⋆⋆⋆⋆. Alice: 2, Bob: 1, Eve: 2. Stars and Bars: ⋆⋆|⋆|⋆⋆. Alice: 0, Bob: 1, Eve: 4. Stars and Bars: |⋆|⋆⋆⋆⋆. Each split = ⇒ a sequence of stars and bars. Each sequence of stars and bars = ⇒ a split.

slide-168
SLIDE 168

Stars and Bars.

How many ways to add up n numbers to equal k? Or: k choices from set of n possibilities with replacement. Sample with replacement where order just doesn’t matter. How many ways can Alice, Bob, and Eve split 5 dollars. Think of Five dollars as Five stars: ⋆⋆⋆⋆⋆. Alice: 2, Bob: 1, Eve: 2. Stars and Bars: ⋆⋆|⋆|⋆⋆. Alice: 0, Bob: 1, Eve: 4. Stars and Bars: |⋆|⋆⋆⋆⋆. Each split = ⇒ a sequence of stars and bars. Each sequence of stars and bars = ⇒ a split. Counting Rule: if there is a one-to-one mapping between two sets they have the same size!

slide-169
SLIDE 169

Stars and Bars.

How many different 5 star and 2 bar diagrams?

slide-170
SLIDE 170

Stars and Bars.

How many different 5 star and 2 bar diagrams? 7 positions in which to place the 2 bars.

slide-171
SLIDE 171

Stars and Bars.

How many different 5 star and 2 bar diagrams? 7 positions in which to place the 2 bars. 7

2

  • ways to do so and
slide-172
SLIDE 172

Stars and Bars.

How many different 5 star and 2 bar diagrams? 7 positions in which to place the 2 bars. 7

2

  • ways to do so and

7

2

  • ways to split 5$ among 3 people.
slide-173
SLIDE 173

Stars and Bars.

How many different 5 star and 2 bar diagrams? 7 positions in which to place the 2 bars. 7

2

  • ways to do so and

7

2

  • ways to split 5$ among 3 people.

Ways to add up n numbers to sum to k?

slide-174
SLIDE 174

Stars and Bars.

How many different 5 star and 2 bar diagrams? 7 positions in which to place the 2 bars. 7

2

  • ways to do so and

7

2

  • ways to split 5$ among 3 people.

Ways to add up n numbers to sum to k? or “ k from n with replacement where order doesn’t matter.”

slide-175
SLIDE 175

Stars and Bars.

How many different 5 star and 2 bar diagrams? 7 positions in which to place the 2 bars. 7

2

  • ways to do so and

7

2

  • ways to split 5$ among 3 people.

Ways to add up n numbers to sum to k? or “ k from n with replacement where order doesn’t matter.” In general, k stars n −1 bars. ⋆⋆|⋆|···|⋆⋆.

slide-176
SLIDE 176

Stars and Bars.

How many different 5 star and 2 bar diagrams? 7 positions in which to place the 2 bars. 7

2

  • ways to do so and

7

2

  • ways to split 5$ among 3 people.

Ways to add up n numbers to sum to k? or “ k from n with replacement where order doesn’t matter.” In general, k stars n −1 bars. ⋆⋆|⋆|···|⋆⋆. n +k −1 positions from which to choose n −1 bar positions.

slide-177
SLIDE 177

Stars and Bars.

How many different 5 star and 2 bar diagrams? 7 positions in which to place the 2 bars. 7

2

  • ways to do so and

7

2

  • ways to split 5$ among 3 people.

Ways to add up n numbers to sum to k? or “ k from n with replacement where order doesn’t matter.” In general, k stars n −1 bars. ⋆⋆|⋆|···|⋆⋆. n +k −1 positions from which to choose n −1 bar positions. n +k −1 n −1

slide-178
SLIDE 178

Simple Inclusion/Exclusion

Sum Rule: For disjoint sets S and T, |S ∪T| = |S|+|T|

slide-179
SLIDE 179

Simple Inclusion/Exclusion

Sum Rule: For disjoint sets S and T, |S ∪T| = |S|+|T| Inclusion/Exclusion Rule: For any S and T, |S ∪T| = |S|+|T|−|S ∩T|.

slide-180
SLIDE 180

Simple Inclusion/Exclusion

Sum Rule: For disjoint sets S and T, |S ∪T| = |S|+|T| Inclusion/Exclusion Rule: For any S and T, |S ∪T| = |S|+|T|−|S ∩T|. Example: How many 10-digit phone numbers have 7 as their first or second digit?

slide-181
SLIDE 181

Simple Inclusion/Exclusion

Sum Rule: For disjoint sets S and T, |S ∪T| = |S|+|T| Inclusion/Exclusion Rule: For any S and T, |S ∪T| = |S|+|T|−|S ∩T|. Example: How many 10-digit phone numbers have 7 as their first or second digit? S = phone numbers with 7 as first digit.

slide-182
SLIDE 182

Simple Inclusion/Exclusion

Sum Rule: For disjoint sets S and T, |S ∪T| = |S|+|T| Inclusion/Exclusion Rule: For any S and T, |S ∪T| = |S|+|T|−|S ∩T|. Example: How many 10-digit phone numbers have 7 as their first or second digit? S = phone numbers with 7 as first digit.|S| = 109

slide-183
SLIDE 183

Simple Inclusion/Exclusion

Sum Rule: For disjoint sets S and T, |S ∪T| = |S|+|T| Inclusion/Exclusion Rule: For any S and T, |S ∪T| = |S|+|T|−|S ∩T|. Example: How many 10-digit phone numbers have 7 as their first or second digit? S = phone numbers with 7 as first digit.|S| = 109 T = phone numbers with 7 as second digit.

slide-184
SLIDE 184

Simple Inclusion/Exclusion

Sum Rule: For disjoint sets S and T, |S ∪T| = |S|+|T| Inclusion/Exclusion Rule: For any S and T, |S ∪T| = |S|+|T|−|S ∩T|. Example: How many 10-digit phone numbers have 7 as their first or second digit? S = phone numbers with 7 as first digit.|S| = 109 T = phone numbers with 7 as second digit. |T| = 109.

slide-185
SLIDE 185

Simple Inclusion/Exclusion

Sum Rule: For disjoint sets S and T, |S ∪T| = |S|+|T| Inclusion/Exclusion Rule: For any S and T, |S ∪T| = |S|+|T|−|S ∩T|. Example: How many 10-digit phone numbers have 7 as their first or second digit? S = phone numbers with 7 as first digit.|S| = 109 T = phone numbers with 7 as second digit. |T| = 109. S ∩T = phone numbers with 7 as first and second digit.

slide-186
SLIDE 186

Simple Inclusion/Exclusion

Sum Rule: For disjoint sets S and T, |S ∪T| = |S|+|T| Inclusion/Exclusion Rule: For any S and T, |S ∪T| = |S|+|T|−|S ∩T|. Example: How many 10-digit phone numbers have 7 as their first or second digit? S = phone numbers with 7 as first digit.|S| = 109 T = phone numbers with 7 as second digit. |T| = 109. S ∩T = phone numbers with 7 as first and second digit. |S ∩T| = 108.

slide-187
SLIDE 187

Simple Inclusion/Exclusion

Sum Rule: For disjoint sets S and T, |S ∪T| = |S|+|T| Inclusion/Exclusion Rule: For any S and T, |S ∪T| = |S|+|T|−|S ∩T|. Example: How many 10-digit phone numbers have 7 as their first or second digit? S = phone numbers with 7 as first digit.|S| = 109 T = phone numbers with 7 as second digit. |T| = 109. S ∩T = phone numbers with 7 as first and second digit. |S ∩T| = 108. Answer: |S|+|T|−|S ∩T| = 109 +109 −108.

slide-188
SLIDE 188

Summary.

First rule: n1 ×n2 ···×n3.

slide-189
SLIDE 189

Summary.

First rule: n1 ×n2 ···×n3. k Samples with replacement from n items: nk.

slide-190
SLIDE 190

Summary.

First rule: n1 ×n2 ···×n3. k Samples with replacement from n items: nk. Sample without replacement:

n! (n−k)!

slide-191
SLIDE 191

Summary.

First rule: n1 ×n2 ···×n3. k Samples with replacement from n items: nk. Sample without replacement:

n! (n−k)!

Second rule: when order doesn’t matter divide..when possible.

slide-192
SLIDE 192

Summary.

First rule: n1 ×n2 ···×n3. k Samples with replacement from n items: nk. Sample without replacement:

n! (n−k)!

Second rule: when order doesn’t matter divide..when possible. Sample without replacement and order doesn’t matter: n

k

  • =

n! (n−k)!k!.

“n choose k”

slide-193
SLIDE 193

Summary.

First rule: n1 ×n2 ···×n3. k Samples with replacement from n items: nk. Sample without replacement:

n! (n−k)!

Second rule: when order doesn’t matter divide..when possible. Sample without replacement and order doesn’t matter: n

k

  • =

n! (n−k)!k!.

“n choose k” One-to-one rule: equal in number if one-to-one correspondence.

slide-194
SLIDE 194

Summary.

First rule: n1 ×n2 ···×n3. k Samples with replacement from n items: nk. Sample without replacement:

n! (n−k)!

Second rule: when order doesn’t matter divide..when possible. Sample without replacement and order doesn’t matter: n

k

  • =

n! (n−k)!k!.

“n choose k” One-to-one rule: equal in number if one-to-one correspondence. Sample with replacement and order doesn’t matter: k+n−1

n

  • .
slide-195
SLIDE 195

Summary.

First rule: n1 ×n2 ···×n3. k Samples with replacement from n items: nk. Sample without replacement:

n! (n−k)!

Second rule: when order doesn’t matter divide..when possible. Sample without replacement and order doesn’t matter: n

k

  • =

n! (n−k)!k!.

“n choose k” One-to-one rule: equal in number if one-to-one correspondence. Sample with replacement and order doesn’t matter: k+n−1

n

  • .

Sum Rule: For disjoint sets S and T, |S ∪T| = |S|+|T|

slide-196
SLIDE 196

Summary.

First rule: n1 ×n2 ···×n3. k Samples with replacement from n items: nk. Sample without replacement:

n! (n−k)!

Second rule: when order doesn’t matter divide..when possible. Sample without replacement and order doesn’t matter: n

k

  • =

n! (n−k)!k!.

“n choose k” One-to-one rule: equal in number if one-to-one correspondence. Sample with replacement and order doesn’t matter: k+n−1

n

  • .

Sum Rule: For disjoint sets S and T, |S ∪T| = |S|+|T| Inclusion/Exclusion Rule: For any S and T, |S ∪T| = |S|+|T|−|S ∩T|.