predicates and quantifiers dr. yasir ali. 1.predicates 2.quantifiers a.universal quantifiers...

25
Predicates and Quantifiers Dr. Yasir Ali

Upload: sabrina-bond

Post on 19-Jan-2016

258 views

Category:

Documents


2 download

TRANSCRIPT

Predicates and Quantifiers

Dr. Yasir Ali

1. Predicates2. Quantifiers

a. Universal Quantifiers b. Existential Quantifiers

3. Negation of Quantifiers4. Universal Conditional Statement

1. Negation of Universal Conditional5. Multiple Quantifiers

1. Precedence of quantifiers2. Order of quantifiers

6. Translation

It is frequently necessary to reason logically about statements of the form

Everything has the property p or

something has the property p. One of the oldest and most famous pieces of logical reasoning, which was known to the ancient Greeks, is an example:

All men are mortal. Socrates is a man.

Therefore Socrates is mortal.Predicate logic, also called first order logic, is an extension to propositional logic that adds two quantifiers that allow statements like the examples above to be expressed.

Everything in propositional logic is also in predicate logic: allthe definitions, inference rules, theorems, algebraic laws, etc., still hold.

“Every computer connected to the university network is functioning properly.”

No rules of propositional logic allow us to conclude the truth of the statement

“MATH3 is functioning properly,”

Where MATH3 is one of the computers connected to the university network.

PredicateA predicate is a statement that an object has a certain property. Such statements may be either true or false.

Or more formally,

A predicate is a sentence that contains a finite number of variables and becomes a statement when specific values are substituted for the variables. The domain of a predicate variable is the set of all values that may be substituted in place of the variable.

Let P(x) be the statement “the word x contains the letter a.” What are these truth values?

1. P(orange)

2. P(lemon)

3. P(true)

4. P(false)

Let be the predicate “” with domain the set R of all real numbers. Write , , and , and indicate which of these statements are true and which are false.

Truth Set of a predicateWhen an element in the domain of the variable of a one-variable predicate is substituted for the variable, the resulting statement is either true or false. The set of all such elements that make the predicate true is called the truth set of the predicate.

Let be the predicate “.”1. Write and P(−8), and indicate which of these statements are

true and which are false.2. Find the truth set of if the domain of is R, the set of all real

numbers.3. If the domain is the set R+ of all positive real numbers, what

is the truth set of ?

Let Q(x, y) denote the statement “x = y + 3.” What are the truth values of the propositions Q(1, 2) and Q(3, 0)?

Quantifiers• One sure way to change predicates into statements is to assign

specific values to all their variables.• For example, if x represents the number 35, the sentence “x is

divisible by 5” is a true statement since 35 = 5· 7. • Another way to obtain statements from predicates is to add

quantifiers. • Quantifiers are words that refer to quantities such as “some”

or “all” and tell for how many elements a given predicate is true.

QuantifiersThe Universal Quantifier:

Let be a predicate and the domain of . A universal statement is a statement of the form “.” It is defined to be true if, and only if, is true for every in . It is defined to be false if, and only if, is false for at least one in . A value for x for which is false is called a counterexample to the universal statement.

Besides “for all” and “for every,” universal quantification can be expressed in many other ways, including “all of,” “for each,” “given any,” “for arbitrary,” “for each,” and “for any.”

Example:

1. Let , and consider the statement

Show that this statement is true.

2. Consider the statement

Find a counterexample to show that this statement is false.

Note:When all elements in the domain can be listed—say, theUniversal quantificationis the same as the conjunction

because this disjunction is true if and only if all of is true and false if atleast one of them is false.

Existential QuantifierLet be a predicate and the domain of . An existential statement is a statement of the form

“.” It is defined to be true if, and only if, is true for at least one in . It is false if, and only if, is false for all in .

Besides the phrase “there exists”, we can also express existential quantification in many other ways, such as by using the words “for some,” “for at least one,” or “there is.” The existential quantification is read as“There is an such that ,”“There is at least one such that ,”or“For some .”

Consider the following statement:

Which of the following are equivalent ways of expressing this statement?1. Every basketball player is tall.2. Among all the basketball players, some are tall.3. Some of all the tall people are basketball players.4. Anyone who is tall is a basketball player.5. All people who are basketball players are tall.6. Anyone who is a basketball player is a tall person.

Consider the following statement:

Which of the following are equivalent ways of expressing this statement?1. The square of each real number is 2.2. Some real numbers have square 2.3. The number has square 2, for some real number .4. If is a real number, then .5. Some real number has square 2.6. There is at least one real number whose square is 2.

Rewrite the following formal statements in a variety of equivalent but more informal ways. Do not use the symbol or .1. • All real numbers have nonnegative squares.• Or: Every real number has a nonnegative square.• Or: Any real number has a nonnegative square.• Or: The square of each real number is nonnegative.2. .• All real numbers have squares that are not equal to −1.• Or: No real numbers have squares equal to −1.(The words none are or no . . . are equivalent to the words all are not.)3. • There is a positive integer whose square is equal to itself.• Or: We can find at least one positive integer equal to its own

square.• Or: Some positive integer equals its own square.

Rewrite each of the following statements formally. Use quantifiers and variables.1. All dinosaurs are extinct.2. Every real number is positive, negative, or zero.3. No irrational numbers are integers.4. Some exercises have answers.5. Some real numbers are rational.

Example:1. Consider the statement such that .Show that this statement is true.

2. Let and consider the statement such that . Show that this statement is false.

Note:When all elements in the domain can be listed—say, theexistential quantification is the same as the disjunction

because this disjunction is true if and only if at least one of is true and false if all of them are false.

Statement When True? When False?

is true for every . There is an for which is false.

There is an for which is true.

is false for every .

Negation of Quantified StatementAlso known as De Morgan’s Law for Quantifiers

Negation Equivalent Statement When Is Negation True?

When False?

For every is false.

There is an for whichis true.

There is an for which is false.

is true for every .

What are the negations of the statements “There is an honest politician” and “All Americans eat cheeseburgers”?

Let H(x) denote “x is honest” and C(x) denote “x eats cheeseburgers.”

Universal Conditional Statements

Rewrite the following statement informally, without quantifiers or variables.

If a real number is greater than 2 then its square is greater than 4.

Negation

What is the negation of ?

Write the negation of the following statement:

Some real number greater than two has a square less or equal to 4.

Translating from English into Logical ExpressionsConsider the following statements.

A ≡ Small animals are good pets.C ≡ Cats are animals.S ≡ Cats are small.

All we have are three propositions: A, C, and S are known, but nothing else, and the only conclusions that can be drawn are uninteresting ones like , , and the like.

The solution is to use predicates to give a more refined translation of the sentences:A(x) ≡ x is an animal.C(x) ≡ x is a cat.S(x) ≡ x is small.GP(x) ≡ x is a good pet.

Now a much richer kind of English sentence can be translated into predicate logic:

≡ Cats are animals.) ≡ Cats are small.≡ Cats are small animals.≡ Small animals are good pets.

It is generally straightforward to translate from formal predicate logic into English, since you can just turn each logical operator directly into an English word or phrase.For example,

could be translated into English literally:(1) For every thing, if that thing is small and that thing is an animal,

then that thing is a good pet.

This is graceless English, but at least it’s comprehensible and correct. The style can be improved:

(2) Everything which is small and which is an animal is a good pet.

Even better would be:

(3) Small animals make good pets.