Propositional Logic: CSS510/ITC430 Discrete Structures
Propositional Logic: CSS510/ITC430 Discrete Structures
Discrete Structures
Lecture 2
Propositional logic
Logical connectives:
Negation
Conjunction
Disjunction
Exclusive or
Implication
Biconditional
Compound propositions
Let p: 2 is a prime
q: 6 is a prime
Determine the truth value of the following statements:
p:
pq:
p q:
pq:
p q:
p q:
q p:
Compound propositions
Let p: 2 is a prime .. T
q: 6 is a prime .. F
Determine the truth value of the following statements:
p:
pq:
p q:
pq:
p q:
p q:
q p:
Compound propositions
Let p: 2 is a prime .. T
q: 6 is a prime .. F
Determine the truth value of the following statements:
p: F
pq:
p q:
pq:
p q:
p q:
q p:
Compound propositions
Let p: 2 is a prime .. T
q: 6 is a prime .. F
Determine the truth value of the following statements:
p: F
pq:F
p q:
pq:
p q:
p q:
q p:
Compound propositions
Let p: 2 is a prime .. T
q: 6 is a prime .. F
Determine the truth value of the following statements:
p: F
pq:F
p q: T
pq:
p q:
p q:
q p:
Compound propositions
Let p: 2 is a prime .. T
q: 6 is a prime .. F
Determine the truth value of the following statements:
p: F
pq:F
p q: T
pq:T
p q:
p q:
q p:
Compound propositions
Let p: 2 is a prime .. T
q: 6 is a prime .. F
Determine the truth value of the following statements:
p: F
pq:F
p q: T
pq:T
p q: T
p q:
q p:
Compound propositions
Let p: 2 is a prime .. T
q: 6 is a prime .. F
Determine the truth value of the following statements:
p: F
pq:F
p q: T
pq:T
p q: T
p q: F
q p:
Compound propositions
Let p: 2 is a prime .. T
q: 6 is a prime .. F
Determine the truth value of the following statements:
p: F
pq:F
p q: T
pq:T
p q: T
p q: F
q p: T
Implication
The converse of p q is q p.
The contrapositive of p q is q p
The inverse of .p q is p q
Examples:
If it snows, the traffic moves slowly.
p: it snows q: traffic moves slowly.
pq
The converse:
If the traffic moves slowly then it snows.
qp
Implication
The contrapositive of p q is q p
The inverse of .p q is p q
Examples:
If it snows, the traffic moves slowly.
The contrapositive:
If the traffic does not move slowly then it does not
snow.
q p
The inverse:
If does not snow the traffic moves quickly.
p q
Biconditional
Definition: Let p and q be propositions. The biconditional
p q (read p if and only if q), is true when p and q have the
same truth values and is false otherwise.
p q pq
T T
T F
F T
F F
Biconditional
Definition: Let p and q be propositions. The biconditional
p q (read p if and only if q), is true when p and q have the
same truth values and is false otherwise.
p q pq
T T T
T F F
F T F
F F T
p q p pq p q (pq)
(pq)
T T
T F
F T
F F
p q p pq p q (pq)
(pq)
T T F
T F F
F T T
F F T
Constructing the truth table
Examples: Construct a truth table for
(p q) (p q)
p q p pq p q (pq)
(pq)
T T F T
T F F F
F T T T
F F T T
p q p pq p q (pq)
(pq)
T T F T F
T F F F T
F T T T T
F F T T F
Constructing the truth table
Examples: Construct a truth table for
(p q) (p q)
p q p pq p q (pq)
(pq)
T T F T F F
T F F F T F
F T T T T T
F F T T F F
Translation
Logic helps us to define the meaning of statements:
Mathematical or English statements.
Assume a sentence:
If you are older than 13 or you are with your parents then
you can attend a PG-13 movie.
Translation
General rule for translation.
Look for patterns corresponding to logical connectives in
the sentence and use them to define elementary
propositions.
Translation
Assume two elementary statements:
p: you drive over 65 mph and q: you get a speeding ticket
Translate each of these sentences to logic
you do not drive over 65 mph
Translation
Assume two elementary statements:
p: you drive over 65 mph and q: you get a speeding ticket
Translate each of these sentences to logic
you do not drive over 65 mph. ( p)
you drive over 65 mph, but you don't get a speeding
ticket.
Translation
Assume two elementary statements:
p: you drive over 65 mph and q: you get a speeding ticket
Translate each of these sentences to logic
you do not drive over 65 mph. (p)
you drive over 65 mph, but you don't get a speeding
ticket. (p q)
you will get a speeding ticket if you drive over 65 mph.
Translation
Assume two elementary statements:
p: you drive over 65 mph and q: you get a speeding ticket
Translate each of these sentences to logic
you do not drive over 65 mph. (p)
you drive over 65 mph, but you don't get a speeding
ticket. (p q)
you will get a speeding ticket if you drive over 65 mph.
(p q)
if you do not drive over 65 mph then you will not get a
speeding ticket
Translation
Assume two elementary statements:
p: you drive over 65 mph and q: you get a speeding ticket
Translate each of these sentences to logic
you do not drive over 65 mph. (p)
you drive over 65 mph, but you don't get a speeding
ticket. (p q)
you will get a speeding ticket if you drive over 65 mph.
(p q)
if you do not drive over 65 mph then you will not get a
speeding ticket. (p q)
driving over 65 mph is sufficient for getting a speeding
ticket.
Translation
Assume two elementary statements:
p: you drive over 65 mph and q: you get a speeding ticket
Translate each of these sentences to logic
you do not drive over 65 mph. (p)
you drive over 65 mph, but you don't get a speeding
ticket. (p q)
you will get a speeding ticket if you drive over 65 mph.
(p q)
if you do not drive over 65 mph then you will not get a
speeding ticket. (p q)
driving over 65 mph is sufficient for getting a speeding
ticket. (p q)
you get a speeding ticket, but you do not drive over 65
mph.
Translation
Assume two elementary statements:
p: you drive over 65 mph and q: you get a speeding ticket
Translate each of these sentences to logic
you do not drive over 65 mph. (p)
you drive over 65 mph, but you don't get a speeding
ticket. (p q)
you will get a speeding ticket if you drive over 65 mph.
(p q)
if you do not drive over 65 mph then you will not get a
speeding ticket.(p q)
driving over 65 mph is sufficient for getting a speeding
ticket. (p q)
you get a speeding ticket, but you do not drive over 65
mph. (q p)
p p
1 0
0 1
Bitwise operations
Examples:
Bitwise operations
Examples: