0% found this document useful (0 votes)
26 views5 pages

Lecture Combinatorics3 6up

This document discusses combinations with repetition, which allows counting the number of ways to choose r objects from n kinds of objects when the same object can be chosen multiple times. It provides examples like counting ice cream scoop combinations and cash bill selections. The key formula presented is that the number of combinations with repetition of choosing r objects from n kinds is (n+r-1)!/(r!(n-1)!). Later examples involve counting integer solutions to equations.

Uploaded by

josiahusman72
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views5 pages

Lecture Combinatorics3 6up

This document discusses combinations with repetition, which allows counting the number of ways to choose r objects from n kinds of objects when the same object can be chosen multiple times. It provides examples like counting ice cream scoop combinations and cash bill selections. The key formula presented is that the number of combinations with repetition of choosing r objects from n kinds is (n+r-1)!/(r!(n-1)!). Later examples involve counting integer solutions to equations.

Uploaded by

josiahusman72
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Combinations with Repetition

I Combinations help us to answer the question ”In how many


ways can we choose r objects from n objects?”
CS311H: Discrete Mathematics
I Now, consider the slightly different question: ”In how many
ways can we choose r objects from n kinds of objects?
Combinatorics 3
I These questions are quite different:
Instructor: Işıl Dillig
I For first question, once we pick one of the n objects, we
cannot pick the same object again

I For second question, once we pick one of the n kinds of


objects, we can pick the same type of object again!

I Combination with repetition allows answering the latter type


of question!

Instructor: Işıl Dillig, CS311H: Discrete Mathematics Combinatorics 3 1/26 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Combinatorics 3 2/26

Example Example, cont.

I An ice cream dessert consists of three scoops of ice cream

I Each scoop can be one of the flavors: chocolate, vanilla, mint,


lemon, raspberry C V M R L

I In how many different ways can you pick your dessert?

I Example of combination with repetition: ”In how many ways I To solve problem, imagine we have ice cream in boxes.
can we pick 3 objects from 5 kinds of objects?”
I We start with leftmost box, and proceed towards right.
I Caveat: Despite looking deceptively simple, quite difficult to
figure this out (at least for me...) I At every box, you can take 0-3 scoops, and then move to next.

I Denote taking a scoop by ◦ and moving to next box by →

Instructor: Işıl Dillig, CS311H: Discrete Mathematics Combinatorics 3 3/26 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Combinatorics 3 4/26

Example, cont. Result

C V M R L I We’ll denote the number of ways to choose r objects from n


kinds of objects C ∗ (n, r ):
 
n +r −1
I Let’s look at some selections and their representation: C ∗ (n, r ) =
r
I 3 scoops of chocolate: ◦ ◦ ◦ →→→→
I Example: In how many ways can we choose 3 scoops of ice
I 1 vanilla, 1 raspberry, 1 lemon: → ◦ →→ ◦ → ◦ cream from 5 different flavors?

I 2 mint, 1 raspberry: →→ ◦◦ → ◦ → I Here, r = 3 and n = 5. Thus:


 
I
7 7!
Invariant: r circles and n − 1 arrows (here, r = 3, n = 5) = = 35
3 3! · 4!
I Our question is equivalent to: ”In how many ways can we
arrange r circles and n − 1 arrows?”
Instructor: Işıl Dillig, CS311H: Discrete Mathematics Combinatorics 3 5/26 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Combinatorics 3 6/26
Example 1 Example 2

I Consider a cash box containing $1 bills, $2 bills, $5 bills, $10


I Suppose there is a bowl containing apples, oranges, and pears
bills, $20 bills, $50 bills, and $100 bills
I There is at least four of each type of fruit in the bowl
I There is at least five of each type of bill in the box
I How many ways to select four pieces of fruit from this bowl?
I How many ways are there to select 5 bills from this cash box?
I
I

Instructor: Işıl Dillig, CS311H: Discrete Mathematics Combinatorics 3 7/26 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Combinatorics 3 8/26

Example 3 Example 4

I Suppose x1 , x2 , x3 are integers s.t. x1 ≥ 1, x2 ≥ 2, x3 ≥ 3.


I Assuming x1 , x2 , x3 are non-negative integers, how many
I Then, how many solutions does x1 + x2 + x3 = 11 have?
solutions does x1 + x2 + x3 = 11 have?

I I

I I

Instructor: Işıl Dillig, CS311H: Discrete Mathematics Combinatorics 3 9/26 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Combinatorics 3 10/26

