week 2 - friday. what did we talk about last time? predicate logic negation multiple quantifiers

29
CS322 Week 2 - Friday

Upload: christine-conley

Post on 31-Dec-2015

220 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Week 2 - Friday.  What did we talk about last time?  Predicate logic  Negation  Multiple quantifiers

CS322Week 2 - Friday

Page 2: Week 2 - Friday.  What did we talk about last time?  Predicate logic  Negation  Multiple quantifiers

Last time

What did we talk about last time? Predicate logic

Negation Multiple quantifiers

Page 3: Week 2 - Friday.  What did we talk about last time?  Predicate logic  Negation  Multiple quantifiers

Questions?

Page 4: Week 2 - Friday.  What did we talk about last time?  Predicate logic  Negation  Multiple quantifiers

Logical warmup

There are two lengths of rope Each one takes exactly one hour to burn

completely The ropes are not the same lengths as each

other Neither rope burns at a consistent speed

(10% of a rope could take 90% of the burn time, etc.)

How can you burn the ropes to measure out exactly 45 minutes of time?

Page 5: Week 2 - Friday.  What did we talk about last time?  Predicate logic  Negation  Multiple quantifiers

Negating quantified statements

When doing a negation, negate the predicate and change the universal quantifier to existential or vice versa

Formally: ~(x, P(x)) x, ~P(x) ~(x, P(x)) x, ~P(x)

Thus, the negation of "Every dragon breathes fire" is "There is one dragon that does not breathe fire"

Page 6: Week 2 - Friday.  What did we talk about last time?  Predicate logic  Negation  Multiple quantifiers

Negation example

Argue the following: "Every unicorn has five legs"

First, let's write the statement formally Let U(x) be "x is a unicorn" Let F(x) be "x has five legs" x, U(x) F(x)

Its negation is x, ~(U(x) F(x)) We can rewrite this as x, U(x) ~F(x)

Informally, this is "There is a unicorn which does not have five legs"

Clearly, this is false If the negation is false, the statement must be true

Page 7: Week 2 - Friday.  What did we talk about last time?  Predicate logic  Negation  Multiple quantifiers

Vacuously true

The previous slide gives an example of a statement which is vacuously true

When we talk about "all things" and there's nothing there, we can say anything we want

Page 8: Week 2 - Friday.  What did we talk about last time?  Predicate logic  Negation  Multiple quantifiers

Conditionals

Recall: Statement: p q Contrapositive:~q ~p Converse:q p Inverse: ~p ~q

These can be extended to universal statements: Statement: x, P(x) Q(x) Contrapositive: x, ~Q(x) ~P(x) Converse: x, Q(x) P(x) Inverse: x, ~P(x) ~Q(x)

Similar properties relating a statement equating a statement to its contrapositive (but not to its converse and inverse) apply

Page 9: Week 2 - Friday.  What did we talk about last time?  Predicate logic  Negation  Multiple quantifiers

Necessary and sufficient

The ideas of necessary and sufficient are meaningful for universally quantified statements as well:

x, P(x) is a sufficient condition for Q(x) means x, P(x) Q(x)

x, P(x) is a necessary condition for Q(x) means x, Q(x) P(x)

Page 10: Week 2 - Friday.  What did we talk about last time?  Predicate logic  Negation  Multiple quantifiers

Multiple Quantifiers

Page 11: Week 2 - Friday.  What did we talk about last time?  Predicate logic  Negation  Multiple quantifiers

Multiple quantifiers

So far, we have not had too much trouble converting informal statements of predicate logic into formal statements and vice versa

Many statements with multiple quantifiers in formal statements can be ambiguous in English

Example: “There is a person supervising every

detail of the production process.”

Page 12: Week 2 - Friday.  What did we talk about last time?  Predicate logic  Negation  Multiple quantifiers

Example

“There is a person supervising every detail of the production process.”

What are the two ways that this could be written formally? Let D be the set of all details of the production

process Let P be the set of all people Let S(x,y) mean “x supervises y”

y D, x P such that S(x,y)

x P, y D such that S(x,y)

Page 13: Week 2 - Friday.  What did we talk about last time?  Predicate logic  Negation  Multiple quantifiers

Mechanics

Intuitively, we imagine that corresponding “actions” happen in the same order as the quantifiers

The action for x A is something like, “pick any x from A you want”

Since a “for all” must work on everything, it doesn’t matter which you pick

The action for y B is something like, “find some y from B”

Since a “there exists” only needs one to work, you should try to find the one that matches

Page 14: Week 2 - Friday.  What did we talk about last time?  Predicate logic  Negation  Multiple quantifiers

Tarski’s World Example

Is the following statement true? “For all blue items x, there is a green item y with the

same shape.” Write the statement formally. Reverse the order of the quantifiers. Does its truth

value change?

a

c

g

b

d

f

i

k

e

h

j

Page 15: Week 2 - Friday.  What did we talk about last time?  Predicate logic  Negation  Multiple quantifiers

Practice

Given the formal statements with multiple quantifiers for each of the following: There is someone for everyone. All roads lead to some city. Someone in this class is smarter than

everyone else. There is no largest prime number.

Page 16: Week 2 - Friday.  What did we talk about last time?  Predicate logic  Negation  Multiple quantifiers

Negating multiply quantified statements

The rules don’t change Simply switch every to and every

to Then negate the predicate Write the following formally:

“Every rose has a thorn” Now, negate the formal version Convert the formal version back to

informal

Page 17: Week 2 - Friday.  What did we talk about last time?  Predicate logic  Negation  Multiple quantifiers

Changing quantifier order As show before, changing the order of

quantifiers can change the truth of the whole statement

However, it does not necessarily Furthermore, quantifiers of the same type

are commutative: You can reorder a sequence of quantifiers

however you want The same goes for Once they start overlapping, however, you

can’t be sure anymore

Page 18: Week 2 - Friday.  What did we talk about last time?  Predicate logic  Negation  Multiple quantifiers

Arguments with Quantified Statements

Page 19: Week 2 - Friday.  What did we talk about last time?  Predicate logic  Negation  Multiple quantifiers

Quantification in arguments Quantification adds new features to an

argument The most fundamental is universal

instantiation If a property is true for everything in a domain

(universal quantifier), it is true for any specific thing in the domain

Example: All the party people in the place to be are throwing

their hands in the air! Julio is a party person in the place to be Julio is throwing his hands in the air

Page 20: Week 2 - Friday.  What did we talk about last time?  Predicate logic  Negation  Multiple quantifiers

Universal modus ponens

Formally, x, P(x) Q(x) P(a) for some particular a Q(a)

Example: If any person disses Dr. Dre, he or she

disses him or herself Tammy disses Dr. Dre Therefore, Tammy disses herself

Page 21: Week 2 - Friday.  What did we talk about last time?  Predicate logic  Negation  Multiple quantifiers

Universal modus tollens

Much the same as universal modus ponens

Formally, x, P(x) Q(x) ~Q(a) for some particular a ~P(a)

Example: Every true DJ can skratch Ted Long can’t skratch Therefore, Ted Long is not a true DJ

Page 22: Week 2 - Friday.  What did we talk about last time?  Predicate logic  Negation  Multiple quantifiers

Inverse and converse errors strike again

Unsurprisingly, the inverse and the converse of universal conditional statements do not have the same truth value as the original

Thus, the following are not valid arguments:

If a person is a superhero, he or she can fly. Astronaut John Blaha can fly. Therefore, John Blaha is a superhero. FALLACY

A good man is hard to find. Osama Bin Laden is not a good man. Therefore, Osama Bin Laden is not hard to find. FALLACY

Page 23: Week 2 - Friday.  What did we talk about last time?  Predicate logic  Negation  Multiple quantifiers

Venn diagrams

We can test arguments using Venn diagrams

To do so, we draw diagrams for each premise and then try to combine the diagrams

Touchable things

This

Page 24: Week 2 - Friday.  What did we talk about last time?  Predicate logic  Negation  Multiple quantifiers

Diagrams showing validity

All integers are rational numbers

is not rational

Therefore, is not an integer

rational numbers

integers

2

rational numbers

2

2

rational numbers

integers

2

Page 25: Week 2 - Friday.  What did we talk about last time?  Predicate logic  Negation  Multiple quantifiers

Diagrams showing invalidity

All tigers are cats

Panthro is a cat

Therefore, Panthro is a tiger

cats

tigers

cats

Panthro

cats

tigers

cats

tigers

Panthro

Panthro

Page 26: Week 2 - Friday.  What did we talk about last time?  Predicate logic  Negation  Multiple quantifiers

Be careful

Diagrams can be useful tools However, they don’t offer the

guarantees that pure logic does Note that the previous slide makes

the converse error unless you are very careful with your diagrams

Page 27: Week 2 - Friday.  What did we talk about last time?  Predicate logic  Negation  Multiple quantifiers

Upcoming

Page 28: Week 2 - Friday.  What did we talk about last time?  Predicate logic  Negation  Multiple quantifiers

Next time…

Proofs and counterexamples Basic number theory

Page 29: Week 2 - Friday.  What did we talk about last time?  Predicate logic  Negation  Multiple quantifiers

Reminders

Assignment 1 is due tonight at midnight

Read Chapter 4 Start on Assignment 2