رياضيات متقطعة لعلوم الحاسب MATH 226. Text books: (Discrete Mathematics and its applications) Kenneth H. Rosen, seventh Edition, 2012, McGraw- Hill.

Slides:



Advertisements
Similar presentations
TRUTH TABLES Section 1.3.
Advertisements

Propositional Equivalences
The Foundations: Logic and Proofs
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.
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.
1 Section 1.2 Propositional Equivalences. 2 Equivalent Propositions Have the same truth table Can be used interchangeably For example, exclusive or and.
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 1, Part I: Propositional Logic With Question/Answer Animations.
The Foundations: Logic and Proofs
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.
The Foundations: Logic and Proofs
Section 1-4 Logic Katelyn Donovan MAT 202 Dr. Marinas January 19, 2006.
Course Outline Book: Discrete Mathematics by K. P. Bogart Topics:
Discrete Maths 2. Propositional Logic Objective
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.
Chapter 1: The Foundations: Logic and Proofs
CS 103 Discrete Structures Lecture 02
BY: MISS FARAH ADIBAH ADNAN IMK. CHAPTER OUTLINE: PART III 1.3 ELEMENTARY LOGIC INTRODUCTION PROPOSITION COMPOUND STATEMENTS LOGICAL.
CSci 2011 Textbook ^Discrete Mathematics and Its Applications,  Rosen  6th Edition  McGraw Hill  2006.
MATH 102 Contemporary Math S. Rook
Chapter 1, Part I: Propositional Logic With Question/Answer Animations.
Introductory Lecture Copyright © McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill.
Propositional Equivalences
Chapter 5 – Logic CSNB 143 Discrete Mathematical Structures.
(CSC 102) Lecture 3 Discrete Structures. Previous Lecture Summary Logical Equivalences. De Morgan’s laws. Tautologies and Contradictions. Laws of Logic.
Fall 2002CMSC Discrete Structures1 Let’s get started with... Logic !
Discrete Mathematics Lecture1 Miss.Amal Alshardy.
CSS 342 Data Structures, Algorithms, and Discrete Mathematics I
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.
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.
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.
CS203 Discrete Mathematical Structures
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.
Chapter 1, Part I: Propositional Logic With Question/Answer Animations.
CSNB143 – Discrete Structure Topic 4 – Logic. Learning Outcomes Students should be able to define statement. Students should be able to identify connectives.
TRUTH TABLES. Introduction The truth value of a statement is the classification as true or false which denoted by T or F. A truth table is a listing of.
The Foundations: Logic and Proofs
Mathematics for Comter I Lecture 2: Logic (1) Basic definitions Logical operators Translating English sentences.
LECTURE 1. Disrete mathematics and its application by rosen 7 th edition THE FOUNDATIONS: LOGIC AND PROOFS 1.1 PROPOSITIONAL LOGIC.
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
TRUTH TABLES Edited from the original by: Mimi Opkins CECS 100 Fall 2011 Thanks for the ppt.
Spring 2003CMSC Discrete Structures1 Let’s get started with... Logic !
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 01: Boolean Logic Sections 1.1 and 1.2 Jarek Rossignac.
CS104 The Foundations: Logic and Proof 1. 2 What is Discrete Structure?  Discrete Objects  Separated from each other (Opposite of continuous)  e.g.,
Chapter 1, Part I: Propositional Logic With Question/Answer Animations.
Chapter 1. Chapter Summary  Propositional Logic  The Language of Propositions (1.1)  Logical Equivalences (1.3)  Predicate Logic  The Language of.
Module Code MA0003NI: Computing mathematics Lecture for Week Autumn.
Chapter 1 Logic and proofs
Discrete Structures for Computer Science Presented By: Andrew F. Conn Slides adapted from: Adam J. Lee Lecture #1: Introduction, Propositional Logic August.
Logic.
(CSC 102) Discrete Structures Lecture 2.
The Foundations: Logic and Proofs
Principles of Computing – UFCFA3-30-1
Propositional Equivalences
Information Technology Department
Applications of Propositional Logic
Discrete Mathematics and Its Applications Kenneth H
The Foundations: Logic and Proofs
Discrete Structures Prepositional Logic 2
The Foundations: Logic and Proofs
Presentation transcript:

رياضيات متقطعة لعلوم الحاسب MATH 226

Text books: (Discrete Mathematics and its applications) Kenneth H. Rosen, seventh Edition, 2012, McGraw- Hill

