CSC 125 :: Final Exam May 3 & 5, 2010

Similar documents
CSC 125 :: Final Exam December 15, 2010

CSC 125 :: Final Exam December 14, 2011

Packet #2: Set Theory & Predicate Calculus. Applied Discrete Mathematics

At least one of us is a knave. What are A and B?

Sample Problems for all sections of CMSC250, Midterm 1 Fall 2014

A. Propositional Logic

DISCRETE MATH: FINAL REVIEW

1. Consider the conditional E = p q r. Use de Morgan s laws to write simplified versions of the following : The negation of E : 5 points

Discrete Structures CRN Test 3 Version 1 CMSC 2123 Autumn 2013

Do not start until you are given the green signal

Discrete Mathematical Structures: Theory and Applications

WUCT121. Discrete Mathematics. Logic. Tutorial Exercises

Intro to Logic and Proofs

2. The Logic of Compound Statements Summary. Aaron Tan August 2017

UNIVERSITY OF CALICUT SCHOOL OF DISTANCE EDUCATION B Sc (MATHEMATICS) I Semester Core Course. FOUNDATIONS OF MATHEMATICS (MODULE I & ii) QUESTION BANK

KS MATEMATIKA DISKRIT (DISCRETE MATHEMATICS ) RULES OF INFERENCE. Discrete Math Team

Logic Overview, I. and T T T T F F F T F F F F

Undergraduate Notes in Mathematics. Arkansas Tech University Department of Mathematics. Introductory Notes in Discrete Mathematics Solution Guide

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel

A Quick Lesson on Negation

Rules Build Arguments Rules Building Arguments

COMP 182 Algorithmic Thinking. Proofs. Luay Nakhleh Computer Science Rice University

Lecture Notes on DISCRETE MATHEMATICS. Eusebius Doedel

CS 2336 Discrete Mathematics

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel

Chapter 1 Elementary Logic

Proofs. Example of an axiom in this system: Given two distinct points, there is exactly one line that contains them.

Announcements. Exam 1 Review

Math 3336: Discrete Mathematics Practice Problems for Exam I

2/2/2018. CS 103 Discrete Structures. Chapter 1. Propositional Logic. Chapter 1.1. Propositional Logic

First order Logic ( Predicate Logic) and Methods of Proof

Boolean Algebra and Proof. Notes. Proving Propositions. Propositional Equivalences. Notes. Notes. Notes. Notes. March 5, 2012

Reexam in Discrete Mathematics

Chapter 1, Logic and Proofs (3) 1.6. Rules of Inference

Steinhardt School of Culture, Education, and Human Development Department of Teaching and Learning. Mathematical Proof and Proving (MPP)

Logic and Proof. Aiichiro Nakano

CSI30. Chapter 1. The Foundations: Logic and Proofs Nested Quantifiers

Readings: Conjecture. Theorem. Rosen Section 1.5

Chapter 3. The Logic of Quantified Statements

ICS141: Discrete Mathematics for Computer Science I

Predicate Logic & Quantification

Test 1 Solutions(COT3100) (1) Prove that the following Absorption Law is correct. I.e, prove this is a tautology:

Tools for reasoning: Logic. Ch. 1: Introduction to Propositional Logic Truth values, truth tables Boolean logic: Implications:

Methods of Proof. 1.6 Rules of Inference. Argument and inference 12/8/2015. CSE2023 Discrete Computational Structures

1 The Foundation: Logic and Proofs

Rules of Inference. Arguments and Validity

Solutions to Exercises (Sections )

5. Use a truth table to determine whether the two statements are equivalent. Let t be a tautology and c be a contradiction.

The Logic of Compound Statements cont.

CSE 20 DISCRETE MATH. Winter

Packet #1: Logic & Proofs. Applied Discrete Mathematics

CS0441 Discrete Structures Recitation 3. Xiang Xiao

1 The Foundation: Logic and Proofs

Chapter 4, Logic using Propositional Calculus Handout

software design & management Gachon University Chulyun Kim

3. The Logic of Quantified Statements Summary. Aaron Tan August 2017

CSE 20 DISCRETE MATH. Fall

Proofs. Chapter 2 P P Q Q

Review: Potential stumbling blocks

Review 1. Andreas Klappenecker

CSCI-2200 FOUNDATIONS OF COMPUTER SCIENCE

III. Elementary Logic

What is the decimal (base 10) representation of the binary number ? Show your work and place your final answer in the box.

1.1 Statements and Compound Statements

PHI Propositional Logic Lecture 2. Truth Tables

MACM 101 Discrete Mathematics I. Exercises on Propositional Logic. Due: Tuesday, September 29th (at the beginning of the class)

Natural Deduction is a method for deriving the conclusion of valid arguments expressed in the symbolism of propositional logic.

Chapter 1: The Logic of Compound Statements. January 7, 2008

CS100: DISCRETE STRUCTURES. Lecture 5: Logic (Ch1)

MAT 243 Test 1 SOLUTIONS, FORM A

Discrete Mathematics Exam File Spring Exam #1

Lecture 3. Logic Predicates and Quantified Statements Statements with Multiple Quantifiers. Introduction to Proofs. Reading (Epp s textbook)

Section A (not in the text) Which of the following are statements? Explain. 3. The President of the United States in 2089 will be a woman.

3/29/2017. Logic. Propositions and logical operations. Main concepts: propositions truth values propositional variables logical operations

CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS

Mathematical Induction

Section 1.3. Let I be a set. When I is used in the following context,

Review 3. Andreas Klappenecker

Math 3320 Foundations of Mathematics

Normal Forms Note: all ppts about normal forms are skipped.

Mathacle. PSet ---- Algebra, Logic. Level Number Name: Date: I. BASICS OF PROPOSITIONAL LOGIC

Discrete Mathematics

(Refer Slide Time: 02:20)

Lecture 7 Feb 4, 14. Sections 1.7 and 1.8 Some problems from Sec 1.8

Proofs: A General How To II. Rules of Inference. Rules of Inference Modus Ponens. Rules of Inference Addition. Rules of Inference Conjunction

Formal Logic: Quantifiers, Predicates, and Validity. CS 130 Discrete Structures

Logic. Logic is a discipline that studies the principles and methods used in correct reasoning. It includes:

CSE 1400 Applied Discrete Mathematics Proofs

Lecture Notes 1 Basic Concepts of Mathematics MATH 352

UNIVERSITY OF VICTORIA DECEMBER EXAMINATIONS MATH 122: Logic and Foundations

Proofs. Introduction II. Notes. Notes. Notes. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry. Fall 2007

CSCE 222 Discrete Structures for Computing. Review for the Final. Hyunyoung Lee

PSU MATH RELAYS LOGIC & SET THEORY 2017

ECOM Discrete Mathematics

Midterm Exam Solution

A Little Deductive Logic

Full file at Chapter 1

Logic. Definition [1] A logic is a formal language that comes with rules for deducing the truth of one proposition from the truth of another.

Thinking of Nested Quantification

Propositional Logic. Argument Forms. Ioan Despi. University of New England. July 19, 2013

Transcription:

CSC 125 :: Final Exam May 3 & 5, 2010 Name KEY (1 5) Complete the truth tables below: p Q p q p q p q p q p q T T T T F T T T F F T T F F F T F T T T F F F F F F T T 6-15. Match the following logical equivalences with the answers found in the Answer Bank. Write the correct letter just to the right of the symbol. Note: Some answers will be used more than once: 6. Identity Laws 7. Domination Laws 8. Idempotent Laws 9. Double Negation Law 10. Commutative Laws p T p p F p p T T p F F p p p p p p ( p) p p q q p p q q p 1

11. Associative Laws 12. Distributive Laws 13. DeMorgan's Laws 14. Absorption Laws 15. Negation Laws (p q) r p (q r) (p q) r p (q r) p (q r) (p q) (p r) p (q r) (p q) (p r) (p q) p q (p q) p q p (p q) p p (p q) p p p T p p F 16-20. Fill in the missing portion of each of the rules of inference named below: 16. Modus ponens 17. Modus tollens p q p. q p q q. p 18. Hypothetical syllogism p q q r p r 19. Disjunctive syllogism p q p. q 2

20. Resolution p q p r q r (21 26) Let B(x,y) be the statement student x attended basketball game y, where the domain for x consists of all students in this class and the domain for y consists of all basketball games this season. Match each of the quantified expressions below with the sentences found in the Answer Bank. Write the letter of the matching sentence just to the right of the expression. Please note: Some answers may be used more than once. 21. x y B(x,y) A student from this class attended a basketball game this season. 22. x y B(x,y) x y B(x,y) x y B(x,y) Note: Equivalent to #38. No student from this class attended a basketball game this season. {For all students and all basketball games, it not true that any student attended any game} 23. x y B(x,y) A student from this class attended every basketball game this season. 24. x y B(x,y) x y B(x,y) x y B(x,y) Note: Equivalent to #37. No student from this class attended every basketball game this season. 25. x y B(x,y) Every student from this class attended a basketball game this season. 26. x y B(x,y) Every student from this class attended every basketball game this season. (27 29) Let F(x,y) be the statement x can fool y, where the domain for both x and y consists of all people in the world. Use quantifiers to express these sentences. 27. Everyone can fool Fred. x F(x,Fred) 3

28. Evelyn can fool everybody. y F(Evelyn,y) 29. Someone can fool everybody. x y F(x,y) (30 32) Let the domain of P(x) consist of the integers 1, 2 and 3 Write out each proposition using disjunctions, conjunctions and negations. 30. x P(x) P(1) P(2) P(3) 31. x P(x) P(1) P(2) P(3) 32. x P(x) P(1) P(2) P(3) (33 37) Determine whether the arguments below are valid or invalid, then circle either Valid or Invalid. If valid, using the list of valid argument forms found in the Answer Bank, write the letter of the rule of inference; if invalid write the letter of the logical fallacy, again using the list of invalid argument forms found in the Answer Bank. 33. If we get 10" of snow, school will be cancelled. We got 8" of snow. School will not be cancelled. Invalid denying the hypothesis 34. If we pigs can fly, Santa Claus is real. Pigs can fly. Santa Claus is real. Valid Invalid Valid Valid modus ponens {affirming the hypothesis} 35. If we pigs can fly, Santa Claus is real. Santa Claus is not real. Pigs cannot fly. Invalid 4

Valid Valid modus tollens {denying the conclusion} 36. If pigs can fly, elephants can sing. If elephants can sing, monkeys can compose music. If pigs can fly, monkeys can compose music. Invalid Valid hypothetical syllogism 37. Logic is either hard or it is nutty. Either logic is easy or it is impossible. Logic is either nutty or it is impossible. Valid Invalid Valid resolution (38 41) Let A = {1, 3, 5, 6} B = {1, 2, 4, 6, 7} 38. A B = {1, 2, 3, 4, 5, 6, 7} 39. A B = {1, 6} 40. A B = {3, 5} 41. A B = {2, 3, 4, 5, 7} 42. Let A = {a, b, c} Give the power set of A, P(A) = {, {a,b,c},{a}, {b}, {c}, {a,b}, {a,c}, {b,c}} (43 44) Let A = {a,b,c} B = {x,y}. Find 43. A B = {(a,x), (a,y), (b,x), (b,y), (c,x), (c,y)} Valid Invalid 5

44. B B = {(x,x), (x,y), (y,y), (y,x)} (45 48) Determine whether each sentence below is true or false. Circle either True or False. 45. {a, b, c} {a, b, c} True False 46. {a, b, c} {a, b, c} True False 47. {a, b} {a, b, c} True False 48. {0} True False (49 51) Determine whether each sentence below is always true or not (sometimes false). Circle either Always True or Not Always. 49. (A B) A Always True Not Always 50. (A B) A Always True Not Always 51. A B = B A Always True Not Always (52 53) Which region(s) in the Venn diagrams above represent: 52. A (B C) B C = 2,3,4,5,6,7 A (B C) = 2,4,5 6

53. cmp(a) cmp(b) cmp(c) Note: cmp(a) cmp(b) cmp(c) = cmp(a B C) A B C = 1,2,3,4,5,6,7 cmp(a B C) = 8 = cmp(a) cmp(b) cmp(c) (54 55) Give the following combinations in simplified form, if: f(x) = (x 2 5) g(x) = (3x + 1) 54. (f + g) (x) = (x 2 5) + (3x + 1) = x 2 + 3x 4 55. (f o g) (x) = f(g(x)) = ((3x+1) 2 5) = 9x 2 + 6x + 1 5 = 9x 2 + 6x 6 (56 57) For the questions below, the notation n j=0 x represents the summation of x as j goes from 0 to n. (56 57) What are the values of these sums? 56. 5 k=0 (k+1) (0+1) + (1+1) + (2+1) + (3+1) + (4+1) + (5+1) = 1 + 2 + 3 + 4 + 5 + 6 = 21 57. 4 j=0 3 3 + 3 + 3 + 3 + 3 = 5*3 = 15 (58 59) What is the value of each of these geometric progressions? 58. 5 j=0 2 j a = 1; r = 2; n = 5 a(r n+1 1)/(r 1) = 1(2 6 1)/(2 1) = 64 1 = 63 59. 4 j=0 ( 3) j a = 1; r = 3; n = 4 a(r n+1 1)/(r 1) = 1(( 3) 5 1)/( 3 1) = ( 243 1)/( 4) = 244/ 4 = 61 (60 61) Compute each of these double sums. 60. 3 i=1 3 j=1 (i+j) 3 i=1 (i+1) + (i+2) + (i+3) = 3 i=1 3i+6 = (3*1 + 6) + (3*2 + 6) + (3*3 + 6) = 9 + 12 + 15 = 36 7

61. 3 i=0 2 j=0 (3i+2j) 3 i=0 (3i + 2*0) + (3i + 2*1) +(3i + 2*2) = 3 i=0 (3i + 0 + 3i + 2 + 3i + 4) = 3 i=0 (9i + 6) = (9*0 + 6) + (9*1 + 6) + (9*2 + 6) + (9*3 + 6) = 9*6 + 4*6 = 54 + 24 = 78 62. Arrange these complexity classes in ascending order of complexity: O(n n ), O(n b ), O(n), O(1), O(n!), O(n log n), O(log n), O(b n ) Answer:: O(1), O(log n), O(n), O(n log n), O(n b ), O(b n ), O(n!), O(n n ) 63. P(9,3) = 9!/6! = 362880/720 = 504 64. C(10,4) = 10!/4!6! = 3628800/24*720 = 210 65. The 8 th line of Pascal s triangle is given below. Give the next line. 1 7 21 35 35 21 7 1 Answer:: 1 8 28 56 70 56 28 8 1 66. How many different bit strings of length 8 are there? 256 67. 144 mod 17 = 8 68. 197 mod 13 = 2 69. Give the prime factorization of 8008 2 3 *7*11*13 70. Give the prime factorization of 1485 3 3 *5*11 71. Give the prime factorization of 7! 2 4 *3 2 *5*7 72. List 3 consecutive odd integers that are all prime. 8

3, 5, 7 73. How many bit strings of length 8 contain exactly 3 1's? 8*7*6/3*2*1 = 56 74. What is the minimum number of students, each of whom comes from one of the 50 states, that must be enrolled in a university to guarantee that there are at least 100 that come from the same state? 4951 75. What are the two basic components of a recursive function? base case recursive call 76. What are the two basic components of mathematical induction? base case inductive step 77. What are the steps in proof by mathematical induction? 1. prove the base case 2. assume true for k 3. prove that it follows for k+1 OR: 1. prove base case, P(0) 2. prove P(k) P(k+1) 78. Give the recursive definition of factorial: fact(n) = 1, if n = 0 n * fact(n), otherwise 79. Why is this not a circular definition? Because: 1. n-1 < n, and therefore: 2. We are guaranteed to eventually reach the base case in the definition 80-81. Prove: The sum of two odd integers is even. Proof: Let: a = 2k + 1 b = 2l + 1 Then: a + b = 2k + 1 + 2 l + 1 = 2(k + l +1) EVEN 9

82-83. Prove: The product of two odd integers is odd. Proof: Let: a = 2k + 1 b = 2l + 1 Then: ab = (2k + 1)*(2 l + 1) = 4kl + 2k + 2l +1 = 2(2kl + k + l) + 1 ODD 84-85. Prove: For every positive integer n, there are n consecutive composite integers. [Hint: Consider the n consecutive integers starting with (n+1)! + 2.] Proof: 2 (n+1)! + 2 3 (n+1)! + 3 4 (n+1)! + 4 5 (n+1)! + 5.. n (n+1)! + n n+1 (n+1)! + n+1 Thus, there are n consecutive composites. Extra Credit EC-1. Give the values of C and k which can be used to show that f(x) = 3x + 7 is O(x). C = 4; k = 7 EC-2. Give the values of C and k which can be used to show that f(x) = x 4 + 9x 3 + 5x 2 + 4x + 7 is O(x 4 ). C = 5; k = 9 EC-3. How many bit strings of length 10 contain at least 4 1's? 2 10 at most 3 1's = 2 10 (C(10,0) + C(10,1) + C(10,2) + C(10,3)) = 1024 - (1 + 10 + 45 + 120) = 848 EC-4. How many bit strings of length 10 have an equal number of 1's and 0's? 10

