Discrete Mathematics MCA 105 LOGICS Preeti Mehta.

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

Grading Lecture attendance: -1% per 2 unexcused absences
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.
Propositional Equivalences. L32 Agenda Tautologies Logical Equivalences.
Goals Determine the true value of statements with AND, OR, IF..THEN. Negate statements with the connectives above Construct truth tables Understand when.
Discrete Mathematics. Agenda Course policies Quick Overview Logic.
Syllabus Every Week: 2 Hourly Exams +Final - as noted on Syllabus
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.
Let remember from the previous lesson what is Knowledge representation
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.
Logical and Rule-Based Reasoning Part I. Logical Models and Reasoning Big Question: Do people think logically?
Propositional Calculus Math Foundations of Computer Science.
Copyright © Cengage Learning. All rights reserved.
Adapted from Discrete Math
The Foundations: Logic and Proofs
Discrete Mathematics Goals of a Discrete Mathematics Learn how to think mathematically 1. Mathematical Reasoning Foundation for discussions of methods.
Intro to Discrete Structures
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
Discrete Mathematics CS 285. Lecture 12 Section 1.1: Logic Axiomatic concepts in math: Equals Opposite Truth and falsehood Statement Objects Collections.
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Ch.1 (Part 1): The Foundations: Logic and Proofs Introduction.
Copyright © Curt Hill Truth Tables A way to show Boolean Operations.
1 Logic Logic is a discipline that studies the principles and methods used in correct reasoning It includes: A formal language for expressing statements.
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
MATH 224 – Discrete Mathematics
Review I Rosen , 3.1 Know your definitions!
CS1Q Computer Systems Lecture 6 Simon Gay. Lecture 6CS1Q Computer Systems - Simon Gay2 Algebraic Notation Writing AND, OR, NOT etc. is long-winded and.
Copyright © Curt Hill Mathematical Logic An Introduction.
Tautologies, contradictions, contingencies
Discrete Structures – CS Text Discrete Mathematics and Its Applications Kenneth H. Rosen (7 th Edition) Chapter 1 The Foundations: Logic and Proofs.
1 CMSC 250 Discrete Structures CMSC 250 Lecture 1.
Reading: Chapter 4 (44-59) from the text book
CS 381 DISCRETE STRUCTURES Gongjun Yan Aug 25, November 2015Introduction & Propositional Logic 1.
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
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.
1 Introduction to Abstract Mathematics Expressions (Propositional formulas or forms) Instructor: Hayk Melikya
Thinking Mathematically
Discrete Mathematics CS 285. Lecture 12 Quick Overview The conceptual center of computer science is the ALGORITHM.
Propositional Logic ITCS 2175 (Rosen Section 1.1, 1.2)
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
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.
CS1Q Computer Systems Lecture 6 Simon Gay. Lecture 6CS1Q Computer Systems - Simon Gay2 Algebraic Notation Writing AND, OR, NOT etc. is long-winded and.
Propositional Logic – The Basics (2) Truth-tables for Propositions.
Section 1.1 Propositions and Logical Operations. Introduction Remember that discrete is –the study of decision making in non-continuous systems. That.
Mathematics for Comter I Lecture 2: Logic (1) Basic definitions Logical operators Translating English sentences.
Discrete Mathematics Lecture # 1. Course Objectives  Express statements with the precision of formal logic.  Analyze arguments to test their validity.
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.
L 11 Discrete Computational Structures. L 12 Lectures and Notes Lectures are electronic and will be available online after class.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 01: Boolean Logic Sections 1.1 and 1.2 Jarek Rossignac.
Foundations of Discrete Mathematics Chapter 1 By Dr. Dalia M. Gil, Ph.D.
CS104 The Foundations: Logic and Proof 1. 2 What is Discrete Structure?  Discrete Objects  Separated from each other (Opposite of continuous)  e.g.,
Boolean Algebra and Computer Logic Mathematical Structures for Computer Science Chapter 7 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Boolean Logic.
Lecture 2 Discrete Mathematics 9/3/ Introduction What is Discrete Mathematics? Discrete Mathematics concerns processes that consist of a sequence.
Discrete Structures for Computer Science Presented By: Andrew F. Conn Slides adapted from: Adam J. Lee Lecture #1: Introduction, Propositional Logic August.
Logic.
Lecture 1 – Formal Logic.
Niu Kun Discrete Mathematics Chapter 1 The Foundations: Logic and Proof, Sets, and Functions Niu Kun 离散数学.
COT 3100, Spr Applications of Discrete Structures
Ch.1 (Part 1): The Foundations: Logic and Proofs
Discrete Mathematics COMS 3203
The Foundations: Logic and Proofs
Principles of Computing – UFCFA3-30-1
Truth tables.
Presentation transcript:

