solutions Mathematics for Algorithm and System Analysis by E.A. Bender and S.G. Williamson

Solutions Mathematics for Algorithm and System Analysis by E.A. Bender and S.G. Williamson

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Solutions for Basic Counting and Listing CL-1.1 This is a simple application of the Rules of Sum and Product. (a) Choose a discrete math text OR a data structures text, etc. This gives 5 + 2 + 6 + 3 = 16. (b) Choose a discrete math text AND a data structures text, etc. This gives 5 × 2 × 6 × 3 = 180. CL-1.2 We can form n digit numbers by choosing the leftmost digit AND choosing the next digit AND ··· AND choosing the rightmost digit. The first choice can be made in 9 ways since a leading zero is not allowed. The remaining n − 1 choices can each be made in 10 ways. By the Rule of Product we have 9 × 10 n − 1 . To count numbers with at most n digits, we could sum up 9 × 10 k − 1 for 1 ≤ k ≤ n . The sum can be evaluated since it is a geometric series. This does not include the number 0. Whether we add 1 to include it depends on our interpretation of the problem’s requirement that there be no leading zeroes. There is an easier way. We can pad out a number with less than n digits by adding leading zeroes. The original number can be recovered from any such n digit number by stripping off the leading zeroes. Thus we see by the Rule of Product that there are 10 n numbers with at most n digits. If we wish to rule out 0 (which pads out to a string of n zeroes), we must subtract 1. CL-1.3 For each element of S you must make one of two choices: “ x is/isn’t in the subset.” To visualize the process, list the elements of the set in any order: a 1 ,a 2 ,... ,a | S | . We can construct a subset by including a 1 or not AND including a 2 or not AND . . . including a | S | or not. CL-1.4 (a) By the Rule of Product, we have 9 × 10 × ··· × 10 = 9 × 10 n − 1 . (b) By the Rule of Product, we have 9 n . (c) By the Rule of Sum, (answer)+9 n = 9 × 10 n − 1 and so the answer is 9(10 n − 1 − 9 n − 1 ) CL-1.5 (a) This is like the previous exercise. There are 26 4 4-letter strings and there are (26 − 5) 4 4-letter strings that contain no vowels. Thus we have 26 4 − 21 4 . (b) We can do this in two ways: First way : Break the problem into 4 problems, depending on where the vowel is located. (This uses the Rule of Sum.) For each subproblem, choose each letter in the list and use the Rule of Product. We obtain one factor equal to 5 and three factors equal to 21. Thus we obtain 5 × 21 3 for each subproblem and 4 × 5 × 21 3 for the final answer. Second way : Choose one of the 4 positions for the vowel, choose the vowel and choose each of the 3 consonants. By the Rule of Product we have 4 × 5 × 21 × 21 × 21. CL-1.6 The only possible vowel and consonant pattern satisfying the two nonadjacent vowels and initial and terminal consonant conditions is CVCVC. By the Rule of Product, there are 3 × 2 × 3 × 2 × 3 = 108 possibilities....
View Full Document

Page1 / 39

Solutions Mathematics for Algorithm and System Analysis by E.A. Bender and S.G. Williamson

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online