Courses / Computer Science I
Discrete Mathematics

Predicate Logic and Quantifiers

Computer Science I 220 words Free to read

Statements About Everything and Something

Propositional logic cannot express general statements like "every integer has a successor." Predicate logic solves this by adding predicates P(x)P(x)—statements with variables that are true or false depending on xx—and quantifiers.

QuantifierSymbolMeaningCondition
UniversalxP(x)\forall x\, P(x)For all xx, P(x)P(x)True for every xx in the domain
ExistentialxP(x)\exists x\, P(x)There exists xx, P(x)P(x)True for at least one xx

Common pitfall: A universal claim (xP(x)\forall x\, P(x)) is disproved by a single counterexample where P(x)P(x) fails.

Order and Negation

The order of quantifiers matters enormously. xyP(x,y)\forall x\, \exists y\, P(x,y) means "every xx has some yy," which is very different from yxP(x,y)\exists y\, \forall x\, P(x,y), meaning "some single yy works for all xx."

For example, "every person has a mother" is true, but "there is one mother of everyone" is false. Swapping quantifiers silently alters meaning.

To negate quantifiers, flip the quantifier and negate the inner predicate:

Common pitfall: ¬xP(x)\neg \forall x\, P(x) means "not all" (+at least one isn’t+\text{at least one isn't}), not "none is."

A negation that names its own witness, plus one honest exception

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

Discrete Mathematics