1. Trang chủ
  2. » Công Nghệ Thông Tin

Chapter 2 Logic Discrete Mathematics by Tran Vinh Tan VNUHCM

38 456 0

Đ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

Thông tin cơ bản

Định dạng
Số trang 38
Dung lượng 415,23 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

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),

Trang 1

Tran Vinh Tan

Contents Predicate Logic Proof Methods

Chapter 2

Logics (cont.)

Discrete Mathematics I on 08 March 2011

Tran Vinh TanFaculty of Computer Science and Engineering

Trang 2

Tran Vinh Tan

Contents Predicate Logic Proof Methods

Contents

1 Predicate Logic

2 Proof Methods

Trang 3

Tran Vinh Tan

Contents Predicate Logic Proof MethodsLimits of Propositional Logic

• x > 3

number Therefore 100 is not a prime number

Trang 4

Tran Vinh Tan

Contents Predicate Logic Proof Methods

Predicates

Definition

variables Ifvalues are assignedto all the variables in a predicate,

Example:

• x > 3 (predicate)

• 5 > 3 (proposition)

• 2 > 3 (proposition)

Trang 5

Tran Vinh Tan

Contents Predicate Logic Proof Methods

Trang 6

Tran Vinh Tan

Contents Predicate Logic Proof Methods

Truth value

• x > 3 is true or false?

• 5 > 3

Trang 7

Tran Vinh Tan

Contents Predicate Logic Proof Methods

Quantifiers

• ∀xP (x) = P (x) is T for all x

• ∃: Existential – Tồn tại

• ∃xP (x) = There exists an element x such that P (x) is T

Trang 8

Tran Vinh Tan

Contents Predicate Logic Proof Methods

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

What is the truth value of the quantification ∃xP (x), where the

domain consists of all real number?

Trang 9

Tran Vinh Tan

Contents Predicate Logic Proof Methods

Example

Express the statement “Some student in this class comes from

Central Vietnam.”

Solution 1

Solution 2

Trang 10

Tran Vinh Tan

Contents Predicate Logic Proof Methods

• There isa CSE student who does not study Discrete Math 1

Trang 11

Tran Vinh Tan

Contents Predicate Logic Proof Methods

Another Example

Example

Translate these:

• All lions are fierce

Solution

Let P (x), Q(x) and R(x) be the statements “x is a lion”, “x is

fierce” and “x drinks coffee”, respectively

Trang 12

Tran Vinh Tan

Contents Predicate Logic Proof Methods

The Order of Quantifiers

• Theorderof quantifiers isimportant, unlessall the quantifiers

are universal quantifiers or all are existential quantifiers

Trang 13

Tran Vinh Tan

Contents Predicate Logic Proof Methods

Translating Nested Quantifiers

Example

∀x (C(x) ∨∃y (C(y) ∧ F (x, y)))

Provided that:

• F (x, y): x and y are friends,

Answer

For every student x in your school, x has a computer orthere isa

Trang 14

Tran Vinh Tan

Contents Predicate Logic Proof Methods

Translating Nested Quantifiers

Example

∃x∀y∀z (((F (x, y) ∧ F (x, z) ∧ (y 6= z)) → ¬F (y, z)))

Provided that:

• F (x, y): x, y are friends

• x, y, z ∈ all students in your school

Answer

There isa student x, so thatfor everystudent y,everystudent z

not the sameas y,ifx and y are friends,andx and z are friends,

Trang 15

Tran Vinh Tan

Contents Predicate Logic Proof Methods

Translating into Logical Expressions

Example

1 “There isa student in the class has visited Hanoi”

2 “Every students in the class have visited Nha Trangor Vung

Tau”

Answer

Assume:

C(x) : x has visited Hanoi

D(x) : x has visited Nha Trang

E(x) : x has visited Vung Tau

We have:

Trang 16

Tran Vinh Tan

Contents Predicate Logic Proof Methods

Translating into Logical Expressions

Trang 17

Tran Vinh Tan

Contents Predicate Logic Proof Methods

Translating into Logical Expressions

Trang 18

Tran Vinh Tan

Contents Predicate Logic Proof Methods

Inference

Example

• If I have a girlfriend, I will take her to go shopping

special day, I will surely buy her some expensive gift

• If I buy my girlfriend expensive gifts, I will eat noodles for a

week

• Therefore, if I have a girlfriend,

• I will eat noodles for a week

Trang 19

Tran Vinh Tan

Contents Predicate Logic Proof Methods

Propositional Rules of Inferences

Rule of Inference Name

Trang 20

Tran Vinh Tan

Contents Predicate Logic Proof Methods

Propositional Rules of Inferences

Rule of Inference Name

Trang 21

Tran Vinh Tan

Contents Predicate Logic Proof Methods

Example

If it rains today, then we will not have a barbecue today If we do

not have a barbecue today, then we will have a barbecue

tomorrow Therefore, if it rains today, then we will have a

barbecue tomorrow

Solution

• p: It is raining today

p → q

q → r

∴ p → r

Hypothetical syllogism

Trang 22

Tran Vinh Tan

Contents Predicate Logic Proof Methods

Example

• It is not sunny this afternoon

(¬p) and it is colder than

yesterday (q)

• We will go swimming (r) only if

it is sunny

• If we do not go swimming, then

we will take a canoe trip (s)

• If we take a canoe trip, then we

will be home by sunset (t)

• We will be home by sunset (t)

Trang 23

Tran Vinh Tan

Contents Predicate Logic Proof Methods

Fallacies

Definition

Fallacies (ngụy biện) resemble rules of inference but are based on

contingencies rather than tautologies

Example

If you do correctly every questions in mid-term exam, you will get

10 grade You got 10 grade

Therefore, you did correctly every questions in mid-term exam

Is[(p → q) ∧ q] → p a tautology?

Trang 24

Tran Vinh Tan

Contents Predicate Logic Proof Methods

Rules of Inference for Quantified Statements

∴ 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 )

Trang 25

Tran Vinh Tan

Contents Predicate Logic Proof Methods

Example

• Someone who passed the first exam has not gone to class

Hint

• C(x): x is in this class

Trang 26

Tran Vinh Tan

Contents Predicate Logic Proof Methods

Trang 27

Tran Vinh Tan

Contents Predicate Logic Proof Methods

Introduction

Definition

A proof is a sequence of logical deductions from

- axioms, and

- previously proved theorems

that concludes with a new theorem

Trang 28

Tran Vinh Tan

Contents Predicate Logic Proof MethodsTerminology

• 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

Trang 29

Tran Vinh Tan

Contents Predicate Logic Proof Methods

• Lemma(bổ đề ) = less important theorem that is helpful in

the proofs of other results

• Corollary(hệ quả ) = 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

Trang 30

Tran Vinh Tan

Contents Predicate Logic Proof Methods

Proving a Theorem

Many theorem has the form ∀xP (x) → Q(x)

Goal:

⇒ How to show that conditional statement p → q is true

Trang 31

Tran Vinh Tan

Contents Predicate Logic Proof Methods

Methods of Proof

Trang 32

Tran Vinh Tan

Contents Predicate Logic Proof Methods

Direct Proofs

Definition

Example

Ex.: If n is an odd integer, then n2 is odd

number

Trang 33

Tran Vinh Tan

Contents Predicate Logic Proof Methods

even, so n = 2k, k ∈ Z Substituting

3n + 2 = 3(2k) + 2 = 6k + 2 = 2(3k + 1) is even Because

the negation of the conclusion of the conditional statement

implies that the hypothesis is false, Q.E.D

Trang 34

Tran Vinh Tan

Contents Predicate Logic Proof Methods

Ex.: Prove that√2 is irrational

Pr.: Let p is the proposition “√2 is irrational” Suppose ¬p is true,

have no common factors Squared, 2 = a2/b2, 2b2= a2, so

Thus, 2b2= 4c2, or b2= 2c2, which means b2 is even and so

assumption

Trang 35

Tran Vinh Tan

Contents Predicate Logic Proof MethodsProblem

Assume that we have an infinite domino string, we want to know

whether every dominoes will fall, if we only know two things:

2 If a domino falls, the next one will be fall

Trang 36

Tran Vinh Tan

Contents Predicate Logic Proof Methods

Mathematical Induction

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:

• 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?

Trang 37

Tran Vinh Tan

Contents Predicate Logic 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 1 =1(1+1)2

Trang 38

Tran Vinh Tan

Contents Predicate Logic Proof Methods

Example on Induction

Example

Prove that n < 2n for all positive integers n

Solution

Let P (n) be the proposition that n > 2n

• Basis Step: P (1) is true, because 1 > 21= 2

• Inductive Step:

Assume that P (k) is true for the positive k, that is, k < 2k

Add 1 to both side of k < 2k, note that 1 ≤ 2k

k + 1 < 2k+ 1 ≤ 2k+ 2k= 2 · 2k= 2k+1

shows that P (k + 1) is true, namely, that k + 1 < 2k+1,

based on the assumption that P (k) is true

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

TỪ KHÓA LIÊN QUAN