Download Logic - Discrete Structures - Slides | CSE 2813 and more Study notes Discrete Structures and Graph Theory in PDF only on Docsity!
Logic
Section 1.
Proposition
(^) Statement that is true or false.
(^) Examples
(^) The capital of New York is Albany.
(^) The moon is made of green cheese.
(^) Go to town.
(^) What time is it?
(^) x + 1 = 2.
Negation (NOT)
(^) p : I am going to town.
(^) ~ p : I am not going to town.
(^) Truth table: p ~ p T F F T
Truth Tables
(^) A truth table lists ALL possible values of a (compound) proposition - (^) one column for each propositional variable - (^) one column for the compound proposition - 2 n^ rows for n propositional variables
Disjunction (OR)
(^) p : I am going to town.
(^) q : It is raining.
(^) p ๏ q : I am going to town or it is raining.
(^) Inclusive or - only one proposition needs to be true for the disjunction to be true.
Exclusive OR
(^) p : I am going to town.
(^) q : It is raining.
(^) p ๏ q : Either I am going to town or it is raining.
(^) Only one of p and q are true. (not both)
Implication -
Equivalent Forms
(^) If p , then q
(^) p implies q
(^) If p , q
(^) q if p
(^) q whenever p
(^) p is a sufficient condition for q
(^) q is a necessary condition for p
(^) p only if q
Converse of an
Implication
(^) Implication: p ๏ฎ q
(^) Converse: q ๏ฎ p
(^) Implication:
(^) If I am going to town, it is raining.
(^) Converse:
(^) If it is raining, then I am going to town.
Inverse of an
Implication
(^) Implication: p ๏ฎ q
(^) Inverse: ๏ p ๏ฎ ๏ q
(^) Implication:
(^) If I am going to town, it is raining.
(^) Inverse:
(^) If I am not going to town, then it is not raining.
Biconditional
(^) โif and only ifโ, โiffโ
(^) p ๏ซ q
(^) I am going to town if and only if it is raining.
(^) Both p and q must have the same truth value for the assertion to be true.
Constructing complex
truth tables
(^) Add intermediate columns for smaller (compound) propositions
(^) ( p ๏ q ) ๏ฎ ๏ r
Precedence of Logical
Operators
(^) Parentheses gets the highest precedence
(^) Then ๏ ๏ ๏ ๏ฎ ๏ซ
(^) Example: p ๏ q ๏ r means ( p ๏ q ) ๏ r , not p ๏ ( q ๏ r ) p ๏ q ๏ฎ r means ( p ๏ q ) ๏ฎ r