Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
DISCRETE MATHEMATICS, HOMEWORK (1) (9.2.15) A combination lock requires three selections of numbers, each from 1 to 30. a) How many different combinations are possible? b) Suppose that the locks are constructed in such a way that no number can be used twice. How many different combinations are possible? Solution: a) 303 = 27000. b) P (30, 3) = 30.29.28 = 24360. (2) (9.3.22) a) How many integers from 1 through 1000 are multiples of 4 or multiples of 7? b) Suppose an integer from 1 through 1000 is chosen at random. Find the probability that the integer is a multiple of 4 or a multiple of 7. c) How many integers from 1 through 1000 are neither multiples of 4 nor multiples of 7? Solution: a) 250 multiples of 4, 142 multiples of 7, 35 multiples of 28 (i.e. both 4 and 7), hence 250 + 142 − 35 = 357 multiples of 4 or 7 in the range. b) p = 357/1000 = 0.357. c) 1000 − 357 = 643 numbers which are not multiples of 4 or 7. (3) (9.4.34) Let S be a set of ten integers chosen from 1 through 50. Show that the set contains at least two different (but not necessarily disjoint) subsets of four integers that add up to the same number. (For instance, if the ten numbers are {3,8,9,18,24,34,35,41,44,50}, the subsets can be taken to be {8,24,34,35} and {9,18,24,50}. The numbers in both of these add up to 101.) Solution: There are 10 = 210 sums of 4 numbers. The lowest possible subset 4 sum is 1 + 2 + 3 + 4 = 10. The highest possible sum is 47 + 48 + 49 + 50 = 194. The number of possible sums is 194 − 10 + 1 = 185. By the Pigeonhole Principle, at least 2 of the 210 possible subset sums must be equal. (4) (9.5.11) For each poker holdings below, (1) find the number of five-card poker hands with that holding; (2) find the probability that a randomply chosen 2 DISCRETE MATHEMATICS, HOMEWORK set of five cards has that holding. a) royal flush Solution: n = 4, p = 4/ 52 5 = 0.0000015. b) straight flush Solution: 4 suits, 9 starting positions for the chain A,2,...,9, hence 52 n = 4 9 = 36, p = 36/ = 0.000014 5 c) four of a kind Solution: Select a denomination for the four, select the 5th card, hence 52 n = 13 48 = 624, p = 624/ = 0.00024 5 d) full house Solution: Select denomination for the three, select three cards. Select denomination for the two, selct two cards, hence 4 4 52 n = 13 12 = 3744, p = 3744/ = 0.00144 3 2 5 e) flush Solution: Select suit, select five cards in the suit, substract the special cases 13 52 n=4 − 36 − 4 = 5108, p = 5108/ = 0.00197 5 5 f) straight Solution: Select the beginning of the chain, selects suits for all 5 cards, substract special cases, hence 52 5 n = 10 4 − 36 − 4 = 10200, p = 10200/ = 0.00392 5 g) three of a kind Solution: Select denomination for the three, select the three cards, select the remaining two cards, hence 4 12 52 2 n = 13 4 = 54912, p = 54912/ = 0.0211 3 2 5 DISCRETE MATHEMATICS, HOMEWORK 3 h) one pair Solution: Select denomination for the two, select two cards, select the remaining three cards, 4 12 3 52 n = 13 4 = 1098240, p = 1098240/ = 0.423 2 3 5 (5) (9.5.27) Let A be a set with eight elements. a) How many relations are there on A? b) How many relations on A are reflexive? c) How many relations on A are symmetric? d) How many relations on A are both reflexive and symmetric? Solution: a) Relations are subsets of the A × A. There are 264 relations. b) The reflexive relations must contain the pairs (a, a) ∈ A × A. Thre are 64 − 8 elements of A × A we have to form susets with, thus 256 reflexive relations. c) Pick the elements (a, a) ∈ A × A, there are 28 choices. Pick the the pairs {(a, b), (b, a)}, b 6= a, there are 228 choices. In total there are 28 228 = 236 choices. d) Arguing as above 228 choices. (6) (9.6.38) Use the binomial theorem to prove that ∀m ≥ 0 m X i m (−1) 2m−i = 1. i i=0 Solution: m m 1 = 1 = (2 − 1) = m X m i=0 i 2m−i (−1)i .