Discrete Mathematics Math 6A Homework 2 1.4-16 A discrete mathematics class contains a mathematics major who is a freshman, 21 mathematics majors who are sophomores, 15 computer science majors who are sophomores, 2 mathematics majors who are juniors, 2 computer science majors who are juniors, and 1 computer science major who is a senior. Express each of these statements in terms of quantifiers and then determine its truth value. We let P(s,c,m) be the statement that student s has class standing c and is majoring in m. The variable s ranges over students in the class, the variable c ranges over the four class standings, and the variable m ranges over all possible majors. a) The proposition is smP(s, junior,m). It is true from the given information. b) The proposition is scP(s,c,computer science). This is false, since there are some mathemathics majors. c) The proposition is xcm(P(s,c,m) (c≠ junior) (m ≠mathematics)). This is true, since there is a sophomore majoring in computer science. d) The proposition is s(cP(s,c,computer science) mP(s, sophomore,m)). This is false, since ther is a freshman mathematics major. e) The proposition is mcsP(s,c,m). This is false. It cannot be that m is mathematics, since there is no senior mathematics major, and it cannot be that m is computer science, since there is no freshman computer science major. Nor can m be any other major. 1.4-21 Use predicates, quantifiers, logical connectives, and mathematical operartors to express the statement that every positive integer is the sum of the squares of four integers. xabcd ((x > 0) x = a2 + b2 + c2 + d2), where the universe of discourse consists of all integers 1.4-30 Rewrite each of these statements so that negations appear only within predicates (that is, so that no negation is outside a quantifier or an express involving logical connectives) a) ~yxP(x,y): yx~P(x,y) b) ~xyP(x,y): xy~P(x,y) c) ~y(Q(y) x~R(x,y)): y(~Q(y) xR(x,y)) d) ~y(xR(x,y) xS(x,y)): y(x~R(x,y) x~S(x,y)) e) ~y(xzT(x,y,z) xzU(x,y,z)): y(xz~T(x,y,z) xz~U(x,y,z)) 1.4-33 Rewrite each of these statements so that negations appear only within predicates (that is, so that no negation is outside a quantifier or an expresssion involving logical connectives.) a) ~xyP(x,y): xy~P(x,y) b) ~yxP(x,y): yx~P(x,y) c) ~yx(P(x,y) Q(x,y)): yx~(P(x,y) Q(x,y)) = yx(~P(x,y) ~Q(x,y)) d) ~(xy~P(x,y) xyQ(x,y)): xyP(x,y) (xy~Q(x,y)) e) ~x(yzP(x,y,z) zyP(x,y,z)): x~(yzP(x,y,z) zyP(x,y,z)) = x(~yzP(x,y,z) ~zyP(x,y,z)) = x(yz~P(x,y,z) zy~P(x,y,z)) 1.6-2 Use set guilder notation to give a description of each of these sets. a) {0,3,6,9,12}: {3n | n = 0,1,2,3,4} or {x | x is a multiple of 3 0 x 12} b) {-3, -2, -1, 0, 1, 2, 3}: {x | -3 x 3}, where we are assuming that the universe of discourse is the set of integers. c) {m, n, o, p}: {x | x is a letter of the word monopoly other than l or y} 1.6-7 Determine whether each of these statements is true of false. a) 0 : false, since the empty set has no elements. b) {0}: false: The set on the right has only one element, namely the number 0, not the empty set c) {0} : false: the empty set has no proper subsets. d) {0}: true: every element of the set on the left is an element of the set on the right; and the set on the right contains an element, namely 0, that is not the set on the left e) {0} {0}: false: the set on the right has only one element, namely the number 0, not the set containing the number 0 f) {0} {0}: false: for one set to be a proper subset of another, the two sets cannot be equal g) {} {}: true: every set is a subset of itself 1.6-12 Find two sets A and B such that A B and A B Since the empty set is a subset of every set, we just need to take a set B that contains as an element. Thus, we can let A = and B={} as the simplest example 1.6-21 what is the Cartesian product AB C, where A is the set of all airlines and B and C are both the set of all cities in the United States? This is the set of triples (a,b,c), where a is an airline and b and c are cities. For example, (TWA, Rochester Hills Michigan, Middletown New Jersey) is an elements of this Cartesian product. A useful subbset of this set is the set of triples (a, b, c) for which a flies between b and c. For example, (Northewest, Detroit, New York) is in this subset, but the triple mentioned earliers is not. 1.7-4 Let A={a,b,c,d,e} and B={a,b,c,d,e,f,g,h}. Find a) A B: {a,b,c,d,e,f,g,h} b) A B: {a,b,c,d,e} c) A – B: d) B- A: {f,g,h} 1.7-12 Let A and B be sets. Show that a) {A B} A: if x is in AB, then perforce it is in A (by definition of intersection) b) A (A B): if x is in A, then perforce it is in A B (by definition of union) c) A – B A: if x is in A-B, then perforce it is in A (by definition of difference) d) A (B - A) = : if xA then xB-A. Therefore, there can be no elements in A (B - A), so A (B - A) = e) A (B – A ) = (A B): The left-hand side consists precisely of those thinks that are either elements of A or else elements of B but no A, in other words, thinks that are elements of either A or B (or both). This is precisely the definition of the right-hand side. 1.7-17 Let A, B, and C be sets. Show that a) A (B C) = (A B) C: {x | xA x(B C)} = {x | xA (xB x C)} = {x | (xA xB) x C)} = {x | (xA B) x C)} = (A B) C b) A (B C) = (A B) C: {x | xA x(B C)} = {x | xA (xB x C)} = {x | (xA xB) x C)} = {x | (xA B) x C)} = (A B) C c) A (B C) = (A B) (A C): {x | xA x(B C)} = {x | xA (xB x C)} = {x | (xA xB) (xA xC))} = {x | (xA B) (xA C)} = (A B) (A C) There are many ways to prove these identities. One way is to reduce them to logical identities. Alternatively, we could argue in each case that the left-hand side is a subset of the right-hand side and vice versa. Another method would be to construct membership tables. 1.7-20 Draw the Venn diagrams for each of these combinations of the sets A, B, and C a) A (B C) b) A' B' C' c) (A-B) (A-C) (B-C) 1.7-40 Suppose that the universal set is U={1,2,3,4,5,6,7.8.9.10}. Express each of these sets with bit strings where the ith bit in the string is 1 if i is in the set and 0 otherwise. a) {3,4,5}: 00 1110 0000 b) {1,3,6,10}: 10 1001 0001 c) {2,3,4,7,8,9}: 01 1100 1110 1.8-1 why is f not a function from R to R if a) f(x) = 1/x?: f(0) is not defined b) f(x) = x?: Things like -3 are not defined c) f(x) = (x2 + 1) ?: The rule for f is ambiguous. We must have f(x) defined uniquely, but here there are two values associated with every x, the positive square root and the negative square root of (x2 + 1) 1.8-5 Find the domain and range of these functions. a) the function that assigns to each bit string the difference between the number of ones and the number of zeros: domain is the set of all bit strings and the range is Z. For example, if the input is 1010000, then 3 or -3 b) the function that assigns to each bit string twice the number of zeros in that string: domain is the set of all bit strings and the range is the set of even natural numbers. (the value of function can be 0,2,4,...) c) the function that assigns the number of bits left over when a bit string is split into bytes (which are blocks of 8 bits): domain is the set of all bit strings and the range is {0,1,2,3,4,5,6,7} d) the function that assigns to each positive integer the largest perfect square not exceeding this integer: the domain is the set of positive integers and the range is {1,4,9,16,... 1.8-10 Determine whether each of these functions from {a,b,c,d} to itself is one-toone a) f(a)=b, f(b)=a, f(c)=c, f(d)=d: one-to-one b) f(a)=b, f(b)=b, f(c)=d, f(d)=c: not one-to-one, since b is the image of both a and b c) f(a)=d, f(b)=b, f(c)=c, f(d)=d: not one-to-one, since d is the image of both a and d 1.8-11 Which functions in Exercise 10 are onto? a) 1.8-14 Determine whether f:Z Z Z is onto if a) f(m,n) = 2m – n: onto b) f(m,n) = m2 – n2: not onto, for example, 2 is not in the range. If m2 – n2 =(m+n)(m-n), then this expression is divisible by 4 and hence cannot equal 2 c) f(m,n) = m + n + 1: onto d) f(m,n) = |m| – |n|: onto e) f(m,n) = m2 – 4: not onto onto: every element bB there is an element aA with f(a)=b 1.8-19 Determine whether each of these functions is a bijection from R to R • f(x) = 2x + 1: bijection • f(x) = x2 + 1: not a bijection, range is [1, infinite) • f(x) = x3: bijection: a) f(x) = (x2 + 1)/(x2+2): not a bijection, not injection since x and –x have the same image for all real numbers x If a function is not a bijection, we cannot define an inverse function