Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Problem Set 2 Solutions - Discrete Mathematics | MATH 387, Assignments of Discrete Mathematics

Material Type: Assignment; Class: DISCRETE MATHEMATICS; Subject: Mathematics; University: University of Louisville; Term: Unknown 2008;

Typology: Assignments

Pre 2010

Uploaded on 09/09/2009

koofers-user-of9
koofers-user-of9 🇺🇸

10 documents

1 / 5

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
MATH 387 Problem Set #2 solutions
2.1.10. On the menu of a Chinese restaurant there are 7 chicken dishes, 6 beef dishes, 6
pork dishes, 8 seafood dishes, and 9 vegetable dishes.
(a) In how many ways can a family order if they choose exactly one dish of each kind?
We may consider this a sequential problem of choosing a chicken dish, then a beef
dish, and so forth. There are 7 options for the first choice, 6 for the second, 6 for
the third, 8 for the fourth, and 9 for the fifth, making a total of 7·6·6·8·9 = 18144
possible orders.
(b) In how many ways can a family order if at most one dish of each kind is ordered?
We may consider this a sequential problem as above, but with one extra option in
each case: the family may elect for each of the seven chicken dishes or to order no
chicken at all, for eight possible choices. Extending this to each decision, we see
that there are 8 options for the first choice, 7 for the second, 7 for the third, 9 for
the fourth, and 10 for the fifth, making a total of 8·7·7·9·10 = 35280 possible orders
(which includes some patent absurdities, such as opting not to order anything at
all, but we have not been given a mandate to specifically exclude any cases; if you
regard that as “not an order”, however, you may subtract one from the number
given above to get 35279 possible orders).
2.1.14. A domino is a 1×2rectangular tile divided into two square halves. The squares in
a standard set of dominos are each marked with zero to six spots. If every domino is
different, how many dominos are there in a complete set of dominos? In particular,
explain why your answer is less than 49.
The na¨ıve solution is to consider the 7 possibilities (zero through six) on the left
half; and then the 7 possibilities on the right half of a domino to get 7 ×7 = 49.
This, however, overcounts: the domino

is the same as

. To solve this more
effectively we need to consider the distinct possibilities of a domino with the same
number of spots on each half, which can happen in 7 ways, and a domino with different
numbers on each half, which can occur in 7·6 = 42 ways. The latter case is overcounted,
since the choice (i, j) is the same as the choice (j, i), so these 42 choices really describe
only 21 distinct dominoes. Thus, the total number of possible dominoes is 21 + 7 = 28.
2.1.18. An m×nmatrix is a rectangular array of numbers containing mrows and ncolumns.
If every number in the matrix is either a 0or a 1:
(a) How many m×nmatrices are there?
An m×nmatrix has mn entries. For each of these entries, we have a choice to
set it to 0 or to 1. Thus, a matrix is the result of mn decisions, each of which has
2 possible choices. We thus multiply mn instances of 2 together to get 2mn.
(b) How many m×nmatrices are there with a single 1in each row?
Since each row contains exactly one “1”, a row is dictated by the decision of
position to place the 1 in, and all other positions are filled with zeroes. For such
a decision, we have npossibilities, and each row’s decision has no influence on the
decision process in other rows, so that building a matrix is the process of making
Page 1 of 5 January 29, 2008
pf3
pf4
pf5

Partial preview of the text

Download Problem Set 2 Solutions - Discrete Mathematics | MATH 387 and more Assignments Discrete Mathematics in PDF only on Docsity!

2.1.10. On the menu of a Chinese restaurant there are 7 chicken dishes, 6 beef dishes, 6 pork dishes, 8 seafood dishes, and 9 vegetable dishes.

(a) In how many ways can a family order if they choose exactly one dish of each kind? We may consider this a sequential problem of choosing a chicken dish, then a beef dish, and so forth. There are 7 options for the first choice, 6 for the second, 6 for the third, 8 for the fourth, and 9 for the fifth, making a total of 7· 6 · 6 · 8 ·9 = 18144 possible orders. (b) In how many ways can a family order if at most one dish of each kind is ordered? We may consider this a sequential problem as above, but with one extra option in each case: the family may elect for each of the seven chicken dishes or to order no chicken at all, for eight possible choices. Extending this to each decision, we see that there are 8 options for the first choice, 7 for the second, 7 for the third, 9 for the fourth, and 10 for the fifth, making a total of 8· 7 · 7 · 9 ·10 = 35280 possible orders (which includes some patent absurdities, such as opting not to order anything at all, but we have not been given a mandate to specifically exclude any cases; if you regard that as “not an order”, however, you may subtract one from the number given above to get 35279 possible orders).

2.1.14. A domino is a 1 × 2 rectangular tile divided into two square halves. The squares in a standard set of dominos are each marked with zero to six spots. If every domino is different, how many dominos are there in a complete set of dominos? In particular, explain why your answer is less than 49. The na¨ıve solution is to consider the 7 possibilities (zero through six) on the left half; and then the 7 possibilities on the right half of a domino to get 7 × 7 = 49. This, however, overcounts: the domino  is the same as . To solve this more effectively we need to consider the distinct possibilities of a domino with the same number of spots on each half, which can happen in 7 ways, and a domino with different numbers on each half, which can occur in 7·6 = 42 ways. The latter case is overcounted, since the choice (i, j) is the same as the choice (j, i), so these 42 choices really describe only 21 distinct dominoes. Thus, the total number of possible dominoes is 21 + 7 = 28.

2.1.18. An m×n matrix is a rectangular array of numbers containing m rows and n columns. If every number in the matrix is either a 0 or a 1 :

(a) How many m × n matrices are there? An m × n matrix has mn entries. For each of these entries, we have a choice to set it to 0 or to 1. Thus, a matrix is the result of mn decisions, each of which has 2 possible choices. We thus multiply mn instances of 2 together to get 2mn. (b) How many m × n matrices are there with a single 1 in each row? Since each row contains exactly one “1”, a row is dictated by the decision of position to place the 1 in, and all other positions are filled with zeroes. For such a decision, we have n possibilities, and each row’s decision has no influence on the decision process in other rows, so that building a matrix is the process of making

such a decision for each of the n rows. Thus, the number of matrices we can build under this constraint is the product of n instances of m, which is mn.

2.1.20. Let A be a set of n distinct elements. There is a one-to-one correspondence between binary relations on the set A and subsets R ⊆ A × A.