Summary of Different Permuations and Combinations Permutations with Indistinguishable Objects

Order matters? Question: How many ways to pick r objects from . . . I How many different strings can be made by reordering the
n objects n types of objects
letters in the word ALL?
Permutation Permutation w/ repetition
I This is not given by 3! because some of the letters in this
Yes
P (n, r ) = n!
(n−r )! P ∗ (n, r ) = n r word are the same

I Different strings: ALL, LAL, LLA ⇒ 3 possibilities, not 6


Combination Combination w/ repetition because relative ordering of L’s doesn’t matter
No
n! (n+r −1)!
C (n, r ) = r !·(n−r )! C ∗ (n, r ) = r !·(n−1)! I In general, how can we compute the number of permutations
of n objects where some of them are indistinguishable?

Instructor: Işıl Dillig, CS311H: Discrete Mathematics Combinatorics 3 11/26 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Combinatorics 3 12/26
Permutations with Indistinguishable Objects, cont. Proof

I Consider n objects such that:


I n1 of them indistingishable of type 1 I Let’s decompose using product rule:
I n2 of them indistingishable of type 2 I First, place all n1 objects of type 1

I ... I Then all n2 objects of type 2 etc.

I nk of them indistinguishable of type k I How many ways to place n1 indistinguishable objects in n


slots?
I The number of permutations in this case is given by:
I
n!
n1 !n2 ! . . . nk !

Instructor: Işıl Dillig, CS311H: Discrete Mathematics Combinatorics 3 13/26 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Combinatorics 3 14/26

Proof, cont. Proof, cont.


 
    kP
−1
n n − n1 n − n
· ... i=1
i 
n1 n2
I Now, how many ways to place n2 objects of type 2? nk

I I Let’s expand this definition:

I Continuing this way and using product rule, number of


permutations is:
 
      kP
−1
n n − n1 n − n1 − n2 n − ni
· · ... i=1

n1 n2 n3 I This simplifies to: n!
nk
n1 !n2 ! . . . nk !

I Another way to see this: Compute total # of permutations (n!) and


then divide by # of relative orderings between objects of type 1
(n1 !), # of relative orderings of objects of type 2 (n2 !) etc.
Instructor: Işıl Dillig, CS311H: Discrete Mathematics Combinatorics 3 15/26 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Combinatorics 3 16/26

Example 1 Example 2

I There are 3 identical red balls, 5 identical blue balls, and 2


I How many different strings can be made by ordering the identical green balls.
letters of the word SUCCESS?
I In how many different ways can these balls be arranged if the
I first ball must be blue?

I I

Instructor: Işıl Dillig, CS311H: Discrete Mathematics Combinatorics 3 17/26 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Combinatorics 3 18/26
Distributing Objects into Boxes Example: Distinguishable Objects in Distinguishable Boxes

I How many ways are there to distribute 5 cards to each of 4


players from a deck of 52 cards?

I
I Many counting problems can be thought of as distributing
objects into boxes
I

I In some cases both objects and boxes are distinguishable


I

I In some cases, boxes are distinguishable, but objects are


indistinguishable

Instructor: Işıl Dillig, CS311H: Discrete Mathematics Combinatorics 3 19/26 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Combinatorics 3 20/26

Example, cont. Indistinguishable Objects Into Distinguishable Boxes

I How many ways are there to place 10 indistinguishable balls


I into 8 distinguishable bins?

I I

I I

Instructor: Işıl Dillig, CS311H: Discrete Mathematics Combinatorics 3 21/26 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Combinatorics 3 22/26

Distributing Objects into Boxes Summary Another Example

I How many ways to distribute six distinguishable objects to five


I
distinguishable boxes?
Distinguishable objects into distinguishable boxes:
I Involves permutations I

I Indistinguishable objects into distinguishable boxes: I

I Involves combination I

Instructor: Işıl Dillig, CS311H: Discrete Mathematics Combinatorics 3 23/26 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Combinatorics 3 24/26
Example 2 Example 3

I How many ways to distribute six indistinguishable objects to I How many ways to assign 15 distinguishable objects into 5
five distinguishable boxes? distinguishable boxes so boxes contain 1, 2, 3, 4, 5 objects
respectively?
I

I
I

I
I

Instructor: Işıl Dillig, CS311H: Discrete Mathematics Combinatorics 3 25/26 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Combinatorics 3 26/26

You might also like