main menu main menu (click on the topics below) permutation example 1 example 2 circular permutation...

43
Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example 3 Example 4 Addition Rule Example 1 Example 2 Difference Rule Example 1 Inclusion Exclusion Rule Example 1 Symmetric Relations Simple graphs Click on the picture

Upload: virgil-moore

Post on 05-Jan-2016

225 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

Main Menu Main Menu (Click on the topics below)

Permutation

Example 1

Example 2Circular PermutationPermuting r of n objects

Example 1

Example 2

Example 3

Example 4Addition Rule

Example 1

Example 2Difference Rule

Example 1Inclusion Exclusion Rule

Example 1

Symmetric Relations

Simple graphs

Click on the picture

Page 2: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

PermutationsPermutations

Sanjay Jain, Lecturer, Sanjay Jain, Lecturer,

School of ComputingSchool of Computing

Page 3: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

PermutationsPermutations

Permutation of a set of objects is an ordering of the objects in a row.

Example: {A, B, C}

ABC, ACB, BAC, BCA, CAB, CBA

Page 4: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

PermutationsPermutations

Theorem: Suppose a set A has n elements (where n1). Then the number of permutations of A is

n!= n*(n-1)*(n-2)*…*1.Proof: Job: select a permuation

T1: Select the 1st element in the row ---> n ways

T2: Select the 2nd element in the row ---> n-1 ways……..

Tn: Select the nth element in the row ---> 1 way

Total number of permutations: n*(n-1)*…..*1

Page 5: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

END OF SEGMENT

Page 6: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

ExamplesExamples

Number of anagrams of SINGAPORE: This is same as premuting 9 distinct elements. 9!

Page 7: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

END OF SEGMENT

Page 8: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

ExamplesExamples

Number of anagrams of SINGAPORE which have “SING” as a substring:

We can think of “SING” as one element.Thus there are a total of 6 elements to be permuted

(“SING”,A,P,O,R,E).6!

Page 9: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

END OF SEGMENT

Page 10: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

ExamplesExamples

Letters of “SING” appear together, but not necessarily in that order.

T1: First permute “SING”, A, P, O, R, ET2: Permute letters of “SING”.

T1 can be done in 6! ways.T2 can be done in 4! ways.

Total number of anagrams with the constraint: 6!*4!

Page 11: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

END OF SEGMENT

Page 12: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

Circular PermutationsCircular Permutations

A

C B B A

C B

CA

A

B C

Page 13: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

Circular PermutationsCircular Permutations

How many circular permutations are there? Note that each circular permutation has n different row permutations (by starting at different objects in the

circle)

)!1(!

nn

n

Convention 0!=1

Page 14: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

END OF SEGMENT

Page 15: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

Permuting r of n objectsPermuting r of n objects

Suppose 1 r n.An r-permutation of a set of n elements is an ordered

selection of r elements from the set.The number of r-permutations of a set of n elements is

denoted by P(n,r)

nPr

Page 16: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

END OF SEGMENT

Page 17: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

Permuting r of n objectsPermuting r of n objects

Theorem: Suppose n, r are integers with 1 r n. P(n,r) = n*(n-1)*…..(n-r+1) = n!/(n-r)!

For r=0, we take P(n,0)=1.

Page 18: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

Permuting r of n objectsPermuting r of n objectsProof:

T1: Select the 1st element in the row

T2: Select the 2nd element in the row……..

Tr: Select the rth element in the row

T1 can be done in n ways.

T2 can be done in n-1 ways.…..

Tr can be done in n - (r - 1) = n - r + 1 ways.

Total number of r-permutations are: n * (n - 1) * ….. * (n - r + 1)

Page 19: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

END OF SEGMENT

Page 20: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

ExampleExample

Suppose there are 350 students. In how many ways can one select president, secretary and treasurer if no person can hold two posts?

Permuting 3 of 350 objects.P(350,3)

Page 21: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

END OF SEGMENT

Page 22: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

ExampleExampleSuppose A and B are finite sets. How many different functions from A to B are 1--1?

A = {a1, a2,…, an}. B = {b1, b2,..., bm}if n > m: No 1--1 functions from A to Bif n m:

Want to select f(a1), f(a2),…, f(an) from the set B

All distinct.Thus, we are finding a n-permutation from a set of m

objects.P(m,n) ways.

Page 23: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

END OF SEGMENT

Page 24: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

ExampleExample

How many bijective functions are there from A to B?

A = {a1, a2,…, an}. B = {b1, b2,..., bm}

If m n: zero bijective functions.If m=n:

Want to select f(a1), f(a2),…, f(an) from the set B

All distinct. We are selecting n out of n objects. P(n,n)=n!

Page 25: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

END OF SEGMENT

Page 26: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

ExampleExampleHow many Hamiltonian circuits are there in K5 ? Assume that we start at a fixed vertex.

T1: Pick first vertex in HC (fixed to be v1 )

T2: Pick second vertex in HC.

T3: Pick third vertex in HC.

T4: Pick fourth vertex in HC.

T5: Pick fifth vertex in HC.

Total number of HC starting at a fixed vertex: 1*4*3*2*1=4!

T1: 1

T2: 4

T3: 3

T4: 2

T5: 1

Page 27: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

END OF SEGMENT

Page 28: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

The Addition RuleThe Addition Rule

Theorem: Suppose a finite set A equals the union of k distinct mutually disjoint sets A1, A2,…, Ak.

That is A= A1 A2 …. Ak,

and, for ij, Ai Aj = .

Then #(A) = #(A1) + #(A2) + …. + #(Ak).

Page 29: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

END OF SEGMENT

Page 30: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

ExampleExample

Suppose I can go from SIN to KL by bus, train or plane.There are

8 flights daily

2 morning and 2 evening trains, daily

1 bus dailyIn how many ways can one go from SIN to KL on a

particular day

Answer: 8+(2+2)+1 ways

Page 31: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

END OF SEGMENT

Page 32: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

ExampleExample

In Fortran identifiers consist of 1 to 6 characters where the first character must be English letter and others either English letter or a digit.

How many different identifiers are possible.

Page 33: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

First step: we calculate how many identifiers of length k are

there (where 1 k 6)

T1: Pick the first character T2: Pick the second character…..Tk: Pick the kth character.

T1: 26 waysT2: 36 ways…..Tk: 36 ways

26*36k-1 identifiers of length k

Second step:Total number of identifiers=26*360+26*361+ 26*362+... …..+26*365

Page 34: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

END OF SEGMENT

Page 35: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

The Difference RuleThe Difference Rule

Theorem: If A is a finite set and BA, then #(A - B) = #(A) - #(B).

Page 36: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

END OF SEGMENT

Page 37: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

ExampleExample

How many three digit numbers have at least one digit repeated?

A---Set of three digit numbersB--- Set of three digit numbers which have no digit repeated.

#(A) = 9*10*10#(B) = 9*9*8#(A - B) = 9*10*10 - 9*9*8

Page 38: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

END OF SEGMENT

Page 39: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

Inclusion Exclusion RuleInclusion Exclusion Rule

Theorem: If A, B and C are finite sets, then#(AB) = #(A) + #(B) - #(AB)

#(ABC) = #(A) + #(B) + #(C) - #(AB) - #(AC) - #(BC) + #(ABC)

Page 40: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

END OF SEGMENT

Page 41: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

ExampleExampleClass of 50 students.30 know Pascal18 know Fortran26 know Java9 know both Pascal and Fortran16 know both Pascal and Java8 know both Fortran and Java47 know at least one of the three languages.Question: How many know all three languages?

P: set of students who know PascalF: set of students who know FortranJ: set of students who know Java

Page 42: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

ExampleExample

#(PFJ) = #(P) + #(F) + #(J) - #(PF) - #(PJ) -#(FJ) + #(PFJ)

47=30 + 18 + 26 - 9 - 16 - 8 + #(PFJ) #(PFJ) = 47 - 30 - 18 - 26 + 9 + 16 + 8

Page 43: Main Menu Main Menu (Click on the topics below) Permutation Example 1 Example 2 Circular Permutation Permuting r of n objects Example 1 Example 2 Example

END OF SEGMENT