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 4

Predicate Logic and Quantifiers

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

Learning objectives

  1. Define a predicate and its domain.
  2. Use ∀ and ∃ to form quantified statements and decide their truth.
  3. Negate quantified statements correctly.
  4. Explain why the order of nested quantifiers matters.

Roman Urdu. Predicate aisa jumla hai jis mein variable ho, jaise P(x) = "x > 3". Jab hum x ko quantifier ∀ (har) ya ∃ (kam az kam ek) se bandhte hain to proposition ban jata hai. Is lecture mein hum in ki sachai parakhna aur negation karna seekhte hain.

Core concepts

Definition (Predicate). A statement P(x) containing a variable x that becomes a proposition when x is given a value from a domain (universe of discourse).

Quantifiers

Statement Meaning True when False when
∀x P(x) P holds for every x in the domain P(x) is true for all x one counterexample exists
∃x P(x) P holds for at least one x one witness exists P(x) is false for all x

Negation laws. ¬∀x P(x) ≡ ∃x ¬P(x) and ¬∃x P(x) ≡ ∀x ¬P(x). These are De Morgan's laws extended to quantifiers.

Nested quantifiers. ∀x∃y and ∃y∀x are different. Take P(x, y): x + y = 0 over ℤ. Then ∀x∃y (x + y = 0) is true (take y = −x), but ∃y∀x (x + y = 0) is false (no single y works for every x).

Common misconceptions - Translate "every student passed" as ∀x (S(x) → P(x)), not ∀x (S(x) ∧ P(x)). The second says everyone in the domain is a student who passed. - Translate "some student passed" as ∃x (S(x) ∧ P(x)), not ∃x (S(x) → P(x)), which is true whenever any non-student exists. - The truth of a quantified statement depends on the domain.

Worked examples

Example 1 (basic). Domain ℤ. Decide ∀x (x² ≥ 0) and ∃x (x² = 2). The first is true, since a square of an integer is never negative. The second is false: the only candidates are ±√2, which are not integers. Over the real numbers the second would be true, so the domain matters.

Example 2 (intermediate). Negate "Every program in the folder compiles." With P(x) = "x compiles": ∀x P(x). Negation: ∃x ¬P(x), i.e. "Some program in the folder does not compile." To refute a ∀ statement, one counterexample is enough.

Example 3 (advanced). Translate and negate: "Every student has a friend who is a student." Let S(x) mean x is a student, F(x, y) mean x and y are friends. Statement: ∀x [S(x) → ∃y (F(x, y) ∧ S(y))]. Negation steps: ¬∀x[…] ≡ ∃x ¬[S(x) → ∃y(…)] ≡ ∃x [S(x) ∧ ¬∃y(F(x, y) ∧ S(y))] ≡ ∃x [S(x) ∧ ∀y (¬F(x, y) ∨ ¬S(y))]. In words: some student has no friend who is a student.

Example 4 (computing). A SQL query SELECT * FROM T WHERE EXISTS (...) expresses ∃. A check "all array elements are positive" is ∀ and stops at the first counterexample, just like a loop with an early break.

Computer science connection

Database queries (EXISTS, NOT EXISTS, relational calculus); program assertions and preconditions; formal specification languages; AI knowledge representation in first-order logic.

Key takeaways

  • One counterexample disproves ∀; one witness proves ∃.
  • ¬∀ ≡ ∃¬ and ¬∃ ≡ ∀¬.
  • ∀ pairs with →; ∃ pairs with ∧. Order of nested quantifiers matters.

Roman Urdu. ∀ ko ghalat sabit karne ke liye sirf ek counterexample kafi hai, ∃ ko sahih sabit karne ke liye sirf ek misaal. ¬∀x P(x) = ∃x ¬P(x). ∀ ke saath aam taur par → aata hai aur ∃ ke saath ∧.

Five revision questions

  1. Over ℤ, give the truth value of ∃x (x² = x) and name a witness.
  2. Negate "There is a prime number that is even and greater than 2."
  3. Translate "No student failed" using S(x) and F(x).
  4. Give a domain in which ∀x ∃y (y > x) is true and one in which it is false.
  5. Why is ∃x (S(x) → P(x)) a poor translation of "some student passed"?

Homework. Write five quantified statements about a university database, state their truth in a small sample table of your own, and write the negation of each.

Quiz

¬∀x P(x) kis ke barabar hai?

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.