START WELL TO END WELL
+92 340 1501700 startwelleducationbhimber@gmail.com Mon – Sat: 8:00 AM – 2:00 PM
Startwell Education logo
StartwellEducation
Discrete Structures · Lecture 5

Rules of Inference

Week 2, slot 2 · CLO-2, CLO-3 · Bloom C3 · Prerequisite: Lectures 1–4 · Reference: Rosen 7th, Logic and Proofs

Learning objectives

  1. Define a valid argument and an argument form.
  2. Recognise and apply the standard rules of inference.
  3. Build a numbered derivation from premises to conclusion.
  4. Spot the fallacies of affirming the conclusion and denying the hypothesis.

Roman Urdu. Rules of inference woh qaide hain jin se hum sahih premises se nayi sahih baat nikalte hain. Is lecture mein hum modus ponens, modus tollens, hypothetical syllogism jaise qaide seekhte hain aur step-by-step derivation likhna seekhte hain. Hum un ghalat tareeqon (fallacies) ko bhi pehchanna seekhte hain jo dekhne mein sahih lagte hain.

Core concepts

Definition. An argument is a list of premises p₁, …, pₙ and a conclusion c. It is valid if whenever all premises are true, c is true. Equivalently, (p₁ ∧ … ∧ pₙ) → c is a tautology. Valid means the form is correct. It does not mean the premises are true.

Standard rules

Rule Premises Conclusion
Modus ponens p, p → q q
Modus tollens ¬q, p → q ¬p
Hypothetical syllogism p → q, q → r p → r
Disjunctive syllogism p ∨ q, ¬p q
Addition p p ∨ q
Simplification p ∧ q p
Conjunction p, q p ∧ q
Resolution p ∨ q, ¬p ∨ r q ∨ r

For quantifiers, four more rules are used: universal instantiation (from ∀x P(x) infer P(c)), universal generalisation, existential instantiation and existential generalisation (from P(c) infer ∃x P(x)).

Fallacies

Fallacy Form Why invalid
Affirming the conclusion q, p → q ⊢ p p = F, q = T makes both premises true and the conclusion false
Denying the hypothesis ¬p, p → q ⊢ ¬q p = F, q = T makes both premises true and the conclusion false

Worked examples

Example 1 (basic). Name the rule. "If it rains, the match is cancelled. The match was not cancelled. Therefore it did not rain." With p = rain, q = cancelled: premises p → q and ¬q, conclusion ¬p. This is modus tollens.

Example 2 (intermediate). Chain of implications. Premises: "If I study, I pass" and "If I pass, I get a scholarship." Conclusion: "If I study, I get a scholarship." Rule: hypothetical syllogism.

Example 3 (advanced). Derive t from ¬p ∧ q, r → p, ¬r → s, s → t.

Step Statement Reason
1 ¬p ∧ q premise
2 ¬p simplification, 1
3 r → p premise
4 ¬r modus tollens, 2, 3
5 ¬r → s premise
6 s modus ponens, 4, 5
7 s → t premise
8 t modus ponens, 6, 7

Why it works: every line is either a premise or follows from earlier lines by a rule that preserves truth.

Example 4 (computing). Specification: "If the server is in maintenance mode then logins are disabled." Observation: logins are enabled. By modus tollens the server is not in maintenance mode. The wrong inference "the server is not in maintenance mode, so logins are enabled" is denying the hypothesis.

Computer science connection

Resolution is the engine of Prolog and of many SAT solvers; automated theorem provers and program verifiers chain these rules; rule-based AI systems apply modus ponens repeatedly (forward chaining).

Key takeaways

  • Valid argument: premises true forces conclusion true.
  • Modus ponens and modus tollens are valid; affirming the conclusion and denying the hypothesis are not.
  • A derivation is a numbered list with a reason for every line.

Roman Urdu. Modus ponens: p aur p → q se q. Modus tollens: ¬q aur p → q se ¬p. "q sahih hai is liye p sahih hai" ghalat hai (affirming the conclusion). Derivation mein har line ki wajah likhna zaroori hai.

Five revision questions

  1. Define a valid argument using a tautology.
  2. Name the rule: "Either the file is corrupt or the disk is full. The file is not corrupt. So the disk is full."
  3. Show by a counterexample row that denying the hypothesis is invalid.
  4. Which rule gives p ∨ q from p?
  5. From p → q and ¬q ∨ r, derive p → r.

Homework. Write three derivations of your own with at least five steps each, and one invalid argument with the counterexample row.

Quiz

p → q aur p diye hon to nateeja?

All lectures

  1. Lecture 0: Discrete vs Continuous
  2. Lecture 1: Propositions and Connectives
  3. Lecture 2: Truth Tables, Tautologies and Contradictions
  4. Lecture 3: Logical Equivalence and the Laws of Logic
  5. Lecture 4: Predicate Logic and Quantifiers
  6. Lecture 5: Rules of Inference
  7. Lecture 6: Logical Arguments and Puzzle Solving
  8. Lecture 7: Direct Proof and Proof by Implication
  9. Lecture 8: Proof by Contraposition
  10. Lecture 9: Proof by Contradiction
  11. Lecture 10: Mathematical Induction
  12. Lecture 11: Strong Induction
  13. Lecture 12: Applications of Proofs and Proof Strategy
Admissions Open

Give your child the right start.

Seats are limited. Visit our campus, meet our teachers and see why families trust Startwell Education.