Download Logical Arguments - Computer Science, Stony Brook University

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

Propositional calculus wikipedia , lookup

Inquiry wikipedia , lookup

Argument wikipedia , lookup

Transcript
CSE 215: Foundations of
Computer Science
Unit 2:
Logical Arguments
Kevin McDonnell
Stony Brook University – CSE 215
1
• In mathematics and logic, an argument is a sequence of
statements ending in a conclusion
• Today we will see how to determine whether an argument
is valid – that is, whether the conclusion follows
necessarily from the preceding statements
• For example, the argument:
If Socrates is a man, then Socrates is mortal.
Socrates is a man.
Therefore, Socrates is mortal.
is a valid argument that has the abstract form:
If p then q
p
∴q
(The symbol ∴ means “therefore”.)
Kevin McDonnell
Stony Brook University – CSE 215
2
• All statements in an argument, except the final one, are
called premises
• The final statement is called the conclusion
• The key fact about a valid argument is that the truth of the
conclusion must necessarily follow from the truth of the
premises
• One way to determine the validity of an argument is by
creating a truth table showing the truth values of all the
premises and the conclusion
• A row of the truth table in which all the premises are true
is called a critical row
• If the conclusion in every critical row is true, then the
argument is valid. Otherwise, the argument is invalid.
Kevin McDonnell
Stony Brook University – CSE 215
3
• Use a truth table to determine if the following argument is
valid:
p → q ∨ ~r
q→p∧r
∴ p→r
Kevin McDonnell
Stony Brook University – CSE 215
4
• In the fourth row we find that all of the premises are true,
yet the conclusion is false
• Therefore, the argument is invalid
Kevin McDonnell
Stony Brook University – CSE 215
5
• Use a truth table to determine whether the argument is
valid:
p∨q
p → ~q
p→r
∴r
Kevin McDonnell
Stony Brook University – CSE 215
6
• An argument form consisting of two premises and a
conclusion is called a syllogism
• The first and second premises are called the major
premise and minor premise, respectively
• The most famous form of syllogism in logic is called modus
ponens. It has the following form:
p→q
p
∴q
• The argument earlier involving Socrates used modus
ponens:
• If Socrates is a man, then Socrates is mortal. Socrates is a
man. Therefore, Socrates is mortal.
Kevin McDonnell
Stony Brook University – CSE 215
7
• Another most famous form of syllogism in logic is called
modus tollens. It has the following form:
p→q
~q
∴ ~p
• Example: If Zeus is human, then Zeus is mortal.
Zeus is not mortal.
Therefore, Zeus is not human.
• The validity of modus ponens and modus tollens can be
easily verified using truth tables
• Modus ponens and modus tollens are two examples of
rules of inference that can be used to build logical proofs
Kevin McDonnell
Stony Brook University – CSE 215
8
• Here are two more rules of inference, called
generalization:
p
q
∴p∨q
∴p∨q
• These rules should make intuitive sense. For example,
suppose we know Suzanne is a junior. Then it follows that
Suzanne is a junior or Suzanne is a senior.
• Here are two other similar rules of inference, called
specialization:
p∧q
p∧q
∴p
∴q
• Example: Anna knows English and Anna knows Japanese.
Therefore, Anna knows English.
Kevin McDonnell
Stony Brook University – CSE 215
9
• The “opposite” of specialization is called conjunction:
p
q
∴p∧q
• Example: Today it is raining. Today is Saturday. Therefore,
today it is raining and today is Saturday.
• I realize this seems a bit silly, but this rule actually does
come in handy.
Kevin McDonnell
Stony Brook University – CSE 215
10
• The following two rules of inference are called elimination
or disjunctive syllogism:
p∨q
p∨q
~q
~p
∴p
∴q
• Basically, the rules say that when you have only two
possibilities and you can rule one out, the other must be
the case
• Example:
x − 3 = 0 or x + 2 = 0
x+2≠0
∴x−3=0
Kevin McDonnell
Stony Brook University – CSE 215
11
• The rule of transitivity:
p→q
q→r
∴p→r
• Many arguments in mathematics contain chains of if-then
statements
• Example:
If 18,486 is divisible by 18, then 18,486 is divisible by 9.
If 18,486 is divisible by 9, then the sum of the digits of
18,486 is divisible by 9.
∴ If 18,486 is divisible by 18, then the sum of the digits of
18,486 is divisible by 9.
Kevin McDonnell
Stony Brook University – CSE 215
12
• The following argument shows division into cases:
p∨q
p→r
q→r
∴r
• Example:
x is positive or x is negative.
If x is positive, then x2 > 0.
If x is negative, then x2 > 0.
∴ x2 > 0.
Kevin McDonnell
Stony Brook University – CSE 215
13
• Use symbols to write the logical form of the following
argument and then use a truth table to test the argument
for validity.
a. If Tom is not on team A, then Chris is on team B.
b. If Chris is not on team B, then Tom is on team A.
c. ∴ Tom is not on team A or Chris is not on team B.
• Let p = “Tom is on team A”
• Let q = “Chris is on team B”
Kevin McDonnell
Stony Brook University – CSE 215
14
Kevin McDonnell
Stony Brook University – CSE 215
15
• You are about to leave for school in the morning and
discover that you don’t have your glasses. You know the
following statements are true:
a. If I was reading the newspaper in the kitchen (RK), then
my glasses are on the kitchen table (GK).
b. If my glasses are on the kitchen table (GK), then I saw
them at breakfast (SB).
c. I did not see my glasses at breakfast (~SB).
d. I was reading the newspaper in the living room (RL) or I
was reading the newspaper in the kitchen (RK).
e. If I was reading the newspaper in the living room (RL)
then my glasses are on the coffee table (GC).
• Where are the glasses?
Kevin McDonnell
Stony Brook University – CSE 215
16
• Let’s rewrite the premises symbolically and then try to
draw a conclusion.
Kevin McDonnell
Stony Brook University – CSE 215
17
• A fallacy is an error in reasoning that results in an invalid
argument
• Three common fallacies are:
1. using ambiguous premises, and treating them as if
they were unambiguous
2. circular reasoning (assuming what is to be proved
without having derived it from the premises)
3. jumping to a conclusion (without adequate grounds)
• We’ll look at two common fallacies now called the
converse error and the inverse error, which resemble
modus ponens and modus tollens, respectively
Kevin McDonnell
Stony Brook University – CSE 215
18
• The following is an invalid argument:
If Zeke is a cheater, then Zeke sits in the back row.
Zeke sits in the back row.
∴ Zeke is a cheater
• Why is this invalid?
• Let p = Zeke is a cheater
• Let q = Zeke sits in the back row
• The argument can be written:
p→q
q
∴p
• This is invalid. We cannot conclude p is true!
Kevin McDonnell
Stony Brook University – CSE 215
19
• The following is an invalid argument:
If interest rates are going up, stock market prices will go
down.
Interest rates are not going up.
∴ Stock market prices will not go down
• Why is this invalid?
• Let p = interest rates are going up
• Let q = stock market prices will go down
• The argument can be written:
p→q
~p
∴ ~q
• This is invalid. We cannot conclude anything about q’s
value.
Kevin McDonnell
Stony Brook University – CSE 215
20
• Use symbols to write the logical form of the following
argument. If the argument is valid, identify which rules of
inference guarantees its validity.
a. If I go to the movies, I won’t finish my homework.
b. If I don’t finish my homework, I won’t do well on the exam
tomorrow.
c. ∴ If I go to the movies, I won’t do well on the exam.
Kevin McDonnell
Stony Brook University – CSE 215
21
• Given the following set of premises and conclusion, use the
valid argument forms to deduce the conclusion from the
premises, giving a reason for each step.
a. ~p ∨ q → r
b. s ∨ ~q
c. ~t
d. p → t
e. ~p ∧ r → ~s
f. ∴ ~q
Kevin McDonnell
Stony Brook University – CSE 215
22
• Given the following set of premises and conclusion, use the
valid argument forms to deduce the conclusion from the
premises, giving a reason for each step.
a.
b.
c.
d.
e.
f.
Kevin McDonnell
Stony Brook University – CSE 215
23
• Given the following set of premises and conclusion, use the
valid argument forms to deduce the conclusion from the
premises, giving a reason for each step.
a.
b.
c.
d.
Kevin McDonnell
Stony Brook University – CSE 215
24
• The concept of logical contradiction can be used to make
inferences through a technique of reasoning called the
contradiction rule
• Suppose p is some statement whose truth you wish to
deduce
• If you assume that p is false and then show that this
assumption leads to a contradiction, then you can conclude
that p must be true
• The contradiction rule provides the foundation of a proof
technique called proof by contradiction that we will study
later
Kevin McDonnell
Stony Brook University – CSE 215
25
• You visit an island populated by Knights and Knaves:
knights always tell the truth and knaves always lie
• You meet two people, A and B. Your job is to determine
what A and B are.
• A says: B is a knight.
• B says: A and I are of opposite type.
Kevin McDonnell
Stony Brook University – CSE 215
26
(A says: B is a knight.)
(B says: A and I are of opposite type.)
Kevin McDonnell
Stony Brook University – CSE 215
27
•
•
•
•
•
•
•
•
You meet some natives on the island:
U says: None of us is a knight.
V says: At least three of us are knights.
W says: At most three of us are knights.
X says: Exactly five of us are knights.
Y says: Exactly two of us are knights.
Z says: Exactly one of us is a knight.
Who are knights and who are knaves?
Kevin McDonnell
Stony Brook University – CSE 215
and Z.
U: 0 knights
V: > 3 knights
W: < 3 knights
X: 5 knights
Y: 2 knights
Z: 1 knight
28
U: 0 knights
V: > 3 knights
W: < 3 knights
X: 5 knights
Y: 2 knights
Z: 1 knight
Kevin McDonnell
Stony Brook University – CSE 215
29