Docsity

Predicates and Quantifiers - Discrete Mathematics - Lecture Slides, Slides of Discrete Mathematics

Partial preview of the text

Download Predicates and Quantifiers - Discrete Mathematics - Lecture Slides and more Slides Discrete Mathematics in PDF only on Docsity!

1

Predicates and Quantifiers

2

Terminology review

  • Proposition: a statement that is either true

or false

  • Must always be one or the other!
  • Example: “The sky is red”
  • Not a proposition: x + 3 > 4
  • Boolean variable: A variable (usually p, q,

r, etc.) that represents a proposition

4

Propositional functions 2

  • Let P(x) = “x is a multiple of 5”
    • For what values of x is P(x) true?
  • Let P(x) = x+1 > x
    • For what values of x is P(x) true?
  • Let P(x) = x + 3
    • For what values of x is P(x) true?

5

Anatomy of a propositional function

P(x) = x + 5 > x

variable predicate

7

So, why do we care about quantifiers?

  • Many things (in this course and beyond)

are specified using quantifiers

  • In some cases, it’s a more accurate way to describe things than Boolean propositions

8

Quantifiers

  • A quantifier is “an operator that limits the

variables of a proposition”

  • Two types:
    • Universal
    • Existential

10

Universal quantifiers 2

  • But is that always true?
    • ∀x P(x)
  • Let x = the character ‘a’
    • Is ‘a’+1 > ‘a’?
  • Let x = the state of Virginia
    • Is Virginia+1 > Virginia?
  • You need to specify your universe!
    • What values x can represent
    • Called the “domain” or “universe of discourse” by the textbook

11

Universal quantifiers 3

  • Let the universe be the real numbers.
    • Then, ∀x P(x) is true
  • Let P(x) = x/2 < x
    • Not true for the negative numbers!
    • Thus, ∀x P(x) is false
      • When the domain is all the real numbers
  • In order to prove that a universal quantification is true, it must be shown for ALL cases
  • In order to prove that a universal quantification is false, it must be shown to be false for only ONE case

13

Universal quantification 5

  • Think of ∀ as a for loop:
  • ∀x P(x), where 1 ≤ x ≤ 10
  • … can be translated as …

for ( x = 1; x <= 10; x++ ) is P(x) true?

  • If P(x) is true for all parts of the for loop, then ∀x P(x)
    • Consequently, if P(x) is false for any one value of the for loop, then ∀x P(x) is false

14

Existential quantification 1

  • Represented by an bacwards E: ∃
    • It means “there exists”
    • Let P(x) = x+1 > x
  • We can state the following:
    • ∃x P(x)
    • English translation: “there exists (a value of) x such that P(x) is true”
    • English translation: “for at least one value of x, x+1>x is true”

16

Existential quantification 3

  • Let P(x) = x+1 > x
    • There is a numerical value for which x+1>x
      • In fact, it’s true for all of the values of x!
    • Thus, ∃x P(x) is true
  • In order to show an existential quantification is true, you only have to find ONE value
  • In order to show an existential quantification is false, you have to show it’s false for ALL values

17

Existential quantification 4

  • Given some propositional function P(x)
  • And values in the universe x 1 .. x (^) n
  • The existential quantification ∃x P(x)

implies:

P(x 1 ) ∨ P(x 2 ) ∨ … ∨ P(x n )

19

Binding variables

  • Let P(x,y) be x > y
  • Consider: ∀x P(x,y)
    • This is not a proposition!
    • What is y?
      • If it’s 5, then ∀x P(x,y) is false
      • If it’s x-1, then ∀x P(x,y) is true
  • Note that y is not “bound” by a quantifier

20

Binding variables 2

  • (∃x P(x)) ∨ Q(x)
    • The x in Q(x) is not bound; thus not a proposition
  • (∃x P(x)) ∨ (∀x Q(x))
    • Both x values are bound; thus it is a proposition
  • (∃x P(x) ∧ Q(x)) ∨ (∀y R(y))
    • All variables are bound; thus it is a proposition
  • (∃x P(x) ∧ Q(y)) ∨ (∀y R(y))
    • The y in Q(y) is not bound; this not a proposition