CPCS222 Discrete Structures I Intro + Logic
Welcome to CPCS222 Meet your Instructor.. Course Syllabus will be sent by email.. Textbook: “Discrete Mathematics and Its Applications”, by Kenneth Rosen, 6th ed. Important Dates: 1st Exam: Monday 3-12-1429H , 1-12-2008G 2nd Exam: Monday 22-1-1430H , 19-1-2009G Important Notes: Absence Policy Class Behavior
Why Study Discrete Structures Digital computers are based on discrete “atoms” (bits). Therefore, both a computer’s structure (circuits) and operations (execution of algorithms) can be described by discrete math.
Starting with Logic.. Crucial for mathematical reasoning Used for designing electronic circuitry Logic is a system based on propositions. A proposition is a statement that is either true or false (not both). We say that the truth value of a proposition is either true (T) or false (F).
“Elephants are bigger than mice.” Propositional Logic.. “Elephants are bigger than mice.” Is this a statement? yes Is this a proposition? yes What is the truth value of the proposition? true
Propositional Logic.. “520 < 111” Is this a statement? yes Is this a proposition? yes What is the truth value of the proposition? false
This is called a propositional function or open sentence. Propositional Logic.. “y > 5” Is this a statement? yes Is this a proposition? no Its truth value depends on the value of y, but this value is not specified. This is called a propositional function or open sentence.
“Today is January 1 and 99 < 5.” Propositional Logic.. “Today is January 1 and 99 < 5.” Is this a statement? yes Is this a proposition? yes What is the truth value of the proposition? false
“Please do not fall asleep.” Only statements can be propositions Propositional Logic.. “Please do not fall asleep.” Is this a statement? no It’s a request no Is this a proposition? Only statements can be propositions
“x<y if and only if y>x.” Propositional Logic.. “x<y if and only if y>x.” Is this a statement? yes Is this a proposition? yes What is the truth value of the proposition? true
Compound Propositions One or more propositions can be combined to form a single compound proposition. Formalized by: Denoting propositions with p, q, r, and s Logical Operators
Logical Operators Negation (NOT) Conjunction (AND) Disjunction (OR) Exclusive or (XOR) Implication (if – then) Biconditional (if and only if) Truth tables can be used to show how these operators can combine propositions to compound propositions.
Truth Tables Truth Table for ~p Truth Table for p q
Truth Tables Truth Table for p q Truth Table for p q
Precedence of logical Operation Operator Precedence 1 2 3 4 5 Exercises: (p q) q (p q) (p q)
Logical Operators Converse is the proposition q p of p q Contrapositive of p q is q p The proposition p q is called the inverse of p q Only the contrapositive always has the same truth value of p q
Statements and Operations Statements and operators can be combined in any way to form new statements. P Q PQ (PQ) (P)(Q) (PQ)(P)(Q) T F (PQ) Ξ (P)(Q). (Equivalence) De Morgan’s laws
Tautologies and Contradictions A tautology is a statement that is always true. Examples: R(R) (PQ)(P)(Q) If ST is a tautology, we write ST. If ST is a tautology, we write ST.
Tautologies and Contradictions A contradiction is a statement that is always false. Examples: R(R) ((PQ)(P)(Q)) The negation of any tautology is a contra- diction, and the negation of any contradiction is a tautology.
Logical Equivalence A compound preposition that have the same truth values are called Logically equivalent ( Ξ ) Examples: Show that (p q)Ξ p q (p q)Ξ ( p q) by p qΞ p q Ξ ( p) q Ξ p q
Hints For some important equivalence check table 6 , 7, and 8 page 25 Table 5 in Section 1.2 shows many useful laws. Exercises 1 and 7 in Section 1.2 may help you get used to propositions and operators.
Lecture Summary Introducing Discrete Structures. What is Propositional Logic. What is a proposition. What is a compound proposition. What are logical operators. What is a truth table.