Uploaded by kimbagacina11

THE-NATURE-OF-LOGIC

advertisement
THE NATURE OF LOGIC
INTRODUCTION
In everyday life, reasoning proves different points. For example, to prove to a
service provider that you had paid your bills on time, you can show the official receipt of
payment. To prove to an airline that you have booked for a flight, you can show your
online reservation or your ticket. Similarly, mathematics and computer science use
mathematical logic or simply logic to prove the results. In particular, mathematical logic
is used in mathematics to prove theorem. In computer science, logic is used to prove the
results of computer algorithms or the correctness of a computer program.
Logic is commonly known as the science of reasoning. Mathematical reasoning
and arguments are based on the rules of logic.
PROPOSITIONS AND RELATED CONCEPTS
A proposition is any meaningful statement that is either true or false, but never
both. Throughout this book, lowercase letters, such as a, b, c, .., p, q, r… will be used
to represent propositions. The truth value of a proposition is true, denoted by T or 1,
if it is a true statement. The truth value of a false statement is F, or 0.
Consider the following examples:
a.
b.
c.
d.
e.
f.
Aidan loves Aimee.
Batman is left-handed.
Columbus discovered the Philippines.
Dynamite is dangerous.
Elephants have wings.
Five is less than 10.
All these statements are propositions. You can determine the truth or falsity of each
statement.
Consider the following:
p. how are you?
q. the square of an integer X.
r. study your lessons everyday!
These are not propositions. The first one is a not a proposition because it is a
question. The second one is not a proposition because you cannot determine the truth
value of the phrase, and the third one is not a proposition because it is a command.
The negation of a proposition p, is the proposition not p. It is denoted by ~š‘. The
truth table of not p is given below.
š’‘
T
F
~š’‘
F
T
COMPOUND PROPOSITIONS
New propositions called compound propositions can be obtained from old ones
by using propositional connectives or logical connectives or operators. The
propositions that form compound propositions are called propositional variables. The
truth table provides the truth value for the result applying the operation on each
possible set of truth values for the operands.
The essential point about assigning truth values to compound statements is that
it allows you− using logic alone− to judge the truth of a compound statement on the
basis of your knowledge of the truth of its component parts. Logic does not help you
determine the truth or falsity of the component statements but rather logic helps link
these separate pieces of information together into a coherent whole.
Let p and q be propositions. The conjunction of p and q, denoted by p ^ q, is
the proposition, p and q. This proposition is defined to be true only when both p and q
are true, and false, otherwise. The truth table of the disjunction of p or q is given in the
following table:
š’‘
T
T
F
F
q
p^q
š’‘
T
T
F
F
q
š’‘
T
T
F
F
q
p⊕q
T
F
T
F
F
T
T
F
T
T
F
F
T
F
F
F
The disjunction of p or q, denoted by p v q, is the proposition, p or q. This
proposition is defined to be a false only when both p and q are false, and true, otherwise.
The truth table of the disjunction of p or q is given in the following table:
pvq
T
T
F
T
T
T
F
F
The exclusive-or of p or q, denoted by p ⊕ q is the proposition that is true
when exactly one of p and q is true and is false otherwise. The truth table of the exclusive
or p and q is given in the following table:
The proposition p NAND q, written p|q is the proposition that is true when either
p or q, or both are false and it is false when both p and q are true. The truth table of
p|q is given in the following table:
š’‘
T
T
F
F
q
p| q
T
F
T
F
F
T
T
T
The proposition p NOR q, written p ↓ q is the proposition that is true when both
p and q are false and it is false otherwise. The truth table of p ↓ q is given in the following
table:
š’‘
T
T
F
F
q
p↓q
T
F
T
F
F
T
T
T
Example 1
Construct the truth table of [~(š‘^š‘ž)] š‘£ š‘Ÿ.
Solution:
š’‘
T
T
T
T
F
F
F
F
š’’
T
T
F
F
T
T
F
F
š‘Ÿ
T
F
T
F
T
F
T
F
š’‘^š’’
T
T
F
F
F
F
F
F
~(š’‘^š’’)
F
F
T
T
T
T
T
T
[~(š’‘^š’’)] š’— š’“
T
F
T
T
T
T
T
T
Example 2
Construct a truth table for the statement (š‘š‘ž )š‘£ ~š‘Ÿ.
Solution:
š’‘
T
T
T
T
F
F
F
F
š’’
T
T
F
F
T
T
F
F
š‘Ÿ
T
F
T
F
T
F
T
F
š’‘^š’’
T
T
F
F
F
F
F
F
~š’“
F
T
F
T
F
T
F
T
(š’‘^š’’)] š’— ~š’“
T
T
F
T
F
T
F
T
Example 3
Construct the following statements:
š‘: 5 is an integer.
š‘ž: √3 is an integer.
š‘Ÿ: 2 divides 4.
Construct the following statements and determine the truth values.
1. (2 divides 4 or 5 is an integer) and 2 divides 4.
2. (5 is an integer and √3 is an integer) and 2 divides 4.
Solution 1: the statement (2 divides 4 or 5 is an integer) and 2 divides 4 can
be written in proportional form as (š‘Ÿ v š‘) ^ š‘Ÿ. Since š‘ is true, š‘ž is false, and š‘Ÿ
is true, the truth value is
š’‘
T
š’’
F
š’“
T
(š’“ v š’‘)
T
(š’“ v š’‘) ^ š’“
T
Solution 2: the statement (5 is an integer and √3 is an integer) and 2 divides
4 can be written in propositional form as (~š‘ ^ š‘ž ) ^ š‘Ÿ. Since š‘ is true, not š’‘
is false , š‘ž is false, and š‘Ÿ is true, the truth value is
š’‘
T
š’’
F
š’“
T
~š’‘
F
(~š’‘^š’’)
F
(~š’‘^š’’) ^š’“
F
Example 4
Show that š‘^š‘ž = š‘ž^š‘.
Solution: construct the truth table.
š’‘
T
T
F
F
š’’
T
F
T
F
š’‘^š’’
T
F
F
F
š’’^š’‘
T
F
F
F
Since, they have the same truth values, they are equivalent.
Example 5
Show that (š‘^š‘ž) v š‘Ÿ ≡ (š‘ v š‘Ÿ) ^ (š‘ž v š‘Ÿ)
Solution: Construct the truth table.
š’‘
T
T
T
T
F
F
F
F
š’’
T
T
F
F
T
T
F
F
Hence, (š‘^š‘ž) v
š’“
š’‘^š’’
š’‘vš’“
T
T
T
F
T
T
T
F
T
F
F
T
T
F
T
F
F
F
T
F
T
F
F
F
š‘Ÿ ≡ (š‘ v š‘Ÿ) ^ (š‘ž v š‘Ÿ)
š’’vš’“
T
T
T
F
T
T
T
F
Example 6
Show that ~(š‘^š‘ž) ā‰¢ š‘^~š‘ž.
Solution: use the truth table to prove the claim.
(š’‘^š’’) v š’“
T
T
T
F
T
F
T
F
(š’‘vš’“) ^ (š’’v š’“)
T
T
T
F
T
F
T
F
š’‘
T
T
F
F
~(š’‘ ŹŒ š’’) ~š’‘ ŹŒ ~š’’
š’’
~š’‘
~š’’
š’‘ŹŒš’’
T
F
F
T
F
F
F
F
T
F
T
F
T
T
F
F
T
F
F
T
T
F
T
T
Since two lines in the truth tables are not equal, the claim is correct.
≠
≠
CONDITIONAL STATEMENTS AND
BICONDITIONAL STATEMENTS
You may have encountered statements such as “if it rains, then our outing is
cancelled,” and “if I pass this course, then I will graduate next year.” In mathematics,
there are statements such as “if the sum of the digits in a number is divisible by 9, then
the number is divisible by 9,” and “if a triangle is isosceles, then the two sides are equal.”
Notice in the aforementioned examples, the statements are connected by
“if..then.” If p and q are two statements, “if p, then q” is a statement called an
implication, or a conditional statement, which is written as š’‘ → š’’; š’‘ is called the
hypothesis, or premise, or antecedent; and š’’ is called the conclusion or
consequence.
The statement š‘ → š‘ž is called a conditional statement because š‘ → š‘ž asserts that
š‘ž is true on the condition the š‘ holds. The truth table š‘ → š‘ž is given below.
š’‘
T
T
F
F
š’’
T
F
T
F
š’‘→š’’
T
F
T
T
Notice that the statement š‘ → š‘ž is true when both š‘ and š‘ž are true when š‘ is
false, no matter what truth value š‘ž has.
Other ways to express a conditional statement are as follows:
“if š‘, then š‘ž”
“š‘ only if š‘ž”
“š‘ is sufficient for š‘ž”
“š‘ž whenever š‘”
“š‘ž if š‘”
“š‘ž when š‘”
“š‘ž is necessary for š‘”
“š‘ž follows from š‘”
You can form new conditional statements from the implication š‘ → š‘ž. The
proposition š‘ž → š‘ is called the converse of š‘ → š‘ž. The contrapositive of š‘ → š‘ž is the
proposition ~š‘ž → ~š‘. The statement ~š‘ → ~š‘ž is called the inverse of the implication
š‘ → š‘ž.
Example 1
Consider the following statement “if 3 is not even integer, then the square root of
4 is even.” Write the converse, inverse, and contrapositive of this implication.
Solution: let š‘: 3 is not an even integer
š‘ž: the square root of 4 is even
The above statement can be expressed in propositional form as š‘ → š‘ž. The
converse is š‘ž → š‘. If the square root of 4 is even, then 3 is not an even integer.
The inverse is ~š‘ → ~š‘ž. In the context of the statement, it can be expressed as
“if 3 is not even integer, then the square root of 4 is even.”
The contrapositive is ~š‘ž → ~š‘ which can be expressed in words as “if the square
root of 4 is not an even integer, then 3 is an even integer.”
Another way to combine propositions that express that two propositions have the
same truth value is by using biconditional statements or bi-implications. The
biconditional statements š‘ ↔ š‘ž, (š‘Ÿš‘’š‘Žš‘‘ š‘Žš‘  š‘ š‘–š‘  š‘™š‘œš‘”š‘–š‘š‘Žš‘™š‘™š‘¦ š‘’š‘žš‘¢š‘–š‘£š‘Žš‘™š‘’š‘›š‘” š‘”š‘œ š‘ž) is the
proposition “š‘ š‘–š‘“ š‘Žš‘›š‘‘ š‘œš‘›š‘™š‘¦ š‘–š‘“ š‘ž. " The bi-implication š‘ ↔ š‘ž can also be written as
š‘ ≡ š‘ž. This statement is true when š‘ š‘Žš‘›š‘‘ š‘ž have the same truth values.
The truth table is given below.
š’‘
T
T
F
F
š’’
T
F
T
F
š’‘↔š’’
T
F
F
T
Other ways to express š‘ ↔ š‘ž are follows:
“š‘ š‘–š‘  š‘›š‘’š‘š‘’š‘ š‘ š‘Žš‘Ÿš‘¦ š‘Žš‘›š‘‘ š‘ š‘¢š‘“š‘“š‘–š‘š‘–š‘’š‘›š‘” š‘“š‘œš‘Ÿ š‘ž"
"š‘–š‘“ š‘ š‘Žš‘›š‘‘ š‘ž š‘Žš‘›š‘‘ š‘š‘œš‘›š‘£š‘’š‘Ÿš‘ š‘’š‘™š‘¦"
"š‘ š‘–š‘“ š‘ž" š‘œš‘Ÿ "š‘ š‘–š‘“ š‘œš‘›š‘™š‘¦ š‘–š‘“ š‘ž"
Example 2
Determine if š‘ v (š‘ž ŹŒ š‘Ÿ) and (š‘ v š‘ž) ŹŒ (š‘ v š‘Ÿ) are logically equivalent.
Solution:
Construct a truth table and determine if they have the same truth
table.
š’‘
T
T
T
T
F
F
F
F
š’’
T
T
F
F
T
T
F
F
š’“
T
F
T
F
T
F
T
F
š’’ŹŒš’“
T
F
F
F
T
F
F
F
š’‘ v (š’’ ŹŒ š’“)
T
T
T
T
T
F
F
F
š’‘vš’’
T
T
T
T
T
T
F
F
š’‘v š’“
T
T
T
T
T
F
T
F
(š’‘ v š’’) ŹŒ (š’‘ v š’“
T
T
T
T
T
F
F
F
Because the truth tables of š‘ v (š‘ž ŹŒ š‘Ÿ) and (š‘ v š‘ž) ŹŒ (š‘ v š‘Ÿ) agree, these compound
propositions are logically equivalent. This is called the distributive law of
disjunction over conjunction.
Example 3
Show that ~(š‘ ŹŒ š‘ž) ≡ ~š‘ v ~š‘ž.
Solution:
the truth table is given below.
š’‘
š’’
š’‘ŹŒš’’
~(š’‘ ŹŒ š’’) ~š’‘
~š’’
~š’‘ v ~š’’
T
T
T
F
F
F
F
T
F
F
T
F
T
T
F
T
F
T
T
F
T
F
F
F
T
T
T
T
From the truth table, ~(š‘ ŹŒ š‘ž) š‘Žš‘›š‘‘ ~š‘ v ~š‘ž have the same truth values,
hence they are logically equivalent. This form is called De Morgan’s Law.
TAUTOLOGIES, CONTRADICTIONS, AND CONTINGIES
Compound propositions can be a tautology, a contradiction or an absurdity,
or a contingency. A compound proposition is called a tautology if it is always true for
all possible values of its propositional variables. A contradiction or absurdity is a
propositional form which is always false for all possible values of its propositional
variables. A propositional form which is neither a tautology nor a contradiction is called a
contingency.
Example
Construct the truth table for the given propositions and determine whether the
propositions is a tautology, contradiction, or contingency.
a.
b.
c.
d.
e.
(š‘ ŹŒ š‘ž) → (š‘ → š‘ž)
š‘ → ~(~š‘)
š‘ ŹŒ ~š‘ž
(š‘ ŹŒ ~š‘) → š‘ž
(š‘ → š‘ž) ŹŒ ( š‘ž → š‘)
Solutions: a. (š‘ ŹŒ š‘ž) → (š‘ → š‘ž)
š’‘
š’’
š’‘ŹŒš’’
š’‘→š’’
(š’‘ ŹŒ š’’) → (š’‘ → š’’)
T
T
T
T
T
T
F
F
F
T
F
T
F
T
T
F
F
F
T
T
Since the truth values of the propositions are all possible values of the variables
š‘ š‘Žš‘›š‘‘ š‘ž, it follows that the proposition is a tautology.
b.
š‘ → ~(~š‘)
š’‘
~š’‘
~(~š’‘)
š’‘ → ~(~š’‘)
T
F
T
T
F
T
F
T
Since the truth values of the propositions are all possible values of the
variables š‘ , it follows that the proposition is a tautology.
c. š‘ ŹŒ ~š‘ž
š’‘
~š’‘
š’‘ ŹŒ ~š’’
T
F
F
F
T
F
Since the truth values of the propositions are all possible values of the
variables š‘ , it follows that the proposition is a contradiction or absurdity.
š‘‘. (š‘ ŹŒ ~š‘) → š‘ž
(š’‘ ŹŒ ~š’‘) → š’’
š’‘
š’’
~š’‘
š’‘ ŹŒ ~š’‘
T
T
F
F
T
T
F
F
F
T
F
T
T
F
T
F
F
T
F
T
Since the truth values of the propositions are all possible values of the
variables š‘ š‘Žš‘›š‘‘ š‘ž, it follows that the proposition is a tautology.
š‘’. (š‘ → š‘ž) ŹŒ ( š‘ž → š‘)
(š’‘ → š’’) ŹŒ ( š’’ → š’‘)
š’‘
š’’
š’‘→š’’
š’’→š’‘
T
T
T
T
T
T
F
F
T
F
F
T
T
F
F
F
F
T
T
T
Since the truth values of the propositions are neither true nor false for all
possible values of the variables š‘ š‘Žš‘›š‘‘ š‘ž, it it follows that the proposition is
a contingency.
VALID ARGUMENTS
Consider the following statements: If triangles š‘‡ā‚ š‘Žš‘›š‘‘ š‘‡ā‚‚ are congruent, then
š‘‡ā‚ š‘Žš‘›š‘‘ š‘‡ā‚‚ are similar. Triangles š‘‡ā‚ š‘Žš‘›š‘‘ š‘‡ā‚‚ are congruent. Therefore, š‘‡ā‚ š‘Žš‘›š‘‘ š‘‡ā‚‚ are similar.
This is an example of an argument. It consists of a sequence of statements called
premises, followed by a final statements called the conclusion. In the aforementioned
example, the statements “If triangles š‘‡ā‚ š‘Žš‘›š‘‘ š‘‡ā‚‚ are congruent, then š‘‡ā‚ š‘Žš‘›š‘‘ š‘‡ā‚‚ are similar”
and “Triangles š‘‡ā‚ š‘Žš‘›š‘‘ š‘‡ā‚‚ are congruent” are the premises. The statement introduced by
the word therefore is the conclusion. In a formal presentation of an argument, the symbol
(∴) is placed before the conclusion to denote the word therefore.
Example 1
If Glenn solved all the problem in the final exams correctly, then Glenn obtained a
grade of 100. Glenn solved all the problems in the final correctly. Therefore, Glenn got a
grade of 100.
Example 2
If 20151 is divisible by 9, then 20151 is divisible by 3. If 20151 is divisible by 3,
then the sum of the digits of 20151 is divisible by 3. Therefore, if 20151 is divisible by 9,
then the sum of the digits of 20151 is divisible by 3.
Example 3
If Xian studies, then he will pass the test. If Xian does not play internet games,
then he will study. Xian did not pass the test. Therefore, Xian played internet games.
Arguments are analysed by considering their forms. An argument is said to be valid
if and only if the truth of the conclusion follows necessarily from the truth of its premises.
That is, if of the premises (š‘ƒā‚ ^ š‘ƒā‚‚ ^ š‘ƒā‚ƒ … ^š‘ƒš‘›) → conclusion š‘Ÿ is a tautology. Sometimes,
an argument is written in the following form:
š‘ƒā‚
š‘ƒā‚‚
ā‹®
š‘ƒā‚ƒ
š‘ƒš‘›
∴š‘Ÿ
One way to determine the validity of an argument is by constructing a truth table.
Example 4
Construct a truth table for the given argument: If triangles š‘‡ā‚ š‘Žš‘›š‘‘ š‘‡ā‚‚ are
congruent, then š‘‡ā‚ š‘Žš‘›š‘‘ š‘‡ā‚‚ are similar.
Solution:
Let š‘: triangles š‘‡ā‚ š‘Žš‘›š‘‘ š‘‡ā‚‚ are congruent.
š‘ž: triangles š‘‡ā‚ š‘Žš‘›š‘‘ š‘‡ā‚‚ are similar.
The argument can be written in the form:
š‘ŹŒš‘ž
š‘
∴š‘ž
Constructing the truth table yields the following:
(š’‘ ŹŒ š’’) ŹŒ š’‘
[(š’‘ ŹŒ š’’) ŹŒ š’‘] → š’’
š’‘
š’’
š’‘ŹŒš’’
T
T
T
T
T
T
F
F
F
T
F
T
F
F
T
F
F
F
F
T
The truth table shows that [(š’‘ ŹŒ š’’) ŹŒ š’‘] → š’’ is a tautology. Hence, the
argument is valid.
Example 5
Write the following argument in propositional form and determine if the argument
is valid.
If 20151 is divisible by 9, then 20151 is divisible by 3. If 20151 is divisible by 3,
then the sum of the digits of 20151 is divisible by 3. Therefore, if 20151 is divisible by 9,
then the sum of the digits of 20151 is divisible by 3.
Solution:
Let š‘: 20151 is divisible by 9.
š‘ž: 20151 is divisible by 3.
š‘Ÿ: the sum of the digits of 20151 is divisible by 3.
The argument can be written in propositional form as:
š‘→š‘ž
š‘ž→š‘Ÿ
∴š‘→š‘Ÿ
The truth table is shown below.
š’‘
š’’
š’“
š’‘→š’’
š’’→š’“
T
T
T
T
F
F
F
F
T
T
F
F
T
T
F
F
T
F
T
F
T
F
T
F
T
T
F
F
T
T
T
T
The argument
T
F
T
T
T
F
T
T
is valid.
š’‘→š’“
(š’‘ → š’’)^ (š’’ → š’“)
(š’‘ → š’’)^ (š’’ → š’“) → (š’‘ → š’“)
T
F
T
F
T
T
T
T
T
F
F
F
T
F
T
T
T
T
T
T
T
T
T
T
Example 6
Consider the following argument:
š‘ → (š‘ž v ~š‘Ÿ)
š‘ž → (š‘ ^ š‘Ÿ)
∴š‘→š‘Ÿ
Determine whether or not this argument is valid.
Solution:
š’‘
š’’
T
T
T
T
F
F
F
F
T
T
F
F
T
T
F
F
{[š’‘ → (š’’ v š’“)] ^[š’’(š’‘^š’“)]} →
(š‘· → š‘¹)
T
F
T
T
T
T
T
F
T
T
F
T
F
T
T
F
F
T
F
T
T
F
T
T
F
T
T
F
T
F
T
F
T
F
T
F
T
T
F
T
F
T
T
F
F
F
T
T
F
F
T
T
F
T
T
F
The truth table shows that even though there are several situations in which the
premises and conclusions are all true, there are lines where the conjunction of the
two premises are true, but the conclusions are false. Hence this argument is NOT
valid.
š’“
~š’“
š’’ v ~š’“
š’‘ŹŒš’“
š’‘ → (š’’ v ~š’“)
š’’ → (š’‘ ŹŒ š’“)
Example 7
Verify that this argument is valid.
š‘ ŹŒ (š‘ž v š‘Ÿ)
(š‘ ŹŒ š‘ž) → š‘ 
(š‘ ŹŒ š‘Ÿ) → š‘ 
∴š‘ 
Solution:
Since there are 4 propositional variables in the argument, the truth table
will have 16 lines. Let š“ = {[š‘ ^ (š‘ž v š‘Ÿ)]^[(š‘^š‘ž) → š‘ ]^[(š‘š‘Ÿ ) → š‘ ]}
š’‘
š’’
T
T
T
T
T
T
T
F
T
F
T
F
T
T
T
F
F
F
F
T
F
F
F
T
F
T
F
T
F
F
F
F
Since the last
(š’‘^š’’) → š’”
(š’‘^š’“) → š’”
š’“
š’”
š‘Ø
š‘Ø→š’”
š’‘^(š’’ v š’“)
T
T
T
T
T
T
T
T
F
T
F
F
F
T
F
T
T
T
T
T
T
F
T
F
T
T
F
T
T
T
T
T
T
T
T
T
F
T
T
F
F
T
F
F
T
F
T
F
T
F
F
F
T
T
F
T
T
F
F
T
T
F
T
T
T
F
T
T
F
T
T
T
F
T
T
F
T
F
F
F
T
T
F
T
F
T
F
T
T
F
T
T
F
F
T
T
F
T
F
T
F
T
T
F
T
F
F
F
T
T
F
T
column in the truth table is a tautology, hence, the argument is valid.
Download