20

Permutations and combinations

Embed Size (px)

Citation preview

Page 1: Permutations and combinations
Page 2: Permutations and combinations

Permutations and Combinations

Name: Ghufran HasanCMS: 11432

Aqib javaid :13765Abdul waheed : 14200

Page 3: Permutations and combinations

Permutations

A permutation of a set of distinct objects is an ordered arrangement of these objects.

An ordered arrangement of r elements of a set is called an r-permutation.

The number of r-permutations of a set with n elements is denoted by P(n,r).

A = {1,2,3,4} 2-permutations of A include 1,2; 2,1; 1,3; 2,3; etc…

Page 4: Permutations and combinations

Counting Permutations

Using the product rule we can find P(n,r)= n*(n-1)*(n-2)* …*(n-r+1)= n!/(n-r)!

How many 2-permutations are there for the set {1,2,3,4}? P(4,2)

12!2!4

1*21*2*3*43*4

Page 5: Permutations and combinations

How many Permutations?

Consider four objects {A,B,C,D}

There are 4 choices for the first slot. There are 3 choices for the second slot. There are 2 choices for the third slot. There is 1 choice for the last slot.

Page 6: Permutations and combinations

4 x 3 x 2 x 1 = 24 Permutations

ABCD ABDC ACBDACDB ADBC ADCBBACD BADC BCAD

BCDA BDAC BDCACABD CADB CBADCBDA CDAB CDBADABC DACB DBAC

DBCA DCAB DCBA

Page 7: Permutations and combinations

GeneralizationThere are 4! ways to

arrange 4 items.

There are n! ways toarrange n items.

Page 8: Permutations and combinations

Permutation FormulaIn how many ways may r items be selected out of a

set of n items where order matters

)!(!),(rnnrnPPrn

Page 9: Permutations and combinations

Permutation ExampleSelecting 3 items out of a set of 5

We have 5 choices for the first item.We have 4 choices for the second item.We have 2 choices for the third item.

5 x 4 x 3 = 60 Permutations

Page 10: Permutations and combinations

Calculations

)!35(!5)3,5(

!2!5

1212345345

35

CC

Page 11: Permutations and combinations

Permutation Formula

)!(!),(rnnrnPPrn

Page 12: Permutations and combinations

Combinations

An r-combination of elements of a set is an unordered selection of r element from the set. (i.e., an r-combination is simply a subset of the set with r elements).

Let A={1,2,3,4} 3-combinations of A are{1,2,3}, {1,2,4}, {1,3,4}, {2,3,4}(same as {3,2,4}) The number of r-combinations of a set with n

distinct elements is denoted by C(n,r).

Page 13: Permutations and combinations

Evaluating

In how many ways may 3 items be selected from a set of 5 without regard to order?

rnC

Page 14: Permutations and combinations

We already know that there 60permutations of these items.

For each set of three, there are3! or 6 arrangements.

A B C A C B B A CB C A C A B C B A

All of these are really the same.

Page 15: Permutations and combinations

Our actual answer is 10.

Consider the set {A,B,C,D,E}These are the combinations.

A,B,C A,B,D A,B,E A,C,D A,C,E A,D,E B,C,D B,C,E B,D,E C,D,E

10660

!335 C

Page 16: Permutations and combinations

Combination Formula

)!(!!),(rnr

nrnCCrn

Page 17: Permutations and combinations

How to compute C(n,r)

To find P(n,r), we could first find C(n,r), then order each subset of r elements to count the number of different orderings. P(n,r) = C(n,r)P(r,r).

So C(n,r) = P(n,r) / P(r,r)

)!(!!

!)!()!(!

)!(!

)!(!

rnrn

rrnrrn

rrr

rnn

Page 18: Permutations and combinations

Example

Let A = {1,2,3}2-permutations of A are: 1,2 2,1 1,3 3,1 2,3 3,26 total. Order is important 2-combinations of A are: {1,2}, {1,3}, {2,3}3 total. Order is not important

If we counted the number of permutations of each 2-combination we could figure out P(3,2)!

Page 19: Permutations and combinations

A club has 25 members

How many ways are there to choose four members of the club to serve on an executive committee? Order not important C(25,4) = 25!/21!4! =

25*24*23*22/4*3*2*1 =25*23*22 = 12,650 How many ways are there to choose a

president, vice president, secretary, and treasurer of the club? Order is important P(25,4) = 25!/21! = 303,600

Page 20: Permutations and combinations

Thank You