0% found this document useful (0 votes)
16 views25 pages

Section 2. Predicate Logic: Discussion

This document discusses predicate logic and quantifiers. It begins by defining key terms like predicate, domain, and truth set. It then covers universal and existential quantifiers, using them to write statements. It discusses how to negate statements with quantifiers and how to handle statements with multiple quantifiers. Examples are provided to illustrate each concept along with exercises for the reader.

Uploaded by

Pi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views25 pages

Section 2. Predicate Logic: Discussion

This document discusses predicate logic and quantifiers. It begins by defining key terms like predicate, domain, and truth set. It then covers universal and existential quantifiers, using them to write statements. It discusses how to negate statements with quantifiers and how to handle statements with multiple quantifiers. Examples are provided to illustrate each concept along with exercises for the reader.

Uploaded by

Pi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

Section 2.

Predicate Logic

Discussion:

In Maths we use variables (usually ranging over numbers)


in various ways.

How does x differ in what it represents in the following


statements? x is real.

x2 = 0 x represents one value, x = 0


x>2 x represents some, but not all values
x+0 = x x represents all values
x2 +1 = 0 x represents no values

Definition: Predicate

A predicate is a sentence that contains one or more


variables and becomes a statement when specific values are
substituted for the variables.

Definition: Domain

The domain of a predicate variable consists of all values


that may be substituted in place of the variable

WUCT121 Logic 60
Definition: Truth Set

If P(x) is a predicate and x has domain D, the truth set of


P(x) is the set of all elements of D that make P(x) true. The
truth set is denoted { x D : P( x )} and is read the set of all
x in D such that P(x).

Examples:

Let P(x) be the predicate x 2 > x with x i.e.


domain the set of real numbers .
Write down P( 2), P(1), P( 2) and indicate which are true
and which are false.
Determine the truth set of P(x)

P( 2) : 2 2 > 2 or 4 > 2 True


P(1) : (1)2 > 1 or 1 > 1 False
P( 2) : ( 2)2 > ( 2) or 4 > ( 2) True

{ x : x 2 > x} = { x : x < 0 x > 1}

Let Q(n) be the predicate n is factor of 8.


Determine the truth set of Q(n) if n +

8 = 1 8, 8 = 2 4
{n + :" n is a factor of 8"} = {1, 2, 4, 8}

WUCT121 Logic 61
Exercises:

Let P(x) be the predicate x > x with x i.e.


3

domain the set of integers, .


Write down P(2), P(0), P( 2) and indicate which are true
and which are false.
Determine the truth set of P(x)

Let Q(n) be the predicate n is factor of 6.


Determine the truth set of Q(n) if n

WUCT121 Logic 62
2.1. Quantifiers

A way to obtain statements from predicates is to add


quantifiers. Quantifiers are words that refer to quantities
such as all, every, or some and tell for how many
elements a given predicate is true.

2.1.1. Universal Quantifier

The symbol denotes for all and is called the universal


quantifier.

Definition: Universal Statement

Let P(x) be a predicate and D the domain of x. A universal


statement is a statement of the form x D, P( x ) . It is
defined to be true if, and only if, P(x) is true for every x in
D. It is defined to be false if, and only if, P(x) is false for at
least one x in D. A value of x for which P(x) is false is
called a counterexample to the universal statement.

Examples:

Write the sentence All human beings are mortal


using the universal quantifier.
Let H be the set of human beings.
h H ,h is mortal

WUCT121 Logic 63
Consider A = { x1 , x2 , x3 } . With x A, P( x ) , the

following must hold: P( x1 ) P( x2 ) P( x3 )

Thus there will be 3 predicates which must hold.

Exercises:

Write the following statements using the universal


quantifier. Determine whether each statement is true or
false.

All dogs are animals

The square of any real number is positive.

Every integer is a rational number.

WUCT121 Logic 64
Exercises:

Write the following statements in words. Determine


whether each statement is true or false.

x , x

x , x 2 1.

WUCT121 Logic 65
2.1.2. Existential Quantifier

The symbol denotes there exists and is called the


existential quantifier.

Definition: Existential Statement

Let P(x) be a predicate and D the domain of x.


An existential statement is a statement of the form
x D, P( x ) .
It is defined to be true if, and only if, P(x) is true for at least
one x in D.
It is defined to be false if, and only if, P(x) is false for all x
in D.

Examples:

Write the sentence Some people are vegetarians


using the existential quantifier.
Let H be the set of human beings.
h H , h is a vegetarian

Consider A = { x1 , x2 , x3 }. With x A, P( x ) , the

following must hold: P( x1 ) P( x2 ) P( x3 )

Thus there will be 1 predicate which must hold.

WUCT121 Logic 66
Exercises:

Write the following statements using the existential


quantifier. Determine whether each statement is true or
false.

Some cats are black

There is a real number whose square is negative.

Some programs are structured.

WUCT121 Logic 67
Exercises:

Write the following statements in words. Determine


whether each statement is true or false.

m , m 2 = m

x , x 2 = 1.

1
x ,
x

WUCT121 Logic 68
2.1.3. Negation of Universal Statements

Let P(x) be a predicate and D the domain of x. The


negation of a universal statement of the form:
x D, P( x ) is logically equivalent to x D, ~ P( x )

Symbolically ~ (x D, P( x )) x D, ~ P( x )

Example:

Write down the negation of the following statement.

x , x 2 + 1 2 x
Negation:

~ (x , x 2 + 1 2 x )
x , ~ ( x 2 + 1 2 x )
x , x 2 + 1 < 2 x
False.

WUCT121 Logic 69
Exercises:

Write down the negation of the following statement.

x , x 2 0

Write down the negation of the following statement.


y +1
y , y 0 < 1
y

WUCT121 Logic 70
Example:

Write the following statement using quantifiers. Find


its negation and determine whether the statement or its
negation is true, giving a brief reason..
Every real number is either positive or negative.
Statement:
x , x < 0 x > 0
Negation:
~ (x , x < 0 x > 0)
x , ~ ( x < 0 x > 0)
x , ~ ( x < 0) ~ ( x > 0)
x , ( x 0) ( x 0)
x , x = 0
The true statement is the negation because x = 0 is neither
positive nor negative.

WUCT121 Logic 71
Exercises:

Write the following statement using quantifiers. Find


the negation.
The square of any integer is positive.

Write the following statement using quantifiers. Find


the negation.
All computer programs are finite.

WUCT121 Logic 72
2.1.4. Negation of Existential Quantifiers

Let P(x) be a predicate and D the domain of x. The


negation of an existential statement of the form:
x D, P( x ) is logically equivalent to x D , ~ P( x )

Symbolically ~ (x D, P( x )) x D , ~ P( x )

Example:

Write down the negation of the following statement.

x , x 2 = 2
Negation:

~ (x , x 2 = 2)
x , ~ ( x 2 = 2)
x , x 2 2
The negation is true.

WUCT121 Logic 73
Exercises:

Write down the negation of the following statement.


z , ( z is odd ) ( z is even)

Write down the negation of the following statement.


n , ( n is even) ( n is prime)

WUCT121 Logic 74
Example:

Write the following statement using quantifiers. Find


its negation
Some dogs are vegetarians.
Let D be the set of dogs.
Statement: d D , d is vegetarian
Negation:
~ (d D, d is vegetarian)
d D , ~ ( d is vegetarian)
d D , d is not vegetarian
All dogs are not vegetarian

Exercises:

Write the following statement using quantifiers. Find


the negation.
There is a real number that is rational.

WUCT121 Logic 75
Write the following statement using quantifiers. Find
the negation.
Some computer hackers are over 40.

Write the following statement using quantifiers. Find


the negation.
Some animals are dogs.

WUCT121 Logic 76
2.1.5. Multiple Quantifiers

When a statement contains multiple quantifiers their order


must be applied as written and will produce different
results for the truth set.

Examples:

Write the following statements using quantifiers:

Everybody loves somebody.


Let H be the set of people.
Statement: x H , y H , x loves y.

Somebody loves everyone.


Let H be the set of people.
Statement: x H , y H , x loves y.

WUCT121 Logic 77
Exercises:

Write the following statements using quantifiers:

Everybody loves everybody.

The Commutative Law of Addition for

Everyone had a mother.

There is an oldest person.

WUCT121 Logic 78
Examples:

Write the following statements without using quantifiers:

x ,, y , x + y = 0
Statement: Given any real number, you can find a real
number so that the sum of the two is zero. Alternatively:
Every real number has an additive inverse.

x ,, y , x + y = y
Statement: There is a real number, which added to any
other real number results in the other number.
Alternatively: Every real number has an additive identity.

Exercises:

Write the following statements without using quantifiers:

c colours, a animals, a is coloured c

b books, p people, p has read b

WUCT121 Logic 79
2.1.6. Interpreting Statements with Multiple
Quantifiers

To establish the truth of a statement with more than one


quantifier, take the action suggested by the quantifiers as
being performed in the order in which the quantifiers occur.

Consider A = { x1 , x 2 , x3 }, B = { y1 , y 2 } and the

predicate P( x, y ) .

There will be 6 possible predicates:


P( x1 , y1 ) , P( x1 , y 2 ),
P( x2 , y1 ), P( x2 , y 2 ),
P( x3 , y1 ) , P( x3 , y 2 ).

For x A, y B, P( x, y ) to be true the following


must hold:
P( x1 , y1 ) P( x1 , y 2 )
P( x2 , y1 ) P( x2 , y 2 )
P( x3 , y1 ) P( x3 , y 2 )

Thus there will be 6 predicates which must all be true. That


is for all pairs (x, y), P(x, y) must be true. It will be false if
there is one pair (x, y), for which P(x, y) is false.

WUCT121 Logic 80
For x A, y B, P( x, y ) to be true, the following
must hold:
P( x1 , y1 ) P( x1 , y 2 )
P( x 2 , y1 ) P( x 2 , y 2 )
P( x3 , y1 ) P( x3 , y 2 )

Thus there will be 3 predicates which must be true. That is


for every x there must be at least one y so that P(x, y) is
true. Given any element x in A you can find an element y in
B, so that P(x, y) is true. It will be false if there is one x in A
for which P(x, y) is false for every y in B.

For x A, y B, P( x, y ) to be true, the following


must hold:
P( x1 , y1 ) P( x1 , y 2 )
P( x 2 , y1 ) P( x 2 , y 2 )
P( x3 , y1 ) P( x3 , y 2 )

Thus there will be 2 predicates which must be true. That is


there is one x that when paired with any y, P(x, y) is true.
You can find one element x in A that with all elements y in
B, P(x, y) is true. It will be false if for every x in A, there is
a y in B for which P(x, y) is false.

WUCT121 Logic 81
For x A, y B, P( x, y ) to be true, the following
must hold:
P( x1 , y1 ) P( x1 , y 2 )
P( x 2 , y1 ) P( x 2 , y 2 )
P( x3 , y1 ) P( x3 , y 2 )

Thus there will be 1 predicate which must be true. That is


there is one x that when paired with one y, P(x, y) is true.
You can find one element x in A and one element y in B,
P(x, y) is true. It will be false if for all pairs (x, y), P(x, y) is
false.

Summary:

Statement When true? When false?


x, y , P( x, y ) P(x, y) is true for There is a pair
all pairs (x, y) (x, y) for which P(x,
y) is false
x, y , P( x, y ) For every x, there There is an x such
is a y for which that P(x, y) is false
P(x, y) is true for every y
x, y , P( x, y ) There is an x such For every x, there is
that P(x, y) is true a y for which P(x, y)
for every y is false
x, y , P( x, y ) There is a pair P(x, y) is false for
(x, y) for which all pairs (x, y)
P(x, y) is true

WUCT121 Logic 82
2.1.7. Negation of Statements with Multiple
Quantifiers.

To negate statements with multiple quantifiers, each


quantifier is negated and the predicate must be negated.

To negate x A, y B, P( x, y )
~ (x A, y B, P( x, y ) ) x A, y B, ~ P( x, y )

To negate x A, y B, P( x, y )
~ (x A, y B, P( x, y ) ) x A, y B, ~ P( x, y )

To negate x A, y B, P( x, y )
~ (x A, y B, P( x, y ) ) x A, y B, ~ P( x, y )

To negate x A, y B, P( x, y )
~ (x A, y B, P( x, y ) ) x A, y B, ~ P( x, y )

Examples:

Write the negation of the following:

Statement: x ,, y , x + y = 0
Negation:
~ (x ,, y , x + y = 0 )
x ,, y , x + y 0
False: Take y = x , then x + y = x x = 0

WUCT121 Logic 83
Statement: x ,, y , xy = 1
Negation:
~ (x ,, y , xy = 1)
x ,, y , xy 1
True : Take y = x, then xy = x 2 1

Exercises:

Write the negation of the following:

Statement: c colours, a animals, a is coloured c

Statement: b books, p people, p has read b

WUCT121 Logic 84

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy