1 2006 310205 Mathematics for Comter I Lecture 2: Logic (1) Basic definitions Logical operators Translating English sentences.

Slides:



Advertisements
Similar presentations
Af2 Introduction. What’s the course about? Discrete Mathematics The mathematics that underpins computer science and other sciences as well.
Advertisements

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.
CS128 – Discrete Mathematics for Computer Science
Copyright © Cengage Learning. All rights reserved. CHAPTER 2 THE LOGIC OF COMPOUND STATEMENTS THE LOGIC OF COMPOUND STATEMENTS.
The Foundation: Logic Conditional Statements Muhammad Arief download dari
2.2 Conditional Statements. Goals Identify statements which are conditional Identify the antecedent and consequent of a conditional statement Negate conditional.
Syllabus Every Week: 2 Hourly Exams +Final - as noted on Syllabus
1 Section 1.1 Logic. 2 Proposition Statement that is either true or false –can’t be both –in English, must contain a form of “to be” Examples: –Cate Sheller.
Introduction to Logic Sections 1.1 and 1.2 of Rosen Fall 2010 CSCE 235 Introduction to Discrete Structures URL: cse.unl.edu/~cse235 Questions:
CSE115/ENGR160 Discrete Mathematics 01/17/12 Ming-Hsuan Yang UC Merced 1.
Adapted from Discrete Math
Chapter 1, Part I: Propositional Logic With Question/Answer Animations.
The Foundations: Logic and Proofs
Propositions and Truth Tables
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
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 Proofs.
Discrete Maths 2. Propositional Logic Objective
Discrete Mathematics and Its Applications
COS 150 Discrete Structures Assoc. Prof. Svetla Boytcheva Fall semester 2014.
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Ch.1 (Part 1): The Foundations: Logic and Proofs Introduction.
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.
Chapter 1: The Foundations: Logic and Proofs
Review I Rosen , 3.1 Know your definitions!
(CSC 102) Lecture 3 Discrete Structures. Previous Lecture Summary Logical Equivalences. De Morgan’s laws. Tautologies and Contradictions. Laws of Logic.
Chapter 2: The Logic of Compound Statements 2.2 Conditional Statements
Lecture 4. CONDITIONAL STATEMENTS: Consider the statement: "If you earn an A in Math, then I'll buy you a computer." This statement is made up of two.
1 CMSC 250 Discrete Structures CMSC 250 Lecture 1.
CS 381 DISCRETE STRUCTURES Gongjun Yan Aug 25, November 2015Introduction & Propositional Logic 1.
LOGIC Lesson 2.1. What is an on-the-spot Quiz  This quiz is defined by me.  While I’m having my lectures, you have to be alert.  Because there are.
Chapter 3: Introduction to Logic. Logic Main goal: use logic to analyze arguments (claims) to see if they are valid or invalid. This is useful for math.
Lecture 9 Conditional Statements CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Propositional Logic ITCS 2175 (Rosen Section 1.1, 1.2)
Chapter 1: The Foundations: Logic and Proofs
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.
Logic The Lost Art of Argument. Logic - Review Proposition – A statement that is either true or false (but not both) Conjunction – And Disjunction – Or.
رياضيات متقطعة لعلوم الحاسب 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.
Mathematics for Comter I Lecture 3: Logic (2) Propositional Equivalences Predicates and Quantifiers.
Discrete Mathematics Lecture # 4. Conditional Statements or Implication  If p and q are statement variables, the conditional of q by p is “If p then.
Conditional statement or implication IF p then q is denoted p ⇒ q p is the antecedent or hypothesis q is the consequent or conclusion ⇒ means IF…THEN.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 01: Boolean Logic Sections 1.1 and 1.2 Jarek Rossignac.
CS104 The Foundations: Logic and Proof 1. 2 What is Discrete Structure?  Discrete Objects  Separated from each other (Opposite of continuous)  e.g.,
Discrete Math by R.S. Chang, Dept. CSIE, NDHU1 Fundamentals of Logic 1. What is a valid argument or proof? 2. Study system of logic 3. In proving theorems.
Chapter 1. Chapter Summary  Propositional Logic  The Language of Propositions (1.1)  Logical Equivalences (1.3)  Predicate Logic  The Language of.
Logical Operators (Connectives) We will examine the following logical operators: Negation (NOT,  ) Negation (NOT,  ) Conjunction (AND,  ) Conjunction.
Simple Logic.
Discrete Structures for Computer Science Presented By: Andrew F. Conn Slides adapted from: Adam J. Lee Lecture #1: Introduction, Propositional Logic August.
Chapter 1 Propositional Logic
2. The Logic of Compound Statements Summary
CSNB 143 Discrete Mathematical Structures
Niu Kun Discrete Mathematics Chapter 1 The Foundations: Logic and Proof, Sets, and Functions Niu Kun 离散数学.
COT 3100, Spr Applications of Discrete Structures
(CSC 102) Discrete Structures Lecture 2.
Ch.1 (Part 1): The Foundations: Logic and Proofs
The Foundations: Logic and Proofs
Principles of Computing – UFCFA3-30-1
Information Technology Department
Chapter 1 The Foundations: Logic and Proof, Sets, and Functions
TRUTH TABLES.
Applied Discrete Mathematics Week 1: Logic
TRUTH TABLES continued.
Discrete Mathematics and Its Applications Kenneth H
MAT 3100 Introduction to Proof
The Foundations: Logic and Proofs
The Foundations: Logic and Proofs
Truth Tables for Conditional and Biconditional Statements
Presentation transcript:

Mathematics for Comter I Lecture 2: Logic (1) Basic definitions Logical operators Translating English sentences

Mathematics for Comter I 2.1. Logic Rules of logic: Give precise meaning to mathematical statements. Distinguish between valid and invalid mathematical arguments. Applications: Design of computer circuits. Construction of computer programs. Verification of correctness of programs.

Mathematics for Comter I 2.1. Logic Logic deals with statements and their truth sets. The statements are called propositions. proposition : true = T (or 1) or false = F (or 0) (binary logic) 1+1 = 2 (Y) ‘the moon is made of green cheese’ (Y) y+1=2 (X) - Uncertain ‘go to town!’ (X) - imperative ‘What time is it?’ (X) - interrogative propositional variables: P, Q, R, S,...

Mathematics for Comter I 2.1. Logic Calculus of propositions: Relate new propositions to old using TRUTH TABLES logical operators (op): Unary: negation Binary: conjunction, disjunction, exclusive or, implication, biconditional

Mathematics for Comter I 2.1. Logic Truth Table Displays the relationships between the truth values of propositions. P1P2P1 op P

Mathematics for Comter I 2.2. Unary Operator Negation ‘not’ Symbol:  Example: P : I am going to town  P: I am not going to town or It is not the case that I am going to town Truth table: P PP F (0)T (1) F (0)

Mathematics for Comter I 2.3. Binary Operators Binary Conjunction ‘and’ Symbol:  Example: P: I am going to town Q: It is going to rain P  Q: I am going to town and it is going to rain. Truth Table: Both P and Q must be true !!! PQ PQPQ

Mathematics for Comter I 2.3. Binary Operators Binary Disjunction – Inclusive ‘or’ Symbol:  Example: P: I am going to town Q: It is going to rain P  Q: I am going to town or it is going to rain. Truth Table: Only one of P, Q need be true. Hence, the inclusive nature. PQ PQPQ

Mathematics for Comter I 2.3. Binary Operators Exclusive ‘or’ Symbol:  Example: P: I am going to town Q: It is going to rain P  Q: Either I am going to town or it is going to rain. Truth Table: Only one of P and Q must be true. PQ PQPQ

Mathematics for Comter I 2.3. Binary Operators Implication ‘If...then...’ Symbol:  Example: P: I am going to town Q: It is going to rain P  Q: If I am going to town then it is going to rain. Truth Table: The implication is false only when P is true and Q is false! PQ PQPQ

Mathematics for Comter I 2.3. Binary Operators In C programming language AND && Inclusive OR || Exclusive OR ^ Not !

Mathematics for Comter I 2.3. Binary Operators Implication (continued) Equivalent forms: If P, then Q P implies Q If P, Q P is a sufficient condition for Q Q if P Q whenever P Q is a necessary condition for P Terminology: P = premise, hypothesis, antecedent Q = conclusion, consequence

Mathematics for Comter I 2.3. Binary Operators Implication (continued) A useful way to remember the truth table is to think of a contract or an obligation.

Mathematics for Comter I 2.3. Binary Operators Example: If you make more than $ 25,000, then you must file a tax return. The statement says nothing about someone making less than $ 25,000 – so true every time. You violate the obligation only if you make more than $ 25,000 and do not file a return. If the total marks of a student are more than 55%, then the student will pass this course. A student whose marks less than 55% may still pass. It is wrong if a student has more than 55% and fails.

Mathematics for Comter I 2.3. Binary Operators Implication (continued) There is no causality implied here! If today is Friday, then 2+3 = 5. True, since its conclusion is true. If today is Friday, then 2+3 = 6. True everyday except Friday, even though 2+3 = 6 is false. Compare implications used in normal language: If it is sunny today, then we will go to the beach

Mathematics for Comter I 2.3. Binary Operators Implication (continued) More terminology: Q  P is the CONVERSE of P  Q  Q  P is the CONTRAPOSITIVE of P  Q Example: Find the converse and contrapositive of the following statement: R: Raining tomorrow is a sufficient condition for my not going to town. Step 1: Assign propositional variables to component propositions P: It will rain tomorrow Q: I will not go to town

Mathematics for Comter I 2.3. Binary Operators Example (continued): Step 2: Symbolize the assertion R: P  Q Step 3: Symbolize the converse Q  P Step 4: Convert the symbols back into word If I don’t go to town then it will rain tomorrow. or Raining tomorrow is a necessary condition for my not going to town. or My not going to town is a sufficient condition for it raining tomorrow.

Mathematics for Comter I 2.3. Binary Operators Biconditional ‘If and only if’, ‘iff’ Symbol:  Example: P: I am going to town Q: It is going to rain P  Q: I am going to town if and only if it is going to rain. Truth Table: Both P and Q must have the same truth value. PQ PQPQ

Mathematics for Comter I 2.3. Binary Operators Biconditional (continued) Example: You must file a tax return if and only if you make more than $ 25,000. The statement now says something about someone making less than $ 25,000 – the rule is violated if somebody asks to pay tax but your income is less than $ 25,000. You violate the obligation if you make more than $ 25,000 and do not file a return.

Mathematics for Comter I 2.4. Translating English Sentences Breaking assertions into component propositions - look for the logical operators! Example: If I go to Harry’s or go to the country I will not go shopping. P: I go to Harry’s Q: I go to the country R: I will go shopping If......P......or.....Q.....then....not.....R (P  Q)  R

Mathematics for Comter I 2.4. Translating English Sentences Constructing a truth table: one column for each propositional variable one for the compound proposition count in binary n propositional variables = 2 n rows You may find it easier to include columns for propositions which themselves are component propositions. e.g. columns for P  Q.

Mathematics for Comter I 2.4. Translating English Sentences Truth Table: PQR PQPQ(P  Q)  R

Mathematics for Comter I 2.4. Translating English Sentences Question: How many different propositions can be constructed from n propositional variables?

Mathematics for Comter I 2.5. Further Readings Basic definitions Rosen: Section 1.1 Logical operators Rosen: Section 1.1 Translating English sentences Rosen: Section 1.1