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
Universal∀x P(x)\forall x\, P(x)For all xx, P(x)P(x)True for every xx in the domain
Existential∃x P(x)\exists x\, P(x)There exists xx, P(x)P(x)True for at least one xx

Common pitfall: A universal claim (∀x P(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. ∀x ∃y P(x,y)\forall x\, \exists y\, P(x,y) means "every xx has some yy," which is very different from ∃y ∀x P(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: ¬∀x P(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

Try the questions below, free, answers included. The full set, with its interactive scenes, is in the Tryals app.

11practice questions
2interactive scenes

Discrete Mathematics