CS 514, Mathematics for Computer Science Mid-semester Exam, Autumn 2017 Department of Computer Science and Engineering IIT Guwahati Important 1. No questions about the paper will be entertained during the exam. 2. You must answer each question in the space provided for that question in the answer sheet. Answers appearing outside the space provided will not be considered. 3. Keep your rough work separate from your answers. A supplementary sheet is being provided for rough work. Do not attach your rough work to the answer sheet. 4. This exam has 3 questions over 5 pages, with a total of 50 marks. 1. Indicate whether the following statements are true (T) or false (F). Each question carries two marks. A wrong answer will get you 2 marks for each question. (a) For sets A, B and C, if A C = B C and A C = B C then A = B. Solution: TRUE. To prove that A B, take any a A and assume a B. Then a A C = B C. Then a C, and therefore a A C = B C, which implies a B, a contradiction. The proof of B A is symmetric. (b) For sets A, B and C, the equality (A \ B) \ C = A \ (B \ C) holds, where the set difference operation is defined as A \ B = {a A a B}. Solution: FALSE. Take A = B = C = {1}. A \ (B \ C) = {1}. Then (A \ B) \ C =, but (c) There is a bijection from the closed interval [0, 1] of the reals to the closed interval [0, 2] of the reals. Here [a, b] = {x R a x b}. Solution: TRUE. It is easily checked that the function f : [0, 1] [0, 2] defined by f(x) = 2x is a bijection. (d) The function f(x) = (1/x) 1 is a bijection from the half open interval (0, 1] = {x x R and 0 < x 1} on the reals to the non-negative reals R 0 = {x x R and x 0}. Solution: TRUE. It is easily checked that f is a bijection between the two sets. (e) Let Z + be the set of positive integers and R Z 2 + Z 2 + be the relation defined by ((a, b), (c, d)) R if and only if ad = bc. Then R is an equivalence relation.
CS 514 (Cont.) Autumn 2017 Page 2 of 5 Solution: TRUE. The three properties of an equivalence relation can be easily checked. (f) Let R 1 and R 2 be equivalence relations on a set X. Then R 1 R 2 is also an equivalence relation. Solution: FALSE. Let X = {a, b, c}, R 1 = {(a, a), (b, b), (c, c), (a, b), (b, a)} and R 2 = {(a, a), (b, b), (c, c), (b, c), (c, b)}. Then R 1 and R 2 are equivalence relations but R 1 R 2 is not an equivalence relation. (g) Let (Z, ) be the set of integers with the relation m n meaning m divides n, i.e., there exists a k Z such that n = mk. Then the divides relation on integers is a partial order. Solution: FALSE. The relation is not antisymmetric, since 5 divides 5 and 5 also divides 5, but 5 5. (h) If A is an uncountable set and B is a countable set then A \ B = {a A a B} is uncountable. Solution: TRUE. If A \ B were countable then A = (A \ B) (A B), being a union of two countable sets, would also be countable. (16) 2. Indicate whether the following statements are true (T) or false (F). Each question carries two marks. A wrong answer will get you 2 marks for each question. (a) If a formula A in propositional logic is satisfiable, then A is unsatisfiable. Solution: FALSE. The formulas P and P are both satisfiable, where P is an atomic formula. (b) A formula A in propositional logic is valid iff A is unsatisfiable. Solution: TRUE. A is valid iff every truth assignment τ satisfies A iff every truth assignment falsifies A iff A is unsatisfiable. (c) (A B) is equivalent to ( B A), where A and B are arbitrary formulas of propositional logic.
CS 514 (Cont.) Autumn 2017 Page 3 of 5 Solution: TRUE. Use truth tables for (A B) and ( B A). (d) If P is a binary predicate symbol in first-order logic then the formula ( y xp (x, y)) ( x yp (x, y)) is valid. Solution: TRUE. Using informal arguments, suppose the structure M satisfies y xp (x, y). Then M satisfies xp (x, m) for some m M, where M is the universe of M. This implies M satisfies P (n, m) for all n M and some m M, which is the same as M satisfies x yp (x, y). (e) The first-order logic formula ( x(p (x) Q(x)) (( xp (x)) ( xq(x)))) is valid. Here P and Q are unary predicate symbols. Solution: FALSE. Take the structure M with the universe M = N and P M (n) is true iff n is odd and Q M (n) is true iff n is even. (f) The first-order sentence x y (x = y) is satisfied by an interpretation iff its universe contains exactly two elements. Solution: FALSE. The formula says the universe contains at least two elements. (g) Consider the sentence A = (A 1 A 2 A 3 A 4 ) in first-order logic, where P is a binary predicate symbol and A 1, A 2, A 3 and A 4 are defined as follows: A 1 = xp (x, x) A 2 = x y((p (x, y) P (y, x)) x = y) A 3 = x y z((p (x, y) P (y, z)) P (x, z)) A 4 = y x(p (x, y) (x = y)) Then all interpretations that satisfy A are infinite, i.e., have infinite domains (universes). Solution: TRUE. The first three sentences together assert that the interpretation of P must be a partial order. The last sentence says that there is no minimal element, which implies the order must be infinite. (h) Consider the sentence A = (A 1 A 2 A 3 ) in first order logic, where P is a binary predicate symbol and A 1, A 2 and A 3 are defined as follows: A 1 = x P (x, x) A 2 = x y(p (x, y) P (y, x)) A 3 = x y z((p (x, y) P (y, z)) P (x, z))
CS 514 (Cont.) Autumn 2017 Page 4 of 5 Then A is satisfiable. Solution: TRUE. The three sentences together assert that the interpretation of P must be a non-reflexive, symmetric and transitive relation. The structure M with the universe any non-empty set (e.g., N) with P M =, the empty relation, satisfies the sentence A. (16) 3. Indicate whether the following statements are true or false, with a justification. There is no negative marking for this question but without proper justification you won t get any credit. Each question carries 3 marks. (a) If a b (mod m) and c d (mod m), where a, b, c, d and m are integers with c and d positive and m 2, then a c b d (mod m). Solution: FALSE. Take m = 3, a = b = 2, c = 1 and d = 4. Then a c = 2 and b d = 16 and 2 16 (mod 3). (b) There are no three consecutive odd positive integers, all greater than 3, that are primes, i.e., there are no odd primes of the form p, p + 2 and p + 4 where p > 3. Solution: TRUE. If p is a multiple of 3 then the statement holds since we are given p > 3. Suppose not, i.e., p 1 (mod 3) or p 2 (mod 3). In the first case, p + 2 is divisible by 3 and in the second, p + 4 is divisible by 3 and both are greater than 3. (c) 937 is a multiplicative inverse of 13 modulo 2436. Solution: TRUE. 937 13 = 12181 = 2436 5 + 1. (d) The congruence 4x 5 (mod 9) has no solution in x. Solution: FALSE. Take x = 8. In general, any k which is relatively prime to n has an inverse modulo n, so 4 has an inverse modulo 9. Multiply both sides of the congruence by 4 1. (e) If p is a prime, the only solution of x 2 x 1 (mod p) or x 1 (mod p). 1 (mod p) are integers x such that Solution: TRUE. x 2 1 (mod p) iff p divides (x 2 1) iff p divides (x + 1) or p divides (x 1), and the result follows.
CS 514 (Cont.) Autumn 2017 Page 5 of 5 (f) 22 200000001 has a multiplicative inverse modulo 49. Solution: TRUE. 22 and 49 are relatively prime, and therefore 22 200000001 and 49 are relatively prime as well. (18)