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.

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

Af2 Introduction. What’s the course about? Discrete Mathematics The mathematics that underpins computer science and other sciences as well.
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.
Foundations of Logic Mathematical Logic is a tool for working with elaborate compound statements. It includes: A formal language for expressing them.
Discrete Mathematics Lecture 1 Logic of Compound Statements Harper Langston New York University.
Syllabus Every Week: 2 Hourly Exams +Final - as noted on Syllabus
Propositional Logic. Negation Given a proposition p, negation of p is the ‘not’ of p.
From Chapter 4 Formal Specification using Z David Lightfoot
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.
Discrete Mathematics Math 6A Instructor: M. Welling.
CSE115/ENGR160 Discrete Mathematics 01/17/12 Ming-Hsuan Yang UC Merced 1.
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.
Copyright © Cengage Learning. All rights reserved.
Adapted from Discrete Math
Lecture 8 Introduction to Logic CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
The Foundations: Logic and Proofs
Discrete Mathematics Goals of a Discrete Mathematics Learn how to think mathematically 1. Mathematical Reasoning Foundation for discussions of methods.
Propositions and Truth Tables
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
CompSci 102 Discrete Math for Computer Science January 17, 2012 Prof. Rodger.
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.
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Ch.1 (Part 1): The Foundations: Logic and Proofs Introduction.
1 Propositional Logic Rosen 5 th ed., § Foundations of Logic: Overview Propositional logic:Propositional logic: –Basic definitions. –Equivalence.
Propositional Logic Foundations of Logic: Overview Propositional logic (§ ): – Basic definitions. (§1.1) – Equivalence rules & derivations. (§1.2)
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
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.
Thinking Mathematically
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.
Mathematics for Comter I Lecture 2: Logic (1) Basic definitions Logical operators Translating English sentences.
رياضيات متقطعة لعلوم الحاسب 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.
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.,
Chapter 1. Chapter Summary  Propositional Logic  The Language of Propositions (1.1)  Logical Equivalences (1.3)  Predicate Logic  The Language of.
Module #1 - Logic 2016/7/91 Module #1: Logic (Textbook: §1.1~1.4) Dr. Chih-Wei Yi Department of Computer Science National Chiao Tung University.
CS-7081 Application - 1. CS-7082 Example - 2 CS-7083 Simplifying a Statement – 3.
Logic I 권태경 To do so, it should include a language to express statements, a notation to simplify expressions. Logic Mathematical 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
Logic.
CSNB 143 Discrete Mathematical Structures
Chapter 1 – Logic and Proof
CS 202, Spring 2008 Epp, sections 1.1 and 1.2
Niu Kun Discrete Mathematics Chapter 1 The Foundations: Logic and Proof, Sets, and Functions Niu Kun 离散数学.
6/20/2018 Discrete Math A word about organization: Since different courses have different lengths of lecture periods, and different instructors go at different.
6/20/2018 Arab Open University Faculty of Computer Studies M131 - Discrete Mathematics 6/20/2018.
Logic.
COT 3100, Spr Applications of Discrete Structures
Ch.1 (Part 1): The Foundations: Logic and Proofs
Propositional Logic (§1.1)
The Foundations: Logic and Proofs
Principles of Computing – UFCFA3-30-1
Information Technology Department
Chapter 3 Introduction to Logic 2012 Pearson Education, Inc.
(1.4) An Introduction to Logic
Discrete Mathematics and Its Applications Kenneth H
MAT 3100 Introduction to Proof
Cs Discrete Mathematics
The Foundations: Logic and Proofs
Logic Logic is a discipline that studies the principles and methods used to construct valid arguments. An argument is a related sequence of statements.
Discrete Structures Prepositional Logic 2
The Foundations: Logic and Proofs
Presentation transcript:

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

2009/92 Introduction to Logic (§1.1) In this section we will introduce the Propositional Logic. Propositional Logic is the logic of compound statements built from simpler statements using so-called Boolean connectives. George Boole ( )

2009/93 Definition of a Proposition A proposition (p, q, r, …) is simply a statement (i.e., a declarative sentence) with a definite meaning, having a truth value that’s either true (T) or false (F) (never both, neither, or somewhere in between). However, you might not know the actual truth value, and it might be situation-dependent.

2009/94 Examples of Propositions “It is raining.” (In a given situation.) “Taipei is the capital of Taiwan.” “1 + 2 = 3” But, the following are NOT propositions: “Who’s there?” (interrogative, question) “Just do it!” (imperative, command) “1 + 2” (expression with a non-true/false value)

2009/95 An operator or connective combines one or more propositions into a larger proposition. Unary operators take 1 operand (e.g., −3) Binary operators take 2 operands (eg 3  4). Propositional or Boolean operators operate on propositions or truth values instead of on numbers. Operators / Connectives

2009/96 Some Popular Boolean Operators Formal NameNicknameAritySymbol

2009/97 The Negation Operator The unary negation operator “¬” (NOT) transforms a prop. into its logical negation. E.g. If p = then ¬p = Truth table for NOT:

2009/98 The Conjunction Operator The binary conjunction operator “  ” (AND) combines two propositions to form their logical conjunction. E.g. If p=“I will have salad for lunch.” and q=“I will have steak for dinner.”, then p  q =

2009/99 Note that a conjunction p 1  p 2  …  p n of n propositions will have 2 n rows in its truth table. Conjunction Truth Table

2009/910 Note that p  q means that p is true, or q is true, or both are true! So, this operation is also called inclusive or, because it includes the possibility that both p and q are true. Disjunction Truth Table

2009/911 Nested Propositional Expressions Use parentheses to group sub-expressions: “I just saw my old friend, and either he’s grown or I’ve shrunk.” = f  (g  s) (f  g)  s would mean something different f  g  s would be ambiguous By convention, “¬” takes precedence over both “  ” and “  ”. ¬s  f means (¬s)  f, not ¬ (s  f )

2009/912 A Simple Exercise Let p =“It rained last night”, q =“The sprinklers came on last night,” r =“The lawn was wet this morning.” Translate each of the following into English: ¬p = r  ¬p = ¬ r  p  q =

2009/913 Note that p  q means that p is true, or q is true, but not both! This operation is called exclusive or, because it excludes the possibility that both p and q are true. Exclusive-Or Truth Table

2009/914 The Implication Operator The implication p  q states that p implies q. I.e., If p is true, then q is true; but if p is not true, then q could be either true or false. E.g., let p = “You study hard.” q = “You will get a good grade.” p  q =

2009/915 Implication Truth Table p  q is false only when p is true but q is not true. p  q does not say that p causes q! p  q does not require that p or q are ever true! E.g. “(1=0)  pigs can fly” is TRUE!

2009/916 Examples of Implications “If this lecture ends, then the sun will rise tomorrow.” True or False? “If Tuesday is a day of the week, then I am a penguin.” True or False? “If = 6, then I am a president.” True or False? “If the moon is made of green cheese, then I am richer than Bill Gates.” True or False?

2009/917 English Phrases Meaning p  q “p implies q” “if p, then q” “if p, q” “when p, q” “whenever p, q” “q if p” “q when p” “q whenever p” “p only if q” “p is sufficient for q” “q is necessary for p” “q follows from p” “q is implied by p” We will see some equivalent logic expressions later.

2009/918 Converse, Inverse, Contrapositive Some terminology, for an implication p  q: Its converse is: q  p. Its inverse is: ¬p  ¬q. Its contrapositive:¬q  ¬ p. One of these three has the same meaning (same truth table) as p  q. Can you figure out which?

2009/919 How do we know for sure? Proving the equivalence of p  q and its contrapositive using truth tables:

2009/920 The biconditional operator The biconditional p  q states that p is true if and only if (IFF) q is true. p = “You can take the flight.” q = “You buy a ticket.” p  q =

2009/921 Biconditional Truth Table p  q means that p and q have the same truth value. Note this truth table is the exact opposite of  ’s! p  q means ¬(p  q) p  q does not imply p and q are true, or cause each other.

2009/922 Boolean Operations Summary We have seen 1 unary operator (out of the 4 possible) and 5 binary operators (out of the 16 possible). Their truth tables are below.

2009/923 Some Alternative Notations

2009/924 Bits and Bit Operations A bit is a binary (base 2) digit: 0 or 1. Bits may be used to represent truth values. By convention: 0 represents “false”; 1 represents “true”. Boolean algebra is like ordinary algebra except that variables stand for bits, + means “or”, and multiplication means “and”. See chapter 10 for more details.

2009/925 Bit Strings A Bit string of length n is an ordered series or sequence of n  0 bits. More on sequences in §3.2. By convention, bit strings are written left to right: e.g. the first bit of “ ” is 1. When a bit string represents a base-2 number, by convention the first bit is the most significant bit. Ex =8+4+1=13.

2009/926 Counting in Binary Did you know that you can count to 1,023 just using two hands?

2009/927 Bitwise Operations Boolean operations can be extended to operate on bit strings as well as single bits. E.g.: