This preview shows pages 1–2. 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: 1.3. Of Sequences, Permutations and Combinations 11 Example 28 Given the set of r symbols { a 1 , . . . , a r } , how many different strings of length n > exist that contain at least two a 1 s (allowing repetition)? Answer Recall that whenever you encounter at least you should consider using the rule of complements. The number of strings that contain at least two a 1 s equals the total strings that can be made less the number of strings that contain exactly one a 1 or no a 1 s. The total number of strings with repeats is r n . The number of strings with exactly one a 1 we saw in the last exercise is ( n 1) r n 1 . The number of strings with no a 1 s is ( r 1) n . Thus, the answer is r n ( n 1) r n 1 ( r 1) n . End of Answer Example 29 Given the set of r symbols { a 1 , . . . , a r } , how many different strings of length n > exist ( not allowing repetition)? Answer We recognize this as a permutation: P ( r, n ) = r ! ( r n )! . Alternatively, you can argue from basic principles that there are r choices for the first entry in the strings, ( r 1) for the second, etc. So the answer is r ( r 1)( r 2) ( r n + 1) = r ! ( r n )! . End of Answer Example 30 Given the set of r symbols { a 1 , . . . , a r } , how many different strings of length n > exist that contain exactly one a 1 ? ( not allowing repetition)? Answer Recall that whenever a problem asks How many strings are there with exactly a certain number of specified elements? one can break the task into a sequence of three subtasks. The first subtask choses the places for the specified elements and counts how many ways these places can be chosen. In this example, the place for a 1 can be chosen in parenleftbigg n 1 parenrightbigg = n ! ( n 1)!1! = n (n choose 1) ways. The second subtask fills the places and counts how many ways they can be filled. In this example that is 1 (for the one place there is only one choice). The third subtask fills the remaining places and counts how many ways they can be filled. In this example that is a permutation, P ( r 1 , n 1) = ( r 1)! (( r 1) ( n 1))! = ( r 1)! ( r n )! The answer is therefore n ( r 1)! ( r n )! . End of Answer Example 31 Given the set of r symbols { a 1 , . . . , a r } , how many different strings of length n > exist that contain exactly at least one a 1 ? ( not allowing repetition)? Answer There are two answers. The first answer is to recognize that at least one when no repetition is allowed means exactly one. Thus, the answer is the same as for the last example. Alternatively, we can employ the rule of complements: The desired result is equal to the number of strings that can be made from the given set of without repetition, less the number of stings that do not contain a a 1 . The answer is P ( r, n ) P ( r 1 , n ) = r !...
View
Full
Document
This note was uploaded on 11/30/2010 for the course CS 336 taught by Professor Myers during the Fall '08 term at University of Texas at Austin.
 Fall '08
 Myers

Click to edit the document details