(a) Compute the number of binary relations on A. We know that |A × A| = n^2 ; we also know, from one of the original bijections we crafted, that if a set S has k elements, there are 2k^ possible subsets of S. There are thus 2(n

possible subsets of A × A, which are established above to be in a one-to-one correspondence with the relations on A, so there are 2(n

relations on A. (b) A binary relation is symmetric if for every (a, b) in R, (b, a) is also in R. Compute the number of symmetric binary relations on A. In the previous problem we essentially answered each of the n^2 questions “is (a, b) in R?” for various values of a and b in either of two ways to get 2(n

. In this case we are again answering a number of independent questions to determine our relation, but the questions are of the form “are both of (a, b) and (b, a) in R, or are neither?” Again, we have 2 answers to each questions, but the questions each determine the membership of two pairs rather than one in R. However, we must be mindful of the case where a = b. The a = b case induces n questions of the above form. When a 6 = b, we have n(n − 1) choices of (a, b), but since two ordered pairs are mentioned in each question, this raises only n(n 2 − 1)questions. We thus characterize a relation by answering n + n(n 2 − 1)yes-no questions, which we can do in 2n+^

n(n−1) (^2) different ways.

2.1.20c. A binary relation is symmetric if for every (a, b) in R with a 6 = b, (b, a) is not in R. Compute the number of symmetric binary relations on A. ‘ Each of the relations (a, a) is either in R or not; thus we have 2n^ ways to choose how the elements of A are self- related. For each unordered pair of distinct nubmers (a, b), however, we have 3 evident choices: (a, b) is in R while (b, a) is not; (b, a) is in R while (a, b) is not; or neither (a, b) nor (b, a) is in R. thus, for each unordered pair (of which there are n(n 2 − 1), as detailed in the previous part of the questions) we have 3 choices of relation membership, so there are 3

n(n−1) (^2) ways to choose relation-membership for distinct elements of A. Thus, there are 2n 3

n(n−1) (^2) antisymmetric relations which can be chosen.

2.1.23. Find the smallest positive integer with exactly 18 positive divisors.

We know, from an example in class (or enumerating the possible prime factorizations for a divisor) that if N has prime factorization pa 1 1 pa 2 2 · · · pa k k, then N has (a 1 + 1)(a 2 +

  1. · · · (ak + 1) factors. For N to have 18 factors, then, the exponents in the prime factorization must be subject to (a 1 + 1)(a 2 + 1) · · · (ak + 1) = 18. Since each ai > 1, we seek to enumerate the possible ways 18 could be decomposed into a product of one or more numbers. There are not too many ways to do so, so they can be explicitly

We may select a string of 6 consonants in 21^6 ways, and choose a pair of vowels in 52 ways. However, the distribution of consonants and vowels in the word has not yet been chosen (and, for instance, AEBCDFGH and BACDEFGH are distinct words). We thus must choose 2 slots from the 8 given for vowels. This is

2

in the parlance of Section 2.3, but in this section we may devise it by taking the 8 · 7 possible ordered selections of two slots, and dividing by 2. We thus have (21^6 )(5^2 )^82 ·^7 = 60036284700. (b) Repeat part (a) if the two vowels cannot be adjacent. Of our 82 ·^7 = 28 selected vowel-placements, 7 have the vowels adjacent: the first and second slots, the second and third slots, and so forth up to the seventh and eighth slots. Thus, we must exclude these placements, yielding (21^6 )(5^2 )

2 −^7

2.2.16. How many five-digit numbers with distinct digits

(a) Contain at least one 0? There are 9 · 9 · 8 · 7 · 6 = 27216 five-digit numbers with distinct digits total. Of these, 9 · 8 · 7 · 6 · 5 = 15120 contain no zero, so there are 27216 − 15120 = 12096 numbers which contain at least one 0. (b) Contain at least one 9? There are 9 · 9 · 8 · 7 · 6 = 27216 five-digit numbers total. Of these, 8 · 8 · 7 · 6 · 5 = 13440 contain no nine, so there are 27216 − 13440 = 13776 numbers which contain at least one 9. (c) Contain at least one 0 and at least one 9? Let A 0 be the set of numbers lacking a zero and A 9 the set of numbers lacking a nine, and let the universe X consist of all five-digit numbers with distinct digits. As observed above, |A 0 | = 15120, |A 9 | = 13440, and |X| = 27216. We seek numbers which have both a 0 and a 9: that is, those which are a member of neither A 0 nor A 9. Alternatively, non-membership in both A 0 and A 9 may be phrased as non-membership in A 0 ∪ A 9 , or membership in A 0 ∪ A 9. We know that

|A 0 ∪ A 9 | = |X| − |A 0 ∪ A 9 | = |X| − (|A 0 | + |A 9 | − |A 0 ∩ A 9 |) = 27216 − (15120 + 13776 − |A 0 ∩ A 9 |) = |A 0 ∩ A 9 | − 1344

Now, we must find |A 0 ∩ A 9 |. This set, by the description of A 0 and A 9 , consists of those numbers which have neither 0 nor 9 appearing in them. We thus have only 8 choices for the first digit, 7 for the second, and so forth, so |A 0 ∩ A 9 | = 8 · 7 · 6 · 5 · 4 = 6720, and our original calculation is 6720 − 1344 = 5376.

Note: all of the above questions can also be answered with direct enumeration.

2.2.18. (a) How many positive integers are divisors of both 1040 and 2030?

Note that 10^40 = (2 · 5)^40 = 2^40540 and 20^30 = (2^2 · 5)^30 = 2^60530. Thus, both have divisors of the form d = 2a 3 b. For d to be a divisor of 10^40 , 0 ≤ a ≤ 40 and 0 ≤ b ≤ 40; for d to be a divisor of 20^30 , 0 ≤ a ≤ 60 and 0 ≤ b ≤ 30. Thus, to be a divisor of both, it must be the case that 0 ≤ a ≤ 40 and 0 ≤ b ≤ 30. This allows 41 choices for a, and 31 for b, so there are 41 · 31 = 1271 shared factors. (b) How many positive integers are divisors of at least one of the integers 1040 and 2030? Let A be the set of divisors of 10^40 and B be the set of divisors of 20^30. Using the prime factorizations determined above, it is easy to see that |A| = (40 + 1)(40 +

  1. = 1681 and that |B| = (60 + 1)(30 + 1) = 1891. We wish to find the number of integers which are divisors of either of 10^40 or 20^30 ; that is, we want to find |A∪B|. The solution to the previous problem was the number of integers in both A and B, so |A∩B| = 1271. Thus, |A∪B| = |A|+|B|−|A∩B| = 1681+1891−1271 = 2301.