You are on page 1of 34

Need for Variables

For every X,
“Every cat can smile.” if X is a cat, then X can smile.
“Tom is a cat.”

“Tom can smile.”

+Variables

Propositional logic First-order Logic (Predicate Logic)


Statements with Variables . . . Generic statements

Many statements involve variables, e.g.,

“If X is a bird, then X has wings”.

“If n is an odd integer, then n+1 is even”.

The main limitation of propositional logic


is the absence of variables.

A step beyond propositional logic is first-order logic (predicate logic),


which allows the use of variables.

A simplified version of first-order logic will now be introduced.


Propositional function and Domain of Discourse

Let P(x) be a statement involving the variable x and D be a set.

Call P a propositional function with respect to D,


if for each x in D, P(x) is a proposition.

Call D the domain of discourse of P.


Propositional function and Domain of Discourse ...

Ben Dang
EXAMPLE

Let P(x) be a statement


“x is a dog”, Tom

and D1 = {Ben, Tom, Dang}. D1

Then:
P(x) : x is a dog
P(Ben) is “Ben is a dog”.
x/Ben
P(Tom) is “Tom is a dog”.
P(Ben) : Ben is a dog
P(Dang) is “Dang is a dog”.

Since P(Ben), P(Tom), P(Dang) are all propositions,


P is a propositional function with respect to the domain of discourse D1.
Propositional function and Domain of Discourse ...

A domain of discourse can be infinite.


EXAMPLE

Let P(x) be a statement 1 2 3 4 5 6 …


“x is an odd integer”,

and D2 be the set of all positive integers.


D2

Then:
P(x) : x is an odd integer
P(1) is “1 is an odd integer”.
x/1 P(2) is “2 is an odd integer”.
P(3) is “3 is an odd integer”.
P(1) : 1 is an odd integer ...
...
...

Since P(1), P(2), P(3) . . . are all propositions,


P is a propositional function with respect to the domain of discourse D2.
How to determine the truth value of
a statement with variables ?

 Universal Quantification

 Existential Quantification
Universal Quantification 
Let P be a propositional function with domain of discourse D.

The statement

“for every x, P(x)”, which may be written as x, P(x),

is called a universally quantified statement.

x, P(x) is also read as: “for any x, P(x)”


“for all x, P(x)”

x, P(x) is true, if P(x) is true for every x in D.

x, P(x) is false, if P(x) is false for at least one x in D.


EXAMPLE

Let P(x) be a statement “x is a dog”.

Ben Dang

Tom

D1

Use D1 as the domain of discourse.

What is the truth value of x, P(x)?


EXAMPLE

Let P(x) be a statement “x is a dog”.

Ben
Toto Dang

Joe Tom
D3

Use D3 as the domain of discourse.

What is the truth value of x, P(x)?


EXAMPLE

1 “for every real number x, x2  0”

2 “for every real number x, if x > 1, then x+1 > 1”

3 “for every real number x, x > 10 or x2  0”

4 “for every real number x, x2 -1 > 0

1,2,3 are true. 4 is false.

A value x in the domain of discourse that makes P(x) false is called


a “counterexample” to the statement x, P(x)
Hint: For Problem 2 in the previous slide
To see that

“for every real number x, if x > 1, then x+1 > 1”


is true, we may consider the following two cases, and justify that
the sentence is true in both cases.

If x > 1, then x+1 > 1

Case 1, when x  1: Case 2, when x > 1:


The condition part is always true.
The condition part is always false.
The conclusion part is also always true.
So the if-then sentence is true.
So the if-then sentence is also always true
in this case.

What is the truth value of the sentence


“for every real number x, if x > 1, then x2 > 1”?
Existential Quantification 
Let P be a propositional function with domain of discourse D.

The statement

“for some x, P(x)”, which may be written as x, P(x),

is called an existentially quantified statement.

 x, P(x) is also read as: “for at least one x, P(x)”


“there exists x such that P(x)”

x, P(x) is true, if P(x) is true for at least one x in D.

x, P(x) is false, if P(x) is false for every x in D.


EXAMPLE

Let P(x) be a statement “x is a dog”.

Ben
Toto Dang

Joe Tom
D3

Use D3 as the domain of discourse.

What is the truth value of x, P(x)?


EXAMPLE

Let P(x) be a statement “x is a dog”.

Ben Dang

Tom

D1

Use D1 as the domain of discourse.

What is the truth value of x, P(x)?


EXAMPLE
1. “for some real number x, 5x+20 = 0”
2. “for some real number x, x2 + 6x + 8 = 0”
3. “for some real number x, x2  0”
4. “for some real number x, if x > 1, then x+1 > 1”

1, 2, 3, 4 above are all true.


EXAMPLE

Determine the truth value of the statement

for some real number x, 1


1
x +1
2

Hint: Show that for every real number x, 1


 1
2
x 1+
Generalized De Morgan Laws

THEOREM

(x, P(x)) and x, P(x) have the same truth values.

(x, P(x)) and x, P(x) have the same truth values.
Questions ???

In general, how to prove that:

1) x, P(x) is true ?

2) x, P(x) is false ?

3) x, P(x) is true ?

4) x, P(x) is false ?


. . . Answers . . .

1) In order to prove that

x, P(x)

is true,

we have to show that for every x in the domain of discourse,


the proposition P(x) is true.

It is not sufficient to show only that P(x) is true for a particular


value x in the domain of discourse.

2) In order to prove that

x, P(x)

is false,

find one value of x (a counterexample) in the domain of discourse


for which P(x) is false. One counterexample suffices.
. . . Answers . . .

3) In order to prove that

x, P(x)

is true,

find one value of x in the domain of discourse for which P(x)


is true. One value suffices.

4) In order to prove that

x, P(x)

is false,

we have to show that for every x in the domain of discourse,


the proposition P(x) is false.

It is not sufficient to show only that P(x) is false for a particular


value x in the domain of discourse.
Nested Quantifiers

How to represent the sentence “Everybody loves somebody”?


(1) x y, x loves y

(2) x y, x loves y

(3) y x, x loves y

(4) y x, x loves y

The four sentences have different meanings.


To determine whether a given statement is true or false:

x y, x+y = 0
1. “Understand”

? 2. “Think”

3. “Prove”
(Justify what you think)

You should first try to “understand” the the meaning of the statement clearly.
 Then, “think” whether the statement is true or false.
 Then, “prove” that what you think is correct !!!
EXAMPLE

Let the domain of discourse be the set of real numbers.


Determine the truth values of:

1. x y, x+y = 0

2. x y, x+y = 0

(1 is true; 2 is false.)

Hint: To show that 2 is false, show that xy, x+y0 is true.


This can be shown by: given any x, select y = 1-x, we always have x+y0.
EXAMPLE

Let the domain of discourse be the set of real numbers.


Determine the truth values of:

x y, x·y = 0
EXERCISE

Let the domain of discourse be the set of real numbers.


Determine the truth values of:

1. x y, x+y = y

2. x y, x+y = x

(1 is true; 2 is false.)

Hint: To show that 2 is false, show that xy, x+yx is true.


This can be shown by: given any x, select y = 1, we always have x+yx.
EXERCISE

Let the domain of discourse be the set of real numbers.


Determine the truth values of:

1. x y, x·y = y

2. x y, x·y = x

(Both of them are true.)


EXAMPLE

Let the domain of discourse be the set of real numbers.


Let P(x,y) be the statement:

“if x2 < y2, then x < y”.

Determine the truth values of:

1. x y, P(x,y)
2. x y, P(x,y)
3. y x, P(x,y)

(1 is false; 2 and 3 are true.)

1. A counterexample: x=1, y=-2.


2. Given any x, select y=0 (or select y=x); then, the condition part is always false.
3. Given any y, select x=|y|+1; then, the condition part is always false.
EXERCISE

Let the domain of discourse be the set of real numbers.


Again let P(x,y) be the statement:

“if x2 < y2, then x < y”.

Determine the truth value of:

x y, P(x,y)

(false)

Hint: Show that xy, ((x2 < y2)  (x  y)) is true.


This can be shown by: given any x, select y = -(|x|+1).
EXERCISE

Let the domain of discourse be the set of real numbers.

Determine the truth values of:

1. x y, x2 + y2 = 10

2. x y, x2 + y2 = 10

3. x y, x2 + y2 = 10

4. x y, x2 + y2 = 10

(1, 2 and 3 are false; 4 is true.)


EXERCISE

Let the domain of discourse be the set of real numbers.

Determine the truth values of:

1. x y, x·y = 100

2. x y, x·y = 100

(1 and 2 are false.)


EXERCISE

Let the domain of discourse be the set of real numbers.

Determine the truth values of:

1. x y, x·y = 0

2. x y, x+y = 10
Selected Exercises from the Main Text (Johnsonbaugh, 7th Ed)

EXECISES on Page 50 of the Main Text

Solve Problems 49-54.

Answers:
49) F 50) T 51) T 52) T 53) F 54) T

EXECISES on Page 59 of the Main Text

Solve Problems 42-59.

Answers:
42) F 43) T 44) F 45) T 46) F 47) F
48) F 49) F 50) F 51) T 52) T 53) T
54) T 55) T 56) F 57) T 58) T 59) T

You might also like