1 / 48

Discrete Mathematics Lecture 2 Continuing Logic, Quantified Logic, Beginning Proofs

This lecture covers conditional statements, quantified logic, beginning proofs, and fallacies in discrete mathematics. Topics include truth tables, representation of conditionals, valid argument forms, and common logical fallacies.

ftobey
Download Presentation

Discrete Mathematics Lecture 2 Continuing Logic, Quantified Logic, Beginning Proofs

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Harper Langston New York University Summer 2018 Discrete MathematicsLecture 2Continuing Logic, QuantifiedLogic, Beginning Proofs

  2. Administration / Q&A • Class Web Site http://cs.nyu.edu/courses/summer18/CSCI-GA.2340-001/ • Mailing ListSubscribe at see website / Classes Messages to: see website / Classes • TA/Office Hours, etc: Homework (in person or on Classes – extra day for Classes)

  3. Conditional Statements • Write truth table for: p  q  ~p • Show that (p  q)  r = (p  r)  (q  r) • Representation of : p  q = ~p  q • Re-write using if-else: Either you get in class on time, or you risk missing some material • Negation of : ~(p  q) = p  ~q • Write negation for: If it is raining, then I cannot go to the beach

  4. Conditional Statements • Contrapositive p  q is another conditional statement ~q  ~p • A conditional statement is equivalent to its contrapositive • The converse of p  q is q  p • The inverse of p  q is ~p  ~q • Conditional statement and its converse are not equivalent • Conditional statement and its inverse are not equivalent

  5. Conditional Statements • The converse and the inverse of a conditional statement are equivalent to each other • p only if q means ~q  ~p, or p  q • Biconditional of p and q means “p if and only if q” and is denoted as p  q • r is a sufficient condition for s means “if r then s” • r is a necessary condition for s means “if not r then not s”

  6. Exercises • Write contrapositive, converse and inverse statements for: • If P is a square, then P is a rectangle • If today is Thanksgiving, then tomorrow is Friday • If c is rational, then the decimal expansion of r is repeating • If n is prime, then n is odd or n is 2 • If x is nonnegative, then x is positive or x is 0 • If Tom is Ann’s father, then Jim is her uncle and Sue is her aunt • If n is divisible by 6, then n is divisible by 2 and n is divisible by 3

  7. Arguments • An argument is a sequence of statements. All statements except the final one are called premises (or assumptions or hypotheses). The final statement is called the conclusion. • An argument is considered valid if from the truth of all premises, the conclusion must also be true. • The conclusion is said to be inferred or deduced from the truth of the premises

  8. Arguments • Test to determine the validity of the argument: • Identify the premises and conclusion of the argument • Construct the truth table for all premises and the conclusion • Find critical rows in which all the premises are true • If the conclusion is true in all critical rows then the argument is valid, otherwise it is invalid • Example of valid argument form: • Premises: p  (q  r) and ~r, conclusion: p  q • Example of invalid argument form: • Premises: p  q  ~r and q  p  r, conclusion: p  r

  9. Valid Argument-Forms • Modus ponens (method of affirming): • Premises: p  q and p, conclusion: q • Modus tollens (method of denying): • Premises: p  q and ~q, conclusion: ~p • Disjunctive addition: • Premises: p, conclusion: p | q • Premises: q, conclusion: p | q • Conjunctive simplification: • Premises: p & q, conclusion: p, q

  10. Valid Argument-Forms • Disjunctive Syllogism: • Premises: p | q and ~q, conclusion: p • Premises: p | q and ~p, conclusion: q • Hypothetical Syllogism • Premises: p  q and q  r, conclusion: p  r • Dilemma: proof by division into cases: • Premises: p | q and p  r and q  r, conclusion: r

  11. Complex Deduction • Premises: • If my glasses are on the kitchen table, then I saw them at breakfast • I was reading the newspaper in the living room or I was reading the newspaper in the kitchen • If I was reading the newspaper in the living room, then my glasses are on the coffee table • I did not see my glasses at breakfast • If I was reading my book in bed, then my glasses are on the bed table • If I was reading the newspaper in the kitchen, then my glasses are on the kitchen table • Where are the glasses?

  12. Fallacies • A fallacy is an error in reasoning that results in an invalid argument • Three common fallacies: • Vague or ambiguous premises • Begging the question (assuming what is to be proved) • Jumping to conclusions without adequate grounds • Converse Error: • Premises: p  q and q, conclusion: p • Inverse Error: • Premises: p  q and ~p, conclusion: ~q

  13. Fallacies • It is possible for a valid argument to have false conclusion and for an invalid argument to have a true conclusion: • Premises: if John Lennon was a rock star, then John Lennon had red hair, John Lennon was a rock star; Conclusion: John Lennon had red hair • Premises: If New York is a big city, then New York has tall buildings, New York has tall buildings; Conclusion: New York is a big city

  14. Contradiction • Contradiction rule: if one can show that the supposition that a statement p is false leads to a contradiction , then p is true. • Knight is a person who always says truth, knave is a person who always lies: • A says: B is a knight • B says: A and I are of opposite types What are A and B?

  15. Digital Logic Circuits • Digital Logic Circuit is a basic electronic component of a digital system • Values of digital signals are 0 or 1 (bits) • Black Box is specified by the signal input/output table • Three gates: NOT-gate, AND-gate, OR-gate • Combinational circuit is a combination of logical gates • Combinational circuit always correspond to some boolean expression, such that input/output table of a table and a truth table of the expression are identical

  16. Number Systems • Decimal number system • Binary number system • Conversion between decimal and binary numbers • Binary addition and subtraction

  17. Logic of Quantified Statements

  18. Predicates • A predicate is a sentence that contains a finite number of variables and becomes a statement when specific values are substituted for the variables • The domain of a predicate variable is a set of all values that may be substituted in place of the variable • P(x): x is a student at NYU

  19. Predicates • If P(x) is a predicate and x has domain D, the truth set of P(x) is the set of all elements in D that make P(x) true when substituted for x. The truth set is denoted as: {x  D | P(x)} • Let P(x) and Q(x) be predicates with the common domain D. P(x)  Q(x) means that every element in the truth set of P(x) is in the truth set of Q(x). P(x)  Q(x) means that P(x) and Q(x) have identical truth sets

  20. Universal Quantifier • Let P(x) be a predicate with domain D. A universal statement is a statement in the form “x  D, P(x)”. It is true iff P(x) is true for every x from D. It is false iff P(x) is false for at least one x from D. A value of x from which P(x) is false is called a counterexample to the universal statement • Examples • D = {1, 2, 3, 4, 5}: x  D, x² >= x • x  R, x² >= x • Method of exhaustion

  21. Existential Quantifier • Let P(x) be a predicate with domain D. An existential statement is a statement in the form “x  D, P(x)”. It is true iff P(x) is true for at least one x from D. It is false iff P(x) is false for every x from D. • Examples: • m  Z, m² = m • E = {5, 6, 7, 8, 9}, x  E, m² = m

  22. Universal Conditional Statement • Universal conditional statement “x, if P(x) then Q(x)”: • x R, if x > 2, then x2 > 4 • Writing Conditional Statements Formally • Universal conditional statement is called vacuously true or true by default iff P(x) is false for every x in D

  23. Negation of Quantified Statements • The negation of a universally quantified statement x  D, P(x) is x  D, ~P(x) • “All balls in the bowl are red” – Vacuosly True Example for Universal Statements • The negation of an existentially quantified statement x  D, P(x) is x  D, ~P(x) • The negation of a universal conditional statement x  D, P(x)  Q(x) is x  D, P(x)  ~Q(x)

  24. Exercises • Write negations for each of the following statements: • All dinosaurs are extinct • No irrational numbers are integers • Some exercises have answers • All COBOL programs have at least 20 lines • The sum of any two even integers is even • The square of any even integer is even • Let P(x) be some predicate defined for all real numbers x, let: r = x  Z, P(x); s = x  Q, P(x); t = x  R, P(x) • Find P(x) (but not x  Z) so that r is true, but s and t are false • Find P(x) so that both r and s are true, but t is false

  25. Variants of Conditionals • Contrapositive • Converse • Inverse • Generalization of relationships from before • Examples

  26. Necessary and Sufficient Conditions, Only If • x, r(x) is a sufficient condition for s(x) means: x, if r(x) then s(x) • x, r(x) is a necessary condition for s(x) means: x, if s(x) then r(x) (or x, if ~r(x) then ~s(x), if r(x) does not happen, s(x) cannot happen) • x, r(x) only if s(x) means: x, if r(x) then s(x) (or x, if ~s(x) then ~r (x))

  27. Multiply Quantified Statements • For all positive numbers x, there exists number y such that y < x • There exists number x such that for all positive numbers y, y < x • For all people x there exists person y such that x loves y • There exists person x such that for all people y, x loves y • Definition of mathematical limit: • Order of quantifiers matters in some (most) cases (will find page reference, “lively discussion”: http://math.stackexchange.com/questions/201051/is-the-order-of-universal-existential-quantifiers-important

  28. Negation of Multiply Quantified Statements • The negation of x, y, P(x, y) is logically equivalent to x, y, ~P(x, y) • The negation of x, y, P(x, y) is logically equivalent to x, y, ~P(x, y)

  29. Prolog Programming Language • Can use parts of logic as programming lang. • Simple statements: isabove(g, b), color(g, gray) • Quantified statements: if isabove(X, Y) and isabove(Y, Z) then isabove(X, Z) • Questions: ?color(b, blue), ?isabove(X, w)

  30. Arguments with Quantified Statements • Rule of universal instantiation: if some property is true of everything in the domain, then this property is true for any subset in the domain • Universal Modus Ponens: • Premises: (x, if P(x) then Q(x)); P(a) for some a • Conclusion: Q(a) • Universal Modus Tollens: • Premises: (x, if P(x) then Q(x)); ~Q(a) for some a • Conclusion: ~P(a) • Converse and inverse errors

  31. Validity of Arguments using Diagrams • Premises: All human beings are mortal; Zeus is not mortal. Conclusion: Zeus is not a human being • Premises: All human beings are mortal; Felix is mortal. Conclusion: Felix is a human being • Premises: No polynomial functions have horizontal asymptotes; This function has a horizontal asymptote. Conclusion: This function is not a polynomial

  32. Proof and Counterexample • Discovery and proof • Even and odd numbers • number n from Z is called even if k  Z, n = 2k • number n from Z is called odd if k  Z, n = 2k + 1 • Prime and composite numbers • number n from Z is called prime if r, s  Z, n = r * s  r = 1  s = 1 • number n from Z is called composite if r, s  Z, n = r * s  r > 1  s > 1

  33. Proving Statements • Constructive proofs for existential statements • Example: Show that there is a prime number that can be written as a sum of two perfect squares • Universal statements: method of exhaustion and generalized proof • Direct Proof: • Express the statement in the form: x  D, P(x)  Q(x) • Take an arbitrary x from D so that P(x) is true • Show that Q(x) is true based on previous axioms, theorems, P(x) and rules of valid reasoning

  34. Proof • Show that if the sum of any two integers is even, then so is their difference • Common mistakes in a proof • Arguing from example • Using the same symbol for different variables • Jumping to a conclusion • Begging the question

  35. Counterexample • To show that the statement in the form “x  D, P(x)  Q(x)” is not true one needs to show that the negation, which has a form “x  D, P(x)  ~Q(x)” is true. x is called a counterexample. • Famous conjectures: • Fermat big theorem: there are no non-zero integers x, y, z such that xn + yn = zn, for n > 2 • Goldbach conjecture: any even integer can be represented as a sum of two prime numbers • Euler’s conjecture: no three perfect fourth powers add up to another perfect fourth power

  36. Exercises • Any product of four consecutive positive integers is one less than a perfect square • To check that an integer is a prime it is sufficient to check that n is not divisible by any prime less than or equal to n • If p is a prime, is 2p – 1 a prime too? • Does 15x3 + 7x2 – 8x – 27 have an integer zero?

  37. Rational Numbers • Real number r is called rational if p,q  Z, r = p / q • All real numbers which are not rational are called irrational • Every integer is a rational number • Sum of any two rational numbers is a rational number

  38. Divisibility • Integer n is a divisible by an integer d, when k  Z, n = d * k • Notation: d | n • Synonymous statements: • n is a multiple of d • d is a factor of n • d is a divisor of n • d divides n

  39. Divisibility • Divisibility is transitive: for all integers a, b, c, if a divides b and b divides c, then a divides c • Any integer greater than 1 is divisible by a prime number • If a | b and b | a, does it mean a = b? • Any integer can be uniquely represented in the standard factored form: n = p1e1* p2e2* … * pkek, p1 < p2 < … < pk, pi is a prime number

  40. Quotient and Remainder • Given any integer n and positive integer d, there exist unique integers q and r, such that n = d * q + r and 0  r < d • Operations: div – quotient, mod – remainder • Parity of an integer refers to the property of an integer to be even or odd • Any two consecutive integers have opposite parity

  41. Exercises • Show that a product of any four consecutive integers is divisible by 8 • Show that the sum of any four consecutive integers is never divisible by 4 • Show that any prime number greater than 3 has remainder 1 or 5 when divided by 6

  42. Floor and Ceiling • For any real number x, the floor of x, written x, is the unique integer n such that n  x < n + 1. It is the max of all ints  x. • For any real number x, the ceiling of x, written x, is the unique integer n such that n – 1 < x  n. What is n? • If x is an integer, what are x and x + 1/2? • Is x + y = x + y? • For all real numbers x and all integers m, x + m = x + m • For any integer n, n/2 is n/2 for even n and (n–1)/2 for odd n • For positive integers n and d, n = d * q + r, where d = n / d and r = n – d * n / d with 0  r < d

  43. Exercises • Is it true that for all real numbers x and y: • x – y = x - y • x – 1 = x - 1 • x + y = x + y • x + 1 = x + 1

  44. Contradiction • Proof by contradiction • Suppose the statement to be proved is false • Show that this supposition leads logically to a contradiction • Conclude that the statement to be proved is true • Square root of 2 is irrational • There are infinite primes

  45. Contraposition • Proof by contraposition • Prepare the statement in the form: x  D, P(x)  Q(x) • Rewrite this statement in the form: x  D, ~Q(x)  ~P(x) • Prove the contrapositive by a direct proof • Close relationship between proofs by contradiction and contraposition

  46. Exercise • Show that for integers n, n2 is odd if and only if n is odd • Show that for all integers n and all prime numbers p, if n2 is divisible by p, then n is divisible by p • For all integers m and n, if m+n is even then m and n are both even or m and n are both odd • The product of any non-zero rational number and any irrational number is irrational • If a, b, and c are integers and a2+b2=c2, must at least one of a and b be even? • Can you find two irrational numbers so that one raised to the power of another would produce a rational number?

  47. Classic Number Theory Results • Square root of 2 is irrational • For any integer a and any integer k > 1, if k | a, then k does not divide (a + 1) • The set of prime numbers is infinite

  48. Exercises • Show that • a square of 3 is irrational • for any integer a, 4 does not divide (a2 – 2) • if n is not a perfect square then its square is irrational • 2 + 3 is irrational • log2(3) is irrational • every integer greater than 11 is a sum of two composite numbers • if p1, p2, …, pn are distinct prime numbers with p1 = 2, then p1p2…pn + 1 has remainder 3 when divided by 4 • for all integers n, if n > 2, then there exists prime number p, such that n < p < n!

More Related