1. Trang chủ
  2. » Giáo án - Bài giảng

Chapter 2 Proving Methods Discrete Structure for Computing (CO1007)

15 348 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 15
Dung lượng 322,61 KB

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

Nội dung

Nguyen An Khuong, Huynh Tuong Nguyen Contents Proof Methods Homeworks and Exercises Chapter 2 Proving Methods Discrete Structure for Computing CO1007 Materials drawn from Chapter 2 in: “

Trang 1

Nguyen An Khuong, Huynh Tuong Nguyen

Contents Proof Methods Homeworks and Exercises

Chapter 2

Proving Methods

Discrete Structure for Computing (CO1007)

(Materials drawn from Chapter 2 in:

“Michael Huth and Mark Ryan Logic in Computer Science: Modelling and

Reasoning about Systems, 2nd Ed., Cambridge University Press, 2006.”)

Trang 2

Nguyen An Khuong, Huynh Tuong Nguyen

Contents Proof Methods Homeworks and Exercises

Contents

Trang 3

Nguyen An Khuong, Huynh Tuong Nguyen

Contents Proof Methods Homeworks and Exercises

Introduction

Definition

A proof is a sequence of logical deductions from

- axioms, and

- previously proved theorems

that concludes with a new theorem

Trang 4

Nguyen An Khuong, Huynh Tuong Nguyen

Contents Proof Methods Homeworks and Exercises

Terminology

true

Trang 5

Nguyen An Khuong, Huynh Tuong Nguyen

Contents Proof Methods Homeworks and Exercises

the proofs of other results

directly from a proved theorem

true, when it is proved, it becomes theorem

Trang 6

Nguyen An Khuong, Huynh Tuong Nguyen

Contents Proof Methods Homeworks and Exercises

Proving a Theorem

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

Goal:

• Show that P (c) → Q(c) is true with arbitrary c of the domain

• Apply universal generalization

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

Trang 7

Nguyen An Khuong, Huynh Tuong Nguyen

Contents Proof Methods Homeworks and Exercises

Methods of Proof

• Direct proofs (chứng minh trực tiếp)

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

Trang 8

Nguyen An Khuong, Huynh Tuong Nguyen

Contents Proof Methods Homeworks and Exercises

Direct Proofs

Definition

A direct proof shows that p → q is true by showing thatifp is

true, then q must alsobe true

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= 4k2+ 4k + 1 = 2(2k2+ 2k) + 1 is an odd

number

Trang 9

Nguyen An Khuong, Huynh Tuong Nguyen

Contents Proof Methods Homeworks and Exercises

Proof by Contraposition

Definition

p → q can be proved by showing (directly) that its contrapositive,

¬q → ¬p, is true

Example

Ex.: If n is an integer and 3n + 2 is odd, then n is odd

Pr.: Assume that “If 3n + 2 is odd, then n is odd” is false; or n is

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 10

Nguyen An Khuong, Huynh Tuong Nguyen

Contents Proof Methods Homeworks and Exercises

Proofs by Contradiction

Definition

p is true if if can show that ¬p → (r ∧ ¬r) is true for some

proposition r

Example

Ex.: Prove that√2 is irrational

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

which means√2 is rational If so, ∃a, b ∈ Z,√2 = a/b, a, b

have no common factors Squared, 2 = 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 2 divides both a and b, contradictwith the

assumption

Trang 11

Nguyen An Khuong, Huynh Tuong Nguyen

Contents Proof Methods Homeworks and Exercises

Problem

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

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

1 We can push the first domino to fall

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

Trang 12

Nguyen An Khuong, Huynh Tuong Nguyen

Contents Proof Methods Homeworks and Exercises

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:

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 13

Nguyen An Khuong, Huynh Tuong Nguyen

Contents Proof Methods Homeworks and Exercises

Example on Induction

Example

Show that if n is a positive integer, then

1 + 2 + + n = n(n + 1)

Solution

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

• Inductive Step :

Assume that 1 + 2 + + k = k(k+1)2 .

Then:

1 + 2 + + k + (k + 1) = k(k + 1)

2 + (k + 1)

= k(k + 1) + 2(k + 1)

2

Trang 14

Nguyen An Khuong, Huynh Tuong Nguyen

Contents Proof Methods Homeworks and Exercises

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

Trang 15

Nguyen An Khuong, Huynh Tuong Nguyen

Contents Proof Methods Homeworks and Exercises

Homeworks and Exercises

1 Cauchy inequality on means

2 Fibonacci in Pascal’s Triangle: Prove that Fn=

C(n, 0) + C(n − 1, 1) + C(n − 2, 2) + + C(dn/2e, bn/2c),

where Fn is the nth Fibonacci number, F0= F1= 1 Notice

that if C(a, b) = 0 for b > a, we can rewrite the desired result

as

Fn=n

0

 +n − 1 1

 +n − 2 2

 + +

 1

n − 1

 + 0 n



in order to have a simpler version to work with, and avoid

considerations of whether n is even or odd

3 Solve Exercises 7-11 in Huth and Ryan’s book

4 Solve exercises in the attachment

Ngày đăng: 29/03/2017, 18:30

TỪ KHÓA LIÊN QUAN