Lecture Notes 03, Laws of Logic and Rules of Inference
Lecture Notes 03, Laws of Logic and Rules of Inference
Inference
Imran Shafi
Email: [email protected]
Contents
Laws of Logic
Examples
Exercises
Rules of Inference
Examples
Exercises
Tautology
A tautology is a statement form that is always true regardless of the truth
values of the statement variables.
A tautology is represented by the symbol “T” or “t”
For example, the following expression is a tautology:
p ¬p
p ¬p p ¬p
True False True
False True True
p ¬p p ¬p
True False False
False True False
pqqp
Commutative Law
pqqp
(p q) r p (q r)
Associative Law
(p q) r p (q r)
p (q r) (p q) (p r)
Distributive Law
p (q r) (p q) (p r)
Laws of Logic
Given any statement variables p, q and r, a tautology t and a contradiction c, the
following logical equivalences hold:
ptp
Identity Laws
pcp
p ¬p c
Negation Laws
p ¬p t
Double Negation Law ¬(¬p) p
pp=p
Idempotent Laws
p p=p
Laws of Logic
Given any statement variables p, q and r, a tautology t and a contradiction c, the
following logical equivalences hold:
Law Logical Form
¬(p q) ¬p ¬q
De Morgan’s Laws
¬(p q) ¬p ¬q
pc=c
Universal Bound Law
p t=t
p (p q) p
Absorption Laws
p (p q) p
¬t = c
Negation of t and c
¬c = t
Negation of Expressions
Use De Morgan’s law to write the negation of the following expression:
-1 < x 4
Negation of Logical Expressions
Write down the negation of the following expressions.
1. Either the fan is very slow or it is very hot outside.
2. Akram is fit and running very fast.
3. Ali is intelligent but he failed in final exam.
4. Hina is neither confused not she is excited.
Logical Proofs … Truth Table
Show the following using truth-table:
p q ¬q ¬p
Truth Table …
Logical Proofs
Show the following using truth-table and/or laws of logic:
ptp
Logical Proofs
Show the following using truth-table and/or laws of logic:
pcc
Logical Proofs
Prove the following using truth-table and/or laws of logic:
p q = ¬p q
Logical Proofs
Prove the following using truth-table and/or laws of logic:
p ⊕ q = (p q) ~ (p q)
Logical Proofs
Prove that the following expressions are logically not equivalent:
i. ¬(p q)
ii. ¬p ¬q
Logical Proofs
Prove that the following expressions is a tautology:
(p q) (¬p (p ¬q))
Logical Proofs
Prove that the following expressions is a contradiction:
(p ¬q) (¬p q)
Proofs … Laws of Logic
Simplify the following expression using laws of logic:
p (¬(¬p q))
Solution:
p (¬(¬p q))
= p ((¬¬p) ¬q)) … De Morgan’s Law
= p (p ¬q) … Double Negation
= (p p) ¬q … Association Law
= p ¬q … Idempotent Law
NOTE : The symbol read “therefore,” is normally placed just before the conclusion.
Validity of an Argument
An argument is valid if the conclusion is true when all the premises are true.
Alternatively, an argument is valid if conjunction of its premises imply
conclusion.
That is (P1 P2 P3 . . . Pn) C is a tautology.
In that case if argument becomes tautology then we say the argument is valid.
Invalidity of an Argument
An argument is invalid if the conclusion is false when all the premises are true.
Validity of argument:
When our premises conjunction is false, the argument is valid no matter what is
the value of conclusion
When our premises conjunction is true and conclusion is false, only then
argument is invalid.
Checking the Validity of an Argument
Construct the truth table using all premises and the conclusion
Now, check all the rows of the truth table where all premises are true, the
argument is valid if the value of conclusion is also true on all of these rows
Lets call the row where are premises are true as ‘critical rows’
If the conclusion in every critical row is TRUE, the argument is valid. Otherwise,
argument is invalid.
Validity of an Argument
Show that the following argument is valid:
Solution:
Lets construct the truth-table using premises and the conclusion:
p q pq p q
You can observe that there is only one critical row
T T T T T (where all premises are true) is the truth table. In the
critical row, the conclusion is also true.
T F F T F
Hence proved that the argument is valid.
F T T F T
F F T F F
Validity of an Argument
Is the following argument valid?
Solution:
If you represent the proposition “You have access to network” with p and “You can change your
grade” with q, you will get the same argument as below.