Discrete Mathematics MCA 105 LOGICS Preeti Mehta

Lecture 12 Quick Overview Discrete Math is essentially that branch of mathematics that does not depend on limits; in this sense, it is the anti- thesis of Calculus. As computers are discrete object operating one jumpy, discontinuous step at a time, Discrete Math is the right framework for describing precisely Computer Science concepts.

Lecture 13 Quick Overview The conceptual center of computer science is the ALGORITHM.

Lecture 14 Quick Overview Discrete Math helps provide… … the machinery necessary for creating sophisticated algorithms … the tools for analyzing their efficiency …the means of proving their validity

Lecture 15 Quick Overview - Topics Formal logic

Lecture 16 Section 1.1: Logic Axiomatic concepts in math: Equals Opposite Truth and falsehood Statement Objects Collections

Lecture 17 Section 1.1: Logic We intuitively know that Truth and Falsehood are opposites. That statements describe the world and can be true/false. That the world is made up of objects and that objects can be organized to form collections. The foundations of logic mimic our intuitions by setting down constructs that behave analogously.

Lecture 18 False, True, Statements Axiom: False is the opposite to Truth. A statement is a description of something. Examples of statements: I’m 31 years old. I have 17 children. I always tell the truth. I’m lying to you. Q’s: Which statements are True? False? Both? Neither?

Lecture 19 False, True, Statements True: I’m 31 years old. False: I have 17 children. I always tell the truth. Both: IMPOSSIBLE, by our Axiom.

Lecture 110 False, True, Statements Neither: I’m lying to you. (If viewed on its own) HUH? Well suppose that S = “I’m lying to you.” were true. In particular, I am actually lying, so S is false. So it’s both true and false, impossible by the Axiom. Okay, so I guess S must be false. But then I must not be lying to you. So the statement is true. Again it’s both true and false. In both cases we get the opposite of our assumption, so S is neither true nor false.

Lecture 111 Propositions To avoid painful head-aches, we ban such silly non-sense and avoid the most general type of statements limiting ourselves to statements with valid truth-values instead: DEF: A proposition is a statement that is true or false.

Propositions Example: = 4, 2. It is Sunday today If a proposition is true, we say that it has a truth value of "true”. If a proposition is false, its truth value is "false". The truth values “true” and “false” are, respectively, denoted by the letters T and F. Lecture 112

Propositions EXAMPLES of PROPOSITIONS: 1. Grass is green = = 7 4. There are four fingers in a hand. Lecture 113

Propositions EXAMPLES of NOT-PROPOSITIONS: 1. Close the door. 2. x is greater than He is very rich Rule: If the sentence is preceded by other sentences that make the pronoun or variable reference clear, then the sentence is a statement. Lecture 114

Propositions Example 1. Bill Gates is an American 2. He is very rich He is very rich is a statement with truth-value TRUE. Lecture 115

Propositions UNDERSTANDING STATEMENTS: 1. x + 2 is positive.Not a statement 2. May I come in?Not a statement 3. Logic is interesting. A statement 4. It is hot today. A statement > 0A statement 6. x + y = 12Not a statement Lecture 116

