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

Lecture Combinatorics2 6up

Using forn exam
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)
9 views5 pages

Lecture Combinatorics2 6up

Using forn exam
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

Permutations

CS311H: Discrete Mathematics I A permutation of a set of distinct objects is an ordered


arrangement of these objects
Permutations and Combinations I No object can be selected more than once

I Order of arrangement matters


Instructor: Işıl Dillig
I Example: S = {a, b, c}. What are the permutations of S ?

Instructor: Işıl Dillig, CS311H: Discrete Mathematics Permutations and Combinations 1/26 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Permutations and Combinations 2/26

How Many Permutations? Examples

I Consider set S = {a1 , a2 , . . . an }

I I Consider the set {7, 10, 23, 4}. How many permutations?
How many permutations of S are there?

I Decompose using product rule: I How many permutations of letters A, B, C, D, E, F, G contain


”ABC” as a substring?
I How many ways to choose first element?
I
I How many ways to choose second element?
I
I ...
I
I How many ways to choose last element?

I What is number of permutations of set S ?

Instructor: Işıl Dillig, CS311H: Discrete Mathematics Permutations and Combinations 3/26 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Permutations and Combinations 4/26

r -Permutations Computing P (n, r )

I Given a set with n elements, what is P (n, r )?


I r-permutation is ordered arrangment of r elements in a set S
I Decompose using product rule:
I S can contain more than r elements I How many ways to pick first element?
I But we want arrangement containing r of the elements in S I How many ways to pick second element?
I The number of r-permutations in a set with n elements is I How many ways to pick i ’th element?
written P (n, r )
I How many ways to pick last element?
I Example: What is P (n, n)?
I n!
Thus, P (n, r ) = n · (n − 1) . . . · (n − r + 1) = (n−r )!

Instructor: Işıl Dillig, CS311H: Discrete Mathematics Permutations and Combinations 5/26 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Permutations and Combinations 6/26
Examples Combinations
I What is the number of 2-permutations of set {a, b, c, d , e}?

I
I An r-combination of set S is the unordered selection of r
I How many ways to select first-prize winner, second-prize elements from that set
winner, third-prize winner from 10 people in a contest? I Unlike permutations, order does not matter in combinations
I
I Example: What are 2-combinations of the set {a, b, c}?
I Salesman must visit 4 cities from list of 10 cities: Must begin
I For this set, 6 2-permutations, but only 3 2-combinations
in Chicago, but can choose the remaining cities and order.

I How many possible itinerary choices are there?

Instructor: Işıl Dillig, CS311H: Discrete Mathematics Permutations and Combinations 7/26 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Permutations and Combinations 8/26

Number of r -combinations Proof of Theorem


I What is the relationship between P (n, r ) and C (n, r )?
I The number of r -combinations of a set with n elements is
written C (n, r ) I Let’s decompose P (n, r ) using product rule:
  I First choose r elements
n
I C (n, r ) is often also written as , read ”n choose r”
r I Then, order these r elements
 
n I How many ways to choose r elements from n?
I is also called the binomial coefficient
r
I How many ways to order r elements?
I Theorem:
  I Thus, P (n, r ) = C (n, r ) ∗ r !
n n!
C (n, r ) = =
r r ! · (n − r )! I Therefore,
P (n, r ) n!
C (n, r ) = =
r! (n − r )! · r !

Instructor: Işıl Dillig, CS311H: Discrete Mathematics Permutations and Combinations 9/26 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Permutations and Combinations 10/26

Examples More Complicated Example

I How many hands of 5 cards can be dealt from a standard I How many bitstrings of length 8 contain at least 6 ones?
deck of 52 cards?
I
I

I
I There are 9 faculty members in a math department, and 11 in
CS department. I

I If we must select 3 math and 4 CS faculty for a committee, I


how many ways are there to form this committee?
I
I

Instructor: Işıl Dillig, CS311H: Discrete Mathematics Permutations and Combinations 11/26 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Permutations and Combinations 12/26
One More Example Binomial Coefficients

I How many bitstrings of length 8 contain at least 3 ones and 3  


zeros? n
I Recall: C (n, r ) is also denoted as and is called the
r
I binomial coefficient

I I Binomial is polynomial with two terms, e.g., (a + b), (a + b)2


 
I n
I called binomial coefficient b/c it occurs as
r
I coefficients in the expansion of (a + b)n

Instructor: Işıl Dillig, CS311H: Discrete Mathematics Permutations and Combinations 13/26 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Permutations and Combinations 14/26

An Example The Binomial Theorem

I Consider expansion of (a + b)3

I (a + b)3 = (a + b)(a + b)(a + b)


I Let x , y be variables and n a non-negative integer. Then,
I = (a 2 + 2ab + b 2 )(a + b) n 
X 
n
(x + y)n = x n−j y j
I = (a 3 + 2a 2 b + ab 2 ) + (a 2 b + 2ab 2 + b 3 ) j
j =0

I = 1a 3 + 3a 2 b + 3ab 2 + 1b 3 I What is the expansion of (x + y)4 ?

1 3 3 1

Instructor: Işıl Dillig, CS311H: Discrete Mathematics Permutations and Combinations 15/26 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Permutations and Combinations 16/26

Another Example Corollary of Binomial Theorem

I What is the coefficient of x 12 y 13 in the expansion of I Binomial theorem allows showing a bunch of useful results.
(2x − 3y)25 ?  
P
n n
I
I Corollary: = 2n
k =0 k

I I

I I

Instructor: Işıl Dillig, CS311H: Discrete Mathematics Permutations and Combinations 17/26 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Permutations and Combinations 18/26
Another Corollary Pascal’s Triangle

 
P
n n
I Corollary: (−1)k =0
k =0 k

I Pascal arranged binomial coefficients as a triangle


 
I
n
n’th row consists of for k = 0, 1, . . . n
k

Instructor: Işıl Dillig, CS311H: Discrete Mathematics Permutations and Combinations 19/26 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Permutations and Combinations 20/26

Proof of Pascal’s Identity Proof of Pascal’s Identity, cont.


     
n +1 n n
= +
k k −1 k    
n n k · n! + (n − k + 1)n!
+ =
k −1 k (k )!(n − k + 1)!
I This identity is known as Pascal’s identity

I Factor the numerator:


I Proof:
       
n! n! n n (n + 1) · n! (n + 1)!
n n + = =
+ = + k −1 k (k )!(n − k + 1)! k ! · (n − k + 1)!
k −1 k (k − 1)!(n − k + 1)! (k )!(n − k )!
 
I Multiply first fraction by k
and second by n−k +1
I
n +1
k n−k +1 : But this is exactly
k
   
n n k · n! + (n − k + 1)n!
+ =
k −1 k (k )!(n − k + 1)!

Instructor: Işıl Dillig, CS311H: Discrete Mathematics Permutations and Combinations 21/26 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Permutations and Combinations 22/26

Interesting Facts about Pascal’s Triangle Some Fun Facts about Pascal’s Triangle, cont.

I What is the sum of numbers in n’th row in Pascal’s triangle


(starting at n = 0)? I Pascal’s triangle is perfectly symmetric
I Observe: This is exactly the corollary we proved earlier! I Numbers on left are mirror image of numbers on right

Xn  
n I Why is this the case?
= 2n
k
k =0

Instructor: Işıl Dillig, CS311H: Discrete Mathematics Permutations and Combinations 23/26 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Permutations and Combinations 24/26
Permutations with Repetitions General Formula for Permutations with Repetition

I Earlier, when we defined permutations, we only allowed each I P ∗ (n, r ) denotes number of r-permutations with repetition
object to be used once in the arrangement from set with n elements
I But sometimes makes sense to use an object multiple times I What is P ∗ (n, r )?
I Example: How many strings of length 4 can be formed using I How many ways to assign 3 jobs to 6 employees if every
letters in English alphabet? employee can be given more than one job?
I A permutation with repetition of a set of objects is an ordered I How many different 3-digit numbers can be formed from
arrangement of these objects, where each object may be used 1, 2, 3, 4, 5?
more than once

Instructor: Işıl Dillig, CS311H: Discrete Mathematics Permutations and Combinations 25/26 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Permutations and Combinations 26/26

You might also like