Download p and q

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

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

Document related concepts
no text concepts found
Transcript
Chapter 3 – Introduction to Logic
Logic is the formal systematic study of the principles of valid
inference and correct reasoning.
It is used in most intellectual activities, but is studied primarily
in the disciplines of philosophy, mathematics, semantics, and
computer science.
Logic examines:
(a) general forms which arguments may take,
(b) which forms are valid, and
(c) which forms are fallacies.
The initial motivation for the study of logic was to learn to
distinguish good arguments from bad arguments.
3.1 – Statements and Quantifiers
Statements
A statement is defined as a declarative sentence that is either
true or false, but not both simultaneously.
Compound Statements
A compound statement may be formed by combining two or
more statements.
The statements making up the compound statement are called
the component statements.
Connectives such as and, or, not, and if…then, can be used in
forming compound statements.
3.1 – Statements and Quantifiers
Determine whether or not the following sentences are
statements, compound statements, or neither.
If Amanda said it, then it must be true.
Compound statement (if, then)
Today is extremely warm.
Statement
The gun is made by Smith and Wesson.
Statement
The gun is a pistol and it is made by Smith and Wesson.
Compound statement (and)
3.1 – Statements and Quantifiers
Negations
A negation is a statement that is a refusal or denial of some
other statement.
Statement: Max has a valuable card.
Negation: Max does not have a valuable card.
The negation of a true statement is false and the negation of a
false statement is true.
Statement: The number 9 is odd.
Negation: The number 9 is not odd.
Statement: The product of 2 negative numbers is not positive.
Negation: The product of 2 negative numbers is positive.
3.1 – Statements and Quantifiers
Negations and Inequality Symbols
Symbolism
ab
a b
ab
ab
Meaning
a is less than b
a is greater than b
a is less than or equal to b
a is greater than or equal to b
Give a negation of each inequality. Do not use a slash symbol.
Statement: p ≥ 3
Negation: p < 3
Statement: 3x – 2y < 12
Negation: 3x – 2y ≥ 12
3.1 – Statements and Quantifiers
Symbols
To simplify work with logic, symbols are used.
Statements are represented with letters, such as p, q, or r,
while several symbols for connectives are shown below.
Connective
Symbol Type of Statement
and
Conjunction
or
not
Disjunction
Negation
3.1 – Statements and Quantifiers
Translating from Symbols to Words
Let: p represent “It is raining,”
q represent “It is March.”
Write each symbolic statement in words.
p˅q
It is raining or it is March.
̴ (p ˄ q)
It is not the case that it is raining and it is March.
3.1 – Statements and Quantifiers
Quantifiers
Universal Quantifiers are the words all, each, every, no, and
none.
Existential Quantifiers are words or phrases such as some,
there exists, for at least one, and at least one.
Quantifiers are used extensively in mathematics to indicate
how many cases of a particular situation exist.
Negations of Quantified Statements
Statement
Negation
All do.
Some do not.
Some do.
None do.
3.1 – Statements and Quantifiers
Forming Negations of Quantified Statements
Statement: Some cats have fleas.
Negation: No cats have fleas.
Statement: Some cats do not have fleas.
Negation: All cats have fleas.
Statement: All dinosaurs are extinct.
Negation: Not all dinosaurs are extinct.
Statement: No horses fly.
Negation: Some horses fly.
3.1 – Statements and Quantifiers
Sets of Numbers
Natural Numbers: {1, 2, 3, 4, …}
Whole Numbers: {0, 1, 2, 3, …}
Integers: {…, -3, -2, -1, 0, 1, 2, 3, 4, …}
Rational Numbers: Any number that can be expressed as a
quotient of two integers (terminating or repeating decimal).
a

 a and b are integers and b  0 
b

Irrational Numbers: Any number that can not be expressed as a
quotient of two integers (non-terminating and non-repeating).
Real Numbers: Any number expressed as a decimal.
3.1 – Statements and Quantifiers
True or False
Every integer is a natural number.
False: – 1 is an integer but not a natural number.
A whole number exists that is not a natural number.
True: 0 is the number.
There exists an irrational number that is not real.
False: All irrational numbers are real numbers.
3.2 – Truth Tables and Equivalent Statements
Truth Values
The truth values of component statements are used to find the
truth values of compound statements.
Conjunctions
The truth values of the conjunction p and q (p ˄ q), are given
in the truth table on the next slide. The connective “and”
implies “both.”
Truth Table
A truth table shows all four possible combinations of truth
values for component statements.
3.2 – Truth Tables and Equivalent Statements
Conjunction Truth Table
p and q
q
p˄q
T
T
T
F
T
F
F
F
T
F
F
F
p
3.2 – Truth Tables and Equivalent Statements
Finding the Truth Value of a Conjunction
If p represent the statement 4 > 1 and q represent the statement
12 < 9, find the truth value of p ˄ q.
p and q
4>1
p is true
12 < 9
q is false
The truth value for p ˄ q is false
q
p˄q
T
T
T
F
T
F
F
F
T
F
F
F
p
3.2 – Truth Tables and Equivalent Statements
Disjunctions
The truth values of the disjunction p or q (p ˅ q) are given in
the truth table below. The connective “or” implies “either.”
Disjunction Truth Table
p or q
p
q
p˅q
T
T
T
T
F
T
F
T
T
F
F
F
3.2 – Truth Tables and Equivalent Statements
Finding the Truth Value of a Disjunction
If p represent the statement 4 > 1, and q represent the
statement 12 < 9, find the truth value of p ˅ q.
p or q
4>1
p is true
p
q
p˅q
12 < 9
q is false
T
T
T
T
F
T
F
T
T
F
F
F
The truth value for p ˅ q is true
3.2 – Truth Tables and Equivalent Statements
Negation
The truth values of the negation of p ( ̴ p) are given in the
truth table below.
not p
p
̴p
T
F
F
T
3.2 – Truth Tables and Equivalent Statements
Example: Constructing a Truth Table
Construct the truth table for: p ˄ (~ p ˅ ~ q)
A logical statement having n component statements will have
2n rows in its truth table.
22 = 4 rows
p
q
T
T
T
F
F
T
F
F
~p
~q
~p˅~q
p ˄ (~ p ˅ ~ q)
3.2 – Truth Tables and Equivalent Statements
Example: Constructing a Truth Table
Construct the truth table for: p ˄ (~ p ˅ ~ q)
A logical statement having n component statements will have
2n rows in its truth table.
22 = 4 rows
q
~p
T
T
F
T
F
F
F
T
T
F
F
T
p
~q
~p˅~q
p ˄ (~ p ˅ ~ q)
3.2 – Truth Tables and Equivalent Statements
Example: Constructing a Truth Table
Construct the truth table for: p ˄ (~ p ˅ ~ q)
A logical statement having n component statements will have
2n rows in its truth table.
22 = 4 rows
q
~p
~q
T
T
F
F
T
F
F
T
F
T
T
F
F
F
T
T
p
~p˅~q
p ˄ (~ p ˅ ~ q)
3.2 – Truth Tables and Equivalent Statements
Example: Constructing a Truth Table
Construct the truth table for: p ˄ (~ p ˅ ~ q)
A logical statement having n component statements will have
2n rows in its truth table.
22 = 4 rows
q
~p
~q
~p˅~q
T
T
F
F
F
T
F
F
T
T
F
T
T
F
T
F
F
T
T
T
p
p ˄ (~ p ˅ ~ q)
3.2 – Truth Tables and Equivalent Statements
Example: Constructing a Truth Table
Construct the truth table for: p ˄ (~ p ˅ ~ q)
A logical statement having n component statements will have
2n rows in its truth table.
22 = 4 rows
q
~p
~q
~p˅~q
p ˄ (~ p ˅ ~ q)
T
T
F
F
F
F
T
F
F
T
T
T
F
T
T
F
T
F
F
F
T
T
T
F
p
3.2 – Truth Tables and Equivalent Statements
Example: Mathematical Statements
If p represent the statement 4 > 1, and q represent the
statement 12 < 9, and r represent 0 < 1, decide whether the
statement is true or false.
̴p˄ ̴q
p q
T T
T F
F T
F F
̴p ̴q
̴p ˄ ̴q
3.2 – Truth Tables and Equivalent Statements
Example: Mathematical Statements
If p represent the statement 4 > 1, and q represent the
statement 12 < 9, and r represent 0 < 1, decide whether the
statement is true or false.
̴p˄ ̴q
p q
T T
̴p ̴q
F F
T F
F T
F F
F T
T F
T T
̴p ˄ ̴q
3.2 – Truth Tables and Equivalent Statements
Example: Mathematical Statements
If p represent the statement 4 > 1, and q represent the
statement 12 < 9, and r represent 0 < 1, decide whether the
statement is true or false.
̴p˄ ̴q
p q
T T
̴p ̴q
F F
̴p ˄ ̴q
F
T F
F T
F F
F T
T F
T T
F
F
T
The truth value for the statement is false.
3.2 – Truth Tables and Equivalent Statements
Example: Mathematical Statements
If p represent the statement 4 > 1, and q represent the
statement 12 < 9, and r represent 0 < 1, decide whether the
statement is true or false.
( ̴ p ˄ r) ˅ ( ̴ q ˄ p)
p q r
T T T
T T F
T F T
T F F
F T T
F T F
F
F T
F
F F
̴p ̴q ̴r
̴p ˄ r
̴q ˄ p
˅
3.2 – Truth Tables and Equivalent Statements
Example: Mathematical Statements
If p represent the statement 4 > 1, and q represent the
statement 12 < 9, and r represent 0 < 1, decide whether the
statement is true or false.
( ̴ p ˄ r) ˅ ( ̴ q ˄ p)
p q r
̴p ̴q ̴r
T T T
F F F
T T F
F F T
T F T
F T F
T F F
F T T
F T T
T F F
F T F
T F T
F
F T
T T F
F
F F
T T T
̴p ˄ r
̴q ˄ p
˅
3.2 – Truth Tables and Equivalent Statements
Example: Mathematical Statements
If p represent the statement 4 > 1, and q represent the
statement 12 < 9, and r represent 0 < 1, decide whether the
statement is true or false.
( ̴ p ˄ r) ˅ ( ̴ q ˄ p)
p q r
̴p ̴q ̴r
̴p ˄ r
T T T
F F F
F
T T F
F F T
F
T F T
F T F
F
T F F
F T T
F
F T T
T F F
T
F T F
T F T
F
F
F T
T T F
T
F
F F
T T T
F
̴q ˄ p
˅
3.2 – Truth Tables and Equivalent Statements
Example: Mathematical Statements
If p represent the statement 4 > 1, and q represent the
statement 12 < 9, and r represent 0 < 1, decide whether the
statement is true or false.
( ̴ p ˄ r) ˅ ( ̴ q ˄ p)
p q r
̴p ̴q ̴r
̴p ˄ r
̴q ˄ p
T T T
F F F
F
F
T T F
F F T
F
F
T F T
F T F
F
T
T F F
F T T
F
T
F T T
T F F
T
F
F T F
T F T
F
F
F
F T
T T F
T
F
F
F F
T T T
F
F
˅
3.2 – Truth Tables and Equivalent Statements
Example: Mathematical Statements
If p represent the statement 4 > 1, and q represent the
statement 12 < 9, and r represent 0 < 1, decide whether the
statement is true or false.
( ̴ p ˄ r) ˅ ( ̴ q ˄ p)
p q r
̴p ̴q ̴r
̴p ˄ r
̴q ˄ p
˅
T T T
F F F
F
F
F
T T F
F F T
F
F
F
T F T
F T F
F
T
T
T F F
F T T
F
T
T
F T T
T F F
T
F
T
F T F
T F T
F
F
F
F
F T
T T F
T
F
T
F
F F
T T T
F
F
F
The truth value for the statement is true.
3.2 – Truth Tables and Equivalent Statements
Equivalent Statements
Two statements are equivalent if they have the same truth
value in every possible situation.
Are the following statements equivalent?
~ p ˄ ~ q and ̴ (p ˅ q)
p
T
T
F
F
q
T
F
T
F
~p˄~q
̴ (p ˅ q)
3.2 – Truth Tables and Equivalent Statements
Equivalent Statements
Two statements are equivalent if they have the same truth
value in every possible situation.
Are the following statements equivalent?
~ p ˄ ~ q and ̴ (p ˅ q)
p
T
T
F
F
q
T
F
T
F
~p˄~q
F
F
F
T
̴ (p ˅ q)
3.2 – Truth Tables and Equivalent Statements
Equivalent Statements
Two statements are equivalent if they have the same truth
value in every possible situation.
Are the following statements equivalent?
~ p ˄ ~ q and ̴ (p ˅ q)
p
T
T
F
F
q
T
F
T
F
~p˄~q
F
F
F
T
Yes
̴ (p ˅ q)
F
F
F
T
3.3 – The Conditional
A conditional statement is a compound statement that uses
the connective if…then.
The conditional is written with an arrow, so “if p then q” is
symbolized
p  q.
The conditional is read as “p implies q” or “if p then q.”
The statement p is the antecedent, while q is the consequent.
3.3 – The Conditional
Special Characteristics of Conditional Statements
for a Truth Table
Teacher:
“If you participate in class, then you will get extra points."
When the antecedent is true and the consequent is true, p → q is
true.
If you participate in class (true) and you get extra points (true) then,
The teacher's statement is true.
When the antecedent is true and the consequent is false, p → q is
false.
If you participate in class (true) and you do not get extra points (false),
then,
The teacher’s statement is false.
3.3 – The Conditional
Special Characteristics of Conditional Statements
for a Truth Table
“If you participate in class, then you will get extra points."
If the antecedent is false, then p → q is automatically true.
If you do not participate in class (false), the truth of the teacher's
statement cannot be judged.
The teacher did not state what would happen if you did NOT participate
in class. Therefore, the statement has to be “true”.
If you do not participate in class (false), then you get extra points.
If you do not participate in class (false), then you do not get extra points.
The teacher's statement is true in both cases.
3.3 – The Conditional
Truth Table for The Conditional
If p, then q
q
p→q
T
T
T
T
F
F
F
T
T
F
F
T
p
A tautology is a statement that is always true, no matter what
the truth values of the components are.
3.3 – The Conditional
Examples:
Decide whether each statement is True or False
(T represents a true statement, F a false statement).
T → (4 < 2)
T→F
F
(8 = 1) → F
F→F
T
F → (3 ≠ 9)
F→T
T
3.4 – More on the Conditional
Converse, Inverse, and Contrapositive
Conditional
Statement
p→q
If p, then q
Converse
q→p
If q, then p
̴p→ ̴q
If not p, then
not q
̴q→ ̴p
If not q, then
not p
Inverse
Contrapositive
3.4 – More on the Conditional
Determining Related Conditional Statements
Given the conditional statement, determine the following:
a) the converse, b) the inverse, and c) the contrapositive.
If I live in Wisconsin, then I shovel snow,
a) Converse
If I shovel snow, then I live in Wisconsin.
b) Inverse
If I do not live in Wisconsin, then I do not shovel snow.
c) Contrapositive
If I do not shovel snow, then I do not live in Wisconsin.
3.4 – More on the Conditional
Equivalences
A conditional statement and its contrapositive are equivalent,
and the converse and inverse are equivalent.
Alternative Forms of “If p, then q”
The conditional p → q can be translated in any of the
following ways:
If p, then q.
p is sufficient for q.
If p, q.
q is necessary for p.
p implies q.
All p are q.
p only if q.
q if p.
3.4 – More on the Conditional
Rewording Conditional Statements
Write each statement in the form “if p, then q.”
a) You’ll be sorry if I go.
(q if p)
If I go, then you’ll be sorry.
b) Today is Sunday only if yesterday was Saturday.
(p only if q)
If today is Sunday, then yesterday was Saturday.
c) All Chemists wear lab coats.
(All p are q)
If you are a Chemist, then you wear a lab coat.
3.4 – More on the Conditional
Negation of a Conditional
The negation of 𝑝 → 𝑞: ~(𝑝 → 𝑞) = 𝑝 ∧ ~𝑞
A Conditional as a Disjunction
The conditional 𝑝 → 𝑞 is equivalent to ~𝑝 ∨ 𝑞
Examples:
If the river is narrow, then we can cross it.
p: the river is narrow. p: the river is not narrow.
q: we can cross it.
q: we cannot cross it.
Negation:
Disjunction:
The river is narrow and
The river is not narrow
we cannot cross it.
or we can cross it.
3.4 – More on the Conditional
Negation of a Conditional
The negation of 𝑝 → 𝑞: ~(𝑝 → 𝑞) = 𝑝 ∧ ~𝑞
A Conditional as a Disjunction
The conditional 𝑝 → 𝑞 is equivalent to ~𝑝 ∨ 𝑞
Examples:
If you are absent, then you have a test.
p: you are absent.
p: you are not absent.
q: you have a test.
q: you do not have a test.
Negation:
You are absent and you
do not have a test.
Disjunction:
You are not absent or
you have a test.
Related documents