Lecture 117 Propositions Propositional Logic is a static discipline of statements which lack semantic content. E.G. p = “Clinton was the president.” q = “The list of U.S. presidents includes Clinton.” r = “Lions like to sleep.” All p and q are no more closely related than q and r are, in propositional calculus. They are both equally related as all three statements are true. Semantically, however, p and q are the same!

Lecture 118 Propositions So why waste time on such matters? Propositional logic is the study of how simple propositions can come together to make more complicated propositions. If the simple propositions were endowed with some meaning –and they will be very soon– then the complicated proposition would have meaning as well, and then finding out the truth value is actually important!

Lecture 119 Compound Propositions In Propositional Logic, we assume a collection of atomic propositions are given: p, q, r, s, t, …. Then we form compound propositions by using logical connectives (logical operators) to form propositional “molecules”.

Lecture 120 Logical Connectives OperatorSymbolUsageName of the Symbol Negation , ~ notTilde Conjunction  andHat Disjunction  orVel Exclusive or  xor Conditional  if,thenArrow Biconditional  iffDouble Arrow

Lecture 121 Compound Propositions: Examples p = “Cruise ships only go on big rivers.” q = “Cruise ships go on the Hudson.” r = “The Hudson is a big river.”  r = “The Hudson is not a big river.” p  q = “Cruise ships only go on big rivers and go on the Hudson.” p  q  r = “If cruise ships only go on big rivers and go on the Hudson, then the Hudson is a big river.”

Lecture 122 Negation This just turns a false proposition to true and the opposite for a true proposition. EG: p = “23 = 15 +7” p happens to be false, so  p is true.

Lecture 123 Negation – truth table Logical operators are defined by truth tables –tables which give the output of the operator in the right-most column. Here is the truth table for negation: p pp FTFT TFTF

Lecture 124 Conjunction Conjunction is a binary operator in that it operates on two propositions when creating compound proposition. On the other hand, negation is a unary operator (the only non-trivial one possible).

Lecture 125 Conjunction Conjunction is supposed to encapsulate what happens when we use the word “and” in English. I.e., for “p and q ” to be true, it must be the case that BOTH p is true, as well as q. If one of these is false, than the compound statement is false as well.

Lecture 126 Conjunction EG. p = “Clinton was the president.” q = “Monica was the president.” r = “The meaning of is is important.” Assuming p and r are true, while q false. Out of p  q, p  r, q  r only p  r is true.

Lecture 127 Conjunction – truth table pq pqpq TTFFTTFF TFTFTFTF TFFFTFFF

Lecture 128 Disjunction – truth table Conversely, disjunction is true when at least one of the components is true: pq pqpq TTFFTTFF TFTFTFTF TTTFTTTF

Lecture 129 Disjunction – caveat Note: English version of disjunction “or” does not always satisfy the assumption that one of p/q being true implies that “p or q ” is true. Q: Can someone come up with an example?

Lecture 130 Disjunction – caveat A: The entrée is served with soup or salad. Most restaurants definitely don’t allow you to get both soup and salad so that the statement is false when both soup and salad is served. To address this situation, exclusive-or is introduced next.

Lecture 131 Exclusive-Or – truth table pq p  q TTFFTTFF TFTFTFTF FTTFFTTF Note: in this course any usage of “or” will connote the logical operator  as opposed to the exclusive-or.

Lecture 132 Conditional (Implication) This one is probably the least intuitive. It’s only partly akin to the English usage of “if,then” or “implies”. DEF: p  q is true if q is true, or if p is false. In the final case (p is true while q is false) p  q is false. Semantics: “p implies q ” is true if one can mathematically derive q from p.

Lecture 133 Conditional -- truth table pq p  q TTFFTTFF TFTFTFTF TFTTTFTT

Lecture 134 Conditional: why F  F is True Remember, all of these are mathematical constructs, not attempts to mimic English. Mathematically, p should imply q whenever it is possible to derive q by from p by using valid arguments. For example consider the mathematical analog of no. 4: If 0 = 1 then 3 = 9. Q: Is this true mathematically?

Lecture 135 Conditional: why F  F is True A: YES mathematically and YES by the truth table. Here’s a mathematical proof: 1. 0 = 1 (assumption)

Lecture 136 Conditional: why F  F is True A: YES mathematically and YES by the truth table. Here’s a mathematical proof: 1. 0 = 1 (assumption) 2. 1 = 2 (added 1 to both sides)

Lecture 137 Conditional: why F  F is True A: YES mathematically and YES by the truth table. Here’s a mathematical proof: 1. 0 = 1 (assumption) 2. 1 = 2 (added 1 to both sides) 3. 3 = 6 (multiplied both sides by 3)

Lecture 138 Conditional: why F  F is True A: YES mathematically and YES by the truth table. Here’s a mathematical proof: 1. 0 = 1 (assumption) 2. 1 = 2 (added 1 to both sides) 3. 3 = 6 (multiplied both sides by 3) 4. 0 = 3 (multiplied no. 1 by 3)

Lecture 139 Conditional: why F  F is True A: YES mathematically and YES by the truth table. Here’s a mathematical proof: 1. 0 = 1 (assumption) 2. 1 = 2 (added 1 to both sides) 3. 3 = 6 (multiplied both sides by 3) 4. 0 = 3 (multiplied no. 1 by 3) 5. 3 = 9 (added no. 3 and no. 4)QED

Lecture 140 Conditional: why F  F is True As we want the conditional to make sense in the semantic context of mathematics, we better define it as we have! Other questionable rows of the truth table can also be justified in a similar manner.

Lecture 141 Conditional: synonyms There are many ways to express the conditional statement p  q : If p then q. p implies q. If p, q. p only if q. p is sufficient for q. Some of the ways reverse the order of p and q but have the same connotation: q if p. q whenever p. q is necessary for p. To aid in remembering these, I suggest inserting “is true” after every variable: EG: “p is true only if q is true”

Lecture 142 Bi-Conditional -- truth table pq p  q TTFFTTFF TFTFTFTF TFFTTFFT For p  q to be true, p and q must have the same truth value. Else, p  q is false: Q : Which operator is  the opposite of?

Lecture 143 Bi-Conditional A :  has exactly the opposite truth table as .

Lecture 144 Bi-Conditional A :  has exactly the opposite truth table as . This means that we could have defined the bi-conditional in terms of other previously defined symbols, so it is redundant. In fact, only really need negation and disjunction to define everything else. Extra operators are for convenience. Q: Could we define all other logical operations using only negation and exclusive or?

Lecture 145 Bi-Conditional A: No. Notice that negation and exclusive-or each maintain parity between truth and false: No matter what combination of these symbols, impossible to get a truth table with four output rows consisting of 3 T’s and 1 F (such as implication and disjuction).

Lecture 146 Bit Strings Electronic computers achieve their calculations inside semiconducting materials. For reliability, only two stable voltage states are used and so the most fundamental operations are carried out by switching voltages between these two stable states. In logic, only two truth values are allowed. Thus propositional logic is ideal for modeling computers. High voltage values are modeled by True, which for brevity we call the number 1, while low voltage values are modeled by False or 0.

Lecture 147 Bit Strings Thus voltage memory stored in a computer can be represented by a sequence of 0’s and 1’s such as Another portion of the memory might look like Each of the number in the sequence is called a bit, and the whole sequence of bits is called a bit string.

Lecture 148 Bit Strings It turns out that the analogs of the logical operations can be carried out quite easily inside the computer, one bit at a time. This can then be transferred to whole bit strings. For example, the exclusive-or of the previous bit strings is: 

SUMMARY What is a statement? How a compound statement is formed. Logical connectives (negation, conjunction, disjunction, Implication, Double-Implication). How to construct a truth table for a statement form. Lecture 149