Learning objectives
- Test an argument for validity using a truth table or a derivation.
- Model a puzzle in symbolic logic and solve it by case analysis.
- Use logic to reason about consistency of software requirements.
- Choose between table, laws and rules for a given problem.
Roman Urdu. Is lecture mein hum puzzles aur software requirements ko logic ke symbols mein likh kar hal karte hain. Argument ki validity truth table se, ya rules of inference se, ya cases bana kar check ki jati hai.
Core concepts
Three ways to decide validity
| Method | When it is best | Cost |
|---|---|---|
| Truth table | Few variables | 2ⁿ rows |
| Rules of inference | Many premises with clear structure | One short derivation |
| Case analysis | Puzzles with a few possibilities | Number of cases |
Consistency. A set of statements is consistent if some assignment of truth values makes all of them true.
Worked examples
Example 1 (basic). Is this valid? "If I am late, I miss the bus. I missed the bus. So I was late." That is affirming the conclusion, so it is invalid. Counterexample: I was on time but the bus broke down.
Example 2 (intermediate). Consistency of requirements. R1: if the system is overloaded then requests are queued. R2: requests are not queued. R3: the system is overloaded. From R1 and R3, requests are queued, which contradicts R2. The set is inconsistent, so the specification must be revised.
Example 3 (advanced). Knights and knaves. Knights always tell the truth and knaves always lie. A says "B is a knave." B says "A and I are the same type." Who is who? Let a = "A is a knight" and b = "B is a knight". A's statement is ¬b, and A is truthful exactly when it is true: a ↔ ¬b. B's statement is a ↔ b, so b ↔ (a ↔ b). - Case b = T: then a ↔ b must be true, so a = T. But a ↔ ¬b = T ↔ F = F. Contradiction. - Case b = F: then b ↔ (a ↔ b) needs (a ↔ F) to be false, so a = T. Check a ↔ ¬b = T ↔ T = T. Consistent.
Answer: A is a knight and B is a knave. Check: A truthfully says B is a knave. B, a knave, falsely says they are the same type. Both statements agree with their types.
Example 4 (computing). To predict whether if (x > 0 && y > 0) executes for (x, y) = (3, −1), evaluate each part: T ∧ F = F. The branch is skipped. Writing the condition as a predicate and evaluating it on test cases is exactly logical reasoning about program behaviour.
Computer science connection
Requirement consistency checking; test-case generation from Boolean conditions; constraint solving in AI planning and scheduling; model checking for protocols.
Key takeaways
- A valid form can still have a false conclusion if a premise is false.
- Inconsistent requirements cannot all be implemented.
- Puzzles reduce to case analysis once statements are symbolised.
Roman Urdu. Puzzle ko pehle symbols mein likhein, phir cases (b = T aur b = F) alag alag check karein. Agar ek case contradiction de to woh case khatam. Inconsistent requirements ko ek saath poora nahi kiya ja sakta.
Five revision questions
- Why can a valid argument have a false conclusion?
- Decide validity: p → q, q → r, ¬r ⊢ ¬p.
- A says "I am a knave." Is A a knight or a knave? Explain.
- Give a set of three consistent requirements for a login page.
- When is a truth table a poor choice for checking validity?
Homework. Create two knights-and-knaves puzzles and solve them with the method above. Write a short note on how you would test a three-condition if for every combination.
Quiz
Valid argument ka matlab?
Validity form ki baat hai: sach premises se sach conclusion.
All lectures
- Lecture 0: Discrete vs Continuous
- Lecture 1: Propositions and Connectives
- Lecture 2: Truth Tables, Tautologies and Contradictions
- Lecture 3: Logical Equivalence and the Laws of Logic
- Lecture 4: Predicate Logic and Quantifiers
- Lecture 5: Rules of Inference
- Lecture 6: Logical Arguments and Puzzle Solving
- Lecture 7: Direct Proof and Proof by Implication
- Lecture 8: Proof by Contraposition
- Lecture 9: Proof by Contradiction
- Lecture 10: Mathematical Induction
- Lecture 11: Strong Induction
- Lecture 12: Applications of Proofs and Proof Strategy
START WELL TO END WELL