Courses / Computer Science I
Discrete Mathematics

Predicate Logic and Quantifiers

Computer Science I 286 words Free to read

Statements About Everything and Something

Propositional logic cannot express "every integer has a successor" — it has no way to talk about all or some objects. Predicate logic adds predicates — statements P(x)P(x) with a variable, true or false depending on xx — and quantifiers that range over a domain.

The two quantifiers:

The order of mixed quantifiers matters enormously. xyP(x,y)\forall x\, \exists y\, P(x,y) ("every xx has some yy") is generally different from yxP(x,y)\exists y\, \forall x\, P(x,y) ("some single yy works for all xx") — the second is much stronger. "Every person has a mother" is true; "there is one mother of everyone" is false. Swapping quantifiers can silently change the meaning.

Negating quantified statements follows a clean rule that flips the quantifier and negates the predicate: ¬xP(x)x¬P(x),¬xP(x)x¬P(x).\neg \forall x\, P(x) \equiv \exists x\, \neg P(x), \qquad \neg \exists x\, P(x) \equiv \forall x\, \neg P(x). In words: the negation of "all are PP" is "some is not PP" (one counterexample suffices), and the negation of "some is PP" is "none is PP." This is why a universal claim is disproved by a single counterexample.

Common pitfall: swapping the order of quantifiers or negating them incorrectly. xy\forall x\, \exists y is not the same as yx\exists y\, \forall x. And ¬xP(x)\neg \forall x\, P(x) is x¬P(x)\exists x\, \neg P(x) — "not all" means "at least one isn't," not "none is." Negation flips \forall to \exists (and vice versa) while negating the inside.

Practise this lesson

The explanation above is free to read. The graded practice for this lesson lives in the Tryals app.

11practice questions
2interactive scenes
Start Computer Science I free

Discrete Mathematics