Grading Lecture attendance: -1% per 2 unexcused absences

Slides:



Advertisements
Similar presentations
Chapter 1: The Foundations: Logic and Proofs
Advertisements

Propositional Predicate
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.
CSE 311 Foundations of Computing I Spring 2013 Lecture 1 Propositional Logic.
Syllabus Every Week: 2 Hourly Exams +Final - as noted on Syllabus
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.
Introduction to Logic Logical Form: general rules
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.
CSE 311 Foundations of Computing I Autumn 2011 Lecture 2 More Propositional Logic Application: Circuits Propositional Equivalence.
Adapted from Discrete Math
The Foundations: Logic and Proofs
CS104 : Discrete Structures
Discrete Mathematics Goals of a Discrete Mathematics Learn how to think mathematically 1. Mathematical Reasoning Foundation for discussions of methods.
Intro to Discrete Structures
Propositions and Truth Tables
Propositions and Truth Tables. Proposition: Makes a claim that may be either true or false; it must have the structure of a complete sentence.
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
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
BY: MISS FARAH ADIBAH ADNAN IMK. CHAPTER OUTLINE: PART III 1.3 ELEMENTARY LOGIC INTRODUCTION PROPOSITION COMPOUND STATEMENTS LOGICAL.
Discrete Mathematics. Propositional Logic 10/8/2015 What’s a proposition? PropositionsNot Propositions = 32Bring me coffee! CS173 is Bryan’s favorite.
Lecture 1.1: Course Overview, and Propositional Logic CS 250, Discrete Structures, Fall 2013 Nitesh Saxena Adopted from previous lectures by Cinda Heeren.
(CSC 102) Lecture 3 Discrete Structures. Previous Lecture Summary Logical Equivalences. De Morgan’s laws. Tautologies and Contradictions. Laws of Logic.
Logical Form and Logical Equivalence Lecture 2 Section 1.1 Fri, Jan 19, 2007.
Tautologies, contradictions, contingencies
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.
Reading: Chapter 4 (44-59) from the text book
SSK3003 DISCRETE STRUCTURES
CS 381 DISCRETE STRUCTURES Gongjun Yan Aug 25, November 2015Introduction & Propositional Logic 1.
Chapter 7 Logic, Sets, and Counting
CS100 : Discrete Structures
Chapter 7 Logic, Sets, and Counting Section 1 Logic.
1/10/ Math/CSE 1019N: Discrete Mathematics for Computer Science Winter 2007 Suprakash Datta Office: CSEB 3043 Phone:
Propositional Logic ITCS 2175 (Rosen Section 1.1, 1.2)
Chapter 1: The Foundations: Logic and Proofs
The Foundations: Logic and Proof, Sets, and Foundations PROPOSITIONS A proposition is a declarative sentence that is either True or False, but not the.
Section 1.1. Section Summary Propositions Connectives Negation Conjunction Disjunction Implication; contrapositive, inverse, converse Biconditional Truth.
Logic UNIT 1.
Mathematics for Comter I Lecture 2: Logic (1) Basic definitions Logical operators Translating English sentences.
LECTURE 1. Disrete mathematics and its application by rosen 7 th edition THE FOUNDATIONS: LOGIC AND PROOFS 1.1 PROPOSITIONAL LOGIC.
رياضيات متقطعة لعلوم الحاسب 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.
Discrete Mathematical الرياضيات المتقطعة Dr. Ahmad Tayyar Al Israa University
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
Discrete Mathematical
Niu Kun Discrete Mathematics Chapter 1 The Foundations: Logic and Proof, Sets, and Functions Niu Kun 离散数学.
6/20/2018 Arab Open University Faculty of Computer Studies M131 - Discrete Mathematics 6/20/2018.
Citra Noviyasari, S.Si, MT
COT 3100, Spr Applications of Discrete Structures
(CSC 102) Discrete Structures Lecture 2.
CPCS222 Discrete Structures I
The Foundations: Logic and Proofs
Principles of Computing – UFCFA3-30-1
Information Technology Department
Chapter 1 The Foundations: Logic and Proof, Sets, and Functions
CSE 311 Foundations of Computing I
MAT 3100 Introduction to Proof
Cs Discrete Mathematics
Discrete Structures Prepositional Logic 2
The Foundations: Logic and Proofs
Presentation transcript:

ICS 253: Discrete Structures I Propositional Logic Section 1.1 Spring Semester 2014 (2013-2) Propositional Logic Section 1.1 Dr. Nasir Al-Darwish Computer Science Department King Fahd University of Petroleum and Minerals darwish@kfupm.edu.sa

Grading Lecture attendance: -1% per 2 unexcused absences Assignments & Quizzes: 20% Two Major Exams: 25% per exam Final Exam: 30%

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.

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.

Propositions versus Not Propositions What’s a proposition? A proposition is a declarative statement that’s either TRUE or FALSE (but not both, not conditional). Propositions Not Propositions 3 + 2 = 32 Bring me coffee! Math is my favorite subject. 3 + 2 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)

Atomic versus Compound Propositions A proposition is either atomic (simple) or compound A compound proposition is formed by combining simple propositions using logical operators (operations) Logical Operation Symbol Negation (NOT)  Conjunction (AND)  Disjunction (OR)  Exclusive OR  Implication (imply)  Biconditional (2-way imply) 

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

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)

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

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. p p F T Note that p is a proposition! Truth table for negation

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. p q p  q F T Truth table for conjunction

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. p q p  q F T Truth table for disjunction

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?) p q p  q F T Truth table for implication

Propositional Logic - logical equivalence How many different logical binary operations could we define? 16 How many different logical operations do we need? ?? To answer, we need the notion of “logical equivalence.” p is logically equivalent to q if their truth tables are the same. Logical equivalence is denoted by p  q (or p  q).

Propositional Logic - logical equivalence Challenge: Try to find a proposition that is equivalent to p  q, but that uses only the connectives , , and . p q p  q F T p q  p  p  q F T

Propositional Logic – a proof of one famous  This is a “proof” of “law of distributivity.” Distributivity: p  (q  r)  (p  q)  (p  r) All truth assignments for p, q, and r. p q r q  r p  (q  r) p  q p  r (p  q)  (p  r) F T

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”

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)

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

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

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)? p q p ↔ q F T Truth table for biconditional

Propositional Logic - some definitions Note: p  q  q  p 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 “If I am hungry, then it is noon.” Inverses: p  q and p  q “If it is not noon, then I am not hungry.”

Propositional Logic - more definitions… A tautology is a proposition that’s always TRUE. A contradiction is a proposition that’s always FALSE. p p p  p p  p T F

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

Translating English Sentences 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.

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.”