CS 173, Lecture B September 1, 2015 Tandy Warnow.

Slides:



Advertisements
Similar presentations
Nested Quantifiers Section 1.4.
Advertisements

Review for CS1050. Review Questions Without using truth tables, prove that  (p  q)   q is a tautology. Prove that the sum of an even integer and an.
Propositional Predicate
The Logic of Quantified Statements
Proofs, Recursion and Analysis of Algorithms Mathematical Structures for Computer Science Chapter 2 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesProofs,
Lecture 23. Subset Sum is NPC
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 1: (Part 2): The Foundations: Logic and Proofs.
L41 Lecture 2: Predicates and Quantifiers.. L42 Agenda Predicates and Quantifiers –Existential Quantifier  –Universal Quantifier 
Elementary Number Theory and Methods of Proof
RMIT University; Taylor's College This is a story about four people named Everybody, Somebody, Anybody and Nobody. There was an important job to be done.
TR1413: INTRO TO DISCRETE MATHEMATICS LECTURE 2: MATHEMATICAL INDUCTION.
Discrete Mathematics Math 6A Instructor: M. Welling.
Discrete Structures Chapter 3: The Logic of Quantified Statements
CSE115/ENGR160 Discrete Mathematics 01/20/11 Ming-Hsuan Yang UC Merced 1.
EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 11 Introduction to Predicate Logic Limitations of Propositional Logic Predicates, quantifiers and propositions.
Mathematical Induction Assume that we are given an infinite supply of stamps of two different denominations, 3 cents and and 5 cents. Prove using mathematical.
Adapted from Discrete Math
CSCI2110 – Discrete Mathematics Tutorial 8 Propositional Logic Wong Chung Hoi (Hollis)
Lecture 8 Introduction to Logic CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
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.
CSCI 2110 Discrete Mathematics Tutorial 10 Chin 1.
Section 1.5 Implications. Implication Statements If Cara has a piano lesson, then it is Friday. If it is raining, then I need to remember my umbrella.
CSCI 115 Chapter 2 Logic. CSCI 115 §2.1 Propositions and Logical Operations.
Discrete Mathematics and Its Applications
Chapter 1: The Foundations: Logic and Proofs
CSE 311: Foundations of Computing Fall 2013 Lecture 8: More Proofs.
CS 173, Lecture B August 27, 2015 Tandy Warnow. Proofs You want to prove that some statement A is true. You can try to prove it directly, or you can prove.
1 Section 1.1 A Proof Primer A proof is a demonstration that some statement is true. We normally demonstrate proofs by writing English sentences mixed.
CSCI 2670 Introduction to Theory of Computing Instructor: Shelby Funk.
First Order Logic Lecture 2: Sep 9. This Lecture Last time we talked about propositional logic, a logic on simple statements. This time we will talk about.
Barnett/Ziegler/Byleen Finite Mathematics 11e1 Chapter 7 Review Important Terms, Symbols, Concepts 7.1. Logic A proposition is a statement (not a question.
Lecture Propositional Equivalences. Compound Propositions Compound propositions are made by combining existing propositions using logical operators.
1 Methods of Proof Proof techniques in this handout –Direct proof –Division into cases –Proof by contradiction In this handout, the proof techniques will.
January 30, 2002Applied Discrete Mathematics Week 1: Logic and Sets 1 Let’s Talk About Logic Logic is a system based on propositions.Logic is a system.
Hazırlayan DISCRETE COMPUTATIONAL STRUCTURES Propositional Logic PROF. DR. YUSUF OYSAL.
Predicates and Quantified Statements
Lecture 4: Predicates and Quantifiers; Sets.
Chapter 2 The Logic of Quantified Statements. Section 2.1 Intro to Predicates & Quantified Statements.
1 Introduction to Abstract Mathematics Predicate Logic Instructor: Hayk Melikya Purpose of Section: To introduce predicate logic (or.
Week 4 - Monday.  What did we talk about last time?  Divisibility  Quotient-remainder theorem  Proof by cases.
Chapter 1: The Foundations: Logic and Proofs
Lecture 7 – Jan 28, Chapter 2 The Logic of Quantified Statements.
Logical Operations – Page 1CSCI 1900 – Discrete Structures CSCI 1900 Discrete Structures Logical Operations Reading: Kolman, Section 2.1.
Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 1 The Foundations: Logic and Proofs Predicates and Quantifiers.
Discrete Structures – CNS 2300
Chapter 2 Symbolic Logic. Section 2-1 Truth, Equivalence and Implication.
CS 285- Discrete Mathematics Lecture 4. Section 1.3 Predicate logic Predicate logic is an extension of propositional logic that permits concisely reasoning.
CSNB143 – Discrete Structure Topic 4 – Logic. Learning Outcomes Students should be able to define statement. Students should be able to identify connectives.
Thinking Mathematically Statements, Negations, and Quantified Statements.
Week 4 - Friday.  What did we talk about last time?  Floor and ceiling  Proof by contradiction.
Week 4 - Wednesday.  What did we talk about last time?  Divisibility  Proof by cases.
Chapter 5. Section 5.1 Climbing an Infinite Ladder Suppose we have an infinite ladder: 1.We can reach the first rung of the ladder. 2.If we can reach.
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 Introduction to Abstract Mathematics Chapter 3: The Logic of Quantified Statements. Predicate Calculus Instructor: Hayk Melikya 3.1.
5-5 Indirect Proof. Indirect Reasoning: all possibilities are considered and then all but one are proved false. The remaining possibility must be true.
1 Formal Proofs. 2 Deductive Proofs From the given statement(s) to a conclusion statement (what we want to prove) Logical progression by direct implications.
Section 1.4. Propositional Functions Propositional functions become propositions (and have truth values) when their variables are each replaced by a value.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 01: Boolean Logic Sections 1.1 and 1.2 Jarek Rossignac.
Prove that: odd + odd = even even + even = even odd + even = odd even + odd = odd.
Introduction to Predicates and Quantified Statements I Lecture 9 Section 2.1 Wed, Jan 31, 2007.
CS 173, Lecture B August 27, 2015 Tandy Warnow. Proofs You want to prove that some statement A is true. You can try to prove it directly, or you can prove.
Argument An argument is a sequence of statements.
Advanced Algorithms Analysis and Design
Discrete Mathematics Lecture # 2.
CS201: Data Structures and Discrete Mathematics I
Mathematics for Computer Science MIT 6.042J/18.062J
Lecture 43 Section 10.1 Wed, Apr 6, 2005
CS201: Data Structures and Discrete Mathematics I
Presentation transcript:

CS 173, Lecture B September 1, 2015 Tandy Warnow

Logic Logical variables Propositions (statements that are true or false) Predicates (statements that are true or false, but depend on the variables) Quantifiers (for all, there exists) AND, OR, XOR, IF A THEN B, or A -> B IFF = IF AND ONLY IF NEGATION

A AND B A and B are logical statements – each can be true or false, but only one A AND B is true if and only if both are true W = “Today is Friday” X = “We are in Chicago” Y = “Today is Thursday” Z = “Barack Obama is the president of the USA” Which of the following statements are true? Y AND Z (two true statements) X AND Y (one false, one true) X AND Z (one false, one true) W AND X (two false statements)

A OR B A and B are logical statements – each can be true or false, but only one A OR B is true if and only if one or both are true (i.e., if and only if at least one is true) W = “Today is Friday” X = “We are in Chicago” Y = “Today is Thursday” Z = “Barack Obama is the president of the USA” Which of the following statements are true? Y OR Z (two true statements) X OR Y (one false, one true) X OR Z (one false, one true) W OR X (two false statements)

A XOR B A and B are logical statements – each can be true or false, but only one A XOR B is true if and only if exactly one of A and B is true This is the same as the “exclusive OR” W = “Today is Friday” X = “We are in Chicago” Y = “Today is Thursday” Z = “Barack Obama is the president of the USA” Which of the following statements are true? Y XOR Z (two true statements) X XOR Y (one false, one true) X XOR Z (one false, one true) W XOR X (two false statements)

IF A THEN B A and B are logical statements – each can be true or false, but only one IF A THEN B is true if and only if… Think about it.

IF A THEN B A and B are logical statements – each can be true or false, but only one IF A THEN B is true if and only if… Think about it.

IF A THEN B IF A THEN B is the same as – “whenever A, then always B” – “Not possible for B to be false if A is true” So, how would you *disprove* “If A THEN B”?

IF A THEN B IF A THEN B is the same as – “whenever A, then always B” – “Not possible for B to be false if A is true” To disprove “IF A THEN B”, you would have to have A being True but B being false. Example: to disprove “If x=8 THEN y=5” show that “x=8” and “y != 5” is possible.

IF A THEN B A and B are logical statements – each can be true or false, but only one IF A THEN B is true if and only if … (A is false) OR (A is true and B is true) W = “Today is Friday” X = “We are in Chicago” Y = “Today is Thursday” Z = “Barack Obama is the president of the USA” Which of the following statements are true? IF X THEN Z (two true statements) IF X THEN Z (X false, Z true) IF Z THEN X (X false, Z true) IF W THEN X (two false statements)

IF A THEN B A and B are logical statements – each can be true or false, but only one IF A THEN B is true if and only if … (A is false) OR (A is true and B is true) W = “Today is Friday” X = “We are in Chicago” Y = “Today is Thursday” Z = “Barack Obama is the president of the USA” Which of the following statements are true? IF X THEN Z (two true statements) IF X THEN Z (X false, Z true) IF Z THEN X (X false, Z true) IF W THEN X (two false statements)

IF A THEN B A and B are logical statements – each can be true or false, but only one IF A THEN B is true if and only if … (A is false) OR (A is true and B is true) W = “Today is Friday” X = “We are in Chicago” Y = “Today is Thursday” Z = “Barack Obama is the president of the USA” Which of the following statements are true? IF Y THEN Z (both true statements) IF X THEN Z (X false, Z true) IF Z THEN X (X false, Z true) IF W THEN X (two false statements)

IF A THEN B Which of the following is true? 1.IF Illinois is in the USA, THEN 2=1+1 2.IF Illinois is in the USA, THEN 2=3 3.IF 2=3 THEN Illinois is in the USA 4.IF 2=3 THEN Illinois is not in the USA 5.If (2=3 OR Illinois is in the USA) THEN 2=3 6.If (2=3 OR Illinois is in the USA) then Illinois is in the USA 7.If (2=3 AND Illinois is in the USA) then 2=3

quantifiers “For all” (written as an upside-down “A”) “There exists” (written as a backwards “E”) The order matters! Think about the following two statements (differing only in the order of the quantifiation): For all integers x, there exists an integer y such that x≤y There exists an integer y such that for all integers x, x≤y

quantifiers For all integers x, there exists an integer y such that x≤y There exists an integer y such that for all integers x, x≤y

quantifiers For all integers x, there exists an integer y such that x<y There exists an integer y such that for all integers x, x<y The first one is true! Proof: Let x be an arbitrary integer. Then let y=x+1. Clearly y is an integer, and x≤y. (For that matter, setting y=x also works!) Q.E.D.

quantifiers For all integers x, there exists an integer y such that x≤y There exists an integer y such that for all integers x other than y, x≤y The second statement is false! Proof (by contradiction). Suppose the second statement is true….

quantifiers There exists an integer y such that for all integers x, x≤y The second statement is false! Proof (by contradiction). Suppose the second statement is true…. Then there is an integer y such that for all integers x, x≤y. Let x=y+1. Note that x is an integer, and that x>y. Hence, it is not the case that x≤y. This contradicts our hypothesis, and so the claim is false. Q.E.D.

Problems with written English English is not as precise as mathematics, so be careful about how you interpret it. Better to use mathematical notation *and* English. What does the following statements mean? – All dogs are not stupid Is this the same as “Not all dogs are stupid”? Or just “all dogs are smart”? (If not being stupid means being smart.) How about – All students in this class are not in Africa. – All students in this class are not women. Try to be careful with how you write English – not just in this class, of course.

More logic: Negation Negation – what is the opposite of a statement? What is the negation of (A OR B)? – NOT A AND NOT B What is the negation of (A AND B)? – NOT A OR NOT B What is the negation of (IF A THEN B)? – A AND NOT B

More logic: Negation Negation – what is the opposite of a statement? What is the negation of (A OR B)? – NOT A AND NOT B What is the negation of (A AND B)? – NOT A OR NOT B What is the negation of (IF A THEN B)? – A AND NOT B

More logic: Negation Negation – what is the opposite of a statement? What is the negation of (A OR B)? – NOT A AND NOT B What is the negation of (A AND B)? – NOT A OR NOT B What is the negation of (IF A THEN B)? – A AND NOT B

More logic: Negation Negation – what is the opposite of a statement? What is the negation of (A OR B)? – NOT A AND NOT B What is the negation of (A AND B)? – NOT A OR NOT B What is the negation of (IF A THEN B)? – A AND NOT B

More logic: Negation Negation – what is the opposite of a statement? What is the negation of (A OR B)? – NOT A AND NOT B What is the negation of (A AND B)? – NOT A OR NOT B What is the negation of (IF A THEN B)? – A AND NOT B

More logic: Negation Negation – what is the opposite of a statement? What is the negation of (A OR B)? – NOT A AND NOT B What is the negation of (A AND B)? – NOT A OR NOT B What is the negation of (IF A THEN B)? – A AND NOT B

More logic Suppose A is a finite subset of the real numbers that satisfies – For all a in A, the number 2a is also in A What can A be? (Note – you cannot change the meaning of multiplication.)

More logic Henry and Allen are each of them either always lying or always telling the truth (but that doesn’t mean both of them are liars or both of them are truth tellers… there could be one of each). Henry says “Allen is a truth teller” Allen says “Only one of us is a truth teller” Is either a truth teller? If so, who?