To be equal #-1s = #-0s = 5 So question is, how many bit strings have exactly 5 1's? C(10,5) = 252 EC-5. What is the coefficient of x 5 y 8 in (x + y) 13? C(13,5) = 1287 EC-6. What is the coefficient of x 7 in (x + 1) 11? C(11,7) = 330 EC-7. What is the coefficient of y 3 x 5 in (3y + 2x) 8? (3y 3 )(2x 5 )*C(8,3) = 3 3 2 5 *8*7*6/3*2*1 = 27*32*56 = 48384 EC-8. What is the coefficient of x 9 in (2 x) 19? -2 10 *C(19,9) = -2 10 *92378 = -94,595,072 EC-9. Prove or disprove: If a bc, with a,b & c positive integers, then either a b or a c. DISPROOF:: by counterexample: a = 15, b =9, c = 5, bc = 45 15 45 but 15 9 & 15 5 OR: a = 6, b =2, c = 9, bc = 18 6 18 but 6 2 & 6 9 EC-10. Prove by mathematical induction: n! > 2 n, for all n > c, where c is some positive integer. To Prove: n! > 2 n, for all n > 3. PROOF:: Prove base case: 4! = 24 > 16 = 2 4 Inductive step: Assume: k! > 2 k, for all k > 3. To prove: (k+1)!> 2 k+1. Proof: (k+1)! = (k+1)*k! > (k+1)* 2 k > 2*2 k = 2 k+1 EC-11. Prove by mathematical induction: The sum of the first n even nonzero integers is n(n+1). In other words, prove: n i=1 i = n(n+1) 11

PROOF:: Prove base case: To prove: 1 i=1 i = n(n+1) Proof: 1 i=1 i = 2*1 = 2 If n =1, then n(n+1) = 1*(1+1) = 2 Inductive step: Assume: k i=1 i = k(k+1) To prove: k+1 i=1 i = (k+1)[(k+1) + 1] Proof: k+1 i=1 i = k i=1 i + 2(k+1) = k(k+1) + 2(k+1) = (k+1)(k+2) = (k+1)[(k+1) + 1] EC-12. Prove by mathematical induction: n! > 25 n, for all n > c, where c is some positive integer. To Prove: n! > 25 n, for all n > 65. PROOF:: Prove base case: 65! = 8.2 x 10 90 > 7.3 x 10 90 = 25 65 Inductive step: Assume: k! > 25 k, for all k > 65. To prove: (k+1)!> 25 k+1. Proof: (k+1)! = (k+1)*k! > (k+1)* 25 k > 25*25 k = 25 k+1 EC-13. Prove: For all b > 0, c b such that n! > b n, for all n > c b. PROOF:: It is very likely that c b = ceil(2*e) is the correct value. But for a Q&D solution, c b = b b^2+b will work. First, we look at two examples: b = 3 b b^2+b = 3 12 (b 2 +b)! = 1*2*3*4*5*6*7*8*9*10*11*12 3*4*5 > 3 3 6*7*8 > 3 3 9 = 3 2 10 > 3 2 11 > 3 2 12 > 3 2 All together, (b 2 +b)! > 3 2*3+4*2 = 3 14 > 3 12 12

b = 5 b b^2+b = 5 30 (b 2 +b)! = 1*2*3*4*5 *.. *29*30 5*6*7*8*9 > 5 5 10*11*12*13*14 > 5 5 15*16*17*18*19 > 5 5 20*21*22*23*24 > 5 5 25 = 5 2 26 > 5 2 27 > 5 2 28 > 5 2 29 > 5 2 30 > 5 2 All together, (b 2 +b)! > 5 4*5+6*2 = 5 32 > 5 30 In general, b b^2+b represents b multiplied by itself b 2 + b times (b 2 +b)! is a number greater than b multiplied by itself (b-1)*b + 2*(b+1) = b 2 b +2b +2 = b 2 + b +2 times Since b 2 + b +2 > b 2 + b, (b 2 + b)! > b b^2+b 13