Discrete math topics such as time complexities, Lecture notes of Mathematics

Discrete math topics such as time complexities

Typology: Lecture notes

2022/2023

Uploaded on 07/29/2023

sandeep-mishra-1
sandeep-mishra-1 🇺🇸

2 documents

1 / 16

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CSCE 222
Discrete Structures for Computing
Predicate Logic
Dr. Hyunyoung Lee!
1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Discrete math topics such as time complexities and more Lecture notes Mathematics in PDF only on Docsity!

CSCE 222

Discrete Structures for Computing

Predicate Logic

Dr. Hyunyoung Lee

Predicates

We often express statements that depend on one or more parameter. For example, let P(n) have the interpretation “n is a prime number.” Then, P(2) = “2 is a prime number” and P(4) = “4 is a prime nubmer”.

Universe

The parameters of a predicate can take on values

from the universe of discourse, or universe. The

universe is comprised of elements that one wants

to refer to in the predicates.

For example, the universe could be the set of

integers, the set of real numbers, the set of all

people, or the like.

The universe is called the domain of the predicate.

Predicates with Several Arguments

A predicate P(x 1 , x 2 ,.. ., xn) with n arguments is

called a predicate of degree n or an n-ary

predicate.

An interpretation of a predicate of degree n

decides for which n-tuples of elements from the

universe the predicate is supposed to be true.

Universal Quantifier (1)

Suppose that P(n) has the interpretation (n!)

2

>= n

n

A typical mathematical statement is

for all positive integers n, we have (n!)

2

>= n

n

If the universe is the set of positive integers, then

we can express this in predicate logic as ∀n P(n).

We call ∀ the universal quantifier and n the

variable bound by the universal quantifier.

Universal Quantifier (2)

Suppose that P(n) is a predicate over a finite universe, say {1,2,3}. Then ∀nP(n) is equivalent to P(1)⋀P(2)⋀P(3).

Existential Quantifier

The statement P(n) holds for some n in the universe

can be written as ∃n P(n).

Suppose that P(n) is a predicate over a finite

universe, say {1,2,3}. Then

∃nP(n) is equivalent to P(1) ∨ P(2) ∨ P(3).

Example: ∃n (n>0 ⋀ n

2

is true if the universe is the real numbers

but false if the universe is the rational numbers.

Logical Equivalence

Two statements involving quantifiers and predicates are logically equivalent if and only if they have the same truth values no matter which predicates are substituted into these statements and which domain is used. We write A ≡ B for logically equivalent A and B.

Example

Proof:

¬ 8 x(P (x)! Q(x)) ⌘ 9x¬(P (x)! Q(x)) ⌘ 9x¬(¬P (x) _ Q(x)) ⌘ 9x(¬¬P (x) ^ ¬Q(x)) ⌘ 9x(P (x) ^ ¬Q(x)) ¬ 8 x(P (x)! Q(x)) ⌘ 9x(P (x) ^ ¬Q(x))

Step (1) is by de Morgan’s Law for universal quantified predicate statement. Step (2) is by the logical equivalence between implication and disjunction (proposition 2.2). Step (3) is by de Morgan’s Law for disjunction. Step (4) is by double negation law.

Nested Quantifiers

Suppose that P(x,y) is a predicate over a finite universe (domain), say Dx={1,2} and Dy={3,4}. Then

∀x∀yP(x,y) ≡ [P(1,3)⋀P(1,4)] ∧ [P(2,3)⋀P(2,4)], and

∃x∀yP(x,y) ≡ [P(1,3)⋀P(1,4)] ∨ [P(2,3)⋀P(2,4)].

Nested Quantifiers Example (2)

Domain for x is the set of persons. Domain for y is the set of all inputs. C(x,y): the program of person x crashes on input y L(x,y): the program of person x loops forever on input y

(1) ∃y∀x (C(x,y) ⊕ L(x,y)) ≢ ∀x∃y (C(x,y) ⊕ L(x,y)) (2)

(1) “There is an input that causes every person’s program to crash or loop forever.” (2) “Every person’s program has some input on which it either crashes or loops forever.”