MODULE-1 - Fundamentals of Logics
MODULE-1 - Fundamentals of Logics
MODULE-1
FUNDAMENTALS OF LOGICS
Basic connectives and truth tables, Logical equivalence – The laws of Logic, Logical
implication – Rules of Inference. Fundamentals of Logic contd.: The Use of Quantifiers-
Quantifiers, Definitions, and the Proofs of Theorems.
❖ New propositions, called compound propositions, are formed from existing propositions
using logical operators. These logical operators are also called connectives.
• Let p and q be propositions. The conjunction of p and q, denoted by “𝑝 ∧ 𝑞”, is the
proposition “p and q.” The conjunction 𝑝 ∧ 𝑞 is true when both p and q are true and is false
otherwise.
Example: Let p: Today is Friday, q: It is raining today, then,
𝑝 ∧ 𝑞: Today is Friday and it is raining today.
• Let p and q be propositions. The disjunction of p and q, denoted by 𝑝 ∨ 𝑞, is the proposition
“p or q.” The disjunction 𝑝 ∨ 𝑞 is false when both p and q are false and is true otherwise.
Example: Let p: Today is Friday, q: It is raining today, then,
𝑝 ∨ 𝑞: Today is Friday or it is raining today.
1
22CDT45A
TABLE 4 TABLE 5
The Truth Table for the The Truth Table for the
Exclusive or of two Conditional Statement
Propositions. 𝒑 𝒒 𝒑→𝒒
𝒑 𝒒 𝒑⊕𝒒 T T T
T T F
T F F
T F T
F T T
F T T
F F T
F F F
2
22CDT45A
• A bit can be used to represent a truth value, because there are only two truth values, namely,
1 and 0. We will use a “1” bit to represent true and a “0” bit to represent false. That is, 1
represents T (true), 0 represents F (false).
Problems:
1. Let 𝑝, 𝑞 and 𝑟 denote the following statements about a particular triangle ABC.
𝑝: Triangle ABC is Isosceles.
𝑞: Triangle ABC is Equilateral.
𝑟: Triangle ABC is Equiangular.
Translate each of the following into English statements.
a) 𝑞 → 𝑝
b) ¬𝑝 → ¬𝑞
c) 𝑞 ↔ 𝑟
d) 𝑝 ∧ ¬𝑞
e) 𝑟 → 𝑝
Sol:
a) If triangle ABC is equilateral, then it is isosceles.
b) If triangle ABC is not isosceles, then it is not equilateral.
c) Triangle ABC is equilateral, if and only if it is equiangular.
d) Triangle ABC is equilateral, but it is not equilateral.
e) If triangle ABC is equiangular, then it is isosceles.
3
22CDT45A
3. Let 𝑝 and 𝑞 be the propositions “Swimming at the New Jersey shore is allowed” and “Sharks
have been spotted near the shore”, respectively. Express each of these compound
propositions as an English sentence.
a) ¬𝑞 b) 𝑝 ∧ 𝑞 c) ¬𝑝 ∨ 𝑞 d) 𝑝 → ¬𝑞 e) ¬𝑞 → 𝑝 f) ¬𝑝 → ¬𝑞
g) 𝑝 ↔ ¬𝑞 h) ¬𝑝 ∧ (𝑝 ∨ ¬𝑞).
Sol: a) ¬𝑞: Sharks have not been spotted near the shore.
b) 𝑝 ∧ 𝑞: Swimming at the New Jersey shore is allowed, and sharks have been spotted near the
shore.
c) ¬𝑝 ∨ 𝑞: Swimming at the New Jersey shore is not allowed, or sharks have been spotted near
the shore.
d) 𝑝 → ¬𝑞: If swimming at the New Jersey shore is allowed, then sharks have not been spotted
near the shore.
e) ¬𝑞 → 𝑝: If sharks have not been spotted near the shore, then swimming at the New Jersey
shore is allowed.
f) ¬𝑝 → ¬𝑞: If swimming at the New Jersey shore is not allowed, then sharks have not been
spotted near the shore.
g) 𝑝 ↔ ¬𝑞: Swimming at the New Jersey shore is allowed if and only if sharks have not been
spotted near the shore.
h) ¬𝑝 ∧ (𝑝 ∨ ¬𝑞): Swimming at the New Jersey shore is not allowed, and either swimming at
the New Jersey shore is allowed or sharks have not been spotted near the shore.
4
22CDT45A
e) Hiking is not safe on the trail whenever grizzly bears have been seen in the area and
berries are ripe along the trail.
Sol: a) 𝑟 ∧ ¬𝑝
b) ¬𝑝 ∧ 𝑞 ∧ 𝑟
c) 𝑟 ⟶ (𝑞 ⟷ ¬𝑝)
d) ¬𝑞 ∧ ¬𝑝 ∧ 𝑟
e) (𝑝 ∧ 𝑟) ⟶ ¬𝑞.
Sol:
a)
𝒑 𝒒 𝒑 ∨ ¬𝒒 ¬(𝒑 ∨ ¬𝒒) → ¬ 𝒑
T T T T
T F T T
F T F T
F F T T
b)
𝑝 𝑞 𝑟 𝑞→𝑟 𝑝 → (𝑞 → 𝑟)
F F F T T
F F T T T
F T F F T
F T T T T
T F F T T
T F T T T
T T F F F
T T T T T
c)
𝒑 𝒒 ¬𝒒 𝒑 ∨ ¬𝒒 (𝒑 ∨ ¬ 𝒒) → 𝒒
T T F T T
T F T T F
F T F F T
F F T T F
5
22CDT45A
d)
𝒑 𝒒 𝒑→ 𝒒 𝒑 ∧ (𝒑 → 𝒒) (𝒑 ∧ (𝒑 → 𝒒)) → 𝒒
T T T T T
T F F F T
F T T F T
F F T F T
Home work
1. Let p and q be the propositions, p: It is below freezing, q: It is snowing. Write the logical
connectives.
a) It is below freezing and snowing.
b) It is below freezing but not snowing.
c) It is not below freezing and it is not snowing.
d) It is either snowing or below freezing (or both).
e) If it is below freezing, it is also snowing.
f) It is either below freezing or it is snowing, but it is not snowing if it is below freezing.
g) That it is below freezing is necessary and sufficient for it to be snowing.
2. Construct a truth table for each of these compound propositions.
a) 𝑞 ↔ (¬ 𝑝 ∨ ¬ 𝑞)
b) [(𝑝 → 𝑞) ∧ (𝑞 → 𝑟)] → (𝑝 → 𝑟)
c) [(𝑝 ∧ 𝑞) ∨ (¬𝑟)] ↔ 𝑝
6
22CDT45A
Logical equivalence
❖ A compound proposition that is always true, no matter what the truth values of the
propositional variables that occur in it, is called a tautology (𝑇0 𝑜𝑟 𝑇). A compound
proposition that is always false is called a contradiction (𝐹0 𝑜𝑟 𝐹). A compound proposition
that is neither a tautology nor a contradiction is called a contingency.
❖ The compound propositions p and q are called logically equivalent if 𝑝 ⟷ 𝑞 is a tautology,
i.e p and q are called logically equivalent, when p is true (respectively, false) if and only if
the q is true (respectively, false). The notation 𝑝 ≡ 𝑞 or 𝑝 ⇔ 𝑞 denotes that p and q are
logically equivalent.
❖ De Morgan’s Laws.
¬(𝑝 ∧ 𝑞) ≡ ¬𝑝 ∨ ¬𝑞 and ¬(𝑝 ∨ 𝑞) ≡ ¬𝑝 ∧ ¬𝑞
❖ Dual: Let s be a statement. If s contains no logical connectives other than ∧ and ∨, then the
dual of s, denoted sd, is the statement obtained from s by replacing each occurrence of ∧ and
∨ by ∨ and ∧, respectively, and each occurrence of 𝑇0 and 𝐹0 by 𝐹0 and 𝑇0 , respectively.
Example: Given the primitive statements 𝑝, 𝑞, 𝑟 and the compound statement
𝑠: (𝑝 ∧ ¬𝑞) ∨ (𝑟 ∧ 𝑇0 ),
then, dual of s is 𝑠 𝑑 : (𝑝 ∨ ¬𝑞) ∧ (𝑟 ∨ 𝐹0 ).
❖ The Principle of Duality. Let s and t be statements that contain no logical connectives other
than ∧ and ∨. If 𝑠 ≡ 𝑡, then 𝑠 𝑑 ≡ 𝑡 𝑑 .
7
22CDT45A
2. Show that
(i) 𝑝 → (𝑝 ∨ 𝑞) is a tautology
(ii) 𝑝 ∧ (¬𝑝 ∧ 𝑞) is a contradiction.
Sol:
𝑝 𝑞 𝑝∨𝑞 𝑝 → (𝑝 ∨ 𝑞) ¬𝑝 ¬𝑝 ∧ 𝑞 𝑝 ∧ (¬𝑝 ∧ 𝑞)
F F F T T F F
F T T T T T F
T F T T F F F
T T T T F F F
8
22CDT45A
9
22CDT45A
Homework
Let 𝑝, 𝑞, 𝑟 denote the primitive statements.
1.Use truth tables to verify the following logical equivalence.
(i) 𝑝 → (𝑞 ∧ 𝑟) ≡ (𝑝 → 𝑞) ∧ (𝑝 → 𝑟).
(ii)[𝑝 → (𝑞 ∨ 𝑟)] ≡ [¬𝑟 → (𝑝 → 𝑞)].
(iii) (𝑝 ∨ 𝑞) ∧ ¬(¬𝑝 ∧ 𝑞) ≡ 𝑝.
(iv) ¬[¬[(𝑝 ∨ 𝑞) ∧ 𝑟] ∨ ¬𝑞] ≡ 𝑞 ∧ 𝑟.
10
22CDT45A
❖ If p, q are arbitrary statements such that 𝑝 → 𝑞 is a tautology, then we say that p logically
implies q and we write 𝑝 ⇒ 𝑞 to denote this situation.
❖ 𝑝 ⇏ 𝑞 indicate that 𝑝 → 𝑞 is not a tautology, so the given implication (namely, 𝑝 → 𝑞) is
not a logical implication.
❖ If 𝑝 ≡ 𝑞, then the statement 𝑝 ⟷ 𝑞 is a tautology, so the statements p, q have same truth
values. Under these conditions the statements 𝑝 → 𝑞, 𝑞 → 𝑝 are tautologies and we have
𝑝 ⇒ 𝑞 and 𝑞 ⇒ 𝑝. Conversely, if 𝑝 ⇒ 𝑞 and 𝑞 ⇒ 𝑝 then, 𝑝 ≡ 𝑞.
Rules of inference:
11
22CDT45A
1. Show that the premises “It is not sunny this afternoon and it is colder than yesterday,” “We
will go swimming only if it is sunny,” “If we do not go swimming, then we will take a canoe
trip,” and “If we take a canoe trip, then we will be home by sunset” lead to the conclusion
“We will be home by sunset.”
Sol: Let the propositions be,
𝑝 -“It is sunny this afternoon,” 𝑞 - “It is colder than yesterday,” 𝑟 - “We will go swimming,”
𝑠 - “We will take a canoe trip,” and 𝑡 - “We will be home by sunset.”
Then the premises become ¬ 𝑝 ∧ 𝑞, 𝑟 → 𝑝, ¬ 𝑟 → 𝑠, and 𝑠 → 𝑡.
The conclusion is simply “𝑡”.
We construct an argument to show that our premises lead to the desired conclusion as follows.
12
22CDT45A
Step Reason
1. ¬ 𝑝 ∧ 𝑞 Premise
2. ¬ 𝑝 Simplification using (1)
3. 𝑟 → 𝑝 Premise
4. ¬ 𝑟 Modus tollens using (2) and (3)
5. ¬ 𝑟 → 𝑠 Premise
6. 𝑠 Modus ponens using (4) and (5)
7. 𝑠 → 𝑡 Premise
8. 𝑡 Modus ponens using (6) and (7) .
2. Show that the premises “If you send me an e-mail message, then I will finish writing the
program,” “If you do not send me an e-mail message, then I will go to sleep early,” and “If
I go to sleep early, then I will wake up feeling refreshed” lead to the conclusion “If I do not
finish writing the program, then I will wake up feeling refreshed.”
Sol: Let the proposition be, 𝑝 -“You send me an e-mail message,” 𝑞 - “I will finish writing the
program,” 𝑟 - “I will go to sleep early,” and 𝑠 - “I will wake up feeling refreshed.”
Then the premises are 𝑝 → 𝑞, ¬ 𝑝 → 𝑟 , and 𝑟 → 𝑠.
The desired conclusion is ¬ 𝑞 → 𝑠.
This argument form shows that the premises lead to the desired conclusion.
Step Reason
1. 𝑝 → 𝑞 Premise
2. ¬ 𝑞 → ¬𝑝 Contrapositive of (1)
3. ¬ 𝑝 → 𝑟 Premise
4. ¬ 𝑞 → 𝑟 Law of syllogism using (2) and (3)
5. 𝑟 → 𝑠 Premise
6. ¬ 𝑞 → 𝑠 Law of syllogism using (4) and (5)
13
22CDT45A
6. Provide the reasons for the steps verifying the following argument.
𝑝→𝑞
𝑞 → (𝑟 ∧ 𝑠)
¬𝑟 ∨ (¬𝑡 ∨ 𝑢)
𝑝∧𝑡
∴ 𝑢.
Step Sol: Reason
1. 𝑝 → 𝑞 Premise
2. 𝑞 → (𝑟 ∧ 𝑠) Premise
3. 𝑝 → (𝑟 ∧ 𝑠) Law of syllogism using (1) and (2)
4. 𝑝 ∧ 𝑡 Premise
5. 𝑝 Conjunctive simplification using (4)
6. 𝑟 ∧ 𝑠 Rule of detachment using (5) and (3)
7. 𝑟 Rule of conjunctive simplification using (6)
14
22CDT45A
8. ¬𝑟 ∨ (¬𝑡 ∨ 𝑢) Premise
9. ¬(𝑟 ∧ 𝑡) ∨ 𝑢 Associative law of ∨ and De Morgans Law using (8)
10. 𝑡 Rule of conjunctive simplification using (4)
11. 𝑟 ∧ 𝑡 Rule of conjunction using (7) and (10)
12. ∴ 𝑢 Law of double negation and Rule of Disjunctive syllogism using
(9) and (11).
Home work
1. Show that the premises “If Rochelle gets the supervisor's position and works hard then she
gets a raise”, “If she gets a raise, then she’ll buy a new car”, “She has not purchased a new
car”, lead to the conclusion “Rochelle did not get the supervisor's position or she did not work
hard”.
2. Establish the validity of the argument
(i) 𝑝 → 𝑟 (ii) (¬𝑝 ∨ 𝑞) → 𝑟 (iii) (¬𝑝 ∨ ¬𝑞) → (𝑟 ∧ 𝑠)
¬𝑝→𝑞 𝑟 → (𝑠 ∨ 𝑡) 𝑟→𝑡
𝑞→𝑠 ¬𝑠∧ ¬𝑢 ¬𝑡
∴ ¬ 𝑟 → 𝑠. ¬𝑢 →¬𝑡 ∴𝑝
∴𝑝
15
22CDT45A
❖ Theorems are the statements of mathematical interest, statements that are known to be true.
❖ A theorem may be the universal quantification of a conditional statement with one or more
premises and a conclusion.
❖ Sometimes the term theorem is used only to describe major results that have many and
varied consequences. Certain of these consequences that follow rather immediately from a
theorem are termed corollaries.
❖ Less important theorems sometimes are called propositions.
❖ We demonstrate that a theorem is true with a proof. A proof is a valid argument that
establishes the truth of a theorem.
❖ The statements used in a proof can include axioms (or postulates), which are statements we
assume to be true, the premises, if any, of the theorem, and previously proven theorems.
❖ A less important theorem that is helpful in the proof of other results is called a lemma (plural
lemmas or lemmata).
❖ A conjecture is a statement that is being proposed to be a true statement, usually on the basis
of some partial evidence, a heuristic argument, or the intuition of an expert.
16
22CDT45A
Definition I: The integer 𝑛 is even if there exists an integer 𝑎 such that 𝑛 = 2𝑎, and 𝑛 is odd
if there exists an integer 𝑎 such that 𝑛 = 2𝑎 + 1.
Problems
1. Consider the open statements. 𝑝(𝑡): 𝑡 has two sides of equal length. 𝑞(𝑡): 𝑡 is an isosceles
triangle. 𝑟(𝑡): 𝑡 has two angles of equal measure. Then the arguments:
In the triangle XYZ there is no pair of angles of equal measure.
If a triangle has two sides of equal length, then it is isosceles.
If a triangle is isosceles, then it has two angles of equal measure.
Therefore triangle XYZ has no two sides of equal length.
Write the arguments symbolically and validate the arguments.
17
22CDT45A
2. Let 𝑗(𝑥), 𝑠(𝑥), and 𝑝(𝑥) be open statements that are defined for a given universe. Establish
the validity of the argument.
∀𝑥 [(𝑗(𝑥) ∨ 𝑠(𝑥)) → ¬𝑝(𝑥)]
𝑝(𝑚)
∴ ¬𝑠(𝑚)
Sol: Step Reason
1) ∀𝑥 [(𝑗(𝑥) ∨ 𝑠(𝑥)) → ¬𝑝(𝑥)] Premise
2) 𝑝(𝑚) Premise
3) (𝑗(𝑚) ∨ 𝑠(𝑚)) → ¬𝑝(𝑚) Rule of universal specification using (1)
4) 𝑝(𝑚) → ¬(𝑗(𝑚) ∨ 𝑠(𝑚)) Law of double negation,(𝑞 → 𝑡) ≡ (¬𝑡 → ¬𝑞) using (3)
5) 𝑝(𝑚) → (¬𝑗(𝑚) ∧ ¬𝑠(𝑚)) DeMorgan’s law using (4)
6) ¬𝑗(𝑚) ∧ ¬𝑠(𝑚) Modus Ponens using (2) and (5)
7) ¬𝑠(𝑚) Rule of Conjunctive simplification using (6)
3. Let 𝑝(𝑥), 𝑞(𝑥), and 𝑟(𝑥) be open statements that are defined for a given universe. Establish
the validity of the argument.
∀𝑥 [𝑝(𝑥) → 𝑞(𝑥)]
∀𝑥 [𝑞(𝑥) → 𝑟(𝑥)]
∴ ∀𝑥 [𝑝(𝑥) → 𝑟(𝑥)]
Sol: Step Reason
1) ∀𝑥 [𝑝(𝑥) → 𝑞(𝑥)] Premise
2) 𝑝(𝑐) → 𝑞(𝑐) Rule of universal specification using (1)
3) ∀𝑥 [𝑞(𝑥) → 𝑟(𝑥)] Premise
4) 𝑞(𝑐) → 𝑟(𝑐) Rule of universal specification using (3)
5) 𝑝(𝑐) → 𝑟(𝑐) Law of the syllogism using (2) and (4)
6) ∴ ∀𝑥 [𝑝(𝑥) → 𝑟(𝑥)] Rule of universal generalization using (5)
18
22CDT45A
Theorem: For all integers k and l, if k, l are both odd, then k+l is even.
Proof: Since k and l are odd, we may write 𝑘 = 2𝑎 + 1 and 𝑙 = 2𝑏 + 1, for some integers a,
b, by Definition I. Then, 𝑘 + 𝑙 = (2𝑎 + 1) + (2𝑏 + 1) = 2(𝑎 + 𝑏 + 1).
Since a, b are integers, 𝑎 + 𝑏 + 1 = 𝑐 is an integer, 𝑘 + 𝑙 = 2𝑐. By Definition I, 𝑘 + 𝑙 is even.
Theorem: For all integers k and l, if k, l are both odd, then their product kl is also odd.
Proof: Since k and l are odd, we may write 𝑘 = 2𝑎 + 1 and 𝑙 = 2𝑏 + 1, for some integers a,
b, by Definition I.
Then, 𝑘𝑙 = (2𝑎 + 1)(2𝑏 + 1) = 4𝑎𝑏 + 2𝑎 + 2𝑏 + 1 = 2(2𝑎𝑏 + 𝑎 + 𝑏) + 1.
Since a, b are integers, 2𝑎𝑏 + 𝑎 + 𝑏 = 𝑐 is an integer, 𝑘𝑙 = 2𝑐 + 1. By Definition I, 𝑘𝑙 is odd.
Theorem: Give (i) a direct proof (ii) an indirect proof (iii) a contradiction proof, of the
following statement. “If m is an even integer, then 𝑚 + 7 is odd.”
Proof: (i)Since m is even, we have 𝑚 = 2𝑎 for some integer 𝑎.
Then, 𝑚 + 7 = 2𝑎 + 7 = 2𝑎 + 6 + 1 = 2(𝑎 + 3) + 1. Since 𝑎 + 3 is an integer, we know
that 𝑚 + 7 is odd (by Definition I).
(ii)Suppose that 𝑚 + 7 is not odd, hence even. Then 𝑚 + 7 = 2𝑏 for some integer b and 𝑚 =
𝑏 − 7 = 2𝑏 − 8 + 1 = 2(𝑏 − 4) + 1, where 𝑏 − 4 is an integer. Hence 𝑚 is odd. (because
∀𝑚[𝑝(𝑚) → 𝑞(𝑚)] ≡ ∀𝑚[¬𝑞(𝑚) → ¬𝑝(𝑚)]).
(iii)Now assume that 𝑚 is even and that 𝑚 + 7 is also even. Then 𝑚 + 7 even implies that
𝑚 + 7 = 2𝑐 for some integer 𝑐. And 𝑚 = 2𝑐 − 7 = 2𝑐 − 8 + 1 = 2(𝑐 − 4) + 1 with 𝑐 − 4
an integer, so 𝑚 is odd, which is a contradiction. Since the assumption is false, its negation is
true. Hence 𝑚 + 7 is odd.
Theorem: Give (i) an indirect proof (ii) a contradiction proof, of the following statement. “For
every integer 𝑛, if 𝑛2 is odd, then 𝑛 is odd.”
Proof: Let 𝑛 be any integer.
Then the given statement reads 𝑝 → 𝑞, where 𝑝: 𝑛2 is odd and 𝑞: 𝑛 is odd.
(i) We prove by contraposition i..e ¬𝑞 → ¬𝑝 is true.
19
22CDT45A
Assume that ¬𝑞 is true, that is assume that 𝑛 is not an odd integer. Then, 𝑛 = 2𝑘, where 𝑘 is
an integer. Consequently, 𝑛2 = (2𝑘)2 = 2(2𝑘 2 ), so that 𝑛2 is not odd. That is, 𝑝 is false or
equivalently, ¬𝑝 is true. This proves the contrapositive statement ¬𝑞 → ¬𝑝.
(ii) Assume that 𝑝 → 𝑞 is false, that is, assume that 𝑝 is true and 𝑞 is false. Now, 𝑞 is false
means: 𝑛 is even, so that 𝑛 = 2𝑘 for some integer 𝑘. This yields 𝑛2 = (2𝑘)2 = 4𝑘 2 from which
it is evident that 𝑛2 is even, that is, 𝑝 is false. This contradicts the assumption that 𝑝 is true.
This proves 𝑝 → 𝑞 is true (for any integer 𝑛).
Theorem: For all positive real numbers 𝑥 and 𝑦, if the product 𝑥𝑦 exceeds 25, then 𝑥 > 5 or
𝑦 > 5.
Proof: Consider the negation of the conclusion that is, 0 < 𝑥 ≤ 5 and 0 < 𝑦 ≤ 5. Under these
circumstances we find that 0 = 0.0 < 𝑥 . 𝑦 ≤ 5 . 5 = 25, so the product 𝑥𝑦 does not exceed
25. Hence the proof. (Proof by contrapositive: ∀𝑥 [¬𝑞(𝑥) → ¬𝑝(𝑥)]).
Homework
1. For the universe of all people, consider the open statements 𝑚(𝑥): 𝑥 is a mathematics
professor; 𝑐(𝑥): 𝑥 has studied calculus. Consider the argument.
All mathematics professors have studied calculus.
Leona is a mathematics professor.
Therefore Leona has studied calculus.
Write the symbolic form of argument and validate.
4. Give (i) a direct proof (ii) an indirect proof (iii) a contradiction proof, of the following
statement. “If n is an odd integer, then 𝑛 + 11 is an even integer.”
20