CSE 321 Discrete Structures Winter 2008 Lecture 1 Propositional Logic.

Slides:



Advertisements
Similar presentations
Propositional Equivalences
Advertisements

Foundations of Computing I CSE 311 Fall 2014 Foundations of Computing I Fall 2014.
CSE 311: Foundations of Computing Fall 2013 Lecture 3: Logic and Boolean algebra.
CSE 311 Foundations of Computing I Spring 2013 Lecture 1 Propositional Logic.
CSE 311 Foundations of Computing I Autumn 2011 Lecture 1 Propositional Logic.
Syllabus Every Week: 2 Hourly Exams +Final - as noted on Syllabus
CSE 311 Foundations of Computing I Lecture 6 Predicate Logic Autumn 2011 CSE 3111.
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.
CSE 311 Foundations of Computing I Autumn 2011 Lecture 2 More Propositional Logic Application: Circuits Propositional Equivalence.
Predicates and Quantifiers
CSE 311 Foundations of Computing I Lecture 6 Predicate Logic, Logical Inference Spring
1 Math/CSE 1019C: Discrete Mathematics for Computer Science Fall 2011 Suprakash Datta Office: CSEB 3043 Phone: ext
Discrete Mathematics Goals of a Discrete Mathematics Learn how to think mathematically 1. Mathematical Reasoning Foundation for discussions of methods.
CSci 2011 Discrete Mathematics Lecture 3 CSci 2011.
CSE 311 Foundations of Computing I Autumn 2012 Lecture 1 Propositional Logic 1.
MATH 213 A – Discrete Mathematics for Computer Science Dr. (Mr.) Bancroft.
Mathematical Structures A collection of objects with operations defined on them and the accompanying properties form a mathematical structure or system.
Foundations of Computing I CSE 311 Fall CSE 311: Foundations of Computing I Fall 2014 Lecture 1: Propositional Logic.
CSE 311: Foundations of Computing Fall 2013 Lecture 8: More Proofs.
CSE 311 Foundations of Computing I Spring 2013, Lecture 3 Propositional Logic, Boolean Logic/Boolean Algebra 1.
Review I Rosen , 3.1 Know your definitions!
Foundations of Computing I CSE 311 Fall bit Binary Adder Inputs: A, B, Carry-in Outputs: Sum, Carry-out A B Cin Cout S
CSE 311 Foundations of Computing I Lecture 5, Boolean Logic and Predicates Autumn 2012 CSE 3111.
CSE 311 Foundations of Computing I Lecture 5 Predicate Logic Spring
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
SSK3003 DISCRETE STRUCTURES
Fundamentals of Logic 1. What is a valid argument or proof? 2. Study system of logic 3. In proving theorems or solving problems, creativity and insight.
CSE 311 Foundations of Computing I Lecture 7 Logical Inference Autumn 2012 CSE
September1999 CMSC 203 / 0201 Fall 2002 Week #1 – 28/30 August 2002 Prof. Marie desJardins.
Predicates and Quantified Statements
Chapter 2 Logic 2.1 Statements 2.2 The Negation of a Statement 2.3 The Disjunction and Conjunction of Statements 2.4 The Implication 2.5 More on Implications.
Chapter 1: The Foundations: Logic and Proofs
UMBC CMSC 203, Section Fall CMSC 203, Section 0401 Discrete Structures Fall 2004 Matt Gaston
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.
Chapter 2 Fundamentals of Logic 1. What is a valid argument or proof?
CSE 311: Foundations of Computing Fall 2013 Lecture 8: Proofs and Set theory.
رياضيات متقطعة لعلوم الحاسب MATH 226. Text books: (Discrete Mathematics and its applications) Kenneth H. Rosen, seventh Edition, 2012, McGraw- Hill.
CSE 311 Foundations of Computing I Lecture 8 Proofs Autumn 2012 CSE
Mathematics for Comter I Lecture 3: Logic (2) Propositional Equivalences Predicates and Quantifiers.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 01: Boolean Logic Sections 1.1 and 1.2 Jarek Rossignac.
CSE 311: Foundations of Computing Fall 2013 Lecture 1: Propositional logic.
The Foundations: Logic and Proofs
CSE15 Discrete Mathematics 01/23/17
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
CSE 311 Foundations of Computing I
CSE 311 Foundations of Computing I
COT 3100, Spr Applications of Discrete Structures
CPCS222 Discrete Structures I
CSCI 3310 Mathematical Foundation of Computer Science
Administrivia Course Web:
CSE 311 Foundations of Computing I
CSE 311 Foundations of Computing I
CSE 311: Foundations of Computing
CSE 311 Foundations of Computing I
CSE 311 Foundations of Computing I
CSE 311 Foundations of Computing I
Negations of quantifiers
Discrete Mathematics CMP-200 Propositional Equivalences, Predicates & Quantifiers, Negating Quantified Statements Abdul Hameed
CSE 321 Discrete Structures
CSE 321 Discrete Structures
CSE 321 Discrete Structures
Cs Discrete Mathematics
CSE 321 Discrete Structures
CSE 311: Foundations of Computing
Discrete Structures Prepositional Logic 2
The Foundations: Logic and Proofs
Presentation transcript:

CSE 321 Discrete Structures Winter 2008 Lecture 1 Propositional Logic

About the course From the CSE catalog: –CSE 321 Discrete Structures (4) Fundamentals of set theory, graph theory, enumeration, and algebraic structures, with applications in computing. Prerequisite: CSE 143; either MATH 126, MATH 129, or MATH 136. What I think the course is about: –Foundational structures for the practice of computer science and engineering

Why this material is important Language and formalism for expressing ideas in computing Fundamental tasks in computing –Translating imprecise specification into a working system –Getting the details right

Topic List Logic/boolean algebra: hardware design, testing, artificial intelligence, software engineering Mathematical reasoning/induction: algorithm design, programming languages Number theory/probability: cryptography, security, algorithm design, machine learning Relations/relational algebra: databases Graph theory: networking, social networks, optimization

Administration Instructor –Richard Anderson Teaching Assistant –Natalie Linnell Quiz section –Thursday, 12:30 – 1:20, or 1:30 – 2:20 –CSE 305 Recorded Lectures –Available on line Text: Rosen, Discrete Mathematics –6 th Edition preferred –5 th Edition okay Homework –Due Wednesdays (starting Jan 16) Exams –Midterms, Feb 8 –Final, March 17, 2:30-4:20 pm All course information posted on the web Sign up for the course mailing list

Propositional Logic

Propositions A statement that has a truth value Which of the following are propositions? –The Washington State flag is red –It snowed in Whistler, BC on January 4, –Hillary Clinton won the democratic caucus in Iowa –Space aliens landed in Roswell, New Mexico –Ron Paul would be a great president –Turn your homework in on Wednesday –Why are we taking this class? –If n is an integer greater than two, then the equation a n + b n = c n has no solutions in non-zero integers a, b, and c. –Every even integer greater than two can be written as the sum of two primes –This statement is false –Propositional variables: p, q, r, s,... –Truth values: T for true, F for false

Compound Propositions Negation (not)  p Conjunction (and) p  q Disjunction (or)p  q Exclusive orp  q Implicationp  q Biconditionalp  q

Truth Tables p  p p pq p  q pq p  q pq p  q

Understanding complex propositions Either Harry finds the locket and Ron breaks his wand or Fred will not open a joke shop

Understanding complex propositions with a truth table h r f h  r  f f (h  r)   f

Aside: Number of binary operators How many different binary operators are there on atomic propositions?

p  qp  q Implication –p implies q –whenever p is true q must be true –if p then q –q if p –p is sufficient for q –p only if q pq p  q

If pigs can whistle then horses can fly

Converse, Contrapositive, Inverse Implication: p  q Converse: q  p Contrapositive:  q   p Inverse:  p   q Are these the same?

Biconditional p  q p iff q p is equivalent to q p implies q and q implies p pq p  q

English and Logic You cannot ride the roller coaster if you are under 4 feet tall unless you are older than 16 years old –q: you can ride the roller coaster –r: you are under 4 feet tall –s: you are older than 16

Logical equivalence Terminology: A compound proposition is a –Tautology if it is always true –Contradiction if it is always false –Contingency if it can be either true or false p   p (p  p)  p p   p  q   q (p  q)  p (p  q)  (p   q)  (  p  q)  (  p   q)

Logical Equivalence p and q are Logically Equivalent if p  q is a tautology. The notation p  q denotes p and q are logically equivalent Example: (p  q)  (  p  q) pq p  q  p p  p  q(p  q)  (  p  q)

Computing equivalence Describe an algorithm for computing if two logical expressions are equivalent What is the run time of the algorithm?

Understanding connectives Reflect basic rules of reasoning and logic Allow manipulation of logical formulas –Simplification –Testing for equivalence Applications –Query optimization –Search optimization and caching –Artificial Intelligence –Program verification

Properties of logical connectives Identity Domination Idempotent Commutative Associative Distributive Absorption Negation

De Morgan’s Laws  (p  q)   p   q  (p  q)   p   q What are the negations of: –Casey has a laptop and Jena has an iPod –Clinton will win Iowa or New Hampshire

Equivalences relating to implication p  q   p  q p  q   q   p p  q   p  q p  q   (p   q) p  q  (p  q)  (q  p) p  q   p   q p  q  (p  q)  (  p   q)  (p  q)  p   q

Logical Proofs To show P is equivalent to Q –Apply a series of logical equivalences to subexpressions to convert P to Q To show P is a tautology –Apply a series of logical equivalences to subexpressions to convert P to T

Why bother with logical proofs when we have truth tables?

Show (p  q)  (p  q) is a tautology

Show (p  q)  r and p  (q  r) are not equivalent

Predicate Calculus Predicate or Propositional Function –A function that returns a truth value “x is a cat” “x is prime” “student x has taken course y” “x > y” “x + y = z”

Quantifiers  x P(x) : P(x) is true for every x in the domain  x P(x) : There is an x in the domain for which P(x) is true

Statements with quantifiers  x Even(x)  x Odd(x)  x (Even(x)  Odd(x))  x (Even(x)  Odd(x))  x Greater(x+1, x)  x (Even(x)  Prime(x)) Even(x) Odd(x) Prime(x) Greater(x,y) Equal(x,y) Domain: Positive Integers

Statements with quantifiers  x  y Greater (y, x)  y  x Greater (y, x)  x  y (Greater(y, x)  Prime(y))  x (Prime(x)  (Equal(x, 2)  Odd(x))  x  y(Equal(x, y + 2)  Prime(x)  Prime(y)) Domain: Positive Integers For every number there is some number that is greater than it Greater(a, b)  “a > b”

Statements with quantifiers “There is an odd prime” “If x is greater than two, x is not an even prime”  x  y  z ((Equal(z, x+y)  Odd(x)  Odd(y))  Even(z)) “There exists an odd integer that is the sum of two primes” Even(x) Odd(x) Prime(x) Greater(x,y) Equal(x,y) Domain: Positive Integers

Goldbach’s Conjecture Every even integer greater than two can be expressed as the sum of two primes Even(x) Odd(x) Prime(x) Greater(x,y) Equal(x,y) Domain: Positive Integers

Systems vulnerability Reasoning about machine status Specify systems state and policy with logic –Formal domain reasoning about security automatic implementation of policies Domains –Machines in the organization –Operating Systems –Versions –Vulnerabilities –Security warnings Predicates –RunsOS(M, O) –Vulnerable(M) –OSVersion(M, Ve) –LaterVersion(Ve, Ve) –Unpatched(M)

System vulnerability statements Unpatched machines are vulnerable There is an unpatched Linux machine All Windows machines have versions later than SP1

Prolog Logic programming language Facts and Rules RunsOS(SlipperPC, Windows) RunsOS(SlipperTablet, Windows) RunsOS(CarmelLaptop, Linux) OSVersion(SlipperPC, SP2) OSVersion(SlipperTablet, SP1) OSVersion(CarmelLaptop, Ver3) LaterVersion(SP2, SP1) LaterVersion(Ver3, Ver2) LaterVersion(Ver2, Ver1) Later(x, y) :- Later(x, z), Later(z, y) NotLater(x, y) :- Later(y, x) NotLater(x, y) :- SameVersion(x, y) MachineVulnerable(m) :- OSVersion(m, v), VersionVulnerable(v) VersionVulnerable(v) :- CriticalVulnerability(x), Version(x, n), NotLater(v, n)

Nested Quantifiers Iteration over multiple variables Nested loops Details –Use distinct variables  x(  y(P(x,y)   x Q(y, x))) –Variable name doesn’t matter  x  y P(x, y)   a  b P(a, b) –Positions of quantifiers can change (but order is important)  x (Q(x)   y P(x, y))   x  y (Q(x)  P(x, y))

Quantification with two variables ExpressionWhen trueWhen false  x  y P(x,y)  x  y P(x,y)  x  y P(x, y)  y  x P(x, y)