(CSC 102) Lecture 3 Discrete Structures. Previous Lecture Summary Logical Equivalences. De Morgan’s laws. Tautologies and Contradictions. Laws of Logic.

Slides:



Advertisements
Similar presentations
Logic Day Two.
Advertisements

Appetizer: True or False 1.2  2 2.If 2 = 3, then 5 = 6. 3.If 1 = 2, then I am the Pope. 4.Open the window. 5.If the proof is wrong, then the proposition.
Goals Determine the true value of statements with AND, OR, IF..THEN. Negate statements with the connectives above Construct truth tables Understand when.
Copyright © Cengage Learning. All rights reserved. CHAPTER 2 THE LOGIC OF COMPOUND STATEMENTS THE LOGIC OF COMPOUND STATEMENTS.
The Foundation: Logic Conditional Statements Muhammad Arief download dari
2.2 Conditional Statements. Goals Identify statements which are conditional Identify the antecedent and consequent of a conditional statement Negate conditional.
Logic Chapter 2. Proposition "Proposition" can be defined as a declarative statement having a specific truth-value, true or false. Examples: 2 is a odd.
Syllabus Every Week: 2 Hourly Exams +Final - as noted on Syllabus
Conditional Statements
Propositional Logic Lecture 2: Sep 9. Conditional Statement If p then q p is called the hypothesis; q is called the conclusion “If your GPA is 4.0, then.
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
Propositional Logic.
1.1 Sets and Logic Set – a collection of objects. Set brackets {} are used to enclose the elements of a set. Example: {1, 2, 5, 9} Elements – objects inside.
Chapter 1 Section 1.4 More on Conditionals. There are three statements that are related to a conditional statement. They are called the converse, inverse.
Conditional Statements M Deductive Reasoning Proceeds from a hypothesis to a conclusion. If p then q. p  q hypothesis  conclusion.
The Foundations: Logic and Proofs
Discrete Maths 2. Propositional Logic Objective
MATERI II PROPOSISI. 2 Tautology and Contradiction Definition A tautology is a statement form that is always true. A statement whose form is a tautology.
Discrete Mathematics and Its Applications
Mathematical Structures A collection of objects with operations defined on them and the accompanying properties form a mathematical structure or system.
CS 285- Discrete Mathematics Lecture 2. Section 1.1 Propositional Logic Propositions Conditional Statements Truth Tables of Compound Propositions Translating.
2.3 Analyze Conditional Statements. Objectives Analyze statements in if-then form. Analyze statements in if-then form. Write the converse, inverse, and.
Review I Rosen , 3.1 Know your definitions!
Chapter 5 – Logic CSNB 143 Discrete Mathematical Structures.
CSNB143 – Discrete Structure LOGIC. Learning Outcomes Student should be able to know what is it means by statement. Students should be able to identify.
Chapter 2: The Logic of Compound Statements 2.2 Conditional Statements
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.
Conditional Statements
Chapter 3: Introduction to Logic. Logic Main goal: use logic to analyze arguments (claims) to see if they are valid or invalid. This is useful for math.
Propositional Logic. Propositions Any statement that is either True (T) or False (F) is a proposition Propositional variables: a variable that can assume.
1 Introduction to Abstract Mathematics Expressions (Propositional formulas or forms) Instructor: Hayk Melikya
Lecture 9 Conditional Statements CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Propositional Logic ITCS 2175 (Rosen Section 1.1, 1.2)
Logical Form and Logical Equivalence M Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.
Chapter 1: The Foundations: Logic and Proofs
Conditional Statements – Page 1CSCI 1900 – Discrete Structures CSCI 1900 Discrete Structures Conditional Statements Reading: Kolman, Section 2.2.
Section 1.1. Section Summary Propositions Connectives Negation Conjunction Disjunction Implication; contrapositive, inverse, converse Biconditional Truth.
CSNB143 – Discrete Structure Topic 4 – Logic. Learning Outcomes Students should be able to define statement. Students should be able to identify connectives.
Mathematics for Comter I Lecture 2: Logic (1) Basic definitions Logical operators Translating English sentences.
Copyright © Cengage Learning. All rights reserved. CHAPTER 2 THE LOGIC OF COMPOUND STATEMENTS THE LOGIC OF COMPOUND STATEMENTS.
Discrete Mathematics Lecture # 7. Bi conditional  If p and q are statement variables, the bi conditional of p and q is  “ p if, and only if, q ” and.
رياضيات متقطعة لعلوم الحاسب 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.
Mathematics for Computing Lecture 2: Computer Logic and Truth Tables Dr Andrew Purkiss-Trew Cancer Research UK
Discrete Mathematics Lecture # 4. Conditional Statements or Implication  If p and q are statement variables, the conditional of q by p is “If p then.
Conditional statement or implication IF p then q is denoted p ⇒ q p is the antecedent or hypothesis q is the consequent or conclusion ⇒ means IF…THEN.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 01: Boolean Logic Sections 1.1 and 1.2 Jarek Rossignac.
Discrete Mathematical Structures: Theory and Applications 1 Logic: Learning Objectives  Learn about statements (propositions)  Learn how to use logical.
Logic and Truth Tables Winter 2012 COMP 1380 Discrete Structures I Computing Science Thompson Rivers University.
Chapter 1. Chapter Summary  Propositional Logic  The Language of Propositions (1.1)  Logical Equivalences (1.3)  Predicate Logic  The Language of.
Law of logic Lecture 4.
Chapter 1 Logic and proofs
CS-7081 Application - 1. CS-7082 Example - 2 CS-7083 Simplifying a Statement – 3.
Simple Logic.
2. The Logic of Compound Statements Summary
Conditional Statements
CSNB 143 Discrete Mathematical Structures
COMP 1380 Discrete Structures I Thompson Rivers University
Conditional Statements
Logic.
(CSC 102) Discrete Structures Lecture 2.
Information Technology Department
Copyright © Cengage Learning. All rights reserved.
Discrete Mathematics and Its Applications Kenneth H
COMP 1380 Discrete Structures I Thompson Rivers University
Discrete Structures Prepositional Logic 2
Presentation transcript:

(CSC 102) Lecture 3 Discrete Structures

Previous Lecture Summary Logical Equivalences. De Morgan’s laws. Tautologies and Contradictions. Laws of Logic. Logical Equivalences using Logical Laws.

Lecture`s outline Conditional Propositions. Negation, Inverse and Converse of the conditional statements. Contra positive. Bi conditional statements. Necessary and Sufficient Conditions. Conditional statements and their Logical equivalences.

Conditional propositions Definition If p and q are propositions, the conditional of q by p is if p then q or p implies q and is denoted by p→q. It is false when p is true and q is false otherwise it is true. Examples If you work hard then you will succeed. If John lives in Islamabad, then he lives in Pakistan.

Implication (if - then) Binary Operator, Symbol: Binary Operator, Symbol:  PQ P  Q TTT TFF FTT FFT

Examples “The online user is sent a notification of a link error if the network link is down”. The statement is equivalent to “If the network link is down, then the online user is sent a notification of a link error.” Using p : The network link is down, q : the online user is sent a notification of a link error. The statement becomes (q if p) p → q. Interpreting Conditional Statements

Examples “When you study the theory, you understand the material”. The statement is equivalent to (using if for ‘‘when’’) “If you study the theory, then you understand the material.” Using p : you study the theory, q : you understand the material. The statement becomes (when p, q) p → q.

Examples “Studying the theory is sufficient for solving the exercise”. The statement is equivalent to “If you study the theory, then you can solve the exercise.” Using p : you study the theory, q : you can solve the exercise. The statement becomes (p is sufficient for q) p → q.

Other forms of conditional propositions if p and q are statements then “p only if q” means ‘’if p then q”. John will break the world`s record for the mile run only if he runs the mile in under four minutes. is equivalent to If john breaks the world`s record, then he will have to run the mile in under four minutes.

Activity Show that  p→q ≡ ¬p  q This shows that a conditional proposition is simple a proposition form that uses a not and an or. Show that  ¬(p→q) ≡ p  ¬q This means that negation of ‘if p then q’ is logically equivalent to ‘p and not q’.

Solution From the above table it is obvious that conditional proposition is equivalent to a “not or proposition” and that its negation is not of the form ‘if then’. pq p  q ¬p  q ¬(p  q)  p  ¬q TTTTFF TFFFTT FTTTFF FFTTFF

Negations of some Conditionals Proposition: If my car is in the repair shop, then I cannot get the class. Negation: My car is in the repair shop and I can get the class. Proposition: If Sara lives in Athens, then she lives in Greece. Negation: Sara lives in Athens and she does not live in Greece.

Converse and inverse of the Conditional Suppose a conditional proposition of the form ‘If p then q’ is given. 1.The converse is ‘if q then p’. 2.The inverse is ‘if ¬p then ¬q’. Symbolically, The converse of p→q is q→p, And The inverse of p→q is ¬p→¬q.

Continue ….. Note: that the converse is not equivalent to the given conditional proposition, for instance “ if john is from Chicago then john is from Illinois” is true, but the converse “ if john is from Illinois then john is from Chicago” may be false. Similarly the inverse is also not equivalent to the conditional proposition, for instance “ if an object is triangle then it is a polygon” is true, but the inverse “ if an object is not a triangle then it is not a polygon” is false i.e. square is a polygon.

Contraposition Definition The contra positive of a conditional proposition of the form ‘if p then q’ is ‘if ¬q then ¬p’. Symbolically, the contra positive of p→q is ¬q→¬p. A conditional proposition is logically equivalent to its contra- positive. Example If today is Sunday, then tomorrow is Monday. Contra positive: If tomorrow is not Monday, then today is not Sunday.

The Biconditional Definition Given proposition variables p and q, the Bi conditional of p and q is p if and only if q and is denoted p↔q. It is true if both p and q have the same truth values and is false if p and q have opposite truth values. The words if and only if are sometime abbreviated iff. Example This computer program is correct iff it produces the correct answer for all possible sets of input data.

Truth table pqp↔q TTT TFF FTF FFT pqp→qq→pp↔q  (p→q)  (q→p) TTTTTT TFFTFF FTTFFF FFTTTT

Interpreting Necessary and sufficient conditions “If a number is divisible by 10, then it is divisible by 2”. The clause introduced by If A number is divisible by 10” is called the hypothesis. It is what we are given, or what we may assume. The clause introduced by then It is divisible by 2 is called the conclusion. It is the statement that "follows" from the hypothesis. When the If-then sentence is true, we say that the hypothesis is a sufficient condition for the conclusion. Thus it is sufficient to know that a number is divisible by 10, in order to conclude that it is divisible by 2. The conclusion is then called a necessary condition of that hypothesis. For, if a number is divisible by 10, it necessarily follows that it will be divisible by 2.

Interpreting Necessary and sufficient conditions Example: Consider the proposition ‘if John is eligible to vote then he is at least 18 year old’. The truth of the condition ‘John is eligible to vote’ is sufficient to ensure the truth of the condition ‘John is at least 18 year old’. In addition, the condition ‘John is at least 18 year old’ is necessary for the condition ‘John is eligible to vote’ to be true. If John were younger than 18, then he would not eligible to vote.

Necessary and Sufficient Conditions Let r and s are two propositions r is a sufficient condition for s means ‘if r then s’. r is a necessary condition for s means ‘if not r then not s’ r is necessary and sufficient condition for s means ‘r if and only if s’

Prove that ¬[r ∨ (q ∧ (¬r →¬p))] ≡ ¬r ∧ (p ∨ ¬q) Logical Equivalence of Conditional propositions ¬[r ∨ (q ∧ (¬r → ¬p))] ≡ ¬r ∧ ¬(q ∧ (¬r → ¬p)), De Morgan’s law ≡ ¬r ∧ ¬(q ∧ (¬¬r ∨ ¬p)), Conditional rewritten as disjunction ≡ ¬r ∧ ¬(q ∧ (r ∨ ¬p)), Double negation law ≡ ¬r ∧ (¬q ∨ ¬(r ∨ ¬p)), De Morgan’s law ≡ ¬r ∧ (¬q ∨ (¬r ∧ p)), De Morgan’s law, double negation ≡ (¬r ∧ ¬q) ∨ (¬r ∧ (¬r ∧ p)), Distributive law ≡ (¬r ∧ ¬q) ∨ ((¬r ∧ ¬r) ∧ p), Associative law ≡ (¬r ∧ ¬q) ∨ (¬r ∧ p), Idempotent law ≡ ¬r ∧ (¬q ∨ p), Distributive law ≡ ¬r ∧ (p ∨ ¬q), Commutative law

Conversion of statements in to symbols Write these system specifications in symbols using the propositions v: “The user enters a valid password,” a: “Access is granted to the user,” c: “The user has contacted the network administrator,” and logical connectives. Then determine if the system specifications are consistent. (i)“The user has contacted the network administrator, but does not enter a valid password.” c ∧ ¬ v

Cont…. ii) “Access is granted whenever the user has contacted the network administrator or enters a valid password.” (c ∨ v) → a (iii) “Access is denied if the user has not entered a valid password or has not contacted the network administrator.” (¬v ∨ ¬c) → ¬a

Conversion of statements in to symbols Translate this system specification into symbols: “Whenever the file is locked or the system is in executive clearance mode, the user cannot make changes in the data.” l : “the file is locked” e : “the system is in executive clearance mode” u : “the user can make changes in the data” then the statement in symbolic form would be (l ∨ e) → ¬ u

Lecture Summary Conditional Propositions. Negation, Inverse and Converse of the conditional statements. Contra positive. Bi conditional statements. Necessary and Sufficient Conditions. Conditional statements and their Logical equivalences. Translating English to Symbols.