This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Mathematical Foundations of Computer Science Lecture Outline January 08, 2011 Permutations of Selected Elements. We looked at permutations of n elements out of the available n elements. Now we will consider permutations of r elements out of the available n elements. Such an arrangement is called an rpermutation. For example, ab,ba,ac,ca,bc,cb are all 2permutations of the set { a,b,c } . Let P ( n,r ) denote the number of rpermutations of a set of n elements. What is the value of P ( n,r )? Forming an rpermutation of a set of n elements can be thought of as an rstep process such that in step i, 1 i r , we choose the i th element of the ordering. There are n ( i 1) = n i + 1 ways of performing step i . By the multiplication rule, the number of rpermutations equals P ( n,r ) = n n 1 n 2 n ( r 1) = n n 1 n 2 n r + 1 = n ( n 1) ( n r + 1) ( n r ) 1 n r ( n r 1) ( n r 2) 1 = n ! ( n r )! Example 1. How many ways are there to select a firstprize winner, a secondprize winner, and a thirdprize winner from 100 different contestants? Solution. Selecting the winners can be done in 3 steps with each step i, 1 i 3 choosing the winner in the i th place. Step i can be performed in 100 ( i 1) ways. By multiplication rule, the total number of possible ways in which the prizes can be given is 100 99 98 = 970200. Note that this is same as P (100 , 3). Example 2. In how many ways can we order 26 letters of the alphabet so that no two of the vowels a,e,i,o,u occur consecutively? Solution. The task of ordering the letters so that no two vowels appear consecutively can be performed in two steps. Step 1. Order the 21 consonants. 2 Lecture Outline January 08, 2011 Step 2. Choose locations for the 5 vowels. The vowels can be placed before the consonants, between the consonants and after the consonants. Step 1 can be performed in 21! ways. To count the number of ways of performing Step 2, observe that there is only one location for placing a vowel before and after the consonants, and 20 locations for placing the vowels between the consonants. This gives a total of 22 valid locations for placing 5 vowels. Thus the number of ways of placing the 5 vowels in 5 of the 22 locations is P (22 , 5). This is because there are 22 locations for a , 21 for e , 20 for i , 19 for o , and 18 for u . By multiplication rule, the total number of orderings in which no two vowels occur consecutively equals 21! P (22 , 5) = 21! 22! 17! The InclusionExclusion Formula. If A,B , and C are any finite sets, then  A B  =  A  +  B    A B   A B C  =  A  +  B  +  C    A B    A C    B C  +  A B C  Observe that if the sets A,B , and C are mutually disjoint, i.e., A B = A C = B C = then we get  A B  =  A  +  B   A B C  =  A  +  B  +  C  This is often called the...
View Full
Document
 Winter '10
 RajivSir
 Computer Science

Click to edit the document details