Propositions
Slides are prepared by using Discrete Mathematics and Its
Applications by K. H. rosen
Propositions
• A proposition is a statement that is either true or
false, but not both.
• p: Ankara is the capital city of Turkey : True - T .
• q: 1+1=2 – True - T
• r: 2+2=3 – False - F
• Not proposition
• What time is it?
• Read this carefully!
• x+1=2
• x+y=z
Representations
• Letters are used to denote propositions
• p, q, r, s, ...
• If the proposition is true, denoted by true (T - D).
• If the proposition is false, denoted by false(F - Y).
• A proposition can be
• A single variable ,p
• Compound, combination of one or more propositions.
pvq
Truth Table
• Truth table displays the relationships between the
truth values of propositions.
• Valueable in determination of the truth values of
propositions constructed by simple propositions.
Logical Operators
• Negation (Not)
• Or
• And
• XOR
• If
• Iff if and only if – ancak ve ancak
• ...
• Example propositions
• p1: Today is Friday.
• p2: It is raining today.
Negation Operator: NOT
• Negates the truth value
• Denoted by ¬ (not sign) or ~ (tilda)
• ¬p1: It is not the case that today is Friday
• ¬p1: Today is not Friday.
• ¬T : F p ¬p
T F
• ¬F : T
F T
Conjunction Operator : And
• True if both of the operands are true and false
otherwise
• Denoted by
• p1 p2 : Today is Friday and it is raining today.
• TF:F p q pq
• TT:T T T T
T F F
F T F
F F F
Disjunction Operator: Or
• True if either of the operands are true and false if
both of the operands false.
• Denoted by
• p1 p2 : Today is Friday or it is raining today.
• TF:T p q pq
• TT:T T T T
T F T
F T T
F F F
Disjunction Operator : XOR
• True if one of the operands are true and false
othewise.
• Denoted by
• Exclusive Or (Dışlayıcı Or)
• p1 p2 : Either today is Friday or it is raining today.
• TF:T p q pq
• TT:F T T F
T F T
F T T
F F F
Implication Operator: IF
• False when p is true and q is false and true otherwise
• Denoted by Example: p q
• p is called hypothesis (or antecedent or premise)
• q is called coclusion (or consequence)
• If p then q
• p implies q
p q pq ¬pq
• p only if q
T T T T
• q whenever p T F F F
• q is necessary for p F T T T
F F T T
Biconditional Operator: IFF
• True when p and q have the same truth values and
false otherwise.
• Denoted by
• p if and only if q
• p is necessary and suffiecient for q p q pq
• pq pq qp T T T
T F F
F T F
F F T
Example 1
• You can access the internet from campus only if you
are a computer science major or you are not a
freshman. Write the statement in proposition
letters?
• a: You can access the internet from campus.
• c: You are a computer science major
• f: You are a freshman.
• a (c ¬f)
Example 2
• You cannot ride the roller coaster if you are under 4 feet tall unless
you are older than 16 years old. Write the sentence in a logical
expression?
• If you are under 4 feet tall and you are not older than 16 years old,
you cannot ride the roller coaster.
• q: You can ride the roller coaster
• r: You are under 4 feet tall
• s: You are older than 16 years old
• The result will be implication : if
• Condition (antecedent) conclusion (or consequence)
• (r ¬s) ¬q
Logic and Bit Operators
• A bit string is sentence of zero or more bits. The length of
this string is the number of bits in the string.
• 0 represents F (false)
• 1 represents T (true)
01 1011 0110
11 0001 1101 x y xy
11 1011 1111 bitwise OR 0 0 0
01 0001 0100 bitwise AND 0 1 1
10 1010 1011 bitwise XOR 1 0 1
1 1 1
Operator Precedence
• NOT
• AND
• OR
• IF
• IFF
Propositional Equvalences
• Tautology: A compound proposition that is always
true, no matter what the truth values of the
propositions that occur in it, is called tautology.
• Contradiction: A compound proposition that is
always false is contradiction.
• Contingencey: A proposition that is neither a
tatutology nor a contradiction is called contingency.
Tautology vs Contradiction
p ¬p tautology contradiction
p¬p p¬p
T F T F
F T T F
Logical Equivalences
• p and q are logically equivalent if pq is tautology.
• pq denotes tha p and q are logically equivalent.
• yerine kullanılabiliyor.
Example 1
• Show that ¬(pq) and ¬p¬q are logically
equivalent?
• ¬(pq) ¬p¬q is tautology ? Yes
p q pvq ¬(pq) ¬p ¬q ¬p¬q ¬(pq) ¬p¬q
T T T F F F F T
T F T F F T F T
F T T F T F F T
F F F T T T T T
Example 2
• Show that pq and ¬pq are logically equivalent?
• (pq) (¬pq) is tautology ?
p q pq ¬p ¬pq (pq) (¬pq)
T T T F T T
T F F F F T
F T T T T T
F F T T T T
Example 3
• Show that p(qr) and (pq)(pr) are logically
equivalent?
p q r p(qr) (pq) (pr) (pq)(pr)
T T T T T T T
T T F T T T T
T F T T T T T
T F F T T T T
F T T T T T T
F T F F T F F
F F T F F T F
F F F F F F F
Logical Equivalences -1
• Identity laws
• pT p
• pF p
• Domination laws
• pT T
• pF F
• Idempotent laws
• pp p
• pp p
Logical Equivalences -2
• Double negation laws
• ¬(¬p) p
• Cummutative laws
• pq qp
• pq qp
• Associative laws
• (pq)r p(qr)
• (pq)r p(qr)
Logical Equivalences -3
• Distributive laws
• p(qr) (pq)(pr)
• p(qr) (pq)(pr)
• De Morgan’s laws
• ¬(pq) ¬p¬q
• ¬(pq) ¬p¬q
• Some useful logical equivalances
• p¬p T
• p¬p F
• (pq) (¬pq)
Example
• Show that ¬(p(¬pq)) and (¬p¬q) are logically
equivalent?
¬(p(¬pq)) ¬p ¬(¬pq) De morgan’s law
¬p ¬(¬pq) De morgan’s law
¬p [¬(¬p) ¬q] Double negation
¬p ( p ¬q) Distributive law
(¬p p) (¬p ¬q)
F (¬p ¬q) Identity law
(¬p ¬q)
They are logically equivalent
Example
• Show that (pq) (pq) is a tautology.
• (pq) (¬pq)
(pq) (pq) ¬(pq) (pq)
(¬p ¬q) (pq) De morgan’s law
¬p¬qpq
(¬pp) (¬qq) Associative law
TT
T expressions are tautology.
Additional Examples
• Show that if (pq) (p q) is tautology?
• Solution
(pq) (p q) (pq) (¬p q) get rid of if
¬(pq) (¬p q) get rid of if
(¬p ¬q) (¬p q) De Morgan’s rule
(¬p ¬p) (¬q q) Cumm. and Assoc.
(¬p ¬p) T
T Domination law
Additional Examples
• Show that if (p q)(¬q r) is tautology?
Note: pq (pq) (qp) use this logical equivalence
for solving the question.
Solution:
(p q) (¬q r)
( (pq) (qp) ) ( (¬qr) (r ¬q))
( (¬p q) (¬q p) ) ( (¬(¬q) r) (¬r ¬q))
( ((¬p q) ¬q) ((¬p q) p)) )
(( (q r) ¬r) ((q r) ¬q)))
....
Additional Examples
• Show that if (¬p ¬q) (q r) is tautology?