Discrete Mathematics Chapter 1 The Foundations : Logic and Proofs 大葉大學 資訊工程系 黃鈴玲 (Lingling Huang)

Slides:



Advertisements
Similar presentations
Propositional Equivalences
Advertisements

Chapter 1: The Foundations: Logic and Proofs
1. Propositions A proposition is a declarative sentence that is either true or false. Examples of propositions: The Moon is made of green cheese. Trenton.
2009/91 Predicates and Quantifiers (§1.3) In the sentence “x is greater than 3”: The phrase “x” denotes the subject - the object or entity that the sentence.
布林代數的應用--- 全及項(最小項)和全或項(最大項)展開式
T-SQL 運算子介紹 11/29. 運算子的總類 指定運算子 算術運算子 比較運算子 邏輯運算子 位元運算子 字串連結運算子 單一運算元運算子.
Logic Chapter 2. Proposition "Proposition" can be defined as a declarative statement having a specific truth-value, true or false. Examples: 2 is a odd.
Chapter 2 Fundamentals of Logic
基礎物理總論 基礎物理總論 熱力學與統計力學(三) Statistical Mechanics 東海大學物理系 施奇廷.
第 1 章 PC 的基本構造. 本章提要 PC 系統簡介 80x86 系列 CPU 及其暫存器群 記憶體: Memory 80x86 的分節式記憶體管理 80x86 的 I/O 結構 學習組合語言的基本工具.
1 Section 1.2 Propositional Equivalences. 2 Equivalent Propositions Have the same truth table Can be used interchangeably For example, exclusive or and.
1 Math 306 Foundations of Mathematics I Math 306 Foundations of Mathematics I Goals of this class Introduction to important mathematical concepts Development.
Chapter 10 m-way 搜尋樹與B-Tree
Discrete Mathematics Math 6A Instructor: M. Welling.
質數 (Prime) 相關問題 (III) — 如何找出相對大的質數 Date: May 27, 2009 Introducer: Hsing-Yen Ann.
Probability Distribution 機率分配 汪群超 12/12. 目的:產生具均等分配的數值 (Data) ,並以 『直方圖』的功能計算出數值在不同範圍內出現 的頻率,及繪製數值的分配圖,以反應出該 機率分配的特性。
: Expressions ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 10157: Expressions 解題者:張庭愿 解題日期: 2009 年 8 月 16 日 題意:所有的括號必須成對,且必須先出現過左 括號後才能出現右括號,如果有.
計算機概論 第6章 數位邏輯設計.
1 Introduction to Java Programming Lecture 3 Mathematical Operators Spring 2008.
First Order Logic. Propositional Logic A proposition is a declarative sentence (a sentence that declares a fact) that is either true or false, but not.
1 Introduction to Java Programming Lecture 3 Mathematical Operators Spring 2009.
第 1 章 PC 的基本構造. 本章提要 PC 系統簡介 80x86 系列 CPU 及其暫存器群 記憶體: Memory 80x86 的分節式記憶體管理 80x86 的 I/O 結構 學習組合語言的基本工具.
VHDL語法(3).
McGraw-Hill/Irwin © 2003 The McGraw-Hill Companies, Inc.,All Rights Reserved. 肆 資料分析與表達.
Chapter 1, Part I: Propositional Logic With Question/Answer Animations.
The Foundations: Logic and Proofs
Discrete Mathematics Chapter 4 Induction and Recursion 大葉大學 資訊工程系 黃鈴玲 (Lingling Huang)
Discrete Mathematics Goals of a Discrete Mathematics Learn how to think mathematically 1. Mathematical Reasoning Foundation for discussions of methods.
Chapter 1 Section 1.4 More on Conditionals. There are three statements that are related to a conditional statement. They are called the converse, inverse.
Section 1.5 Implications. Implication Statements If Cara has a piano lesson, then it is Friday. If it is raining, then I need to remember my umbrella.
Chapter 2 – Fundamentals of Logic. Outline Basic Connectives and Truth Tables Logical Equivalence: The Laws of Logic Ligical Implication: Rules of Inference.
The Foundations: Logic and Proofs
Discrete Maths 2. Propositional Logic Objective
Discrete Mathematics and Its Applications
2009/9 1 Logic and Proofs §1.1 Introduction §1.2 Propositional Equivalences §1.3 Predicates and Quantifiers §1.4 Nested Quantifiers §1.5~7 Methods of.
Mathematical Structures A collection of objects with operations defined on them and the accompanying properties form a mathematical structure or system.
CS 285- Discrete Mathematics Lecture 2. Section 1.1 Propositional Logic Propositions Conditional Statements Truth Tables of Compound Propositions Translating.
Discrete Mathematics Chapter 1 The Foundations : Logic and Proofs, Sets, and Functions 大葉大學 資訊工程系 黃鈴玲.
CS 103 Discrete Structures Lecture 02
BY: MISS FARAH ADIBAH ADNAN IMK. CHAPTER OUTLINE: PART III 1.3 ELEMENTARY LOGIC INTRODUCTION PROPOSITION COMPOUND STATEMENTS LOGICAL.
CSci 2011 Textbook ^Discrete Mathematics and Its Applications,  Rosen  6th Edition  McGraw Hill  2006.
Chapter 1, Part I: Propositional Logic With Question/Answer Animations.
Chapter 5 – Logic CSNB 143 Discrete Mathematical Structures.
Fall 2002CMSC Discrete Structures1 Let’s get started with... Logic !
Logical Form and Logical Equivalence Lecture 2 Section 1.1 Fri, Jan 19, 2007.
Discrete Mathematics Lecture1 Miss.Amal Alshardy.
The Foundations Logic and Proofs by raedRASHEED 2014.
CSNB143 – Discrete Structure LOGIC. Learning Outcomes Student should be able to know what is it means by statement. Students should be able to identify.
Discrete Mathematics Chapter 2 Basic Structures : Sets, Functions, Sequences, and Sums 大葉大學 資訊工程系 黃鈴玲 (Lingling Huang)
資訊科學數學 4 : More About Logic 陳光琦助理教授 (Kuang-Chi Chen)
Lecture 9 Conditional Statements CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Logical Form and Logical Equivalence Lecture 1 Section 1.1 Wed, Jan 12, 2005.
Discrete Mathematics Chapter 7 Relations 感謝 大葉大學 資訊工程系 黃鈴玲老師 提供.
Chapter 1: The Foundations: Logic and Proofs
Discrete Mathematics Section 3.7 Applications of Number Theory 大葉大學 資訊工程系 黃鈴玲.
Section 1.1. Section Summary Propositions Connectives Negation Conjunction Disjunction Implication; contrapositive, inverse, converse Biconditional Truth.
CSNB143 – Discrete Structure Topic 4 – Logic. Learning Outcomes Students should be able to define statement. Students should be able to identify connectives.
CSci 2011 Recap ^Propositional operation summary not andorconditionalBi-conditional pq ppqqpqpqpqpqpqpqpqpq TTFFTTTT TFFTFTFF FTTFFTTF FFTTFFTT.
Discrete Mathematics Mathematical reasoning: think logically; know how to prove Combinatorial analysis: know how to count Discrete structures: represent.
رياضيات متقطعة لعلوم الحاسب MATH 226. Text books: (Discrete Mathematics and its applications) Kenneth H. Rosen, seventh Edition, 2012, McGraw- Hill.
Section 1.1. Propositions A proposition is a declarative sentence that is either true or false. Examples of propositions: a) The Moon is made of green.
Spring 2003CMSC Discrete Structures1 Let’s get started with... Logic !
Introduction to Discrete Mathematics Discrete Mathematics: is the part of mathematics devoted to the study of discrete objects. Discrete Mathematics is.
Chapter 1. Chapter Summary  Propositional Logic  The Language of Propositions (1.1)  Logical Equivalences (1.3)  Predicate Logic  The Language of.
Chapter 1 Logic and proofs
CSNB 143 Discrete Mathematical Structures
Niu Kun Discrete Mathematics Chapter 1 The Foundations: Logic and Proof, Sets, and Functions Niu Kun 离散数学.
Citra Noviyasari, S.Si, MT
CS100: Discrete structures
Discrete Structures Prepositional Logic 2
Presentation transcript:

Discrete Mathematics Chapter 1 The Foundations : Logic and Proofs 大葉大學 資訊工程系 黃鈴玲 (Lingling Huang)

1-1 Logic Def : A proposition ( 命題 ) is a declarative ( 敘述 ) sentence that is either true or false, but not both. Example 1 : The following declarative sentences are propositions. (1) Toronto is the capital of Canada. (F) (2) = 2 (T) Example 2 : Consider the following sentences. (1) what time is it ? (not declarative) (2) Read this carefully. (not declarative) (3) x + 1 = 2 (neither true nor false) Ch1-2

Logical operators ( 邏輯運算子 ) and truth table ( 真值表 ) Table 1. The truth table for the Negation (not) of a Proposition eg. p : “ Today is Friday.” ﹁ p : “ Today is not Friday.” Def : A truth table displays the relationships between the truth values of propositions. Table 2. The truth table for the Conjunction (and) of two propositions. eg. p : “ Today is Friday.” q : “ It’s raining today. ” p  q : “ Today is Friday and it’s raining today. “ Ch1-3 pq p  q TTT TFF FTF FFF p ﹁ p TF FT

Table 3. The truth table for the Disjunction (or) of two propositions. eg. p : " Today is Friday. " q : " It’s raining today. " p  q : " Today is Friday or it’s raining today. " Table 4. The truth table for the Exclusive or (xor) of two propositions. eg. p : " Today is Friday. " q : " It’s raining today. " p ⊕ q : " Either today is Friday or it’s raining today, but not both. " pq p  q TTT TFT FTT FFF Ch1-4 pq p ⊕ q TTF TFT FTT FFF

Table 5. The truth table for the Implication (p implies q) p → q. ( 觀念 : 若 p 對,則 q 一定要對 若 p 錯,則對 q 不做要求 ) eg. p : “ You make more than $25000 ” q : “ You must file a tax return. “ p → q : “ If you make more … then you must …. “ Some of the more common ways of expressing this implication are : (1) if p then q ( 若 p 則 q , p 是 q 的充分條件 ) (2) p implies q (3) p only if q ( 只有 q 是 True 時, p 才可能是 True , 若 q 是 False ,則 p 一定是 False) pqp → q TTT TFF FTT FFT Ch1-5

Def : In the implication p → q, p is called the hypothesis ( 假設 ) and q is called the conclusion ( 結論 ). Def : Compound propositions ( 合成命題 ) are formed from existing propositions using logical operators. ( 即  、  、 ⊕、 → 等 ) Table 6. The truth table for the Biconditional p ↔ q ( p → q and q → p ) “p if and only if q” “p iff q ” “If p then q, and conversely.” Ch1-6 pqp → qq → pp ↔ q TTTTT TFFTF FTTFF FFTTT ( 若且唯若 )

Example 9 : How can the following English sentence be translated into a logical expression ? “You can access the Internet from campus only if you are a computer science major or you are not a freshman. ” Sol : p : “You can access the Internet from campus.” q : “You are a computer science major.” r : “You are a freshman.” ∴ p only if ( q or ( ﹁ r )) => p → ( q  ( ﹁ r )) Ch1-7 Translating English Sentences into Logical Expression

Example 10 : You cannot ride the roller coaster ( 雲霄飛 車 ) if you are under 4 feet tall unless you are older than 16 years old. Sol : q : “ You can ride the roller coaster. “ r : “ You are under 4 feet tall. “ s : “ You are older than 16 years old. “ ∴ ﹁ q if r unless s ∴ ( r  ﹁ s ) → ﹁ q Table 8. Precedence of Logical Operators eg. (1) p  q  r means ( p  q )  r (2) p  q → r means ( p  q ) → r (3) p  ﹁ q means p  ( ﹁ q ) Exercise : 9 、 13 、 29 、 31 、 34 OperatorPrecedence ﹁ 1  2  3 →4  5 Ch1-8

Ch1-9 Def: A set of propositional expressions is consistent if there is an assignment of truth values to the variables in the expressions that makes each expression true. ( 一群由數個變數 pqr 等組成的命題,若存在 一組真值的給法,如設 p  T, q  F, r  T 等, 使所有的命題都可以為真,即稱為 consistent)

Ch1-10 Sol: Let p be “the system is in multiuser state”, q be “the system is operating normally”, and r be “the kernel is functioning”. 題目的敘述等同於: p  q, q  r,  r   q,  p  q, q  T 因 q  r 需為真,故 r  T , 因  r   q 需為真,故 not consistent ex: Are the following specifications consistent? “The system is in multiuser state if and only if it is operating normally. If the system is operating normally, the kernel is functioning. The kernel is not functioning or the system is in interrupt mode. If the system is not in multiuser state, then it is in interrupt mode. The system is not in interrupt mode.”

1-2 Propositional Equivalences Def 1: A compound proposition that is always true is called a tautology. ( 真理 ) A compound proposition that is always false is called a contradiction. ( 矛盾 ) Example 1 : Def 2: The propositions p and q that have the same truth values in all possible cases are called logically equivalent. The notation p ≡ q ( or p  q ) denotes that p and q are logically equivalent. Ch1-11 p ﹁p﹁pp  ﹁ pp  ﹁ p T F T F F T T F

Example 2 : Show that ﹁ ( p  q ) ≡ ﹁ p  ﹁ q pf : ※ Some important logically equivalences (Table 6, 7) (1) p  q ≡ q  p (2) p  q ≡ q  p (3) ( p  q )  r ≡ p  (q  r ) (4) ( p  q )  r ≡ p  (q  r ) (5) p  ( q  r ) ≡ ( p  q )  ( p  r ) (6) p  ( q  r ) ≡ ( p  q )  ( p  r ) ((5) 、 (6) 的觀念類似於 (a + b) x c = (a x c ) + (b x c)) pq ﹁ ( p  q ) ﹁p﹁p ﹁q﹁q ﹁ p  ﹁ q TTFFFF TFFFTF FTFTFF FFTTTT Ch1-12 commutative laws. 交換律 associative laws. 結合律 distributive laws 分配律

(7) ﹁ ( p  q ) ≡ ﹁ p  ﹁ q (8) ﹁ ( p  q ) ≡ ﹁ p  ﹁ q (9) p  ﹁ p ≡ T (10) p  ﹁ p ≡ F (11) p → q ≡ ﹁ p  q Example 7 : Show that ﹁ ( p  ( ﹁ p  q )) ≡ ﹁ p  ﹁ q pf : ( 也可用真值表証 ) ﹁ ( p  ( ﹁ p  q ) ) ≡ ﹁ p  ﹁ ( ﹁ p  q ) ≡ ﹁ p  ( p  ﹁ q ) ≡ ( ﹁ p  p )  ( ﹁ p  ﹁ q ) ≡ F  ( ﹁ p  ﹁ q ) ≡ ﹁ p  ﹁ q Ch1-13 De Morgan’s laws by (8) by (7) by (6) by (10)

Example 8 : Show ( p  q ) → (p  q) is a tautology. pf : ( p  q ) → (p  q) ≡ ﹁ ( p  q )  (p  q ) ≡ ( ﹁ p  ﹁ q )  (p  q ) ≡ ( ﹁ p  p )  ( ﹁ q  q ) ≡ T  T ≡ T Exercise : 9 、 11 、 17 Ch1-14 By (3) By (11) By (7)

1-3 Predicates and Quantifiers 目標 : 了解 ∀ 及 ∃ 符號 Def : The statement P(x) is said to be the value of the propositional function P at x. ex : P(x) : “ x is greater than 3 “ ※命題中出現變數 x 時 the domain of x 指的是 x 的範圍 ※ Quantifiers : ( 數量詞,如 some , any , all 等 ) ∀ : universal quantifier ( for all, for every ) ∃ : existential quantifier ( there exist, there is, for some ) Ch1-15 variable predicate 屬性數量詞

Table 1. Quantifiers Example 16 : Let P(x) : x 2 > 10, when x ∈ Z, x ≤ 4 What is the truth value of ∃ x P(x) ? Sol : x ∈ {1, 2, 3, 4} ∴ 4 2 = 16 > 10 ∴ ∃ x P(x) is true. StatementWhen True ?When False ? ∀ x P(x) P(x) is true for every x. There is an x for which P(x) is false. ∃ x P(x) There is an x for which P(x) is true. P(x) is false for every x. Ch1-16

Table 2. Negating Quantifiers. Example 21 : P(x) : x 2 > x, Q(x) : x 2 = 2, what is the negations of ∀ x P(x) and ∃ x Q(x) ? Sol : ﹁∀ x P(x) ≡ ∃ x ﹁ P(x) ≡ ∃ x (x 2 ≤ x) ﹁∃ x Q(x) ≡ ∀ x ﹁ Q(x) ≡ ∀ x (x 2 ≠ 2) Exercise : 11 、 13 、 15 、 53 NegationEquivalent Statement When True ?When False ? ﹁∃ x P(x) ∀ x ﹁ P(x) P(x) is false for every x. ∃ x, s.t. P(x) is true. ﹁∀ x P(x) ∃ x ﹁ P(x) ∃ x, s.t. P(x) is false P(x) is true for every x. Ch1-17

補充 : 習題 52 “ ∃ !” 表示 存在且唯一 ∃ ! x P ( x ) 表示 “There exists a unique x s.t. P ( x ) is true.” Example : What is the truth values of the statements (a) ∃ ! x ( x 2 = 1 ) (b) ∃ ! x ( x + 3 = 2x ) where the domain is the set of integers. ( 即 x ∈ Z ) Ans : (a) 1 2 = 1, (  1) 2 =1 (b) True. Ch1-18

1-4 Nested Quantifiers eg. ∀ x ∃ y (x + y = 0 ) Table 1. Quantifications of Two Variables. StatementWhen true ?When False ? ∀ x ∀ y P(x,y) ∀ y ∀ x P(x,y) P(x,y) is true for every pair x,y. ∃ a pair (x,y) s.t. P(x,y) is false. ∀ x ∃ y P(x,y)For every x, ∃ y s.t. P(x,y) is true. ∃ x, s.t. P(x,y) is false for every y. ∃ x ∀ y P(x,y) There is an x for which P(x,y) is true for every y. For every x, ∃ y s.t. P(x,y) is false. ∃ x ∃ y P(x,y) ∃ y ∃ x P(x,y) ∃ a pair (x,y) s.t. P(x,y) is true. ∀ pair (x,y), P(x,y) is false. Ch1-19

Ch1-20 Example : What is the truth values of the statements (a) ∀ x ∀ y (x + y ≥ 0), x,y ∈ N  T (b) ∀ x ∀ y (xy = 0), x,y ∈ Z  F (c) ∀ x ∃ y (x + y = 0), x,y ∈ Z  T (d) ∀ x ∃ y (xy =  1), x,y ∈ Z  F (e) ∃ x ∀ y (xy = 0), x,y ∈ Z  T (f) ∃ x ∀ y (x + y = 0), x,y ∈ Z  F (g) ∃ x ∃ y (xy = 0), x,y ∈ Z  T (h) ∃ x ∃ y (x + y = ½), x,y ∈ Z  F Exercise: 27