CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic

28
CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic Wong Chung Hoi (Hollis) [email protected] 2-11-2011

description

CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic. Wong Chung Hoi (Hollis) [email protected] 2-11-2011. Agenda. First Order Logic Multiple Quantifiers Proofing Arguments Validity Proof by truth table Proof by inference rules. First Order Logic. - PowerPoint PPT Presentation

Transcript of CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic

Page 1: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic

CSCI2110 – Discrete MathematicsTutorial 9

First Order Logic

Wong Chung Hoi (Hollis)[email protected]

2-11-2011

Page 2: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic

Agenda

• First Order Logic• Multiple Quantifiers• Proofing Arguments Validity– Proof by truth table– Proof by inference rules

Page 3: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic

First Order Logic

• Predicate - Proposition with variables– P(x): x > 0 p: -5 > 0– H(y): y is smart h: Peter is smart– G(s,t): s is a subset of t g: {1,2} is a subset of Ø

• Domain – Set of values that the variables take.– – –

Page 4: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic

First Order Logic

• Predicates takes different truth value on different substituted values.– P(x): x > 0, P(0) = F, P(1) = T– H(y): y is smart, H(“Peter”) = T, H(“John”) = F

H(“Paul”) = F, H(“Mary”) = T• Truth set – set of elements that are evaluated

True on a predicate.– –

Page 5: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic

From Predicates to Propositions

• By substitution P(x): x > 0– p: P(10), p: P(-1)

• By quantifiers– For All –

• for every, for any, for each, given any, for arbitrary•

– There Exists – • there is a, we can find a, at least one, for some•

Page 6: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic

Exercise

• Express in terms of .–

• Express in terms of .–

• What is the negation of ? • What is the negation of ?

Page 7: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic

All people never grow up

P – Set of all peopleG(x): x grows up

Some people never grow up. All people grow up.

Page 8: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic

S – Set of all things that can be boughtE(x): x is expensive these days.

Nothing is expensive these days.

Something is expensive these days.

Page 9: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic

S – Set of things to be described.E(x): x can end well.

Not everything can end well.

Everything can end well.

Page 10: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic

P – Set of all peopleR(x): x can readW(x): x can write

Some people can’t read and some people can’t write.

All people can read or all people can write.

Page 11: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic

P – Set of all peopleA – Set of all AmericanC(x): For x, it’s a crutchL(x): For x, it’s a way of life

For some people, it’s a crutch and for all American, it’s a way of life.

For all people, it’s not a crutch or for some American, it’s not a way of life.

Page 12: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic

Agenda

• First Order Logic• Multiple Quantifiers• Proofing Arguments Validity– Proof by truth table– Proof by inference rules

Page 13: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic

Multiple Quantifiers

• K(x, y): x takes the course y– Domain of x is set of all CSE students (S)– Domain of y is set of all CSE courses (C)

• Two quantifiers of the same type can be combined.

Page 14: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic

Multiple Quantifiers

• K(x, y): x takes the course y– Domain of x is set of all CSE students (S)– Domain of y is set of all CSE courses (C)

• Two quantifiers of different type cannot be reverse.

Page 15: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic

Exercise

• Express in terms of .–

• Express in terms of .–

• What is the negation of ? • What is the negation of ?

Page 16: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic

S – Set of all postersP – Set of all peopleM(x, y): x can make y

There are some people who can’t make any posters.

All people can make some posters.

Page 17: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic

R – Set of all retardsP – Set of all peopleK(x, y): x know y

Everyone knows some retards.

There exists someone who don’t know any retards.

Page 18: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic

Agenda

• First Order Logic• Multiple Quantifiers• Proofing Arguments Validity– Proof by truth table– Proof by inference rules

Page 19: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic

Proofing Arguments Validity

• Arguments – hypothesis and conclusion– E.g.

• Valid argument: If all hypothesizes are true, then the conclusion is true.– Proof by truth table.– Proof by Inference rules.

Page 20: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic

Proof By Truth Table 1

• Is this argument valid?

Page 21: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic

Proof By Truth Table 2

• Is this argument valid?

Page 22: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic

Inference Rules

• All can be proven by truth table• Modus Ponens Modus Tollens

• Generalization Specialization

• Transitivity Contradiction Rule

Page 23: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic

Proof By Inference Rules 1

• Show that the argument is valid.

Page 24: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic

Proof By Inference Rules 2

• Show that the argument is valid.

Page 25: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic

Inference rule for predicates

• Universal instantiation

• Universal Modus Pollens

• Universal Modus Tollens

Page 26: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic

Proof By Inference Rules 3

• Show that the argument is valid. Assume the domain of all predicates is a set and .

Page 27: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic

Proof By Inference Rules 3

• Show that the argument is valid. Assume the domain of all predicates is a set and .

Page 28: CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic

Summary

• Difference between predicates and proposition

• Quantifiers and negation• Proofing Arguments Validity– Proof by truth table– Proof by inference rules