Chapter 2 Logic Discrete Mathematics by Tran Vinh Tan VNUHCM

38 455 0
Chapter 2 Logic Discrete Mathematics by Tran Vinh Tan VNUHCM

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Predicates Definition A predicate (vị từ) is a statement containing one or more variables. If values are assigned to all the variables in a predicate, the resulting statement is a proposition (mệnh đề ). Example: • x > 3 (predicate) • 5 > 3 (proposition) • 2 > 3 (proposition) Example Let P(x) be the statement “x < 2”. What is the truth value of the quantification ∀xP(x), where the domain consists of all real number? • P(3) = 3 < 2 is false • ⇒∀xP(x) is false • 3 is a counterexample (phản ví dụ) of ∀xP(x) Example What is the truth value of the quantification ∃xP(x),

Logics (cont.) Tran Vinh Tan Chapter Logics (cont.) Discrete Mathematics I on 08 March 2011 Contents Predicate Logic Proof Methods Tran Vinh Tan Faculty of Computer Science and Engineering University of Technology - VNUHCM 2.1 Contents Logics (cont.) Tran Vinh Tan Contents Predicate Logic Predicate Logic Proof Methods Proof Methods 2.2 Limits of Propositional Logic Logics (cont.) Tran Vinh Tan Contents Predicate Logic • x>3 Proof Methods • All square numbers are not prime numbers 100 is a square number Therefore 100 is not a prime number 2.3 Predicates Logics (cont.) Tran Vinh Tan Definition A predicate (vị từ) is a statement containing one or more variables If values are assigned to all the variables in a predicate, the resulting statement is a proposition (mệnh đề ) Contents Predicate Logic Proof Methods Example: • x > (predicate) • > (proposition) • > (proposition) 2.4 Predicates Logics (cont.) Tran Vinh Tan Contents Predicate Logic • x > → P (x) Proof Methods • > → P (5) • A predicate with n variables P (x1 , x2 , , xn ) 2.5 Truth value Logics (cont.) Tran Vinh Tan Contents Predicate Logic • x > is true or false? Proof Methods • 5>3 • For every number x, x > holds • There is a number x such that x > 2.6 Quantifiers Logics (cont.) Tran Vinh Tan Contents • ∀: Universal – Với • ∀xP (x) = P (x) is T for all x Predicate Logic Proof Methods • ∃: Existential – Tồn • ∃xP (x) = There exists an element x such that P (x) is T • We need a domain of discourse for variable 2.7 Logics (cont.) Tran Vinh Tan Example Let P (x) be the statement “x < 2” What is the truth value of the quantification ∀xP (x), where the domain consists of all real number? Contents Predicate Logic • P (3) = < is false Proof Methods • ⇒ ∀xP (x) is false • is a counterexample (phản ví dụ) of ∀xP (x) Example What is the truth value of the quantification ∃xP (x), where the domain consists of all real number? 2.8 Logics (cont.) Tran Vinh Tan Example Express the statement “Some student in this class comes from Central Vietnam.” Contents Solution • M (x) = x comes from Central Vietnam Predicate Logic Proof Methods • Domain for x is the students in the class • ∃xM (x) Solution • Domain for x is all people • 2.9 Logics (cont.) Negation of Quantifiers Tran Vinh Tan Statement Negation Equivalent form ∀xP (x) ¬(∀xP (x)) ∃x¬P (x) ∃xP (x) ¬(∃xP (x)) ∀x¬P (x) Contents Predicate Logic Proof Methods Example • All CSE students study Discrete Math • Let C(x) denote “x is a CSE student” • Let S(x) denote “x studies Discrete Math 1” • ∀x : C(x) → S(x) • ∃x : ¬(C(x) → S(x)) ≡ ∃x : C(x) ∧ ¬S(x) • There is a CSE student who does not study Discrete Math 2.10 Rules of Inference for Quantified Statements Logics (cont.) Tran Vinh Tan Rule of Inference Name ∀xP (x) ∴ P (c) Universal instantiation (Cụ thể hóa phổ quát) P (c)for an arbitrary c ∴ ∀xP (x) Universal generalization (Tổng quát hóa phổ quát) ∃xP (x) ∴ P (c)for some element c Existential instantiation (Cụ thể hóa tồn tại) P (c)for some element c ∴ ∃xP (x) Existential generalization (Tổng quát hóa tồn tại) Contents Predicate Logic Proof Methods 2.24 Logics (cont.) Tran Vinh Tan Example • A student in this class has not gone to class • Everyone in this class passed the first exam • Someone who passed the first exam has not gone to class Contents Predicate Logic Proof Methods Hint • C(x): x is in this class • B(x): x has gone to class • P (x): x passed the first exam • Premises??? 2.25 Logics (cont.) Tran Vinh Tan ∃x(C(x) ∧ ¬B(x)) C(a) ∧ ¬B(a) C(a) ∀x(C(x) → P (x)) C(a) → P (a) P (a) ¬B(a) P (a) ∧ ¬B(a) ∃x(P (x) ∧ ¬B(x)) Premise Existential instantiation from (1) Simplification from (2) Premise Universal instantiation from (4) Modus ponens from (3) and (5) Simplification from (2) Conjunction from (6) and (7) Existential generalization from (8) Contents Predicate Logic Proof Methods 2.26 Introduction Logics (cont.) Tran Vinh Tan Contents Definition Predicate Logic Proof Methods A proof is a sequence of logical deductions from - axioms, and - previously proved theorems that concludes with a new theorem 2.27 Terminology Logics (cont.) Tran Vinh Tan Contents Predicate Logic Proof Methods • Theorem (định lý ) = a statement that can be shown to be true • Axiom (tiên đề ) = a statement we assume to be true • Hypothesis (giả thiết) = the premises of the theorem 2.28 Logics (cont.) Tran Vinh Tan Contents Predicate Logic Proof Methods • Lemma (bổ đề ) = less important theorem that is helpful in the proofs of other results • Corollary (hệ ) = a theorem that can be established directly from a proved theorem • Conjecture (phỏng đoán) = statement being proposed to be true, when it is proved, it becomes theorem 2.29 Proving a Theorem Logics (cont.) Tran Vinh Tan Contents Many theorem has the form ∀xP (x) → Q(x) Goal: • Show that P (c) → Q(c) is true with arbitrary c of the domain Predicate Logic Proof Methods • Apply universal generalization ⇒ How to show that conditional statement p → q is true 2.30 Methods of Proof Logics (cont.) Tran Vinh Tan Contents • Direct proofs (chứng minh trực tiếp) Predicate Logic Proof Methods • Proof by contraposition (chứng minh phản đảo) • Proof by contradiction (chứng minh phản chứng ) • Mathematical induction (quy nạp toán học) 2.31 Direct Proofs Logics (cont.) Tran Vinh Tan Definition A direct proof shows that p → q is true by showing that if p is true, then q must also be true Contents Predicate Logic Proof Methods Example Ex.: If n is an odd integer, then n2 is odd Pr.: Assume that n is odd By the definition, n = 2k + 1, k ∈ Z n2 = (2k + 1)2 = 4k + 4k + = 2(2k + 2k) + is an odd number 2.32 Proof by Contraposition Logics (cont.) Tran Vinh Tan Definition p → q can be proved by showing (directly) that its contrapositive, ¬q → ¬p, is true Contents Predicate Logic Proof Methods Example Ex.: If n is an integer and 3n + is odd, then n is odd Pr.: Assume that “If 3n + is odd, then n is odd” is false; or n is even, so n = 2k, k ∈ Z Substituting 3n + = 3(2k) + = 6k + = 2(3k + 1) is even Because the negation of the conclusion of the conditional statement implies that the hypothesis is false, Q.E.D 2.33 Proofs by Contradiction Logics (cont.) Tran Vinh Tan Definition p is true if if can show that ¬p → (r ∧ ¬r) is true for some proposition r Contents Predicate Logic Example Proof Methods √ Ex.: Prove that is irrational √ Pr.: Let p is the proposition “ is irrational” Suppose ¬p is true, √ √ which means is rational If so, ∃a, b ∈ Z, = a/b, a, b have no common factors Squared, = a2 /b2 , 2b2 = a2 , so a2 is even, and a is even, too Because of that a = 2c, c ∈ Z Thus, 2b2 = 4c2 , or b2 = 2c2 , which means b2 is even and so is b That means divides both a and b, contradict with the assumption 2.34 Problem Logics (cont.) Tran Vinh Tan Contents Predicate Logic Proof Methods Assume that we have an infinite domino string, we want to know whether every dominoes will fall, if we only know two things: We can push the first domino to fall If a domino falls, the next one will be fall We can! Mathematical induction 2.35 Mathematical Induction Logics (cont.) Tran Vinh Tan Definition (Induction) To prove that P (n) is true for all positive integers n, where P (n) is a propositional function, we complete two steps: Contents Predicate Logic Proof Methods • Basis Step: Verify that P (1) is true • Inductive Step: Show that the conditional statement P (k) → P (k + 1) is true for all positive integers k Logic form: [P (1) ∧ ∀kP (k) → P (k + 1))] → ∀nP (n) What is P (n) in domino string case? 2.36 Logics (cont.) Example on Induction Tran Vinh Tan Example Show that if n is a positive integer, then + + + n = n(n + 1) Contents Predicate Logic Solution Proof Methods Let P (n) be the proposition that sum of first n is n(n + 1)/2 • Basis Step: P (1) is true, because = • Inductive Step: Assume that + + + k = Then: 1(1+1) k(k+1) + + + k + (k + 1) = = = k(k + 1) + (k + 1) k(k + 1) + 2(k + 1) (k + 1)(k + 2) shows that P (k + 1) is true under the assumption that P (k) is true 2.37 Logics (cont.) Example on Induction Tran Vinh Tan Example Prove that n < 2n for all positive integers n Contents Solution Predicate Logic n Let P (n) be the proposition that n > Proof Methods • Basis Step: P (1) is true, because > 21 = • Inductive Step: Assume that P (k) is true for the positive k, that is, k < 2k Add to both side of k < 2k , note that ≤ 2k k + < 2k + ≤ 2k + 2k = · 2k = 2k+1 shows that P (k + 1) is true, namely, that k + < 2k+1 , based on the assumption that P (k) is true 2.38

Ngày đăng: 07/06/2016, 19:14

Từ khóa liên quan

Mục lục

  • Predicate Logic

  • Proof Methods

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan