First Name: Family Name: Student Number: Class/Tutorial: WOLLONGONG COLLEGE AUSTRALIA A College of the University of Wollongong Diploma in Information Technology Mid-Session Test Summer Session 008-00 SOLUTIONS WUCT Discrete Mathematics This exam represents 0% of the total subject marks Reading Time: 5 minutes Time allowed: 0 Minutes ITC Education Ltd trading as Wollongong College Australia CRICOS 073D ABN 40533 WCA-WUCT-EXMST SOLUTIONS Page of
Question. Write the following statement in predicate calculus notation using quantifiers and variables: Both the sum and the difference of any two natural numbers is also a natural number. x y ( x y) ( x y) [3] (b) Write the following statement in simple English without using quantifiers or variables: x,( x is odd y ( x 3y x 3y )) All odd natural numbers are three times some natural number plus one or two. [] (c) For the statement y, x y < x (i) Write the negation of the statement in predicate calculus notation using quantifiers and variables. y, x y x [3] (ii) State whether the negation is true or false, giving reasons for your answer. False. Consider the original statement y, x y < x and take y, giving x < x thus the original statement is true and so the negation is false. [] WCA-WUCT-EXMST SOLUTIONS Page of
Question. Using a full truth table, determine whether the following statement is a tautology, a contradiction, or is contingent: (~ p ( r ) (~ ( p q) ~ r) p q r (~p (r ) (~ (p q) ~r) T T T F F F F F F T T F T T F F F F F F F T T T T F T F T T T F T F F F T F F F F F T F T F T T F T T T T F F F T F F F F T F T T F F T T F T T F F T T T T T F T F F F F F F T T F T T T F T T Step: 3 4 * 6 5 8 7 The table above shows that the given compound statement is contingent.[5, half a mark for each connective and half for conclusion] (b) Using the quick method for evaluating truth tables, prove that the following statement is a tautology: (~ p ( r q)) ((~ r ~ q) p (~ (r ) ((~r ~q) ~ Order: 3 * 4 6 5 8 7 Step # F Step # T F Step #3 T T Step #4 F T T Step #5 F F Step #6 F F Step #7 T Step #: Place F under main connective Step#: Connective 3, must be T and connective 8,, must be "F". Step#3: Connective, ~p must be T and connective,, must be "T". Step#4: p must be F and q and r must all be T. Step#5: From Step#4, ~q and ~r must be F. WCA-WUCT-EXMST SOLUTIONS Page 3 of
Step#6: Connective 6, must be F and given connective 8 is F, connective 7, ~p, must be "F". Step#7: p must be T. Step#4 gives p is F and Step#7 gives p is T. This is a contradiction. Thus there is no combination that will allow F under the main connective and the statement is a tautology. [5, half a mark for each step and one for conclusion] Question 3. Using the Rules of Substitution and Substitution of Equivalence prove that the following statement is a tautology (~ p ( q r)) ((~ r ~ You may use the following and other known tautologies: (i) ( p q) (~ p q) (iii) (( p q) r) ( p ( q r)) (ii) ~ ( p q) (~ p (iv) p p p (~ p ( q r)) ((~ r ~ ~ (~ p ( q r)) ((~ r ~ using(i) (~~ p ~ ( q r)) ((~ r ~ using(ii) ( p (~ q ~ r)) ((~ r ~ using(ii) p ~ q ~ r ~ r ~ q ~ p associativity p ~ p ~ q ~ r (iii) and (iv) T ~ q ~ r T [4 marks, half mark for each step as appropriate, citing laws not required for marks] (b) Explain the following terms as they relate to the set of integers Ÿ. (i) Law of Trichotomy; If a and b are integers, then one and only one of the following relationships hold true: a < b a b a > b [] (ii) Associativity under ordinary multiplication; a, b, c, ( a b) c a ( b c) [] WCA-WUCT-EXMST SOLUTIONS Page 4 of
(iii) Commutativity under ordinary addition. a, b, a b b a [] (c) Prove using the Principle of Mathematical Induction: For all integers n, 4 6 L n n n. Let Claim(n) be For all integers n, 4 6 L n n n. Claim(): n, LHS RHS LHS RHS So Claim() is true Assume Claim(k), that is assume 4 6 L k k k. k K() Prove Claim( k ), that is prove 4 6 L k ( k ) ( k ) ( k ). LHS 4 6 L k ( k ) k k k k k k ( k ) ( k ). RHS by () Thus Claim( k ) is true. So, by the Principle of Mathematical Induction, for all integers n, 4 6 L n n n. [5: Claim(), assumption, proof, conclusion] Question 4. Define or otherwise explain the Fundamental Theorem of Arithmetic. If a and a > then a can be factorised in a unique way in the form: where a α p α α p p 3... p p, p 3 α p k k,, K k are each prime numbers and i α for each i,, K, k. [] WCA-WUCT-EXMST SOLUTIONS Page 5 of
(b) Write down two composite integers, m and n, that are relatively prime. One example: m 4, n 3 3, gcd(4,) [] (i) (ii) What is the value of gcd(m, n)? Briefly explain your answer. Since m and n have no common factor greater than, the greatest common divisor of m and n, gcd(m, n), is equal to. [] What is the value of lcm(m, n)? Briefly explain your answer. Since m and n have no common factor greater than, the least common multiple of m and n, lcm(m, n), is equal to m n. [] (iii) Use the Sieve of Eratosthenes to find all the prime numbers between and 40. 40 6. Primes to 6 are, 3, 5. Delete multiples of, 3, 5. 3 4 5 6 7 8 0 3 4 5 6 7 8 0 3 4 5 6 7 8 30 3 3 33 34 35 36 37 38 3 40 Primes are:, 3, 5, 7,, 3, 7,, 3,, 3, 37 [4: for listing primes up to 6, for sieve, for listed primes] (iv) List the twin primes between and 40. 3 & 5, 5 & 7, & 3, 7 &, & 3. [] (v) Write down a set of twin primes, between and 40, whose sum is a perfect square. 7 & : 7 36 6 [] (c) Use the Euclidean Algorithm to find gcd( 567,) and find integers m and n such gcd( 567,) 567m n. WCA-WUCT-EXMST SOLUTIONS Page 6 of
WCA-WUCT-EXMST SOLUTIONS Page 7 of 567,) gcd( gcd(567,) 0 0 0 0 4 8 567 gcd(567,) 567,) gcd( From above 64, 64 567 8) (567 4) ( 0 ) 0 ( 0 0 0 4 0 8 567 n m [5 finding gcd, 5 finding m, n]
Question 5. Consider the following tautology: z ( z is odd z is odd) Explain how Modus Ponens can be used to prove that The logical rule Modus Ponens states that if both P and 530 is odd. P Q, then so is Q. If P is the statement: n is an odd integer and Q is the statement: n is an odd integer If we let n 530, then P is true, and we know, from results in lectures, P Q is true. Thus, by Modus Ponens, Q is true. [] (b) Consider the following statements: If 7 is less than or equal to 3, then is not a prime number. is a prime number. What conclusion can be made? State what rule is used in making your conclusion. It can be concluded, by the rule of Modus Tollens, that 7 is greater than 3. [] (c) Define or otherwise explain the Law of Syllogism. If P Q and Q R are both tautologies, then so is P R. [] (d) Show by a direct proof that y 3 y. x x y (3y ) y y y 0 y 4 0 4 y 3 y y y 0 3 y [3] (e) Complete the tautology ( p r) ( q r) ( KKKK KK) ( p r) ( q r) (( p q) r) [] WCA-WUCT-EXMST SOLUTIONS Page 8 of
Question 6. Prove or disprove the following statements: (i) For all integers a, b and c, if a b and a c then a ( b c) a b b ap a c c aq b c ap aq a( p q) ar a ( b c) p q r p q K() K() () () (ii), 4 ( z 3) z. [] False. Consider z, z 3 4 3, and 4 does not divide. [] (b) A pigeon fancier wants to provide sufficient cages to ensure that during a pigeon race, none of his cages will have to accommodate more than 5 pigeons. Given that there are more than 0 pigeons racing, what is the minimum number of cages that you would advise should be provided? Let the minimum number of cages recommended be k. The number of pigeons, n, is 0 and 0 5 k or 0 > k 4 k k It follows from the Generalised Pigeonhole Principle that k should be set at in order to ensure that the pigeons could be handled with no more than 5 pigeons per cage. [] (c) (d) Define or otherwise explain the Quotient-Remainder Theorem. If n and d > 0 are both integers, then there exist unique integers q and r such that n dq r and 0 r < d. [] Show that any integer n can be written in one of the 3 forms: n 3 q, n 3q, n 3q, for some integer q. By the Quotient-Remainder Theorem with d 3, q, r : n n 3q r where 0 r < d. Thus r 0, or and so n 3 q, n 3q, n 3q. [] END OF EXAM WCA-WUCT-EXMST SOLUTIONS Page of