CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 1 Lecture 2 CS 1813 – Discrete Mathematics Proofs Propositions and Calculuses.

Slides:



Advertisements
Similar presentations
Artificial Intelligence Chapter 13 The Propositional Calculus Biointelligence Lab School of Computer Sci. & Eng. Seoul National University.
Advertisements

CSE 311: Foundations of Computing Fall 2013 Lecture 3: Logic and Boolean algebra.
1 Logic Logic in general is a subfield of philosophy and its development is credited to ancient Greeks. Symbolic or mathematical logic is used in AI. In.
CS344 : Introduction to Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 9,10,11- Logic; Deduction Theorem 23/1/09 to 30/1/09.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 1 Lecture 3 CS 1813 – Discrete Mathematics Truth Inference and the Logical Way.
Syllabus Every Week: 2 Hourly Exams +Final - as noted on Syllabus
TR1413: Discrete Mathematics For Computer Science Lecture 3: Formal approach to propositional logic.
Logic: Connectives AND OR NOT P Q (P ^ Q) T F P Q (P v Q) T F P ~P T F
From Chapter 4 Formal Specification using Z David Lightfoot
Discrete Mathematics Math 6A Instructor: M. Welling.
CS 4700: Foundations of Artificial Intelligence
Proofs, Recursion and Analysis of Algorithms Mathematical Structures for Computer Science Chapter 2.1 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesProofs,
Describing Syntax and Semantics
Copyright © Cengage Learning. All rights reserved.
22C:19 Discrete Math Introduction and Scope Propositions Fall 2011 Sukumar Ghosh.
Adapted from Discrete Math
Discrete Mathematics Goals of a Discrete Mathematics Learn how to think mathematically 1. Mathematical Reasoning Foundation for discussions of methods.
Intro to Discrete Structures
Discrete Mathematics and Its Applications
CS 490 Mathematical Logic, Combinatorics, Counting Arguments, Graph Theory, Number Theory, Discrete Probability, Recurrence Relation. Thao Tran.
CISC 2315 Discrete Structures Professor William G. Tanner, Jr. Fall 2010 Slides created by James L. Hein, author of Discrete Structures, Logic, and Computability,
Math 240: Transition to Advanced Math Deductive reasoning: logic is used to draw conclusions based on statements accepted as true. Thus conclusions are.
CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 1 Lecture 10 CS 1813 – Discrete Mathematics Quantify What? Reasoning with Predicates.
Pattern-directed inference systems
CISC 2315 Discrete Structures Professor William G. Tanner, Jr. Spring 2011 Slides created by James L. Hein, author of Discrete Structures, Logic, and Computability,
Great Theoretical Ideas in Computer Science about AWESOME Some Generating Functions Probability Infinity MATH Some Formal Logic (which is really.
Propositional Logic Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma Guadalajara
Copyright © Curt Hill Mathematical Logic An Introduction.
MATH 224 – Discrete Mathematics
1 CMSC 250 Discrete Structures CMSC 250 Lecture 1.
SSK3003 DISCRETE STRUCTURES
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.
Hazırlayan DISCRETE COMPUTATIONAL STRUCTURES Propositional Logic PROF. DR. YUSUF OYSAL.
1 CA 208 Logic PQ PQPQPQPQPQPQPQPQ
CS6133 Software Specification and Verification
Chapter 1: The Foundations: Logic and Proofs
Artificial Intelligence 7. Making Deductive Inferences Course V231 Department of Computing Imperial College, London Jeremy Gow.
Logic UNIT 1.
 22M:150 Introduction to Discrete Mathematics  Fall :30A - 11:20A MWF 218 MLH  Instructor: Dr. Isabel Darcy Office:B1H MLH Phone:
Computing & Information Sciences Kansas State University Lecture 12 of 42 CIS 530 / 730 Artificial Intelligence Lecture 12 of 42 William H. Hsu Department.
CSE 311: Foundations of Computing Fall 2013 Lecture 8: Proofs and Set theory.
Propositional Logic Rather than jumping right into FOL, we begin with propositional logic A logic involves: §Language (with a syntax) §Semantics §Proof.
ARTIFICIAL INTELLIGENCE Lecture 2 Propositional Calculus.
1 Section 6.2 Propositional Calculus Propositional calculus is the language of propositions (statements that are true or false). We represent propositions.
CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 1 Lecture 14 CS 1813 – Discrete Mathematics A Little Bit of Set Theory.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 01: Boolean Logic Sections 1.1 and 1.2 Jarek Rossignac.
Prof. Pushpak Bhattacharyya, IIT Bombay 1 CS 621 Artificial Intelligence Lecture 16 – 09/09/05 Prof. Pushpak Bhattacharyya Soundness, Completeness,
Discrete Mathematical Structures: Theory and Applications 1 Logic: Learning Objectives  Learn about statements (propositions)  Learn how to use logical.
1 Section 7.1 First-Order Predicate Calculus Predicate calculus studies the internal structure of sentences where subjects are applied to predicates existentially.
Chapter 2 1. Chapter Summary Sets (This Slide) The Language of Sets - Sec 2.1 – Lecture 8 Set Operations and Set Identities - Sec 2.2 – Lecture 9 Functions.
March 3, 2016Introduction to Artificial Intelligence Lecture 12: Knowledge Representation & Reasoning I 1 Back to “Serious” Topics… Knowledge Representation.
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture–6: Propositional calculus, Semantic Tableau, formal System 2 nd August,
CENG 424-Logic for CS Introduction Based on the Lecture Notes of Konstantin Korovin, Valentin Goranko, Russel and Norvig, and Michael Genesereth.
Propositional Logic (a.k.a. Sentential Logic)
DISCRETE MATHEMATICS CHAPTER I.
Lecture 1 – Formal Logic.
Knowledge Representation and Reasoning
MATH 245 Spring 2009 This is mathematics for computer science
Mathematics for Computing
Information Technology Department
CS 1813 – Discrete Mathematics
Quizzes CS 1813 – Discrete Mathematics
Lecture 1 CS 1813 – Discrete Mathematics
Back to “Serious” Topics…
Computer Security: Art and Science, 2nd Edition
Lecture 8 CS 1813 – Discrete Mathematics
This Lecture Substitution model
Presentation transcript:

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 1 Lecture 2 CS 1813 – Discrete Mathematics Proofs Propositions and Calculuses

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 2 City of Königsberg (Kaliningrad)

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 3 Bridges of Königsberg Must the route have a matching exit to each land mass for each entry? For a particular land mass, can the total number of entries and exits be and odd number? Can there be an odd number of bridges to a land mass with an even entry/exit count? So, there must be either no land masses with an odd number of bridges, or exactly two. Right? How many land masses have an odd number of bridges? Problem Find a route that crosses each bridge exactly once TILT Adapted from Singh, Fermat’s Enigma, Walker & Co, 1997

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 4 Tracing a Square and Its Diagonals If it’s possible to do such a tracing, how many corners will have an odd number of lines emanating from them? None. Or two, right? Square + Diagonals Problem  Start at any corner  Trace some line to another corner  Then trace from that corner to another  Keep going until all six lines are traced  Don’t trace any line more than once TILT Euler solved the bridges of Königsberg problem in the 1700s. The field of graph theory includes problems of this kind.

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 5 Logic a tool for careful reasoning  Software and hardware development Formal logic can lead to defect-free products Used in chip design (since Pentium disaster) Used in safety-critical software Used in network-secure software Positive influence on all software development  Foundation for programming languages Lambda calculus – semantic base for all PLs Type checking and type inference – basis in logic Computation models – limits of computabilty  Artificial intelligence, database systems Grounded in formal logic

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 6 all three consistent Propositional Logic Starting Here What does this mean?  Proposition – atomic entity, true or false Capital letters denote propositional variables –Standing for specific propositions –P, Q, … specific propositions - value: true or false Lowercase letters are metavariables –Denoting propositional formulas –a, b, … value: formula, such as P, (P  Q), …  Calculus a method of reasoning by computation of symbols  Propositional Calculus Scheme for calculating with logic formulas  Three different Propositional Calculuses Semantics-based reasoning – truth tables Syntax-based reasoning – inference rules Equational reasoning – Boolean algebra

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 7 Logical Operators  Logical And P  Q, (P  Q)  R, …  Logical Or P  Q, P  (Q  R), …  Logical Not  P, ((  P)  Q), …  Logical Implication P  Q, (P  Q)  Q, …  Logical Equivalence P  Q, (P  Q)  (Q  P)  Exclusive Or P  Q, (P  Q)  R, …  Logical operators provide ways to combine propositions for calculation

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 8 Truth Table – Logical And  True iff both operands are True  Define P = x  0, Q = x  10  P  Q is True iff x is between 0 and 10 P Q P  Q False False False False True False True False False True True True Pronounced “if and only if”

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 9 Truth Table – Logical Or  True iff either operand is True  Define P = x  0, Q = x  10  P  Q is True iff x is outside 0 to 10  This is the “inclusive or”  Usually and/or in English P Q P  Q False False False False True True True False True True True True

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 10 Truth Table – Logical Not  True iff operand is False  Define P = x  0, Q = x  10   P is True iff x is non-negative   (P  Q) is True iff x is between 0 and 10 P  P False True True False

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 11 Truth Table – Logical Implication  False iff 1 st operand is True and 2 nd False  Define P = x  10, Q = x  0  Consider x = 15, x = 5, and x = -5  P  Q is True, regardless of x’s value That is, third line in table does not occur  Q  P is False when x is between 0 and 10 So, line 3 in table sometimes applies to this formula  This confirms intuition about inference We expect to infer Q, knowing P (P  Q is True) But not vice versa (cannot always infer P, knowing Q) P Q P  Q False False True False True True True False False True True True

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 12 Truth Table – Logical Equivalence  True iff both operands have the same value  P  Q has same value as (P  Q)  (Q  P) P Q P  Q False False True False True False True False False True True True

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 13 Truth Table – Exclusive Or  True iff operands have different values  Define P = x  0, Q = y  0  P  Q is True iff (x, y) is in 2 nd or 4 th quadrant  P  Q also has same value as  (P  Q) P Q P  Q False False False False True True True False True True True False Quadrant 1 x > 0, y > 0 Quadrant 2 x 0 Quadrant 4 x > 0, y < 0 Quadrant 3 x < 0, y < 0 y x

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 14 Well-Formed Formulas — WFFs the syntax of logic formulas Classes of WFFs  True  False  Any propositional variable  (  p) if p is a WFF  (p  q) if p and q are WFFs  (p  q) if p and q are WFFs  (p  q) if p and q are WFFs  (p  q) if p and q are WFFs  (p  q) if p and q are WFFs Examples  True  False  P, Q, …  (  P), (  Q), (  (  P)), …  (P  Q), ((  P)  (P  Q)), …  (P  Q), ((P  Q)  (  Q)), …  (P  Q), ((P  Q)  (P  Q)), …  (P  Q), ((P  Q)  (Q  P)), …  (P  Q), ((  P)  Q), … This syntax defines WFFs In case of missing parens: Precedence:       Association: P  (Q  R) atomic formulas formulas with connectives (not atomic) Inductive definition

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 15 Confirming WFFness by Analyzing Constituents WFF? ((P  Q)  ((  P)  Q)) Constituents (must be WFFS) ( P  Q) ((  P)  Q) Constituents (of constituents) P Q (  P) Q Constituents (of constituents of constituents) P Yes, it’s a WFF – constituents match WFF patterns all the way down to atomic formulas

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 16 Constituent Analysis Can Confirm non-WFFness, Too WFF? (( P  (  (  Q)))  ((  P)  Q)) ( P  (  (  Q))) ((  P)  Q) Constituents (must be WFFS) Constituents (of constituents) P (  (  Q)) (  P) Q Constituents (of constituents of constituents) (  Q) P Whoops!  Q not a WFF No WFF begins with  TILT

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 17 Semantic Reasoning with Truth Tables Proposition (WFF): ((P  Q)  ((  P)  Q)) P Q False False True True False True False True ( P  Q) (  P) True False ((  P)  Q) False True ( ( P  Q)  ((  P)  Q)) False True Some True: prop is Satisfiable If they were all True: Tautology All False: Contradiction (not satisfiable) If prop is True when all variables areTrue: P, Q ( ( P  Q)  ((  P)  Q)) Formal statement about meaning Proved via truth table double turnstile

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 18 Another Truth Table Proposition (WFF): (((  P)  Q)  ((  P)  Q)) P Q False False True True False True False True False ((  P)  Q) (  P) True False ((  P)  Q) False True ( ( ((  P)  Q)  ((  P)  Q)) False True False Prop is False when all variables areTrue P, Q ((  P)  Q)  ((  P)  Q))

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 19 Why Reasoning with Truth Tables Is Infeasible  Works fine when there are 2 variables  {T,F}  {T,F} = set of potential values of variables  2  2 lines in truth table  Three variables — starts to get tedious  {T,F}  {T,F}  {T,F} = set of potential values  2  2  2 lines in truth table  Twenty variables — definitely out of hand  2  2  …  2 lines (2 20 )  You want to look at a million lines?  If you did, how would you avoid making errors?  Hundreds of variables — not in a million years

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 20 End of Lecture