We think you have liked this presentation. If you wish to download it, please recommend it to your friends in any social system. Share buttons are a little bit lower. Thank you!
Presentation is loading. Please wait.
Published byLena Matson
Modified about 1 year ago
ICS 253: Discrete Structures I Dr. Nasir Al-Darwish Computer Science Department King Fahd University of Petroleum and Minerals Spring Semester 2014 (2013-2) Propositional Logic Section 1.1
KFUPM: Dr. Al-Darwish © Grading Lecture attendance: -1% per 2 unexcused absences Assignments & Quizzes: 20% Two Major Exams: 25% per exam Final Exam: 30%
KFUPM: Dr. Al-Darwish © Expectations This is really a fun course! The course covers some of the most useful math you’ll ever learn. It teaches abstraction, describe (or model) a given problem using precise formal notation Hints for success Read the textbook. Lectures really do help! Do the homework.
KFUPM: Dr. Al-Darwish © Propositional Logic Traditionally, logic distinguishes valid and invalid arguments (2-valued logic). A claim is either true or false. There are other types of logic, e.g. fuzzy logic The building blocks of logic are propositions. A proposition (claim) is a declarative statement that is either true or false.
KFUPM: Dr. Al-Darwish © What’s a proposition? PropositionsNot Propositions = 32Bring me coffee! Math is my favorite subject Every cow has 4 legs.Do you like Cake? There is other life in the universe. I will go fishing tomorrow. X – 2 = 10 (depends on X) A proposition is a declarative statement that’s either TRUE or FALSE (but not both, not conditional). Propositions versus Not Propositions
KFUPM: Dr. Al-Darwish © Atomic versus Compound Propositions Logical OperationSymbol Negation (NOT) Conjunction (AND) Disjunction (OR) Exclusive OR Implication (imply) Biconditional (2-way imply) A proposition is either atomic (simple) or compound A compound proposition is formed by combining simple propositions using logical operators (operations)
KFUPM: Dr. Al-Darwish © Logical Operations Let p & q be propositions, then the following are compound propositions: Negation: p = not p Conjunction: p q = p AND q Disjunction: p q= p OR q Exclusive OR: p q= p XOR q Implication: p q= if p then q Biconditional: p q= p if and only if q
KFUPM: Dr. Al-Darwish © Precedence of Logical Operators In a parenthesized expression, the inner most parenthesized part is computed first Binary operators with same precedence are applied left-to-right; unary are applied right-to-left The following is the order of operators by precedence , , v, , This means for example (assuming parenthesis are not present) (((p ( q)) v p v q) q) ((p ( q)) v p)
KFUPM: Dr. Al-Darwish © Truth Tables A truth table shows the truth values of a compound proposition in relation to the truth values of its constituent propositions Normally, the truth table will have as many rows as the different possible truth value of its constituent propositions. For example, a compound proposition involving two simple propositions P, Q will have 4 rows (4 different T/F combinations for P and Q).
KFUPM: Dr. Al-Darwish © Propositional Logic - negation Suppose p is a proposition. The negation of p is written p and has meaning: “It is not the case that p.” Ex. P = Pizza is my favorite food. P = It is not the case that pizza is my favorite food. More simply, pizza is NOT my favorite food. Truth table for negation p pp FTFT TFTF Note that p is a proposition!
KFUPM: Dr. Al-Darwish © Propositional Logic - conjunction Conjunction corresponds to English “and” p q is true exactly when p is true and q is true (or both are true). Ex. Amy is curious AND clever. Truth table for conjunction pqp q FFTTFFTT FTFTFTFT FFFTFFFT
KFUPM: Dr. Al-Darwish © Propositional Logic - disjunction Disjunction corresponds to English “or” p q is true when p is true or q is true (or both are true). Ex. Michael is brave OR nuts. Truth table for disjunction pqp q FFTTFFTT FTFTFTFT FTTTFTTT
KFUPM: Dr. Al-Darwish © The implication The implication p q corresponds to English: “if p then q” or “p implies q” P Q can be considered as a contract that relates a condition P to a conclusion Q P = build me a house, Q = pay you $1 million If you build me a house then I will pay you $1 million The contract is violated if the house is built but the payment is not made p q is false only in the case where p is true and q is false If p then 2+2=4. (This is true. Why?) Truth table for implication pqp q FFTTFFTT FTFTFTFT TTFTTTFT
KFUPM: Dr. Al-Darwish © Propositional Logic - logical equivalence How many different logical binary operations could we define? To answer, we need the notion of “logical equivalence.” 16 How many different logical operations do we need? ?? p is logically equivalent to q if their truth tables are the same. Logical equivalence is denoted by p q (or p q).
KFUPM: Dr. Al-Darwish © Propositional Logic - logical equivalence Challenge: Try to find a proposition that is equivalent to p q, but that uses only the connectives , , and . pqp q FFTTFFTT FTFTFTFT TTFTTTFT pq p p q FFTTFFTT FTFTFTFT TTFFTTFF TTFTTTFT
KFUPM: Dr. Al-Darwish © Propositional Logic – a proof of one famous Distributivity: p (q r) (p q) (p r) pqr q rq rp (q r)p qp qp rp r(p q) (p r) FFFFFFFF FFTFFFTF FTFFFTFF FTTTTTTT TFFFTTTT TFTFTTTT TTFFTTTT TTTTTTTT All truth assignments for p, q, and r. This is a “proof” of “law of distributivity.”
KFUPM: Dr. Al-Darwish © Expressing Implications The implication p q essentially says that we cannot have p true yet q is false, (p q). Thus, p q (p q) (1). (The equivalence can be shown by truth table) Simplifying the RHS (use DeMorgan’s law), gives p q p q (2) It is important to observe that p q also means (because we cannot have p and not q): not q not p It is easy to show that p q q p (3) This last equivalence is known as the ContraPositive (negative of positive). I liken it to “the cub is half full the cub is half empty”
KFUPM: Dr. Al-Darwish © Expressing Implications – cont. Definition: p is sufficient for q if whenever p is true, q is true. Thus, p q means that p is sufficient for q. Definition: p is necessary for q if whenever p is false, q is false. Thus, p q means that q is necessary for q. (recall from previous slide that p q q p)
KFUPM: Dr. Al-Darwish © Expressing Implications – cont. The following are some of the ways of expressing p q p implies q if p then q if p, q q if p (stating the conclusion first) p only if q* (see next two slides for justification) p is sufficient for q q is necessary for p q whenever (when) p q follows from p q unless ¬p* ** These seem confusing
KFUPM: Dr. Al-Darwish © Expressing Implications – cont. p q can be expressed as: p only if q: p cannot be true if q is not true This corresponds to the contrapositive of p q q unless p If p is false, then q must be true Example: If You fail the final exam then you will get F You will get F unless you do not fail the final exam
KFUPM: Dr. Al-Darwish © Propositional Logic - biconditional The biconditional proposition p ↔ q (read as, p if and only if q) states that p and q are always equal (either they are both true or both false) The biconditional proposition p ↔ q is equivalent to “(p q) and (q p)” Because in the expression “p if and only if q”, “p if q” is q p, it follows that p q is “p only if q” Question: Is p ↔ q (p q) ( p q)? pqp ↔ q FFTTFFTT FTFTFTFT TFFTTFFT Truth table for biconditional
KFUPM: Dr. Al-Darwish © Propositional Logic - some definitions Contrapositives: p q and q p Ex. “If it is noon, then I am hungry.” “If I am not hungry, then it is not noon.” Converses: p q and q p Ex. “If it is noon, then I am hungry.” “If I am hungry, then it is noon.” Inverses: p q and p q Ex. “If it is noon, then I am hungry.” “If it is not noon, then I am not hungry.” Note: p q q p
KFUPM: Dr. Al-Darwish © Propositional Logic - more definitions… A tautology is a proposition that’s always TRUE. A contradiction is a proposition that’s always FALSE. p ppp pp pp pp p TFTF FTTF
KFUPM: Dr. Al-Darwish © Translating English Sentences English (and every other human language) is often ambiguous. Translating sentences into compound propositions removes the ambiguity. Example: How can this 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.” Solution: Let a, c, and f represent “You can access the Internet from campus”, “You are a computer science major”, and “You are a freshman” The sentence can be translated into: a → (c ν ¬f).
KFUPM: Dr. Al-Darwish © Example: How can this English sentence be translated into a logical expression? “You cannot enter into the pool if you are under 4 feet tall unless you are older than 16 years old.” Solution: Let p, r, and s represent “You can enter into the pool”, “You are under 4 feet tall”, and “You are older than 16 years old” The sentence can be translated into: (r Λ ¬ s) → ¬p. Translating English Sentences
KFUPM: Dr. Al-Darwish © Propositional Logic – why?… We’re primarily using propositional logic as a foundation for formal proofs. Later we will study different proof methods and these are needed for developing (or ensuring correctness) of algorithms. Propositional logic is a key to writing correct program code…you can’t do any kind of conditional (if) statement without understanding the condition you’re testing. The logical operations we’ve discussed are also found in hardware and are called “logic gates.”
Discrete Mathematics. Propositional Logic 10/8/2015 What’s a proposition? PropositionsNot Propositions = 32Bring me coffee! CS173 is Bryan’s favorite.
Chapter 1: The Foundations: Logic and Proofs Discrete Mathematics and Its Applications Lingma Acheson Department of Computer and Information.
Discrete Mathematical الرياضيات المتقطعة Dr. Ahmad Tayyar Al Israa University
ICS 253: Discrete Structures I Dr. Nasir Al-Darwish Computer Science Department King Fahd University of Petroleum and Minerals Spring.
Logic Reading: Chapter 4 (44-59) from the text book 1.
CS104 The Foundations: Logic and Proof 1. 2 What is Discrete Structure? Discrete Objects Separated from each other (Opposite of continuous) e.g.,
CS 285- Discrete Mathematics Lecture 2. Section 1.1 Propositional Logic Propositions Conditional Statements Truth Tables of Compound Propositions Translating.
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.
Chapter 1, Part I: Propositional Logic With Question/Answer Animations.
Propositions and Truth Tables. Proposition: Makes a claim that may be either true or false; it must have the structure of a complete sentence.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 01: Boolean Logic Sections 1.1 and 1.2 Jarek Rossignac.
LECTURE 1. Disrete mathematics and its application by rosen 7 th edition THE FOUNDATIONS: LOGIC AND PROOFS 1.1 PROPOSITIONAL LOGIC.
Discrete Mathematics Goals of a Discrete Mathematics Learn how to think mathematically 1. Mathematical Reasoning Foundation for discussions of methods.
CSE115/ENGR160 Discrete Mathematics 01/17/12 Ming-Hsuan Yang UC Merced 1.
Mathematics for Comter I Lecture 2: Logic (1) Basic definitions Logical operators Translating English sentences.
Syllabus Lecture Section: TuTh 9:30-10:45 Lab/Discussion Section M & W 9-9:50 or 10-10:50 Every Week: –Worksheet –Quiz –Homework 2 Hourly Exams +Final.
Discrete Maths Objective to re-introduce propositional logic , Semester 2, Propositional Logic 1.
1/10/ Math/CSE 1019N: Discrete Mathematics for Computer Science Winter 2007 Suprakash Datta Office: CSEB 3043 Phone:
Section 1.1. Section Summary Propositions Connectives Negation Conjunction Disjunction Implication; contrapositive, inverse, converse Biconditional Truth.
Intro to Discrete Structures Spring 2014 Text: Mathematical Structures for Computer Science.
Lecture 1.1: Course Overview, and Propositional Logic CS 250, Discrete Structures, Fall 2013 Nitesh Saxena Adopted from previous lectures by Cinda Heeren.
Chapter 1. Chapter Summary Propositional Logic The Language of Propositions (1.1) Logical Equivalences (1.3) Predicate Logic The Language of.
Mathematical Logic Adapted from Discrete Math. Learning Objectives Learn about sets Explore various operations on sets Become familiar with Venn diagrams.
1 CMSC 250 Discrete Structures CMSC 250 Lecture 1.
Logical Form: general rules ◦ All logical comparisons must be done with complete statements ◦ A statement is an expression that is true or false but.
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.
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.
11/25/2015 Prepared by Dr.Saad Alabbad & Dr. Zakir Ahmed 1 CS100 : Discrete Structures Chapter 1 Logic Theory Dr.Saad Alabbad Department of Computer Science.
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.
Discrete Structures for Computer Science Presented By: Andrew F. Conn Slides adapted from: Adam J. Lee Lecture #1: Introduction, Propositional Logic August.
رياضيات متقطعة لعلوم الحاسب MATH 226. Text books: (Discrete Mathematics and its applications) Kenneth H. Rosen, seventh Edition, 2012, McGraw- Hill.
1 SSK3003 DISCRETE STRUCTURES Prof. Madya Dr.Ali Mamat Department of Computer Science.
CS 381 DISCRETE STRUCTURES Gongjun Yan Aug 25, November 2015Introduction & Propositional Logic 1.
The Foundations: Logic and Proof, Sets, and Foundations PROPOSITIONS A proposition is a declarative sentence that is either True or False, but not the.
Discrete Mathematics and Its Applications 1 The Foundations: Logic and Proofs Propositional.
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.
Chapter 1: The Foundations: Logic and Proofs 1.1 Propositional Logic 1.2 Propositional Equivalences 1.3 Predicates and Quantifiers 1.4 Nested Quantifiers.
Chapter 7 Logic, Sets, and Counting Section 1 Logic.
Propositional Logic ITCS 2175 (Rosen Section 1.1, 1.2)
BY: MISS FARAH ADIBAH ADNAN IMK. CHAPTER OUTLINE: PART III 1.3 ELEMENTARY LOGIC INTRODUCTION PROPOSITION COMPOUND STATEMENTS LOGICAL.
Logical Form and Logical Equivalence Lecture 2 Section 1.1 Fri, Jan 19, 2007.
1 Propositional Logic From Chapter 4 Formal Specification using Z David Lightfoot.
CS104 : Discrete Structures Chapter I Introduction & Logic Theory.
Logic UNIT 1. Logical Operations and Truth Tables At first glance, it may not seem that the study of logic should be part of mathematics. For most of.
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.
Chapter 1: The Foundations: Logic and Proofs Discrete Mathematics and Its Applications CSE 211 Department of Computer Science and Engineering, CUET 1.
Foundations of Discrete Mathematics Chapter 1 By Dr. Dalia M. Gil, Ph.D.
© 2017 SlidePlayer.com Inc. All rights reserved.