Sie sind auf Seite 1von 13

Chapter

2
Introduction to
Logic

Chapter Outline

• Logic and Propositions


• Logical Connectives
• Truth Tables
• Conditional Statements
• Tautology,
Contradiction, and
Contingency
• Logical Equivalences
and Implications
Introduction to Logic

Logic and Propositions


Logic is the discipline that deals with the study of reasoning. It provides rules and
techniques for determining whether a given argument is valid or not.

The rules of logic are used in many areas, particularly in mathematics. Logical
methods are used to prove theorems or to distinguish between valid and invalid
mathematical arguments. It is also essential in computer science in verifying the
correctness of programs.

A proposition is any declarative sentence that is either true or false, but not both.

The truth value of a proposition is true, denoted by T (or 1), if it is a true


proposition and false, denoted by F (or 0), if it is a false proposition.

Example 1
Which of the following are propositions?
a. Today is Monday.
b. Did you buy the textbook?
c. 13 + 17 = 40
d. Take your medicine.
e. There are nine planets in the universe.
f. 23 – x = 11

Solution

Logical Connectives

A proposition is said to be atomic if it cannot be further subdivided. Atomic


propositions may be combined to form compound propositions. Atomic propositions are
usually denoted by lowercase letters p, q, r etc.

Compound propositions are formed by combining one or more atomic


propositions using logical connectives. There are five basic logical connectives or logical
operators used in logic. These are the negation, conjunction, disjunction, conditional, and
biconditional.

2
Lecture Notes in Mathematical Logic
Introduction to Logic

Negation
The negation of a proposition p, denoted by ¬p (read as "not p"), is the statement
"It is not the case that p." The truth value of ¬p is the opposite of the truth value of p.

Example 2
Find the negation of each proposition.
a. Today is Wednesday.
b. There is no pollution in Metro Manila.

Solution

Conjunction
The conjunction of two propositions p and q, denoted by p ∧ q , is the proposition
"p and q". The conjunction p ∧ q is true when both p and q are true and is false
otherwise.

Disjunction
The disjunction of two propositions p and q, denoted by p ∨ q , is the proposition
"p or q". The disjunction p ∨ q is false when both p and q are false and is true otherwise.

Example 3
Let p: Today is Monday.
q: It is raining today.
Write a. p∧q
b. p∨q
c. ¬p ∧ q
d. p ∨ ¬q .

Solution

3
Lecture Notes in Mathematical Logic
Introduction to Logic

Exclusive or
The exclusive or of propositions p and q, denoted by p ⊕ q , is the proposition that
is true when exactly one of p and q is true and is false otherwise.

Conditional
The conditional statement (also called implication) p → q is the proposition "if p
then q". The conditional statement p → q is false when p is true and q is false, and true
otherwise. In the statement p → q , p is called the hypothesis (or antecedent or premise)
and q is called the conclusion (or consequent).

Biconditional
The biconditional statement p ↔ q is the proposition "p if and only if q". The
biconditional statement p ↔ q is true when p and q have the same truth values, and is
false otherwise.

Example 4
Let p: John learns math logic.
q: John will get a good grade.
Write a. p→q
b. q↔ p
c. ¬p → ¬q
d. ¬q ↔ ¬p

Solution

Example 5
Let p: You pass the final examination.
q: You do every exercise in class.
q: You pass this course.
Write these propositions using p, q, and r and logical connectives
a. You pass the final exam and this course.
b. You pass this course but you do not do every exercise in class.

4
Lecture Notes in Mathematical Logic
Introduction to Logic

c. If you either do every exercise in class or pass the final examination you
will pass this course.
d. You will pass this course if and only you both do every exercise in class
and pass the final exam.
e. You wont pass this course if you neither pass the final exam nor do
every exercise in class.

Solution

In general, parentheses, brackets, and braces are used to specify the order in
which logical operators in a compound proposition are to be applied. In cases where
grouping symbols were not used we shall use the following precedence of logical
operators.

Operator Precedence
¬ 1
∧ 2
∨ 3
→ 4
↔ 5

Example 6
Using parenthesis/parentheses and the rules of precedence of
logical operators to establish what is really meant in each expression.
a. ¬p ∧ q
b. p ∧ q ∨ r
c. p ∨ q → r

Solution

5
Lecture Notes in Mathematical Logic
Introduction to Logic

Truth Tables
Truth values of propositions may be summarized in a table. A truth table of a
proposition gives the truth values of the proposition under all possible cases or
assignments.
The following are the truth tables of the compound propositions combined by the
logical operators.

p ¬p
T F
F T

p q p∧q p q p∨ q p q p⊕q
T T T T T T T T F
T F F T F T T F T
F T F F T T F T T
F F F F F F F F F

p q p→q p q p↔q
T T T T T T
T F F T F F
F T T F T F
F F T F F T

Example 7
Construct the truth table for each proposition.
a. p ∧ ¬p b. p ⊕ ¬p
c. ¬p ∧ (q → ¬p ) d. ( p → q ) ↔ (¬q → ¬p )
e. ( p ∨ q ) ∧ ¬r f. ( p ∨ q ) → (r ∧ ¬p )

Solution

6
Lecture Notes in Mathematical Logic
Introduction to Logic

The Conditional Statement

The conditional statement p → q can be expressed in a variety of ways. The


following statements are equivalent.
if p then q p implies q
if p, q p only if q
p is sufficient for q q if p
q whenever p q is necessary for p
q when p q follows from p
q unless not p

7
Lecture Notes in Mathematical Logic
Introduction to Logic

Example 8
Rewrite each of these statements in the form "if p then q".
a. Classes will be suspended if storm signal is raised to level 3.
b. To get a good grade, it is sufficient to do every exercise in the book.
c. Mark will go swimming unless the water is too cold.
d. You will receive a passing grade only if you comply with all the
requirements.
e. It is necessary to have a password to log on to the server.

Solution

There are three related conditional statements that can be derived from a given
conditional. These are the converse, inverse, and contrapositive.

Given a conditional statement p → q , then the


i. converse is defined as q → p ;
ii. inverse is defined as ¬p → ¬q ; and
iii. contrapositive is defined as ¬q → ¬p

Example 9
Give the converse, inverse and contrapositive of the statement
If a triangle is right then it has a 90º angle.
Solution

8
Lecture Notes in Mathematical Logic
Introduction to Logic

Example 10
Give the converse, inverse and contrapositive of the statement
You are taking care of you health if you don't smoke.

Solution

Example 11
Construct the truth table for the conditional statement, its
converse, inverse, and contrapositive.

Solution

Tautology, Contradiction and Contingency


A compound proposition that is always true for all possible truth values of the
constituent propositions, is called a tautology. A compound proposition that is always
false for all possible truth values of the constituent propositions, is called a contradiction.
A compound proposition that is neither a tautology nor contradiction is called
contingency.

9
Lecture Notes in Mathematical Logic
Introduction to Logic

Example 12
By constructing truth tables determine whether the given
compound proposition is a tautology, contradiction or contingency.

a. p ∨ ¬( p ∧ q ) b. ( p ∧ q ) ∧ ¬( p ∨ q ) c. p ∨ (q ∧ ¬r )

Solution

Logical Equivalences and Logical Implications

The proposition p and q are logically equivalent, denoted as p ≡ q or ( p ⇔ q )


if and only if p ↔ q is a tautology. If p → q is a tautology then p logically implies q ,
denoted as p ⇒ q .

10
Lecture Notes in Mathematical Logic
Introduction to Logic

Example 13
Verify the identity
a. ¬( p ↔ q ) ⇔ p ↔ ¬q . b. ( p → q ) ∨ ( p → r ) ≡ p → (q ∨ r ) .

Solution

Example 14
Show that
a. [( p ↔ q ) ∧ q ] ⇒ p . b. [( p → q ) ∧ (q → r )] ⇒ ( p → r ) .
Solution

11
Lecture Notes in Mathematical Logic
Introduction to Logic

The following table summarizes the some important logical equivalences. We


shall call them rules of replacement.

RULES OF REPLACEMENT
Equivalence Name
p ∧T ≡ p
Identity Law
p∨F ≡ p
p∨T ≡T
Domination Law
p∧F ≡F
p∨ p≡ p
p∧ p≡ p Idempotent Law
¬ (¬ p ) ≡ p Double Negation
p∨q ≡q∨ p
p∧q≡q∧ p Commutative Laws
( p ∨ q ) ∨ r ≡ p ∨ (q ∨ r )
Associative Laws
( p ∧ q ) ∧ r ≡ p ∧ (q ∧ r )
p ∨ (q ∧ r ) ≡ ( p ∨ q ) ∧ ( p ∨ r )
Distributive Laws
p ∧ (q ∨ r ) ≡ ( p ∧ q ) ∨ ( p ∧ r )
¬( p ∧ q ) ≡ ¬ p ∨ ¬ q
De Morgan's Laws
¬( p ∨ q ) ≡ ¬ p ∧ ¬ q
p ∨ (p ∧ q)≡ p
Absorption Laws
p ∧ (p ∨ q)≡ p
p ∨ ¬p ≡ T
Negation Laws
p ∧ ¬p ≡ F
p → q ≡ ¬q → ¬p Contrapositive
p → q ≡ ¬p ∨ q Material Implication
p ↔ q ≡ ( p → q ) ∧ (q → p ) Material Equivalence

Other logical equivalences may also be established using the rules of replacement.
Consider the next example.

Example 15
The following series of logical equivalences shows that
¬[ p ∨ (¬p ∧ q )] ≡ ¬p ∧ ¬q . Identify the rule of replacement used in
each step.
¬[ p ∨ (¬p ∧ q )] ≡ ¬p ∧ ¬(¬p ∧ q ) ________________
≡ ¬p ∧ [¬(¬p ) ∨ ¬q ] ________________
≡ ¬p ∧ ( p ∨ ¬q ) ________________
≡ (¬p ∧ p ) ∨ (¬p ∧ ¬q ) ________________
≡ F ∨ (¬p ∧ ¬q ) ________________
≡ (¬p ∧ ¬q ) ∨ F ________________
≡ ¬p ∧ ¬q ________________

12
Lecture Notes in Mathematical Logic
Introduction to Logic

Solution

Example 16
Using rules of replacement show that
( p → r ) ∨ (q → r ) ≡ ( p ∧ q ) → r .
Solution

13
Lecture Notes in Mathematical Logic

Das könnte Ihnen auch gefallen