Course contentsShow
← Computer Science
Lesson 46 of 2,8722. Discrete Mathematics for CSFree lesson

Predicates and Propositional Functions

Learn how predicates generalize propositions by introducing variables and domains of discourse.

Predicates and Propositional Functions

What you'll learn: How to extend simple propositions by introducing variables that let you express statements about entire collections of values.

From Fixed Propositions to Flexible Predicates

Until now, you've worked with propositions—statements that are always either true or false, like "5 is odd" or "The sky is blue." But what if you want to talk about a pattern that could be true for many different values?

A predicate (or propositional function) is like a proposition with blanks you can fill in. It contains one or more variables and becomes a proposition only when you plug in specific values.

Understanding Through Examples

Consider: "x is an even number"

This isn't true or false by itself—it depends on what x is! We can write this as P(x), where:

  • P is the predicate (the property "is an even number")
  • x is the variable
  • The domain of discourse is the set of values x can take (e.g., all integers)

When you substitute a value:

  • P(4) → "4 is an even number" → TRUE
  • P(7) → "7 is an even number" → FALSE

Why This Matters

Predicates bridge the gap between logic and programming. Think of a predicate like a Boolean function that takes input parameters. You've already seen this pattern in truth tables, where you evaluated expressions for different variable assignments—predicates formalize exactly that idea.

Key Takeaway: Predicates transform propositions from fixed statements into flexible templates with variables; they become true or false only when you specify values from a domain of discourse.