COT300 Practice Problems for Exam. These problems are only meant to help you prepare the first exam. It is not guaranteed that the exam questions will be similar to these problems. There will be five problems on the exam:. Propositional logic and equivalences (. and.2) 2. Predicates and Quantifiers (.3) 3. Rules of Inference and Proofs (.5) 4. Set Operations (2. and 2.2) 5. Functions and sequences (2.3 and 2.4) The (brief) solutions will be available only after 9pm on Thursday night. However, instead of memorizing the solutions, you should attempt to solve all problems by yourself first.. What is the truth value of (p q) (p q), when both p and q are false? Solution: You should work out this problem and convince yourself that your answer is correct. 2. State the converse and contrapositive of, If I answer this question, then I will get 4 points. Solution: You just need to know the definitions of converse and contrapositive. Check out the textbook or lecture slides. 3. Which rule of inference allows you to conclude, Mark has stripes from the statements, Every zebra has stripes and Mark is a zebra? Solution: Same as above. 4. Construct the truth table for the proposition p ( q r). Solution: Clock yourself to make sure that you don t take more than three minutes on this problem. 5. Prove that there is a positive integer that equals the sum of positive integers not exceeding it. Solution: 3 is one such number.
6. Prove that the product of a rational number and an irrational number is irrational. Solution: We know that the product and quotient of two rational numbers are also ration. Therefore, we can prove this by contradiction. Let p, q be the two numbers with p rational and q irrational. Assume that r = pq is rational. Then, this implies that q = r/p is also rational, which is the desired contradiction. 7. Prove that the proposition [(p q) ( p r)] (q r) is a tautology. Solution: Compute the truth table and show that it is always true. 8. We briefly discussed the uniqueness quantifier,!. The notation!x P (x) meant There is a unique x, such that P (x) is true. Express this uniqueness quantification!x P (x) in terms of universal quantifiers, existential quantifiers and logical operators. (Hint: You might need to use nested quantifiers). Solution: Here is a partial solution:!x P (x) x y{a B}. You have to figure out what to put for A and B. 9. Prove that at least one of the real numbers a, a 2,..., a n is greater than or equal to their average. Solution: Proof by contradiction. If all a i are smaller than their average, then you can show that this average is smaller than itself, which is the contradiction. 0. For the following argument, explain which rules of inference are used in each step to lead from the premises to the conclusion: There is someone in this class who has been to France. Everyone who visits France visits the Louvre. Therefore, someone in this class has visited the Louvre. Solution: Again, the answer can be found in the textbook (Section.5).. Give one example of a trivial proof and one example of a vacuous proof. Solution: A vacuous proof is a proof that shows the hypothesis is false. Here is an example: Suppose x is a real number. Show that if x 2 < 0, then x 2 + x 6 = 2. The (vacuous) proof is to show that x 2 < 0 is false if x is real number. Then, because the hypothesis is false, the implication is always true. 2
2. Use the rules of inference to prove that if (a) x(p (x) Q(x)) (b) x( Q(x) S(x)) (c) x(r(x) S(x)) (d) x P (x) are true, then x R(x) is also true. Solution: Work out this problem yourself. Make sure that you know how to solve this problem. There are similar examples in the textbook and lecture slides. 3. Prove that there cannot exist any real number x such that x 2 + /x 2 = π/2. Solution: We did this in class. 4. If x is an integer, prove that x = floor(x/2) + ceil(x/2). Solution: There are two cases: () x = 2k+ is odd. Then floor(x/2) = k and ceil(x/2) = k +. Therefore, x = f loor(x/2) + ceil(x/2). Similarly, if x is even, we can show that x = floor(x/2) + ceil(x/2). 5. Prove that A B C = A + B + C A B A C B C + A B C. Solution: We went over this problem in class. You need to use the formula A B = A + B A B. 6. Give an example each of a function from the set of natural numbers to the set of natural numbers which is (a) one-to-one but not onto, (b) onto but not one-to-one, and (c) neither one-to-one nor onto. Prove your example in each case. Solution: (a) f(n) = n 2. (b) f(n) = n. (c) f(n) =. 7. Let A, A 2,...A n.. be a countable collection of countable sets. Show that their union and intersection are also countable.. Solution: The intersection will be a subset of say A. Because A is countable, the intersection (which is a subset) is also countable. To show that their union is also countable, you can do the following. First, show that the set N >0 N >0 is countable, i.e., the set of cartesian product of positive integers is countable. The required bijection is constructed exactly as in the proof that shows the set of rational numbers is countable. Once you have 3
shown that N >0 N >0 is countable, you can define an onto function from N >0 N >0 to A A 2... A n... showing that the latter set is indeed countable. 8. Determine whether each of these sets is countable. For those that are countable, exhibit an one-to-one correspondence between the set of natural numbers and that set. (a) integers not divisible by 3. (b) integers divisible by 5 but not by 7. (c) the real numbers with decimal representations consisting of all s. (d) the real numbers with representation of all s or 9s. (e) the real numbers not containing 0 in their decimal representation. (f) the real numbers containing only a finite number of s in their decimal representation. Solution: (a) and (b) are both countable because they are subsets of the integers. (c) is also countable. (d) will depend on how you read the problem. If the number can contain s or 9s but not both, then, it will be countable (it is just a union of two countable sets). However, if the number can contain both and 9 in its decimal representation, then, the set is uncountable. Cantor s diagonal argument can be used here to show that this set is uncountable. (e) and (f) are both uncountable. 9. Let f be a function from the set A to the set b. Let S and T be subsets of A. Show that (a) f(s T ) = f(s) f(t ). (b) f(s T ) f(s) f(t ). Solution: Here we show how to solve (a). Let x f(s T ). This means that there exists an y S T such that f(y) = x. If y S, then x f(s). Else, y T, then x f(t ). This shows that x f(s) f(t ). Conversely, if x f(s) f(t ). If x f(t ), there exists y T such that f(y) = x. This shows that x f(s T ). 4
20. Compute the sum n Solution: n. k 2 +k k 2 + k = n This telescoping sum is simply n+. ( k k + ) 5