Free unit-wise study notes on propositional and predicate logic for Discrete Structures and Theory of Logic, Semester 3 of B.Tech — Computer Science & Engineering — key concepts, examples, important questions and a revision checklist for semester exams.
A deep dive into Propositional Logic, Truth Tables, Tautologies, Normal Forms (DNF/CNF), Predicate Logic, and Rules of Inference. The foundation of artificial intelligence and formal verification.
Notebook — 14 pages
Page 1
Wink Notes
B.Tech CSE — 3rd Semester
Discrete Structures and Theory of Logic
— Unit - 2 —
1. Introduction to Propositional Logic
Logic is the study of formal reasoning based on statements. The fundamental building block is a Proposition.
⇒1.1 What is a Proposition?
A proposition (or statement) is a declarative sentence that is either True (T) or False (F), but not both.
Valid Propositions: "Delhi is the capital of India" (True). "2+2=5" (False).
Invalid Propositions: "What time is it?" (Question). "Close the door!" (Command). "x+5=10" (Variables make it a predicate, not a proposition, until x is defined).
⇒1.2 Compound Propositions
Simple propositions can be combined using logical connectives to form compound propositions.
Page 2
Wink Notes
B.Tech CSE — 3rd Semester
Discrete Structures and Theory of Logic
— Unit - 2 —
2. Logical Connectives & Truth Tables
Logical connectives dictate how the truth value of a compound proposition is derived from its constituent propositions.
⇒2.1 Basic Connectives
Negation (¬P or ∼P): "NOT". Reverses the truth value. If P is True, ¬P is False.
Conjunction (P∧Q): "AND". True only if both P and Q are True.
Disjunction (P∨Q): "OR". True if at least one of P or Q is True.
Exclusive OR (P⊕Q): "XOR". True if exactly one of P or Q is True, but not both.
⇒2.2 Conditional Connectives
Implication (P→Q): "If P, then Q". P is the hypothesis/antecedent, Q is the conclusion/consequent. This is False only when P is True and Q is False. In all other cases, it is True.
Biconditional (P↔Q): "P if and only if Q" (iff). True when P and Q have the exact same truth value.
Page 3
Wink Notes
B.Tech CSE — 3rd Semester
Discrete Structures and Theory of Logic
— Unit - 2 —
3. Variations of Implication
Given a standard conditional statement P→Q, there are three related conditional statements.
Converse:Q→P
Inverse:¬P→¬Q
Contrapositive:¬Q→¬P
⇒3.1 Logical Equivalence of Contrapositive
A very important rule in mathematical proofs is that a statement is logically equivalent to its contrapositive.
(P→Q)≡(¬Q→¬P)
However, a statement is not logically equivalent to its converse or inverse. (Though the converse and inverse are equivalent to each other).
Page 4
Wink Notes
B.Tech CSE — 3rd Semester
Discrete Structures and Theory of Logic
— Unit - 2 —
4. Tautology and Contradiction
We classify compound propositions based on their final truth tables.
Tautology: A compound proposition that is always True, regardless of the truth values of its constituent variables. Example: P∨¬P.
Contradiction (Fallacy): A compound proposition that is always False. Example: P∧¬P.
Contingency: A proposition that is neither a tautology nor a contradiction (it can be True or False depending on the variables).
⇒4.1 Satisfiability
A proposition is satisfiable if there is at least one assignment of truth values to its variables that makes it True. (Therefore, tautologies and contingencies are satisfiable, but contradictions are not).
Page 5
Wink Notes
B.Tech CSE — 3rd Semester
Discrete Structures and Theory of Logic
— Unit - 2 —
5. Logical Equivalence
Two propositions A and B are logically equivalent (denoted A≡B) if they have identical truth tables.
Alternatively, A≡B if and only if the biconditional A↔B is a tautology.
⇒5.1 Key Logical Equivalences (Laws of Logic)
These are identical to the laws of Set Theory:
De Morgan's Laws:¬(P∧Q)≡¬P∨¬Q and ¬(P∨Q)≡¬P∧¬Q
Implication Equivalence:P→Q≡¬P∨Q (This is heavily used to convert implications into standard AND/OR logic).
Biconditional Equivalence:P↔Q≡(P→Q)∧(Q→P)
Distributive Laws:P∨(Q∧R)≡(P∨Q)∧(P∨R)
Page 6
Wink Notes
B.Tech CSE — 3rd Semester
Discrete Structures and Theory of Logic
— Unit - 2 —
6. Normal Forms
A proposition can be rewritten into standardized formats known as Normal Forms using logical equivalences. This is crucial for automated theorem proving.
⇒6.1 Disjunctive Normal Form (DNF)
A formula is in DNF if it is a sum of products (OR of ANDs). It consists of disjunctions of conjunctions.
Example: (P∧Q)∨(¬P∧R)∨(Q∧¬R)
A Principal DNF (PDNF) (or Sum of Minterms) is a DNF where every conjunction contains all variables exactly once (either negated or unnegated).
⇒6.2 Conjunctive Normal Form (CNF)
A formula is in CNF if it is a product of sums (AND of ORs). It consists of conjunctions of disjunctions.
Example: (P∨Q)∧(¬P∨R)∧(Q∨¬R)
A Principal CNF (PCNF) (or Product of Maxterms) is a CNF where every disjunction contains all variables exactly once.
Page 7
Wink Notes
B.Tech CSE — 3rd Semester
Discrete Structures and Theory of Logic
— Unit - 2 —
7. Rules of Inference
Rules of inference are templates for creating valid mathematical arguments. A valid argument ensures that if the premises are True, the conclusion must absolutely be True.
⇒7.1 Modus Ponens (Law of Detachment)
Premise 1: P→Q Premise 2: P Conclusion: ∴Q
⇒7.2 Modus Tollens
Premise 1: P→Q Premise 2: ¬Q Conclusion: ∴¬P
⇒7.3 Hypothetical Syllogism
Premise 1: P→Q Premise 2: Q→R Conclusion: ∴P→R
⇒7.4 Disjunctive Syllogism
Premise 1: P∨Q Premise 2: ¬P Conclusion: ∴Q
Page 8
Wink Notes
B.Tech CSE — 3rd Semester
Discrete Structures and Theory of Logic
— Unit - 2 —
8. Predicate Logic
Propositional logic cannot handle statements with variables, such as "x>3". This is where Predicate Logic (or First-Order Logic) comes in.
⇒8.1 Predicates
A predicate is a statement containing one or more variables, which becomes a proposition when values are substituted for the variables.
Let P(x) denote "x>3". P(4) is True (proposition). P(2) is False (proposition).
⇒8.2 Universe of Discourse (Domain)
The set of all possible values that can be substituted for the variables in a predicate. If P(x) is "x is a student", the domain might be "all people in the university".
Page 9
Wink Notes
B.Tech CSE — 3rd Semester
Discrete Structures and Theory of Logic
— Unit - 2 —
9. Quantifiers
Quantifiers are used to express the extent to which a predicate is true over a domain.
⇒9.1 Universal Quantifier (∀)
Read as "For all" or "For every".
∀xP(x) means P(x) is true for everyx in the domain.
⇒9.2 Existential Quantifier (∃)
Read as "There exists" or "For some".
∃xP(x) means there is at least onex in the domain for which P(x) is true.
⇒9.3 Bound vs Free Variables
A variable is bound if a quantifier is attached to it. A variable is free if it is not bound. In ∀xP(x,y), x is bound, but y is free.
Page 10
Wink Notes
B.Tech CSE — 3rd Semester
Discrete Structures and Theory of Logic
— Unit - 2 —
10. Negation of Quantifiers (De Morgan's for Predicates)
When we negate a quantified statement, the quantifier flips and the negation moves inside to the predicate.
⇒10.1 Negating Universal
¬(∀xP(x))≡∃x¬P(x)
"It is not true that everyone is happy"≡"There exists someone who is not happy."
⇒10.2 Negating Existential
¬(∃xP(x))≡∀x¬P(x)
"It is not true that there exists a flying pig"≡"All pigs do not fly."
Page 11
Wink Notes
B.Tech CSE — 3rd Semester
Discrete Structures and Theory of Logic
— Unit - 2 —
11. Nested Quantifiers
Complex statements require multiple quantifiers. The order in which they appear drastically changes the meaning of the statement.
⇒11.1 Same Quantifiers
The order does not matter if the quantifiers are the same.
∀x∀yP(x,y)≡∀y∀xP(x,y)
⇒11.2 Mixed Quantifiers (Order Matters!)
∀x∃yP(x,y) is NOT equivalent to ∃y∀xP(x,y).
Let L(x,y) be "x loves y".
∀x∃yL(x,y): "For every person x, there is someone y that they love." (Everyone loves somebody).
∃y∀xL(x,y): "There is someone y who is loved by every person x." (There is one specific person whom everyone loves).
Page 12
Wink Notes
B.Tech CSE — 3rd Semester
Discrete Structures and Theory of Logic
— Unit - 2 —
12. Inference with Quantifiers
To apply rules of inference (like Modus Ponens) to quantified statements, we must first remove the quantifiers using Instantiation, apply the rules on specific elements, and then re-apply quantifiers using Generalization.
⇒12.1 Four Rules of Instantiation/Generalization
Universal Instantiation: If ∀xP(x) is true, then P(c) is true for any arbitrary element c in the domain.
Universal Generalization: If P(c) is proven true for an arbitrary element c, then we can conclude ∀xP(x).
Existential Instantiation: If ∃xP(x) is true, there is some specific element c for which P(c) is true. (You cannot assume c is arbitrary).
Existential Generalization: If P(c) is true for a specific element c, then we can conclude ∃xP(x).
Page 13
Wink Notes
B.Tech CSE — 3rd Semester
Discrete Structures and Theory of Logic
— Unit - 2 —
13. Mathematical Induction
A powerful proof technique used to prove that a proposition P(n) is true for all positive integers n.
⇒13.1 Principle of Mathematical Induction
Step 1 (Base Case): Prove that P(1) is true.
Step 2 (Inductive Hypothesis): Assume that P(k) is true for some arbitrary positive integer k.
Step 3 (Inductive Step): Using the assumption from Step 2, prove that P(k+1) is true.
If all three steps are successful, then by the principle of mathematical induction, P(n) is true for all n≥1.
⇒13.2 Strong Induction
A variant where the inductive hypothesis assumes that P(1),P(2),…,P(k) are all true, and uses this stronger assumption to prove P(k+1).
Page 14
Wink Notes
B.Tech CSE — 3rd Semester
Discrete Structures and Theory of Logic
— Unit - 2 —
14. Summary & Review Checklist
Logic is the grammar of computer science.
⇒14.1 University Exam Checklist
Construct a truth table to prove that two compound propositions are logically equivalent.
Convert a given proposition into Principal Disjunctive Normal Form (PDNF) and Principal Conjunctive Normal Form (PCNF).
Translate English sentences into Predicate Logic using quantifiers.
Write the negation of a nested quantified statement (e.g., ¬(∀x∃yP(x,y))).
Test the validity of an argument using rules of inference (Modus Ponens, Modus Tollens).
Prove a formula (like the sum of the first n numbers) using Mathematical Induction.
⇒14.2 Application Focus
How does Propositional Logic directly map to Digital Logic gates (AND/OR/NOT)?
How is Predicate Logic used in Artificial Intelligence (specifically in rule-based expert systems and Prolog)?
How does the concept of Satisfiability relate to the famous boolean SAT problem in algorithm complexity?