Download p - Erwin Sitompul

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Axiom of reducibility wikipedia , lookup

Fuzzy logic wikipedia , lookup

Jesús Mosterín wikipedia , lookup

Analytic–synthetic distinction wikipedia , lookup

Willard Van Orman Quine wikipedia , lookup

Inquiry wikipedia , lookup

Quantum logic wikipedia , lookup

Catuṣkoṭi wikipedia , lookup

Modal logic wikipedia , lookup

Truth-bearer wikipedia , lookup

Combinatory logic wikipedia , lookup

History of logic wikipedia , lookup

Intuitionistic logic wikipedia , lookup

Propositional calculus wikipedia , lookup

Mathematical logic wikipedia , lookup

Mathematical proof wikipedia , lookup

Laws of Form wikipedia , lookup

Curry–Howard correspondence wikipedia , lookup

Principia Mathematica wikipedia , lookup

Law of thought wikipedia , lookup

Foundations of mathematics wikipedia , lookup

Natural deduction wikipedia , lookup

Argument wikipedia , lookup

Transcript
Discrete Mathematics
Lecture 2
Dr.-Ing. Erwin Sitompul
President University
http://zitompul.wordpress.com
2
President University
0
1
6
Erwin Sitompul
Discrete Mathematics 2/1
Chapter 1 Logic and Proofs
Homework 1
1. Two merchants publish new marketing campaign to attract more
customers. The first merchant launches a motto “Good stuffs are not
cheap.” The second merchants says “Cheap stuffs is not good.”
a) Examine whether both mottos tell the same message or not.
b) In your opinion, which motto is better?
 Solution:
p: “Good stuffs.”
q: “Cheap stuffs.”
The motto of the first merchant: p  q.
The motto of the second merchant: q  p
Is it true that p  q  q  p
President University
Erwin Sitompul
Discrete Mathematics 2/2
Chapter 1 Logic and Proofs
Solution to Homework 1
p
q
p
q
p  q
q  p
T
T
F
F
F
F
T
F
F
T
T
T
F
T
T
F
T
T
F
F
T
T
T
T
 p  q  q  p
● The mottos of both merchants are logically
equivalent (thus identical).
President University
Erwin Sitompul
Discrete Mathematics 2/3
Chapter 1 Logic and Proofs
Variants of Conditional Proposition
 For an implication given by p  q, we can create:
 The converse, given by q  p
 The inverse, given by p  q
 The contrapositive, given by q  p
Contrapositive
p
q
p
q
T
T
F
F
T
T
T
T
T
F
F
T
F
T
T
F
F
T
T
F
T
F
F
T
F
F
T
T
T
T
T
T
President University
pq
Converse
Inverse
Implication
qp
Erwin Sitompul
p  q q  p
Discrete Mathematics 2/4
Chapter 1 Logic and Proofs
Variants of Conditional Proposition
 Example:
“If it snows, then the traffic moves slowly.”
p: “It snows.”
q: “The traffic moves slowly.”
▪ The converse
“If the traffic moves slowly, then it snows.”
▪ The inverse
“If it does not snow, then the traffic does not move slowly.”
▪ The contrapositive
“It the traffic does not move slowly, then it does not snow.”
Converse:
qp
Inverse:
p  q
Contrapositive: q  p
President University
Erwin Sitompul
Discrete Mathematics 2/5
Chapter 1 Logic and Proofs
Variants of Conditional Proposition
 Example:
Determine the converse, inverse, and contrapositive of:
“If someone owns a car, then she is rich.”
▪ The converse
“If someone is rich, then she owns a car.”
▪ The inverse
“If someone does not own a car, then she is not rich.”
▪ The contrapositive
“If someone is not rich, then she does not own a car.”
Converse:
qp
Inverse:
p  q
Contrapositive: q  p
President University
Erwin Sitompul
Discrete Mathematics 2/6
Chapter 1 Logic and Proofs
Contrapositive
 Example: Determine the contrapositive of the following propositions.
i. “If she is found guilty, then she will be put in prison.”
ii. “If 6 is greater than 0, then 6 is not a negative number.”
iii. “Ivan passes the exam only if he studies hard.”
·p only if q
Solution:
i. “If she is not put in prison, then she was not found guilty.”
ii. “If 6 is a negative number, then 6 is not greater than 0.”
iii. “If Ivan does not study hard, then he does not pass the exam.”
Contrapositive: q  p
President University
Erwin Sitompul
Discrete Mathematics 2/7
Chapter 1 Logic and Proofs
Contrapositive
 Example: Determine the contrapositive of the following propositions.
iv. “Only if she is not late, she will get the job.”
v. “Wind is necessary for the kite to fly.”
vi. “Rain falling in the afternoon is sufficient to
make the night freezing cold.”
·p only if q
·q is necessary for p
·p is sufficient for q
Solution:
iv. “If she is late, then she will not get the job.”
v. “If the wind does not blow, then the kite cannot fly.”
vi. “If the night is not freezing cold, then rain does not fall
in the afternoon.”
Contrapositive: q  p
President University
Erwin Sitompul
Discrete Mathematics 2/8
Chapter 1 Logic and Proofs
Biconditional Proposition
 Biconditional proposition is also called
bi-implication.
 Notation: p  q
 The way to pronounce: “p if and only if q”
 The biconditional p  q is true when p and q have
the same truth values and is false otherwise.
President University
Erwin Sitompul
● Biconditional
p
q
pq
T
T
T
T
F
F
F
T
F
F
F
T
Discrete Mathematics 2/9
Chapter 1 Logic and Proofs
Biconditional Proposition
 Various ways to express implication p  q:
 p if and only if q.
 p is the necessary and sufficient condition for q.
 p is necessary and sufficient for q.
 if p then q, and conversely (vise versa).
 if p then q and if q then p.
 p iff q.
President University
Erwin Sitompul
Discrete Mathematics 2/10
Chapter 1 Logic and Proofs
Biconditional Proposition
p
q
pq
pq
qp
(p  q)  (q  p)
T
T
T
T
T
T
T
F
F
F
T
F
F
T
F
T
F
F
F
F
T
T
T
T
pq
“p if and only if q”
President University


(p  q)  (q  p)
“if p then q and if q then p”
Erwin Sitompul
Discrete Mathematics 2/11
Chapter 1 Logic and Proofs
Biconditional Proposition
 Example: Biconditional in various expressions.
 “1 + 1 = 2 if and only if 2 + 2 = 4.”
 “The necessary and sufficient condition for rain to fall is high air
humidity.”
 “If you are rich, then you have much money, and vice versa.”
 “Cikarang is located in West Java iff West Java is one of the 34
provinces in Indonesia.”
 “If the weather is hot then I buy ice cream, and if I buy ice cream then
the weather is hot.”
 “Training and discipline are sufficient and necessary for you to win the
match.”
 “You are promoted if you have connection, and you have connection if
you are promoted.”
 “If I watch television too much then my eyes are irritated, and vice
versa.”
 “Trains always come late when and only when I need them for travel.”
President University
Erwin Sitompul
Discrete Mathematics 2/12
Chapter 1 Logic and Proofs
Logical Equivalences for Conditional and Biconditional
President University
Erwin Sitompul
Discrete Mathematics 2/13
Chapter 1 Logic and Proofs
Some Examples
 Example: Given a proposition
“It is not true that he learns Technical Drawing but not State Philosophy.”,
i. Express this proposition in symbolic notation (logical expression).
ii. Write one possible logically equivalent proposition as the proposition
above.
Solution:
Defining p: “He learns Technical Drawing.”
q: “He learns State Philosophy.”
i. (p  q)
ii. (p  q)  p  q
“He does not learn Technical Drawing
or learns State Philosophy.”
President University
Erwin Sitompul
p
T
T
F
F
q (p  q)
T
T
F
F
T
T
F
T
p  q
T
F
T
T
Discrete Mathematics 2/14
Chapter 1 Logic and Proofs
Some Examples
 Example: Construct a truth table for (p  q)  (p  q)
President University
Erwin Sitompul
Discrete Mathematics 2/15
Chapter 1 Logic and Proofs
Some Examples
 Example: Three propositions are given to describe the quality of a hotel.
p: “The service is good.”
q: “The room rate is low.”
r: “The hotel is a three-star hotel.”
Translate the following proposition into symbolic notation:
i. “The room rate is low but the service is bad.”
ii. “Either the room rate is high or the service is good, but not both.”
iii. “It is not the case that if a hotel is a three star hotel, then the room
rate is low and the service is bad.”
i. q  p
President University
ii. q  p
(q  p )  (q  p)
Erwin Sitompul
iii. (r  (q  p))
Discrete Mathematics 2/16
Chapter 1 Logic and Proofs
Some Examples
 Example: Express the following statement in symbolic notation:
“If you are below 17 years old, then you may not vote in a general election,
unless you are already married.”
Solution:
Defining p: “You are below 17 years old.”
q: “You are already married.”
r: “You may vote in a general election.”
Then the statement above can be express in symbolic notation as:
(p  q)  r,
“If you are below 17 years old and are not already married,
then you may not vote in a general election.”
which is equivalent to
r  (p  q)
President University
Erwin Sitompul
Discrete Mathematics 2/17
Chapter 1 Logic and Proofs
Some Examples
 Example: Proof that [p  (p  q)]  q is a tautology.
Solution:
To proof the tautology, we construct the truth table:
p
q
p
pq
p  (p  q) [p  (p  q)]  q
T
T
F
T
F
T
T
F
F
T
F
T
F
T
T
T
T
T
F
F
T
F
F
T
 [p  (p  q)]  q is a tautology.
● Redo the proof by using
logical equivalences.
President University
Erwin Sitompul
Discrete Mathematics 2/18
Chapter 1 Logic and Proofs
Argument and Proof
 The truth value of some statements about the world is obvious and easy to
assign.
 The truth of other statements may not be so obvious, but it may still follow
(be derived) from known facts about the world.
 To show the truth value (validity) of such a statement following from other
statements, we need to provide a correct supporting argument or proof.
 Important questions:
 When is the argument correct?
 How to proof that a statement is correct?
 How to construct a correct argument, what method to use?
President University
Erwin Sitompul
Discrete Mathematics 2/19
Chapter 1 Logic and Proofs
Argument and Proof
 A formal proof is a set of proofs which follows logically from the set of
premises.
 Formal proofs allow us to infer new true statements from known true
statements.
 A proposition or its part can be transformed using a sequence of logical
equivalence until some conclusions can be reached.
 Example: Show that (p  q)  p is a tautology by using logical equivalences.
President University
Erwin Sitompul
Discrete Mathematics 2/20
Chapter 1 Logic and Proofs
Argument and Proof
 In showing the truth of a statement, we must use a valid argument.
 A valid argument is one built using a so called rules of inference from
premises. When all premises are true, then the argument should lead us to
a the correct conclusion.
 Typically, a problem of finding a valid argument looks like this:
(p1  p2  p3  …  pn)  q
● Premises
● Conclusion
● Conclusion
● Premises
President University
Erwin Sitompul
Discrete Mathematics 2/21
Chapter 1 Logic and Proofs
Rules of Inference
 An inference rule is a logical form consisting of a function which takes
premises, analyzes their syntax (grammatical arrangement), and returns a
conclusion or conclusions.
 The inference rule is valid in the sense that if the premises are true, then so
is the conclusion.
 Popular rules of inference in propositional logic include modus ponens and
modus tollens.
 Modus ponens takes two premises, one in the form “if p then q” and
another in the form “p”, and returns the conclusion “q”.
 Modus tollens takes two premises, one in the form “if p then q” and
another in the form “q”, and returns the conclusion “p”.
pq
p
q
● Modus Ponens
President University
pq
q
 p
● Modus Tollens
Erwin Sitompul
Discrete Mathematics 2/22
Chapter 1 Logic and Proofs
Rules of Inference
 1. Modus ponens
Given the implication p  q
is true and p is true,
then q is true.
 2. Modus tollens
Given the implication p  q
is true and q is true,
then p is true.
President University
p
q
pq
p  (p  q)
T
T
T
T
T
F
F
F
pq
p
q
F
T
T
F
● Modus Ponens
F
F
T
F
p
q
pq
q  (p  q)
F
F
T
F
F
T
F
F
pq
q
 p
T
F
T
F
● Modus Tollens
T
T
T
T
Erwin Sitompul
Discrete Mathematics 2/23
Chapter 1 Logic and Proofs
Rules of Inference
 Modus ponens
“If today is Tuesday, then John will go to work.”
“Today is Tuesday.”
“Therefore, John will go to work.”
pq
p
q
● Modus Ponens
“If a low tide occurs after an underwater earthquake,
then a tsunami is triggered.”
“A low tide occurs after an underwater earthquake.”
“Therefore, a tsunami is triggered.”
 Modus tollens
“If the dog detects an intruder, then the dog will bark. “
“The dog did not bark.”
“Therefore, no intruder was detected by the dog.”
pq
q
 p
● Modus Tollens
President University
Erwin Sitompul
Discrete Mathematics 2/24
Chapter 1 Logic and Proofs
Checking the Validity of an Argument
 The validity of an argument can be check by using truth table.
 If [p1  p2  ….  pn ]  q is a tautology, then the argument is valid.
President University
Erwin Sitompul
Discrete Mathematics 2/25
Chapter 1 Logic and Proofs
Checking the Validity of an Argument
 Example: Show that the reasoning of the following argument is false, or the
argument is invalid:
“If a low tide occurs after an underwater earthquake, then a tsunami
is triggered.”
“A tsunami is triggered.”
“Therefore, a low tide occurs after an underwater earthquake.”
Solution:
Taking
p : “A low tide occurs after an underwater earthquake.”
q : “A tsunami is triggered.”
then the argument above can be written as: p  q
(p1)
p1
p2
q
[p1  p2 ]  q
p q
q
p
[(p q)  q]  p
T
T
T
T
F
F
T
T
T
T
F
F
T
F
F
T
President University
Erwin Sitompul
q
p
(p1)
(q)
[(p q)  q]  p is not a
tautology.
 The argument is not valid.
Discrete Mathematics 2/26
Chapter 1 Logic and Proofs
Rules of Inference
 3. Addition
Given p is true, then p  q will always be true.
p
pq
● Addition
 4. Simplification
Given p  q is true, then p (and q) will always be true.
pq
p
● Simplification
pq
q
● Simplification
President University
Erwin Sitompul
Discrete Mathematics 2/27
Chapter 1 Logic and Proofs
Example: Checking the Argument
 Example: We have the following premises:
“It is not sunny this afternoon and it is colder than yesterday.”
“We will go swimming only if it is sunny.”
“If we do not go swimming, then we will take a canoe trip.”
“If we take a canoe trip, then we will be home by sunset.”
Can we conclude that “Therefore, we will be home by sunset”?
Solution:
Defining p : “It is sunny this afternoon.”
q : “It is colder than yesterday.”
r : “We will go swimming.”
s : “We will take a canoe trip.”
t : “We will be home by sunset.”
then the argument above can be written as: p  q
r p
r  s
st
t
President University
Erwin Sitompul
● We must now check
whether this argument
is valid or not
Discrete Mathematics 2/28
Chapter 1 Logic and Proofs
Example: Checking the Argument
p  q
r p
r  s
st
t
p  q
 p
● 1st premise
● Simplification
p
r p
 r
● 2nd premise
r
r  s
s
● 3rd premise
s
st
t
● 4th premise
● Modus tollens
● Modus ponens
● Modus ponens
 The argument is VALID
President University
Erwin Sitompul
Discrete Mathematics 2/29
Chapter 1 Logic and Proofs
More Rules of Inference
 5. Conjunction
If p and q are each true, then p  q is true.
p
q
pq
● Conjunction
 6. Disjunctive syllogism
If p  q is true and p is false, then q must be true.
p  q
p
q
● Disjunctive syllogism
 7. Resolution
If p  q is true and p  r is true, then q  r must be true.
p  q
p  r
qr
● Resolution
 8. Hypothetical syllogism
If p  q is true, and q  r is true, then p  r must be true.
pq
qr
pr
● Hypothetical syllogism
President University
Erwin Sitompul
Discrete Mathematics 2/30
Chapter 1 Logic and Proofs
Summary: Rules of Inference
p
Modus ponens
pq
q
Addition
Conjunction
Resolution
President University
p
pq
p
q
pq
pq
p  r
qr
q
Modus tollens
pq
 p
pq
Simplification
p
Disjunctive
syllogism
Hypothetical
syllogism
Erwin Sitompul
pq
p
q
pq
qr
pr
Discrete Mathematics 2/31
Chapter 1 Logic and Proofs
More Example: Checking the Argument
 Example: Given the following premises:
“If it does not rain or if it is not foggy, then the sailing race will be held
and the lifesaving demonstration will go on.”
“If the sailing race is held, then the trophy will be awarded.”
“The trophy was not awarded.”
Proof that the conclusion “Therefore, it rained” is valid.
Solution:
Defining r : “It is rain.”
f : “It is foggy.”
s : “The sailing race will be held.”
d : “The lifesaving demonstration will go on.”
t : “The trophy will be awarded .”
then the argument above can be written as:
(r  f)  (s  d)
st
t
● We must now check whether
r
this argument is valid or not
President University
Erwin Sitompul
Discrete Mathematics 2/32
Chapter 1 Logic and Proofs
More Example: Checking the Argument
(s  d)  (r  f)
(s  d)  (r  f)
(r  f)  (s  d)
st
t
r
st
t
 s
● (A) Contrapositive
of 1st premise
● (B) De Morgan’s Law and
Double Negation Law of (A)
● 2nd premise
● 3rd premise
● Modus tollens
s
 s  d
● (C) Addition
(s  d)  (r  f)
s  d
 (r  f)
● Modus ponens of (B) and (C)
(r  f)
r
● Simplification
 The argument is VALID
President University
Erwin Sitompul
Discrete Mathematics 2/33
Chapter 1 Logic and Proofs
Homework 2
1. Given the statement “A valid password is necessary for you to log on to the
campus server.”
a) Express the statement above in the proposition form of “if p then q.”
b) Determine also the negation, converse, inverse, and contrapositive of
the statement.
2. Check the validity of the argument below by using truth table:
“If 5 is less then 4, then 5 is not a prime number.”
“5 is not less then 4.”
“Therefore, 5 is a prime number.”
President University
Erwin Sitompul
Discrete Mathematics 2/34
Chapter 1 Logic and Proofs
Homework 2A
1. Given the statement “In order to be registered for consultation with our
doctors, you only have to send an SMS to the number on this card.”
a) Express the statement above in the proposition form of “if p then q.”
b) Determine also the negation, converse, inverse, and contrapositive of
the statement.
2. Check the validity of the argument below by using truth table and rules of
inference:
“The budget is proposed and the venue is already booked.”
“If the deadline is reduced then the budget will not be proposed.”
“Therefore, the deadline is not reduced.”
President University
Erwin Sitompul
Discrete Mathematics 2/35