CS 173: Discrete Structures, Spring 2013 Homework 3 Solutions

This homework contains 3 problems worth a total of 38 points. It is due on Wednesday, Febuary 13th, at 9pm

Remember to introduce your variables and assumptions at the start of the proof, put your steps in logical order, use connector words and good formatting, and briefly justify key harder steps.

1. [8 points] Three shows, , American Dad, and The Cleveland Show, have characters which often appear on more than one show. Specifically, we know that

(1) The three shows have a total of 57 characters (that is, 57 characters have been on Family Guy, American Dad, and/or the Cleveland Show). (2) 45 Characters have been on Family guy, 26 on American Dad, and 34 on The Cleveland Show (3) 14 characters have been on both Family Guy and American Dad, 7 have been on both American Dad and the Cleveland Show. (4) 7 have been on all three shows.

Answer the following questions, either separately or using a single analysis that covers both questions:

(a) (4 points) How many characters have been on both Family Guy and The Cleveland Show? Explain why your answer is correct. (b) (4 points) Show that every character on The Cleveland Show has been on Family Guy. This doesn’t have to be a formal proof, but include each step and the reasoning.

You may use the following facts, true for any finite sets A, B, and C:

|A ∪ B ∪ C| =|A| + |B| + |C|− |A ∩ B| - |A ∩ C| - |B ∩ C| + |A ∩ B ∩ C|

If A ⊆ B and |A| = |B|, then A = B.

Solution

(a) Let F= the set of characters who have been on Family guy, A=the set of characters who have been on American Dad, and C= the set of characters who have been on The Cleveland Show. We know that |A ∪ F ∪ C| =57,|A|=26, |F |=45, |C|=34, |A ∩ F |= 14, |A ∩ C|=7, and |A ∩ F ∩ C|=7.

1 We want to know |F ∩ C|, and we know that |A ∪ F ∪ C| =|A| + |F | + |C|− |A ∩ F | - |A ∩ C| - |F ∩ C| + |A ∩ F ∩ C|. Filling in known values we see that: 57=26+45+34-14-7- |F ∩ C| +7. So57=91- |F ∩ C|. Solving for |F ∩ C|, we see that |F ∩ C| = 34. So 34 characters have been on both Family Guy and The Cleveland Show. (b) Note that every element of |F ∩ C| must be an element of C (and an element of F). Thus, by the definition of subset, C ⊆ F ∩ C . We saw in part (a) that |F ∩ C| and C| are both equal to 34. So |F ∩ C| = |C|. So by the fact above, we know that C = F ∩ C ⊆ F . Thus, C ⊆ F . Thus, every element of C is an element of F. So every character on The Cleveland Show is also a character who has been on Family Guy.

2. 18 points Let F be a relation on the set Z+ × Z+, i.e pairs of positive integers, such that (a, b)F (x, y) if and only of a = x and b | y. (a) (8 points) Prove that F is antisymmetric. (b) (8 points) Prove that F is transitive. (c) (2 points) Is F a linear order? Why, or why not? Solution

(a) Suppose that we have two given points (a,b) and (x,y) ∈ Z+ × Z+ and assume that (a,b)F(x,y) and (x,y)F(a,b). If we can prove from this assumption that (a,b) = (x,y), then F is antisymmetric (Note: If there are no two such points (a,b) and (x,y) such that they are related in both directions, then F is antisymmetric by vacuous truth). Since (a,b)F(x,y), a=x, and b | y, by the definition of the relation F. And since (x,y)F(a,b), x=a (not new information), and y | b. By the definition of divides, we can see from b | y that y=b*k (equation 1), for some integer k. Similarly, from y | b we know that b=y*j for some integer j (equation 2). Note that, since y and b are both positive, we can see that k and j are also both positive. Combining equations 1 and 2 by substitution, we see that y=(y*j)*k. Since y is positive, it is not zero so we can divide both sides by it and get 1=j*k. Thus (since j and k are both positive integers), the only numbers they could both be is 1. So j=1, k=1. Replacing j with 1 in equation 2, we see that b=y. Thus, since we already know that a=x, we conclude that (a,b)=(x,y), as required. So F is antisymmetric. (b) Assume that for three points (a,b), (x,y), (c,d) ∈ Z+ × Z+, we have (a, b)F (x, y) and (x, y)F (c,d). We want to show that (a, b)F (c,d). By the definition of the relation F, (a, b)F (x, y) and a = x and b | y. Similarly, since (x, y)F (c,d), x = c and y | d. So we have a = x, and x = c. By the transitive property of (equals), this means that a=c.

2 Also, we know that b | y and y | d. And all the variables, being integers, are also real numbers. Thus, since “divides” is transitive for real numbers, (stated in book, p. 71), we know that b | d. Thus, by the definition of F, we know that (a,b)F(c,d), as required. (c) Linear orders require that every pair of positive integers are comparable with every other pair (that is, for all (a,b), (x,y) ∈ Z+ × Z+, (a,b)F(x,y) or (x,y)F(a,b). This can be shown to be untrue for this relation in several different ways, of which we will mention three (only one is needed for full credit). One type of counterexample is when a = x. For example, the two points (1,5) and (3,5). In this case (1,5) is not related to (3,5) because 1 = 3, and (3,5) is not related to (1,5) because 3 = 1. Another type is when y and b do not divide each other. For example, (1,5) and (1,7). A third type is a combination of the above two types. Any single counterexample is enough for full credit on this problem.

3. [12 points] Let the set A be {(x, y):(x, y) ∈ R2, x2 + y2 ≥ 1} . Let the set B be {(a, b):(a, b) ∈ R2, b = a2 +2}. Prove that B ⊆ A. You must use the method of choosing an element from the smaller set and showing that it is also in the larger set. Hint: Graphing the two sets might be helpful for understanding why the result is true, although the proof itself should involve algebra and equations. Solution Consider an arbitrary element of B, (x,y) (Note: we chose the letters “x” and “y” here for convenience. However, the variable names are arbitrary and do not imply that we know this point is in the set A. We still need to show that.) Since (x, y) ∈ B, (x, y) ∈ R2, and y = x2 + 2. Thus, x2+y2 = x2+(x2 + 2)2. Squaring this out, we get x2 + y2 = x2 + x4 +4x2 +4= x4 +5x2 + 4 But x4 +5x2 +4 ≥ 0 + 0 + 4 since x4 and x2 are both squares and thus greater than or equal to zero. Thus, x2+y2 ≥ 4 > 1 . Thus, x2 + y2 ≥ 1. So by the definition of set A, (x,y) ∈ A, as required. Thus, any point in B is also in A, so B ⊆ A.

3