Dr. Amer Rasheed COMSATS Institute of Information Technology

Slides:



Advertisements
Similar presentations
Goals Determine the true value of statements with AND, OR, IF..THEN. Negate statements with the connectives above Construct truth tables Understand when.
Advertisements

CS128 – Discrete Mathematics for Computer Science
Discrete Mathematics Lecture 1 Logic of Compound Statements Harper Langston New York University.
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.
1 Math 306 Foundations of Mathematics I Math 306 Foundations of Mathematics I Goals of this class Introduction to important mathematical concepts Development.
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.
Chapter 2: The Logic of Compound Statements 2.1 Logical Forms and Equivalence 12.1 Logical Forms and Equivalences Logic is a science of the necessary laws.
Adapted from Discrete Math
Discrete Mathematics Goals of a Discrete Mathematics Learn how to think mathematically 1. Mathematical Reasoning Foundation for discussions of methods.
Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015
Propositions and Truth Tables
Chapter 3 Section 4 – Slide 1 Copyright © 2009 Pearson Education, Inc. AND.
Discrete Mathematics and Its Applications
COS 150 Discrete Structures Assoc. Prof. Svetla Boytcheva Fall semester 2014.
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Ch.1 (Part 1): The Foundations: Logic and Proofs Introduction.
Mathematical Structures A collection of objects with operations defined on them and the accompanying properties form a mathematical structure or system.
Chapter 1: The Foundations: Logic and Proofs
BY: MISS FARAH ADIBAH ADNAN IMK. CHAPTER OUTLINE: PART III 1.3 ELEMENTARY LOGIC INTRODUCTION PROPOSITION COMPOUND STATEMENTS LOGICAL.
(CSC 102) Lecture 32 Discrete Structures. Trees Previous Lecture  Matrices and Graphs  Matrices and Directed Graphs  Matrices and undirected Graphs.
Fall 2002CMSC Discrete Structures1 Let’s get started with... Logic !
Discrete Mathematics Lecture1 Miss.Amal Alshardy.
Discrete Structures – CS Text Discrete Mathematics and Its Applications Kenneth H. Rosen (7 th Edition) Chapter 1 The Foundations: Logic and Proofs.
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.
Lecture Propositional Equivalences. Compound Propositions Compound propositions are made by combining existing propositions using logical operators.
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.
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.
September1999 CMSC 203 / 0201 Fall 2002 Week #1 – 28/30 August 2002 Prof. Marie desJardins.
1 Introduction to Abstract Mathematics Expressions (Propositional formulas or forms) Instructor: Hayk Melikya
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
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.
Symbolic Logic The Following slide were written using materials from the Book: The Following slide were written using materials from the Book: Discrete.
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.
Spring 2003CMSC Discrete Structures1 Let’s get started with... Logic !
3/6/20161 Let’s get started with... Logic !. 3/6/20162 Logic Crucial for mathematical reasoningCrucial for mathematical reasoning Used for designing electronic.
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.,
Ch01-Logic 1. Logic Crucial for mathematical reasoningCrucial for mathematical reasoning Used for designing electronic circuitryUsed for designing electronic.
Discrete Structures MT217 Lecture 01. Course Objectives Express statements with the precision of formal logic Analyze arguments to test their validity.
Logical Operators (Connectives) We will examine the following logical operators: Negation (NOT,  ) Negation (NOT,  ) Conjunction (AND,  ) Conjunction.
Chapter 1 Propositional Logic
2. The Logic of Compound Statements Summary
Discrete Mathematics Lecture 1 Logic of Compound Statements
Discrete Mathematics Logic.
Niu Kun Discrete Mathematics Chapter 1 The Foundations: Logic and Proof, Sets, and Functions Niu Kun 离散数学.
COMP 1380 Discrete Structures I Thompson Rivers University
(CSC 102) Discrete Structures Lecture 2.
CPCS222 Discrete Structures I
Ch.1 (Part 1): The Foundations: Logic and Proofs
Discrete Mathematics Lecture # 2.
CMSC Discrete Structures
Principles of Computing – UFCFA3-30-1
Chapter 8 Logic Topics
CSCI 3310 Mathematical Foundation of Computer Science
Information Technology Department
Chapter 1 The Foundations: Logic and Proof, Sets, and Functions
CHAPTER 1: LOGICS AND PROOF
Applied Discrete Mathematics Week 1: Logic
Discrete Mathematics and Its Applications Kenneth H
Discrete Mathematics Logic.
Foundations of Discrete Mathematics
COMP 1380 Discrete Structures I Thompson Rivers University
Presentation transcript:

Dr. Amer Rasheed COMSATS Institute of Information Technology (CSC 102) Discrete Structures Dr. Amer Rasheed COMSATS Institute of Information Technology

Discrete vs Continuous Examples of discrete Data Number of boys in the class. Number of candies in a packet. Number of suitcases lost by an airline. Examples of continuous Data Height of a person. Time in a race. Distance traveled by a car.

What is discrete Structures? Discrete mathematics is the part of mathematics devoted to the study of discrete objects (Kenneth H. Rosen, 6th edition). Discrete mathematics is the study of mathematical structures that are fundamentally discrete rather than continuous (wikipedia).

Applications of discrete mathematics How can a circuit that adds two integers be designed? How many ways are there to choose a valid password on a computer? What is the shortest path between two cities using transportation system? How can I encrypt a message so that no unintended recipient can read it? How many valid internet addresses are there? How can a list of integers be sorted so that the integers are in increasing order?

Syllabus (Topics to be covered in this course) Logic Elementary Number Theory and Methods of Proof Set Theory Relations Sequences and Recursion Mathematical Induction Counting Relations and Equivalence Relations Graphs Trees

Reference Books Discrete Mathematics and its Applications (with Combinatorics and Graph Theory) 6th Edition, The McGraw-Hill Companies, 2007, Kenneth H. Rosen. Discrete Mathematics with Applications 2nd Edition, Thomson Learning, 1995, Susanna S. Epp. Discrete Mathematics for Computer Scientists 2nd Edition, Addison-Wesley, 1999, John Truss.

Logic Propositional Logic Logic of Compound Statements Propositional Equivalences Conditional Statements Logical Equivalences Valid and Invalid Arguments Applications: Digital Logic Circuits Predicates and Quantifiers Logic of Quantified Statements

Propositional Logic Proposition: A proposition (or Statement) is a declarative sentence (that is, a sentence that declares a fact) that is either true or false, but not both. Examples Is the following sentence a proposition? If it is a proposition, determine whether it is true or false. Paris is the capital of France. This makes a declarative statement, and hence is a proposition. The proposition is TRUE (T).

Examples (Propositions Cont.) 2. Is the following sentence a proposition? If it is a proposition, determine whether it is true or false. Can Ali come with you?. This is a question not the declarative sentence and hence not a proposition.

Examples (Propositions Cont.) 3. Is the following sentence a proposition? If it is a proposition, determine whether it is true or false. Take two aspirins. This is an imperative sentence not the declarative sentence and therefore not a proposition.

Examples (Propositions Cont.) 4. Is the following sentence a proposition? If it is a proposition, determine whether it is true or false. x+ 4 > 9. Because this is true for certain values of x (such as x = 6) and false for other values of x (such as x = 5), it is not a proposition.

Examples (Propositions Cont.) 5. Is the following sentence a proposition? If it is a proposition, determine whether it is true or false. He is a college student. Because truth or falsity of this proposition depend on the reference for the pronoun he. it is not a proposition.

Notations The small letters are commonly used to denote the propositional variables, that is, variables that represent propositions, such as, p, q, r, s, …. The truth value of a proposition is true, denoted by T or 1, if it is a true proposition and false, denoted by F or 0, if it is a false proposition.

Compound Propositions Producing new propositions from existing propositions. Logical Operators or Connectives Not  And ˄ Or ˅ Exclusive or  Implication  Biconditional 

“It is not the case that p”. Compound Propositions Negation of a proposition Let p be a proposition. The negation of p, denoted by  p (also denoted by ~p), is the statement “It is not the case that p”. The proposition  p is read as “not p”. The truth values of the negation of p,  p, is the opposite of the truth value of p.

p : It is not the case that today is Friday. Examples Find the negation of the following proposition p : Today is Friday. The negation is p : It is not the case that today is Friday. This negation can be more simply expressed by  p : Today is not Friday.

“It is not the case that 6 is negative”. Examples 2. Write the negation of “6 is negative”. The negation is “It is not the case that 6 is negative”. or “6 is nonnegative”.

Unary Operator, Symbol:  Truth Table (NOT) Unary Operator, Symbol:  p p true false

Conjunction (AND) Definition Let p and q be propositions. The conjunction of p and q, denoted by p˄q, is the proposition “p and q”. The conjunction p˄q is true when p and q are both true and is false otherwise.

p˄q : Today is Friday and it is raining today. Examples Find the conjunction of the propositions p and q, where p : Today is Friday. q : It is raining today. The conjunction is p˄q : Today is Friday and it is raining today.

Binary Operator, Symbol:  Truth Table (AND) Binary Operator, Symbol:  p q pq true false

Disjunction (OR) Definition Let p and q be propositions. The disjunction of p and q, denoted by p˅q, is the proposition “p or q”. The disjunction p˅q is false when both p and q are false and is true otherwise.

p˅q : Today is Friday or it is raining today. Examples Find the disjunction of the propositions p and q, where p : Today is Friday. q : It is raining today. The disjunction is p˅q : Today is Friday or it is raining today.

Binary Operator, Symbol:  Truth Table (OR) Binary Operator, Symbol:  p q p  q true false

Exclusive OR (XOR) Definition Let p and q be propositions. The exclusive or of p and q, denoted by pq, is the proposition “pq”. The exclusive or, p  q, is true when exactly one of p and q is true and is false otherwise.

Examples q : Atif will fail the course CSC102. Find the exclusive or of the propositions p and q, where p : Atif will pass the course CSC102. q : Atif will fail the course CSC102. The exclusive or is pq : Atif will pass or fail the course CSC102.

Binary Operator, Symbol:  Truth Table (XOR) Binary Operator, Symbol:  p q pq true false

1. “Nabeel has one or two brothers”. Examples (OR vs XOR) The following proposition uses the (English) connective “or”. Determine from the context whether “or” is intended to be used in the inclusive or exclusive sense. 1. “Nabeel has one or two brothers”. A person cannot have both one and two brothers. Therefore, “or” is used in the exclusive sense.

Examples (OR vs XOR) 2. To register for BSC you must have passed the qualifying exam or be listed as an Math major. Presumably, if you have passed the qualifying exam and are also listed as an Math major, you can still register for BCS. Therefore, “or” is inclusive.

Composite Statements p q p q (p)(q) true false Statements and operators can be combined in any way to form new statements. p q p q (p)(q) true false

Translating English to Logic I did not buy a lottery ticket this week or I bought a lottery ticket and won the million dollar on Friday. Let p and q be two propositions p: I bought a lottery ticket this week. q: I won the million dollar on Friday. In logic form p(pq)

Lecture Summery Introduction to the Course Propositions Logical Connectives Truth Tables Compound propositions Translating English to logic and logic to English.

Conditional Statements Implication Definition: Let p and q be propositions. The conditional statement p  q, is the proposition “If p, then q”. The conditional statement p  q is false when p is true and q is false and is true otherwise. where p is called hypothesis, antecedent or premise. q is called conclusion or consequence

Binary Operator, Symbol:  Implication (if - then) Binary Operator, Symbol:  P Q P  Q true false

Conditional Statements Biconditional Statements Definition: Let p and q be propositions. The biconditional statement pq, is the proposition “p if and only if q”. The biconditional (bi-implication) statement p  q is true when p and q have same truth values and is false otherwise.

Binary Operator, Symbol:  Biconditional (if and only if) Binary Operator, Symbol:  P Q P  Q true false

Composite Statements P Q P Q (P)(Q) true false Statements and operators can be combined in any way to form new statements. P Q P Q (P)(Q) true false

Equivalent Statements P Q (PQ) (P)(Q) (PQ)(P)(Q) true false Two statements are called logically equivalent if and only if (iff) they have identical truth tables The statements (PQ) and (P)(Q) are logically equivalent, because (PQ)(P)(Q) is always true.

Tautologies and Contradictions Tautology is a statement that is always true regardless of the truth values of the individual logical variables Examples: R(R) (PQ)  (P)(Q) If S  T is a tautology, we write S  T. If S  T is a tautology, we write S  T.

Tautologies and Contradictions A Contradiction is a statement that is always false regardless of the truth values of the individual logical variables Examples R(R) ((PQ)(P)(Q)) The negation of any tautology is a contradiction, and the negation of any contradiction is a tautology.

Applied Discrete Mathematics Week 1: Logic and Sets Exercises We already know the following tautology: (PQ)  (P)(Q) Nice home exercise: Show that (PQ)  (P)(Q). These two tautologies are known as De Morgan’s laws. January 24, 2012 Applied Discrete Mathematics Week 1: Logic and Sets 49

Applied Discrete Mathematics Week 2: Functions and Sequences Exercises Question 1 Given a set A = {x, y, z} and a set B = {1, 2, 3, 4}, what is the value of | 2A  2B | ? Answer | 2A  2B | = | 2A |  | 2B | = 2|A|  2|B| = 816 = 128 January 31, 2012 Applied Discrete Mathematics Week 2: Functions and Sequences 50