Presentation is loading. Please wait.

Presentation is loading. Please wait.

CPCS222 Discrete Structures I

Similar presentations


Presentation on theme: "CPCS222 Discrete Structures I"— Presentation transcript:

1 CPCS222 Discrete Structures I
Intro + Logic

2 Welcome to CPCS222 Meet your Instructor..
Course Syllabus will be sent by .. Textbook: “Discrete Mathematics and Its Applications”, by Kenneth Rosen, 6th ed. Important Dates: 1st Exam: Monday H , G 2nd Exam: Monday H , G Important Notes: Absence Policy Class Behavior

3 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.

4 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).

5 “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

6 Propositional Logic.. “520 < 111” Is this a statement? yes
Is this a proposition? yes What is the truth value of the proposition? false

7 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.

8 “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

9 “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

10 “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

11 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

12 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.

13 Truth Tables Truth Table for ~p Truth Table for p q
  

14 Truth Tables Truth Table for p q Truth Table for p q

15 Precedence of logical Operation
Operator Precedence 1 2 3 4 5 Exercises: (p   q)  q (p  q)  (p  q)

16 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

17 Statements and Operations
Statements and operators can be combined in any way to form new statements. P Q PQ  (PQ) (P)(Q) (PQ)(P)(Q) T F (PQ) Ξ (P)(Q). (Equivalence) De Morgan’s laws

18 Tautologies and Contradictions
A tautology is a statement that is always true. 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.

19 Tautologies and Contradictions
A contradiction is a statement that is always false. Examples: R(R) ((PQ)(P)(Q)) The negation of any tautology is a contra- diction, and the negation of any contradiction is a tautology.

20 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

21 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.

22 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.


Download ppt "CPCS222 Discrete Structures I"

Similar presentations


Ads by Google