Introduction What is discrete mathematics? Discrete mathematics is the part of mathematics devoted to ( the study of discrete objects.) (Here discrete means consisting of distinct or unconnected elements.)

What is the main purpose for this course? - Give About Discrete Mathematics - Understand the principles of mathematical logic (Logic), and methods of evidence - Identify Groups (Sets) and basic operations on groups - Understand the different types of relationships and - Boolean algebra (Boolean Algebra), Paul functions and logical circuits (Logical Circuits) - Graphs and trees

Chapter Propositional Logic Applications of Propositional Logic 1.3 Propositional Equivalences..

Section 1.1

Propositions A proposition is a declarative sentence that is either true or false. Examples of propositions: a) riyad is the capital of Saudi Arabia b) the color of blood is green c) = 1 d) = 2 Examples that are not propositions. a) Sit down! b) What time is it? c) x + 1 = 2 d) x + y = z Propositions a and c are true, whereas b and d are false.

Propositional Logic Propositional Variables: We use letters to denote propositional variables that is, variables that represent propositions Propositional Variables: p, q, r, s, … E.g. Proposition p – “Today is Friday.” Truth values – T, F The proposition that is always true is denoted by T and the proposition that is always false is denoted by F. Propositional Logic – the area of logic that deals with propositions

Compound Propositions Compound Propositions; constructed from logical connectives and other propositions Negation ¬ Conjunction ∧ Disjunction ∨ Implication → Biconditional ↔

Examples Find the negation of the proposition “Today is Friday.” and express this in simple English. Find the negation of the proposition ““Rana PC runs Linux”.” and express this in simple English. DEFINITION 1 Let p be a proposition. The negation of p, denoted by ¬p, is the statement “It is not the case that p.” The proposition ¬p is read “not p.” Solution: The negation is “It is not the case that today is Friday.” In simple English, “Today is not Friday.” or “It is not Friday today.” Solution: The negation is “It is not the case that Rana PC runs Linux.” This negation can be more simply expressed as “Rana PC does not run Linux.”.” Compound Propositions: Negation

The truth value of the negation of p, ¬p is the opposite of the truth value of p. has this truth table: Example: If p denotes “The earth is round.”, then ¬p denotes “It is not the case that the earth is round,” or more simply “The earth is not round.” p¬p¬p TF FT

Examples Find the conjunction of the propositions p and q where p is the proposition “Today is Friday.” and q is the proposition “It is raining today.”, and the truth value of the conjunction. DEFINITION 2 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 both p and q are true and is false otherwise. Solution: The conjunction is the proposition “Today is Friday and it is raining today.” The proposition is true on rainy Fridays. 12 Conjunction

(p ∧ q ) and has this truth table: Example: If p denotes “I am at home.” and q denotes “It is raining.” then p ∧q denotes “I am at home and it is raining.” pqp ∧ q TTT TFF FTF FFF

Note: inclusive or : The disjunction is true when at least one of the two propositions is true. E.g. “Students who have taken calculus or computer science can take this class.” – those who take one or both classes. exclusive or : The disjunction is true only when one of the proposition is true. p ⊕ q E.g. “Students who have taken calculus or computer science, but not both, can take this class.” – only those who take one of them. Definition 3 uses inclusive or. DEFINITION 3 Let p and q be propositions. The disjunction of p and q, denoted by p ν q, is the proposition “p or q”. The conjunction p ν q is false when both p and q are false and is true otherwise. 14 Disjunction

truth table: Example: If p denotes “I am at home.” and q denotes “It is raining.” then p ∨q denotes “I am at home or it is raining.” pqp ∨q TTT TFT FTT FFF

Implication (conditional statement ) and has this truth table: Example: If p denotes “I am at home.” and q denotes “It is raining.” then p →q denotes “If I am at home then it is raining.” In p →q, p is the hypothesis and q is the conclusion pqp →q TTT TFF FTT FFT DEFINITION 5 Let p and q be propositions. The conditional statement p → q, is the proposition “if p, then q.” The conditional statement is false when p is true and q is false, and true otherwise.

Understanding Implication Example: Let p be the statement “Marim learns discrete mathematics.” and q the statement “Marim will find a good job.” Express the statement p → q as a statement in English. Solution: Any of the following - “If Marim learns discrete mathematics, then she will find a good job. “Marim will find a good job when she learns discrete mathematics.” “Marim will find a good job unless she does not learn discrete mathematics.” 17

Converse, Contrapositive, and Inverse From p →q we can form new conditional statements. q →p is the converse of p →q ¬q → ¬ p is the contrapositive of p →q ¬ p → ¬ q is the inverse of p →q Example: Find the converse, inverse, and contrapositive of “It raining is a sufficient condition for my not going to town.” Solution: converse: If I do not go to town, then it is raining. inverse: If it is not raining, then I will go to town. contrapositive: If I go to town, then it is not raining. NOTE :only the contrapositive always has the same truth value as p → q.

Biconditional If p and q are propositions, then we can form the biconditional proposition p ↔q, read as “ p if and only if q.” The biconditional p ↔q denotes the proposition with this truth table: If p denotes “I am at home.” and q denotes “It is raining.” then p ↔q denotes “I am at home if and only if it is raining.” pqp ↔q TTT TFF FTF FFT

Truth Tables of Compound Propositions Example Truth Table Construct a truth table for pqr rr p  q p  q →  r TTTFTF TTFTTT TFTFTF TFFTTT FTTFTF FTFTTT FFTFFT FFFTFT

Equivalent Propositions Two propositions are equivalent if they always have the same truth value. Example: Show using a truth table that the biconditional is equivalent to the contrapositive. Solution: pq¬ p¬ qp →q¬q → ¬ p TTFFTT TFFTFF FTTFTT FFTTFT

Using a Truth Table to Show Non- Equivalence Example: Show using truth tables that neither the converse nor inverse of an implication are not equivalent to the implication. Solution: pq¬ p¬ qp →q¬ p →¬ qq → p TTFFTTT TFFTFTT FTTFTFF FFTTFTT

Problem How many rows are there in a truth table with n propositional variables? Solution: 2 n We will see how to do this in Chapter 6. Note that this means that with n propositional variables, we can construct 2 n distinct (i.e., not equivalent) propositions.

Precedence of Logical Operators OperatorPrecedence  1     2323     4545 p  q   r is equivalent to (p  q)   r If the intended meaning is p  (q   r ) then parentheses must be used.

Section 1.2

Translating English Sentences Steps to convert an English sentence to a statement in propositional logic Identify atomic propositions and represent using propositional variables. Determine appropriate logical connectives “If I go to Harry’s or to the country, I will not go shopping.” p: I go to Harry’s q: I go to the country. r: I will go shopping. If p or q then not r.

Example Problem: Translate the following sentence into propositional logic: “You can access the Internet from campus only if you are a computer science major or you are not a freshman.” One Solution: Let a, c, and f represent respectively “You can access the internet from campus,” “You are a computer science major,” and “You are a freshman.” a→ (c ∨ ¬ f )

Logic Circuits (Studied in depth in Chapter 12) Electronic circuits; each input/output signal can be viewed as a 0 or 1. 0 represents False 1 represents True Complicated circuits are constructed from three basic circuits called gates. The inverter (NOT gate)takes an input bit and produces the negation of that bit. The OR gate takes two input bits and produces the value equivalent to the disjunction of the two bits. The AND gate takes two input bits and produces the value equivalent to the conjunction of the two bits. More complicated digital circuits can be constructed by combining these basic circuits to produce the desired output given the input signals by building a circuit for each piece of the output expression and then combining them. For example:

Section 1.3

Logically Equivalent We write this as p⇔q or as p≡q where p and q are compound propositions. Two compound propositions p and q are equivalent if and only if the columns in a truth table giving their truth values agree. This truth table show ¬p ∨ q is equivalent to p → q. pq¬p¬p¬p ∨ qp→ q TTFTT TFFFF FTTTT FFTTT

De Morgan’s Laws pq¬p¬p¬q¬q ( p∨q)¬ ( p∨q)¬p∧¬q TTFFTFF TFFTTFF FTTFTFF FFTTFTT This truth table shows that De Morgan’s Second Law holds. Augustus De Morgan

Key Logical Equivalences (cont) Commutative Laws:, Associative Laws: Distributive Laws: Absorption Laws:

Key Logical Equivalences Identity Laws:, Domination Laws:, Idempotent laws:, Double Negation Law: Negation Laws:,

More Logical Equivalences

Equivalence Proofs Example: Show that is logically equivalent to Solution:

Equivalence Proofs Example: Show that is a tautology. Solution: