Module 1
Module 1
DR. PAVITHRA R.
52258
ASSISTANT PROFESSOR – SAS
r.pavithra@vit.ac.in
Discrete Mathematics
▪Discrete Mathematics deals with the study of Mathematical structures.
▪It deals with objects that can have distinct separate values. It is also called Decision
Mathematics or finite Mathematics.
▪It is the study of mathematical structures that are fundamentally discrete in nature and it does
not require the notion of continuity.
▪Objects that are studied in discrete mathematics are largely countable sets such as formal
languages, integers, finite graphs, and so on.
▪Due to its application in Computer Science, it has become popular in recent decades. It is used
in programming languages, software development, cryptography, algorithms etc.
▪Discrete Mathematics covers some important concepts such as set theory, graph theory, logic,
permutation and combination as well.
Mathematical Statements
Investigate!
While walking through a fictional forest, you encounter three trolls guarding a bridge. Each is
either a knight, who always tells the truth, or a knave, who always lies. The trolls will not let you
pass until you correctly identify each as either a knight or a knave. Each troll makes a single
statement:
Troll 1: If I am a knave, then there are exactly two knights here.
Troll 2: Troll 1 is lying.
Troll 3: Either we are all knaves or at least one of us is a knight.
Which troll is which?
Propositions
▪ A declarative sentence which is true or false, but not both, is called a proposition (or statement)
▪ Sentences which are exclamatory, interrogative or imperative in nature are not propositions
▪Lower case letters such as 𝑝, 𝑞, 𝑟, … are used to denote propositions
▪For example,
1. New Delhi is the capital city of India
2. How beautiful is Rose?
3. 2+2=3
4. What time is it?
5. 𝑥+𝑦=𝑧
6. Take a cup of coffee
(2), (4) and (6) are obviously not propositions as they are not declarative in nature
(1) and (3) are propositions, but (5) is not
Truth value of proposition
▪ If proposition is true, we say that the truth value of that proposition is true, denoted by 𝑇 or 1.
▪If the proposition is false, we say that the truth value of the proposition is false, denoted by 𝐹 or 0.
≡~ ~𝑝 ∨ 𝐹 ∧ 𝑝∨𝑞
≡ ~(~𝑝) ∧ (𝑝 ∨ 𝑞), by identity law
≡𝑝∧ 𝑝∨𝑞
≡ 𝑝, by absorption law
𝑖𝑖 𝑝 ∨ 𝑞 → 𝑟 ≡ (𝑝 → 𝑟) ∧ (𝑞 → 𝑟)
Solution
𝑝 ∨ 𝑞 → 𝑟 ≡ (𝑝 → 𝑟) ∧ (𝑞 → 𝑟)
⇒ ~(𝑝 ∨ 𝑞) ∨ 𝑟 ≡ (~𝑝 ∨ 𝑟) ∧ (~𝑞 ∨ 𝑟)
The dual of equivalence is ~(𝑝 ∧ 𝑞) ∧ 𝑟 ≡ (~𝑝 ∧ 𝑟) ∨ (~𝑞 ∧ 𝑟)
Proof:
L.H.S ≡ ~(𝑝 ∧ 𝑞) ∧ 𝑟
≡ ~𝑝 ∨ ~𝑞 ∧ r, by De Morgan’s Law
≡ ~𝑝 ∧ 𝑟 ∨ (~𝑞 ∧ 𝑟), by distribution law
Hence Proved
(iii) 𝑝 ∧ 𝑝 ⟷ 𝑞 →𝑞≡𝑇
Solution:
𝑝∧ 𝑝⟷𝑞 →𝑞≡𝑇
⇒ 𝑝∧ ~𝑝 ∨ 𝑞 ∧ ~𝑞 ∨ 𝑝 →𝑞≡𝑇
⇒~ 𝑝∧ ~𝑝 ∨ 𝑞 ∧ ~𝑞 ∨ 𝑝 ∨𝑞 ≡ 𝑇
Dual of this~ 𝑝 ∨ ~𝑝 ∧ 𝑞 ∨ ~𝑞 ∧ 𝑝 ∧𝑞 ≡𝐹
L.H.S ≡ ~ (𝑝 ∨ ~𝑝 ∧ 𝑞 ) ∨ ~𝑞 ∧ 𝑝 ∧ 𝑞, by associative law
Solution
𝑝 ∨ ~𝑝 → 𝑞 ∨ 𝑞 → ~𝑟 ≡ 𝑝 ∨ (𝑝 ∨ (𝑞 ∨ (𝑞 → ~𝑟)))
≡ 𝑝 ∨ 𝑝 ∨ 𝑞 ∨ ~𝑞 ∨ ~𝑟
≡ 𝑝 ∨ 𝑝 ∨ 𝑞 ∨ ~𝑞 ∨ ~𝑟
≡𝑇
Since we want it as DNF
≡ 𝑝 ∨ 𝑝 ∨ 𝑞 ∨ ~𝑞 ∨ ~𝑟
≡ 𝑝 ∨ 𝑞 ∨ ~𝑞 ∨ ~𝑟
Find the conjunction normal forms of the following statements:
𝑖 𝑝∧~ 𝑞∧𝑟 ∨ 𝑝→𝑞
𝑖𝑖 𝑞 ∨ 𝑝 ∧ 𝑞 ∧ ~((𝑝 ∨ 𝑟) ∧ 𝑞)
𝑖𝑖𝑖 (𝑝 ∧ ~(𝑞 ∧ 𝑟)) ∨ (𝑝 → 𝑞)
Solution
𝑖 𝑝∧~ 𝑞∧𝑟 ∨ 𝑝 → 𝑞 ≡ (𝑝 ∧ (~𝑞 ∨ ~𝑟)) ∨ (~𝑝 ∨ 𝑞)
≡ 𝑝 ∧ ~𝑞 ∨ 𝑝 ∧ ~𝑟 ∨ ~𝑝 ∨ 𝑞
≡ 𝑝 ∨ 𝑝 ∧ 𝑝 ∨ ~𝑟 ∧ ~𝑞 ∨ 𝑝 ∧ ~𝑞 ∨ ~𝑟 ∨ ~𝑝 ∨ 𝑞
≡ 𝑝 ∨ 𝑝 ∧ 𝑝 ∨ ~𝑟 ∧ ~𝑞 ∨ 𝑝 ∧ ~𝑞 ∨ ~𝑟 ∨ ~𝑝 ∨ 𝑞
≡ 𝑝 ∧ 𝑝 ∨ ~𝑟 ∧ 𝑝 ∨ ~𝑞 ∧ ~𝑞 ∨ 𝑞 ∨ ~𝑝 ∨ ~𝑟
≡ 𝑝 ∧ 𝑝 ∨ ~𝑟 ∧ 𝑝 ∨ ~𝑞 ∧ 𝑇 ∨ ~𝑝 ∨ ~𝑟
≡ 𝑝 ∧ 𝑝 ∨ ~𝑟 ∧ 𝑝 ∨ ~𝑞
(ii) 𝑞 ∨ 𝑝 ∧ 𝑞 ∧ ~((𝑝 ∨ 𝑟) ∧ 𝑞) ≡ 𝑞 ∧ ~((𝑝 ∨ 𝑟) ∧ 𝑞), by absorption law
≡ 𝑞 ∧ ~((𝑝 ∨ 𝑟) ∧ 𝑞)
≡ 𝑞 ∧ ~ 𝑝 ∨ 𝑟 ∨ ~𝑞
≡𝑞∧ ~𝑝 ∧ ~𝑟 ∨ ~𝑞
≡ 𝑞 ∧ (~𝑝 ∨ ~𝑞) ∧ (~𝑟 ∨ ~𝑞)
Principal disjunctive and principal conjunctive normal forms
• Given a number of variables, the product (or conjunctions) in which each variable or its
negation, but not both occurs only once are called the minterms. For two variable 𝑝 and 𝑞, the
possible minterms are 𝑝 ∧ 𝑞, 𝑝 ∧ ~𝑞, ~𝑝 ∧ q and ~𝑝 ∧ ~𝑞
•We note that there are 2𝑛 minterms for n variables.
•Given a number of variables, the sum in which each variable or its negation but not both
occurs only once are called maxterms. Maxterms are simply the duals of minterms
•The formula consisting of disjunctions of minterms in the variables only and equivalent to a
given formula is known as its principal disjunctive normal form (PDNF) or its sum of products
canonical form of the given formula.
•Similarly, a formula consisting of conjunction of maxterms in the variables only and equivalent
to given formula is known as its principal conjunctive normal form (PCNF) or its product of sums
canonical form.
•In order to obtain a DNF of the formula by using the procedure given above. To get the minterms
in the disjunctions, the missing factors are introduced through the complement law (𝑝 ∨ ~𝑝 =
𝑇) and then applying the distributive law.
•Identical minterms appearing in the disjunctions are then deleted, as 𝑝 ∨ 𝑝 = 𝑝.
•A similar procedure with necessary modifications is adopted to get PCNF of a formula.
•In order to verify whether two given formulas are equivalent, we may obtain either PDNF or
PCNF of both the formulas and compare them.
Without constructing the truth tables, find the principal disjunctive normal forms of the following statements:
𝑖 ~𝑝 → 𝑞 ∧ 𝑞 ⟷ 𝑝
𝑖𝑖 𝑝 ∧ 𝑞 ∨ ~𝑝 ∧ 𝑞 ∨ 𝑞 ∧ 𝑟
𝑖𝑖𝑖 𝑝 ∧ ~(𝑞 ∧ 𝑟) ∨ (𝑝 → 𝑞)
𝑖𝑣 𝑞 ∨ 𝑝 ∧ 𝑟 ∧ ~((𝑝 ∨ 𝑟) ∧ 𝑞)
Solution:
𝑖 ~𝑝 → 𝑞 ∧ 𝑞 ⟷ 𝑝 ≡ 𝑝 ∨ 𝑞 ∧ 𝑞 ∧ 𝑝 ∨ ~𝑞 ∧ ~𝑝
≡ (𝑝 ∨ 𝑞) ∧ ((𝑝 ∧ 𝑞) ∨ ~(𝑝 ∨ 𝑞))
≡ ( 𝑝 ∨ 𝑞 ∧ 𝑝 ∧ 𝑞 ) ∨ ((𝑝 ∨ 𝑞) ∧ ~(𝑝 ∨ 𝑞))
≡ (𝑝 ∨ 𝑞) ∧ (𝑝 ∧ 𝑞) ∨ 𝐹
≡ (𝑝 ∧ (𝑝 ∧ 𝑞)) ∨ (𝑞 ∧ (𝑝 ∧ 𝑞))
≡ 𝑝∧𝑞 ∨ 𝑝∧𝑞
≡𝑝∧𝑞
𝑖𝑖𝑖 𝑝 ∧ ~ 𝑞 ∧ 𝑟 ∨ 𝑝 → 𝑞 ≡ (𝑝 ∧ (~𝑞 ∨ ~𝑟)) ∨ (~𝑝 ∨ 𝑞)
≡ 𝑝 ∧ ~𝑞 ∨ 𝑝 ∧ ~𝑟 ∨ ~𝑝 ∨ 𝑞
≡ (𝑝 ∧ ~𝑞) ∨ (𝑝 ∧ ~𝑟) ∨ (~𝑝 ∧ 𝒒 ∨ ~𝒒 ) ∨ (𝑞 ∧ (𝒑 ∨ ~𝒑))
≡ (𝑝 ∧ ~𝑞) ∨ (𝑝 ∧ ~𝑟) ∨ (~𝑝 ∧ 𝑞 ∨ ~𝑞 ) ∨ (𝑞 ∧ (𝑝 ∨ ~𝑝))
≡ 𝑝 ∧ ~𝑞 ∨ 𝑝 ∧ ~𝑟 ∨ ~𝒑 ∧ 𝒒 ∨ ~𝑝 ∧ ~𝑞 ∨ 𝑞 ∧ 𝑝 ∨ 𝒒 ∧ ~𝒑
≡ (𝑝 ∧ ~𝑞) ∨ (𝑝 ∧ ~𝑟) ∨ (~𝑝 ∧ 𝑞) ∨ (~𝑝 ∧ ~𝑞) ∨ (𝑞 ∧ 𝑝)
≡ ((𝑝 ∧ ~𝑞) ∧ (𝒓 ∨ ~𝒓)) ∨ ( 𝑝 ∧ ~𝑟 ∧ (𝒒 ∨ ~𝒒)) ∨ ( ~𝑝 ∧ 𝑞 ∧ 𝒓 ∨ ~𝒓 ) ∨ ( ~𝑝 ∧ ~𝑞 ∧ (𝒓 ∨ ~𝒓)) ∨
((𝑞 ∧ 𝑝) ∧ (𝒓 ∨ ~𝒓))
≡ (𝑝 ∧ ~𝑞 ∧ 𝑟) ∨ (𝑝 ∧ ~𝑞 ∧ ~𝑟) ∨ (𝑝 ∧ ~𝑟 ∧ 𝑞) ∨ (𝑝 ∧ ~𝑟 ∧ ~𝑞) ∨ (~𝑝 ∧ 𝑞 ∧ 𝑟) ∨ (~𝑝 ∧ 𝑞 ∧ ~𝑟) ∨
(~𝑝 ∧ ~𝑞 ∧ 𝑟) ∨ (~𝑝 ∧ ~𝑞 ∧ ~𝑟) ∨ (𝑞 ∧ 𝑝 ∧ 𝑟) ∨ (𝑞 ∧ 𝑝 ∧ ~𝑟)
≡ (𝑝 ∧ ~𝑞 ∧ 𝑟) ∨ (𝒑 ∧ ~𝒒 ∧ ~𝒓) ∨ (𝒑 ∧ 𝒒 ∧ ~𝒓) ∨ (𝒑 ∧ ~𝒒 ∧ ~𝒓) ∨ (~𝑝 ∧ 𝑞 ∧ 𝑟) ∨ (~𝑝 ∧ 𝑞 ∧ ~𝑟) ∨
(~𝑝 ∧ ~𝑞 ∧ 𝑟) ∨ (~𝑝 ∧ ~𝑞 ∧ ~𝑟) ∨ (𝑝 ∧ 𝑞 ∧ 𝑟) ∨ (𝒑 ∧ 𝒒 ∧ ~𝒓)
≡ (𝑝 ∧ ~𝑞 ∧ 𝑟) ∨ (𝑝 ∧ ~𝑞 ∧ ~𝑟) ∨ (𝑝 ∧ ~𝑞 ∧ ~𝑟) ∨ (~𝑝 ∧ 𝑞 ∧ 𝑟) ∨ (~𝑝 ∧ 𝑞 ∧ ~𝑟) ∨ (~𝑝 ∧ ~𝑞 ∧ 𝑟) ∨
(~𝑝 ∧ ~𝑞 ∧ ~𝑟) ∨ (𝑝 ∧ 𝑞 ∧ 𝑟)
𝑖𝑣 𝑞 ∨ 𝑝 ∧ 𝑟 ∧ ~( 𝑝 ∨ 𝑟 ∧ 𝑞)
≡ 𝑞∨ 𝑝∧𝑟 ∧ ~ 𝑝 ∨ 𝑟 ∨ ~𝑞
≡ 𝑞∨ 𝑝∧𝑟 ∧ ~𝑝 ∧ ~𝑟 ∨ ~𝑞
≡ (𝑞 ∧ ~𝑝 ∧ ~𝑟 ) ∨ ( 𝑝 ∧ 𝑟 ∧ (~𝑝 ∧ ~𝑟)) ∨ (𝑞 ∧ ~𝑞) ∨ ((𝑝 ∧ 𝑟) ∧ ~𝑞)
≡ ~𝑝 ∧ 𝑞 ∧ ~𝑟 ∨ 𝑝 ∧ ~𝑝 ∧ 𝑟 ∧ ~𝑟 ∨ 𝐹 ∨ 𝑝 ∧ ~𝑞 ∧ 𝑟
≡ ~𝑝 ∧ 𝑞 ∧ ~𝑟 ∨ 𝐹 ∨ 𝐹 ∨ 𝑝 ∧ ~𝑞 ∧ 𝑟
≡ ~𝑝 ∧ 𝑞 ∧ ~𝑟 ∨ 𝑝 ∧ ~𝑞 ∧ 𝑟
Without constructing the truth tables, find the principal conjunctive normal forms of the following statements:
𝑖 (𝑝 ∧ 𝑞) ∨ (~𝑝 ∧ 𝑞 ∧ 𝑟)
𝑖𝑖 𝑝 ∨ 𝑞 ∧ 𝑟 ∨ ~𝑝 ∧ 𝑞 ∨ ~𝑟
(𝑖𝑖𝑖)(𝑝 ∨ ~(𝑞 ∨ 𝑟)) ∨ (((𝑝 ∧ 𝑞) ∧ ~𝑟) ∧ 𝑝)
𝑖𝑣 𝑝 → 𝑞 ∧ 𝑟 ∧ ~𝑝 → ~𝑞 ∧ ~𝑟
Solution:
𝑖 𝑝 ∧ 𝑞 ∨ ~𝑝 ∧ 𝑞 ∧ 𝑟 ≡ 𝑝 ∧ 𝑞 ∨ ~𝑝 ∧ 𝑝∧𝑞 ∨𝑞 ∧ 𝑝∧𝑞 ∨𝑟
≡ 𝑝 ∨ ~𝑝 ∧ 𝑞 ∨ ~𝑝 ∧ 𝑝 ∨ 𝑞 ∧ 𝑞 ∨ 𝑞 ∧ 𝑝 ∨ 𝑟 ∧ 𝑞 ∨ 𝑟
≡ 𝑇 ∧ 𝑞 ∨ ~𝑝 ∧ 𝑝 ∨ 𝑞 ∧ 𝑞 ∧ 𝑝 ∨ 𝑟 ∧ 𝑞 ∨ 𝑟
≡ ~𝑝 ∨ 𝑞 ∨ 𝑟 ∧ ~𝑟 ∧ 𝑝 ∨ 𝑞 ∨ 𝑟 ∧ ~𝑟 ∧ 𝑞 ∨ 𝑝 ∧ ~𝑝 ∧ 𝑝 ∨ 𝑟 ∨ 𝑞 ∧ ~𝑞 ∧ 𝑞 ∨ 𝑟 ∨ 𝑝 ∧ ~𝑝
•Mathematical logic is often used for logical proofs. Proofs are valid arguments that determine
the truth values of mathematical statements.
•An argument is a sequence of statements.
•The last statement is the conclusion and all its preceding statements are called premises (or
hypothesis). The symbol “∴”, (read therefore) is placed before the conclusion.
•A valid argument is one where the conclusion follows from the truth values of the premises.
•Rules of Inference provide the templates or guidelines for constructing valid arguments from the
statements that we already have.
Rules of Inference
Rule in tautological form Name of the rule
𝑝 ∧ 𝑞 → 𝑝 (𝑝 ∧ 𝑞 ⇒ 𝑝) Simplification
𝑝 ∧ 𝑞 → 𝑞(𝑝 ∧ 𝑞 ⇒ 𝑞)
𝑝 → (𝑝 ∨ 𝑞) Addition
𝑞 → (𝑝 ∧ 𝑞)
𝑝 ∧ 𝑞 → 𝑝∧𝑞 Conjunction
𝑝∧ 𝑝→𝑞 →𝑞 Modus Ponens
~𝑞 ∧ 𝑝 → 𝑞 → ~𝑟 Modus tollens
𝑝→𝑞 ∧ 𝑞→𝑟 → 𝑝→𝑟 Hypothetical Syllogism
𝑝 ∨ 𝑞 ∧ ~𝑝 → 𝑞 Disjunctive Syllogism
𝑝 ∨ 𝑞 ∧ ~𝑝 ∨ 𝑟 → 𝑞∨𝑟 Resolution
𝑝∨𝑟 ∧ 𝑝→𝑟 ∧ 𝑞 →𝑟 →𝑟 Dilemma
Rules of Inference
Rule Tautology Name of the rule
𝑃→𝑞 ( 𝑝 → 𝑞) ∧ 𝑝 ⇒ 𝑞 Modus Ponens
𝑞 (Law of Detachment)
----------
∴𝑞
𝑃→𝑞 𝑝 → 𝑞 ∧ ~𝑞 ⇒ (~𝑝) Modus tollens
~𝑞
----------
∴ ~𝑝
𝑃→𝑞 𝑝 → 𝑞 ∧ 𝑞 → 𝑟 ⇒ (𝑝 → 𝑟) Hypothetical Syllogism
𝑞→𝑟 (Transititvity)
----------
∴𝑝→𝑟
𝑝∨𝑞 𝑝 ∨ 𝑞 ∧ ~𝑝 ⇒ 𝑞 Disjuntive Syllogism
~𝑝
---------
∴𝑞
Rules of Inference
Rule Tautology Name of the rule
𝑝 𝑝⇒𝑝∨𝑞 Addition
----------
∴𝑝∨𝑞
𝑝∧𝑞 𝑝 ∧ 𝑞 ⇒ (𝑝) Simplification
----------
∴𝑝
𝑝 𝑝 ∧ 𝑞 ⇒𝑝∧𝑞 Conjunction
𝑞
----------
∴𝑝∧𝑞
𝑝∨𝑞 𝑝 ∨ 𝑞 ∧ (~𝑝 ∨ 𝑟) ⇒ (𝑞 ∨ 𝑟) Resolution
~𝑝 ∨ 𝑟
---------
∴𝑞∨𝑟
Rules of Inference
Rule Tautology Name of the rule
(𝑝 → 𝑞) ∧ (𝑟 → 𝑠) (𝑝 → 𝑞) ∧ (𝑟 → 𝑠) ∧ Destructive Dilemma
~𝑞 ∨ ~𝑠 ~𝑞 ∨ ~𝑠 ⇒ ~𝑝 ∨ ~𝑟
--------------------------
∴ ~𝑝 ∨ ~𝑟
(𝑝 → 𝑞) ∧ (𝑟 → 𝑠) (𝑝 → 𝑞) ∧ (𝑟 → 𝑠) ∧ Constructive Dilemma
p∨𝑟 𝑝∨r ⇒q∨𝑠
--------------------------
∴𝑞∨𝑠
Examples:
Addition:
Let 𝑃 be the proposition, “He studies very hard” is true
Therefore – “Either he studies very hard or not he is a very bad student”. Here Q is the proposition “he is a very
bad student” P ∨ 𝑄
Conjunction:
Let 𝑃 – “He studies very hard”, 𝑄 – “He is the best boy in the class”
Therefore – “He studies very hard and he is the best boy in the class” 𝑃 ∧ 𝑄
Simplification:
“He studies very hard and he is the best boy in the class” 𝑃 ∧ 𝑄
Therefore – “He studies very hard” 𝑃
Modus Ponens:
“If you have a password, then you can log on to facebook” 𝑃 → 𝑄
“You have a password”, 𝑃
Therefore – “You can log on to facebook”
Modus Tollens:
“If you have a password, then you can log on to facebook”, 𝑃 → 𝑄
“You cannot log on to facebook” ~𝑄
Therefore – “You do not have password” ~𝑃
Disjunctive Syllogism:
“The ice cream is not vanilla flavored”, ~𝑃
“The ice cream is either vanilla flavored or chocolate flavored” 𝑃 ∨ 𝑄
Therfore – “The ice cream is chocolate flavored” 𝑄
Hypothetical Syllogism:
“If it rains, I shall not go to school” 𝑃 → 𝑄
“If I don’t go to school, I won’t need to do homework” 𝑄 → 𝑅
Therefore - “If it rains, I won’t need to do homework” 𝑃 → 𝑅
Constructive Dilemma:
“If it rains, I will take a leave” 𝑃 → 𝑄
“If it is hot outside, I will go for a shower” 𝑅 → 𝑆
“Either it will rain or it is hot outside” 𝑃 ∨ 𝑅
Therefore – “I will take a leave or I will go for a shower” 𝑄 ∨ 𝑆
Destructive Dilemma:
“If it rains, I will take a leave” 𝑃 → 𝑄
“If it is hot outside, I will go for a shower” 𝑅 → 𝑆
“Either it will not take a leave or I will not go for a shower” ~Q∨ ~𝑆
Therefore – “Either It does not rain or it is not hot outside” ~𝑃 ∨ ~𝑅
Form of Argument
• When a set of given statements constitute a valid argument, the argument form will be presented as in the following
example:
• “If it rains heavily, then traveling will be difficult”.
• “If students arrive on time, then travelling was not difficult”.
• “They arrived on time. Therefore, it did not rain heavily”
𝐻1 and 𝐻2 and hence 𝐻1 ∧ 𝐻2 are true in the third row, in which 𝐶 is false.
Hence 𝐶 does not follow from 𝐻1 and 𝐻2
(ii) 𝐻1 : 𝑝 ∨ 𝑞, 𝐻2 : 𝑝 → 𝑟, 𝐻3 : 𝑞 → 𝑟, 𝐶: 𝑟
𝑝 𝑞 𝑟 𝐻1 ≡ 𝑝 ∨ 𝑞 𝐻2 ≡ 𝑝 → 𝑟 𝐻3 ≡ 𝑞 → 𝑟 𝐻1 ∧ 𝐻2 ∧ 𝐻3
T T T T T T T
T T F T F F F
T F T T T T T
T F F T F T F
F T T T T T T
F T F T T F F
F F T F T T F
F F F F T T F
𝐻1 ∧ 𝐻2 ∧ 𝐻3 are true in first, third and fifth rows in which 𝑟 is also true
Hence 𝐶 follows from 𝐻1 , 𝐻2 and 𝐻3
2. Show that (𝑡 ∧ 𝑠) can be derived form the premises 𝑝 → 𝑞, 𝑞 → ~𝑟, 𝑟, 𝑝 ∨ (𝑡 ∧ 𝑠).
Solution:
Step No. Statement Reason
1. 𝑝→𝑞 Rule P
2. 𝑞 → ~𝑟 Rule P
3. 𝑝 → ~𝑟 𝑇, 1, 2 and Hypothetical Syllogism
4. 𝑟 → ~𝑝 T, 3 and Contrapositive (𝑝 → 𝑞 ≡ ~𝑞 → ~𝑝)
5. r Rule P
6. ~𝑝 𝑇, 4, 5 and Modus ponens
7. 𝑝 ∨ (𝑡 ∧ 𝑠) Rule P
8. 𝑡∧𝑠 𝑇, 6, 7 and Disjunctive Syllogism
3. Show that (𝑎 ∨ 𝑏) follows logically from the premises 𝑝 ∨ 𝑞 , 𝑝 ∨ 𝑞 → ~𝑟, ~𝑟 → (𝑠 ∧ ~𝑡)
and 𝑠 ∧ ~𝑡 → (𝑎 ∨ 𝑏).
Solution
Step No. Statement Reason
1. 𝑝 ∨ 𝑞 → ~𝑟 Rule P
2. ~𝑟 → (𝑠 ∧ ~𝑡) Rule P
3. 𝑝 ∨ 𝑞 → (𝑠 ∧ ~𝑡) T, 1, 2 and Hypothetical Syllogism
4. 𝑝∨𝑞 Rule P
5. 𝑠 ∧ ~𝑡 T, 3, 4 and Modus Ponen
6. 𝑆 ∧ ~𝑡 → (𝑎 ∨ 𝑏) Rule P
7. 𝑎∨𝑏 T, 5, 6 and Modus Ponen
4. Show that 𝑝 → 𝑞 ∧ 𝑟 → 𝑠 , 𝑞 → 𝑡 ∧ 𝑠 → 𝑢 , ~(𝑡 ∧ 𝑢) and 𝑝 → 𝑟 ⇒ ~𝑝.
Solution: Step No. Statement Reason
1. (𝑝 → 𝑞) ∧ (𝑟 → 𝑠) Rule P
2. 𝑝→𝑞 T, 1 and simplification
3. 𝑟→𝑠 T, 1 and simplification
4. (𝑞 → 𝑡) ∧ (𝑠 → 𝑢) Rule P
5. 𝑞→𝑡 T, 1 and simplification
6. 𝑠→𝑢 T, 1 and simplification
7. 𝑝→𝑡 T, 2, 5 and hypothetical syllogism
8. 𝑟→𝑢 T, 3, 6 and hypothetical syllogism
9. 𝑝→𝑟 Rule P
10 𝑝→𝑢 T, 9, 8 and Hypothetical syllogism
11. ~𝑡 → ~𝑝 T, 7 and contrapositive
12. ~𝑢 → ~𝑝 T, 10and contrapositive
13. ~𝑡 ∨ ~𝑢 → ~𝑝 T, 11, 12 and 𝑎 → 𝑏 , 𝑐 → 𝑏 ⇒ 𝑎 ∨ 𝑏 → 𝑏
14. ~ 𝑡 ∧ 𝑢 → ~𝑝 T, 13 and De Morgan’s Las
15. ~(𝑡 ∧ 𝑢) Rule P
16. ~𝑝 T, 14, 15 and Modus Ponens
Homework
5. Show that 𝑎 → 𝑏 ∧ 𝑎 → 𝑐 , ~ 𝑏 ∧ 𝑐 , 𝑑 ∨ 𝑎 ⇒ 𝑑
6. Give a direct proof for the implication 𝑝 → 𝑞 → 𝑠 , ~𝑟 ∨ 𝑝 , 𝑞 ⇒ (𝑟 → 𝑠)
Solution
Step No. Statement Reason
1. (~𝑟 ∨ 𝑝) Rule P
2. 𝑟→𝑝 T, 1 and equivalence of (1)
3. 𝑝 → (𝑞 → 𝑠) Rule P
4. 𝑟 → (𝑞 → 𝑠) T, 2, 3 and hypothetical syllogism
5. ~𝑟 ∨ (~𝑞 ∨ 𝑠) T, 4 and equivalence of (4)
6. 𝑞 Rule P
7. 𝑞 ∧ (~𝑟 ∨ ~𝑞 ∨ 𝑠) T, 5, 6 and Conjunction
8. 𝑞 ∧ (~𝑟 ∨ 𝑠) T, 7, 8 and negation and domination laws
9. ~𝑟 ∨ 𝑠 T, 8 and simplification
10. 𝑟→𝑠 T, 9 and equivalence of (9)
7. Derive 𝑝 → (𝑞 → 𝑠) using the CP-rule (if necessary) form the premises 𝑝 → (𝑞 → 𝑟) and
𝑞 → (𝑟 → 𝑠)
Solution:
We shall assume 𝑝 as an additional premise. Using 𝑝 and the two given premises, we will derive
(𝑞 → 𝑠). Then, by CP-rule, 𝑝 → (𝑞 → 𝑠) is deemed to have been derived from the two given
premises.
Step No. Statement Reason
1. 𝑝 P (additional)
2. 𝑝 → (𝑞 → 𝑟) P
3. 𝑞→𝑟 T, 1, 2 and Modus Ponens
4. ~𝑞 ∨ 𝑟 T, 3 and equivalence of (3)
5. 𝑞 → (𝑟 → 𝑠) P
6. ~𝑞 ∨ (𝑟 → 𝑆) T, 5 and equivalence of (5)
7. ~𝑞 ∨ (𝑟 ∧ (𝑟 → 𝑆)) T, 4, 6 and distributive law
8. ~𝑞 ∨ 𝑠 T, 7 and modus ponens
9. 𝑞→s T, 8 and equivalence of (8)
10. 𝑝 → (𝑞 → 𝑠) T, 9 and CP-rule
8. Use the indirect method to show that 𝑟 → ~𝑞, 𝑟 ∨ 𝑠, 𝑠 → ~𝑞, 𝑝 → 𝑞 ⇒ ~p
Solution:
To use indirect method, we will include ~ ~𝑝 ≡ 𝑝 as an additional premise and prove a
contradiction.
∀𝑥 𝐻 𝑥 →𝑀 𝑥 ∧𝐻 𝑠 ⇒𝑀 𝑠
The derivation of the proof is as follows:
Step No. Statement Reason
1 ∀𝑥 (𝐻 𝑥 → 𝑀(𝑥)) 𝑃
2 𝐻 𝑆 → 𝑀(𝑆) 𝑈𝑆 , 2
3 𝐻(𝑆) P
4 𝑀(𝑆) T, 2, 3, Modus Ponen
15. Express each of the following statements using mathematical and logical operations,
predicates and quantifiers, where the universe of discourse consists of all computer science
students/ mathematics courses.
(a) Every computer science students need a course in mathematics
(b) There is a student in this class who owns a personal computer
(c) Every student in this class has taken at least one mathematics course
(d) There is a student in this class who has taken at least one mathematics course
Solution:
(a) Let 𝑀(𝑥) ≡ ′𝑥 needs a course in mathematics’, where the universe of discourse consists of all
computer science students. Then ∀𝑥 𝑀(𝑥)
(b) Let 𝑃 𝑥 ≡′ 𝑥 owns a personal computer’, where the universe consists of all students in this
class, then ∃𝑥 𝑃(𝑥)
(c) Let 𝑄 𝑥, 𝑦 ≡ ′𝑥 has taken 𝑦 ′ , where the universe of 𝑥 consists of all students in this class
and that of 𝑦 consists of all mathematics courses. Then ∀𝑥 ∃𝑦 𝑄 𝑥, 𝑦
(d) Using the same assumptions as in (c), we have ∃𝑥 ∃𝑦 𝑄 𝑥, 𝑦
16. Show that the premises “one student in the class knows how to write programs in JAVA” and
“Everyone who knows how to write programs in JAVA can get a high-paying job” imply the
conclusion “someone in this class can get a high-paying job”.
Solution:
Let 𝐶(𝑥) represent “x is in this class”
𝐽(𝑥) represent “x knowns JAVA Programming”
𝐻(𝑥) represent “x can get a high paying job”
Then the given premises are ∃𝑥 (𝐶(𝑥) ∧ 𝐽(𝑥)) and ∀𝑥 (𝐽 𝑥 → (𝐻(𝑥))). The conclusion is
∃𝑥 𝐶 𝑥 ∧ 𝐻 𝑥
Step No. Statement Reason
1. ∃𝑥 (𝐶(𝑥) ∧ 𝐽(𝑥)) P
2. C(𝑎) ∧ 𝐽 𝑎 ES and 1
3. 𝐶(𝑎) T, 2 and simplification
4. 𝐽(𝑎) T, 2 and simplification
5. ∀𝑥 (𝐽 𝑥 → (𝐻(𝑥))) P
6. 𝐽 𝑎 → 𝐻(𝑎) US and 5
7. 𝐻(𝑎) T, 4 and 6, Modus ponens
8. 𝐶(𝑎) ∧ 𝐻(𝑎) T, 3, 7 and Conjunction
9. ∃𝑥 (𝐶(𝑥) ∧ 𝐻(𝑥)) EG and 8
17. Express the negations of the following statements using quantifiers and English:
(a) If the teacher is absent, then some students do not keep quiet.
(b) All the students keep quiet and the teacher is present
(c) Some of the students do not keep quiet or the teacher is absent
(d) No one has done every problem in the exercise.
Solution:
(a) Let T represent the presence of the teacher and Q(x) represent “x” keeps quiet
Then the given statement ~𝑇 → ∃𝑥 ~𝑄 𝑥 ≡ ~𝑇 → ~∀𝑥 𝑄 𝑥 ≡ 𝑇 ∨ ~∀𝑥 𝑄 𝑥
Negation: ~ 𝑇 ∨ ~∀𝑥 𝑄 𝑥 ≡ ~𝑇 ∧ ∀𝑥 𝑄 𝑥
i.e The teacher is absent and all the students keep quiet.
(b) All the students keep quiet and the teacher is present
∀𝑥 𝑄 𝑥 ∧ 𝑇
The negation is ~ ∀𝑥 𝑄 𝑥 ∧ 𝑇 ≡ ∃𝑥 ~𝑄 𝑥 ∨ ~𝑇
i.e. some of the students do not keep quiet or teacher is absent
(c) Some of the students do not keep quiet or teacher is absent: ∃𝑥 ~𝑄 𝑥 ∨ ~𝑇
Negation :∀𝑥 𝑄 𝑥 ∧ 𝑇 => All the students keep quiet and the teacher is present
(d) No one has done every problem in the exercise.
Let 𝐷(𝑥, 𝑦) represent 𝑥 has done problem 𝑦
The given statement is ~∃𝑥 ∀𝑦 𝐷 𝑥, 𝑦
Negation: ~( ~∃𝑥 ∀𝑦 𝐷 𝑥, 𝑦 ) ≡ ∃𝑥 ∀y D(x, y)
Some one has done every problem in the exercise
Tutorial Problems
1. Prove that 𝐻1 : ~𝑞, 𝐻2 : 𝑝 → 𝑞, 𝐶: ~𝑝
2. Prove that 𝑝 ∨ 𝑞, 𝑝 → 𝑟, 𝑞 → 𝑠 ⇒ 𝑠 ∨ 𝑟 using direct method
3. Prove that 𝑝 → 𝑞, 𝑞 → 𝑟, ~ 𝑝 ∧ 𝑟 , 𝑝 ∨ 𝑟 ⇒ 𝑟 using indirect method
4. Prove the following by using the CP rule 𝑝 ∨ 𝑞 → 𝑟 ⇒ 𝑝 ∧ 𝑞 → 𝑟
5. Prove that ∀𝑥 𝑃 𝑥 → 𝑄 𝑦 ∧ 𝑅 𝑥 , ∃𝑥 𝑃 𝑥 ⇒ 𝑄(𝑦) ∧ ∃𝑥(𝑃(𝑥) ∧ 𝑅(𝑥))
6. Prove the implication ∀𝑥 𝑃 𝑥 → 𝑄 𝑥 , ∀𝑥 𝑅 𝑥 → ~𝑄 𝑥 ⇒ ∀𝑥 𝑅 𝑥 → ~𝑃 𝑥
7. Show that ∀𝑥 𝑃 𝑥 ∨ 𝑄 𝑥 ⇒ ∀𝑥 𝑃 𝑥 ∨ ∃𝑥 𝑄(𝑥) using the indirect method.
8. If A(x): x is animal, B(x): x is black and C(x): x is a cat, translate the following in words:
(a) ∀𝑥 [𝑐 𝑥 → 𝐴(𝑥)] (b) ∃𝑥 𝑐 𝑥 ∧ 𝐵 𝑥