You are on page 1of 34

Logic

GEC 14
Mathematics in the Modern World

Department of Mathematics
College of Science
Bicol University

J.B.E. Riñon - Bicol University GEC 14 MMW: Logic 1 / 34


LOGIC - study of reasoning
Proposition/Statement – A sentence (declarative) that is
either true or false, but not both.
Simple proposition/statement – conveys a single idea
Compound proposition/statement – conveys two or more
ideas; combination of propositions
Examples:
statement: 1+1=2.
He is a student of Bicol University.
Pigs can fly.
not a statement: Close the door.

J.B.E. Riñon - Bicol University GEC 14 MMW: Logic 2 / 34


Definition
Let p and q be propositions. The conjunction of p and q,
denoted by p ∧ q, is the proposition p and q. The disjunction
of p and q, denoted p ∨ q, is the proposition p or q.

Example: p: 1+1 = 3
q: A century is 100 years.
then:
conjunction (p ∧ q): 1+1 = 3 and a century is 100 years.
disjunction (p ∨ q): 1+1 = 3 or a century is 100 years.

Each statement (simple/compound) has a truth value of


either true or false. The truth values of propositions are can
be described by truth tables.

J.B.E. Riñon - Bicol University GEC 14 MMW: Logic 3 / 34


Definition
The truth value of the compound proposition p ∧ q is defined
by the following truth table.
p q p∧q
T T T
T F F
F T F
F F F
Here, take note that the conjunction p ∧ q is true provided
that p and q are both true. Otherwise, p ∧ q is false.
Note: p but q means p and q.

J.B.E. Riñon - Bicol University GEC 14 MMW: Logic 4 / 34


Definition
The truth value of the compound proposition p ∨ q is defined
by the following truth table.
p q p∨q
T T T
T F T
F T T
F F F
Here, take note that the disjunction p ∨ q is true if either p or
q or both are true; false if both p and q are false.

J.B.E. Riñon - Bicol University GEC 14 MMW: Logic 5 / 34


Example:

p : 1+1=3 this statement is false


q : A century is 100 years. this statement is true

then:

conjunction (p ∧ q) : 1 + 1 = 3 and a century is 100 years.


F ∧ T
∴ the conjuction is false

disjunction (p ∨ q) : 1 + 1 = 3 or a century is 100 years.


F ∨ T
∴ the disjunction is true

J.B.E. Riñon - Bicol University GEC 14 MMW: Logic 6 / 34


Example: Let

p: “0 < x”
q: “x < 5”
r: “x = 5”

Write the following inequalities symbolically:


a. x ≤5 q∨r
b. 0<x <5 p∧q
c. 0<x ≤5 p ∧ (q ∨ r )

J.B.E. Riñon - Bicol University GEC 14 MMW: Logic 7 / 34


Definition
The negation of p, denoted by p̄, is the proposition not p.
The truth table of the proposition p̄ is defined by the
following truth table.
p p̄
T F
F T

J.B.E. Riñon - Bicol University GEC 14 MMW: Logic 8 / 34


Example: (from Discrete Mathematics by Richard Johnsonbaugh)
p : Blaise Pascal invented several calculating machines.
q : The first all-electronic digital computer was constructed
in the 20th century.
r : π was calculated to 1M decimal digits in 1954.

Represent the proposition:


Either Blaise Pascal invented several calculating machines and
it is not the case that the first all-electronic digital computer
was constructed in the 20th century; or π was calculated to
1M decimal digits in 1954.
(p ∧ q̄) ∨ r

J.B.E. Riñon - Bicol University GEC 14 MMW: Logic 9 / 34


Definition
If p and q are propositions, the compound propositions
if p then q is called conditional proposition and is denoted
by p → q. The proposition p is called the hypothesis (or
antecedent) and the proposition q is called the conclusion (or
consequent).

Example:
p: The Dept. of Health gets an additional Php. 200,000.
q: The Dept. of Health hires one new health worker.
p → q : If the Dept. of Health gets an additional
Php. 200,000, then it will hire one health worker.

J.B.E. Riñon - Bicol University GEC 14 MMW: Logic 10 / 34


p→q
• if p then q
• p implies q (q is implied by p)
• whenever p, q (q whenever p)
• q unless p̄
• p only if q (if not q then not p)
• q̄ implies p̄
• p is a sufficient condition for q
• q is a necessary condition for p

J.B.E. Riñon - Bicol University GEC 14 MMW: Logic 11 / 34


Definition
The truth value of the conditional proposition p → q is
defined by the following truth table.
p q p→q
T T T
T F F
F T T
F F T

J.B.E. Riñon - Bicol University GEC 14 MMW: Logic 12 / 34


Examples:
1. p :1>2 False
q :4<8 True
p →q True
q →p False

2. Given p is true, q is false, r is true, find the truth value of:


a. (p ∧ q) → r
b. (p ∨ q) → r¯

J.B.E. Riñon - Bicol University GEC 14 MMW: Logic 13 / 34


Converse: The proposition q → p is the converse of the
proposition p → q.

Inverse: The proposition p̄ → q̄ is the inverse of the


proposition p → q.

J.B.E. Riñon - Bicol University GEC 14 MMW: Logic 14 / 34


Definition
If p and q are propositions, the compound proposition
p if and only if q is called a biconditional proposition and
is denoted by p ↔ q.

p↔q
• p is equivalent to q
• p iff q
• p is a sufficient and necessary condition for q
• p → q and q → p (p implies q and q implies p)

J.B.E. Riñon - Bicol University GEC 14 MMW: Logic 15 / 34


Definition
The truth value of the proposition p ↔ q is defined by the
following truth table.
p q p↔q
T T T
T F F
F T F
F F T

J.B.E. Riñon - Bicol University GEC 14 MMW: Logic 16 / 34


Definition
Suppose that the compound propositions P and Q are made
up of the propositions p1 , p2 , . . . , pn . We say that P and Q
are logically equivalent and write P ≡ Q , provided that
given any truth values of p1 , p2 , . . . , pn , either P and Q are
both true or P and Q are both false.

J.B.E. Riñon - Bicol University GEC 14 MMW: Logic 17 / 34


De Morgan’s Laws for Logic
1. p ∨ q ≡ p̄ ∧ q̄
2. p ∧ q ≡ p̄ ∨ q̄

p q p∨q p̄ ∧ q̄
T T F F
T F F F
F T F F
F F T T
∴ P and Q logically equivalent

J.B.E. Riñon - Bicol University GEC 14 MMW: Logic 18 / 34


Definition
The contrapositive (or transposition) of the conditional
proposition p → q is the proposition q̄ → p̄.

Theorem
The conditional proposition p → q and its contrapositive
q̄ → p̄ are logically equivalent.

J.B.E. Riñon - Bicol University GEC 14 MMW: Logic 19 / 34


Exercises

1. Consider the following simple statements.

p: Today is Saturday.
q: It is a sunny day.
r: I am going to the theater.
s: I am not going to the soccer game.

Write the following statement in symbolic form.


a. Today is not Saturday and I am going to the theater.
b. I am going to the soccer game and I am not going to the theater.
c. I am going to the soccer game if and only if it is a sunny day.
d. If today is Saturday, then I am going to the soccer game.

J.B.E. Riñon - Bicol University GEC 14 MMW: Logic 20 / 34


Exercises

2. Consider the following statements.

p : You will take a vacation.


q : You finish the job early.
r : You will receive a bonus.

Do the following.
a. Write (p ∧ q) → r as an English sentence.
b. Write in symbolic form: “ If you do not finish the job early,
then you cannot take an early vacation and you will not
receive a bonus.”

J.B.E. Riñon - Bicol University GEC 14 MMW: Logic 21 / 34


Exercises

3. Use one of De Morgan’s laws to restate the following


sentences in an equivalent form.
a. It is not true that, I lied or I confess.
b. It is not true that, I am going to the birthday party and
I am going to the mall.

4. Show that p → q ≡ p̄ ∨ q.
5. Write each of the following in its equivalent disjunctive
form. (use no. 4)
a. If I could play the violin, I would join the orchestra.
b. If LeBron James cannot play, then his team will lose.

J.B.E. Riñon - Bicol University GEC 14 MMW: Logic 22 / 34


Exercises

6. Write the converse, inverse and contrapositive of “ If I get


the job, then I will buy you dinner.”

7. The converse of the contrapositive of p → q is


of q → p.

8. The inverse of the contrapositive of p → q is the


of p → q.

J.B.E. Riñon - Bicol University GEC 14 MMW: Logic 23 / 34


Argument
An argument consists of a set of statements called premises
and another statement called the conclusion. An argument is
valid if the conclusion is true whenever all the premises are
assumed to be true. An argument is invalid if it is not a valid
argument.

Example:
If Heracles was human, then Heracles was mortal.
Heracles was human.

Therefore, Heracles was mortal.

J.B.E. Riñon - Bicol University GEC 14 MMW: Logic 24 / 34


Example:
Determine if the argument is valid.
a. If it rains, then we will not be going to the movie.
It is not raining. Therefore, we will go to the movie.
b. If I am going to do triathlon, then I will buy a good
road bike. If I buy a good road bike, then I will
not buy a new mobile phone. Therefore, if I buy a
new mobile phone, I will not do triathlon.

J.B.E. Riñon - Bicol University GEC 14 MMW: Logic 25 / 34


Valid Arguments
Any argument that has a symbolic form identical to one of
these forms is a valid argument.

J.B.E. Riñon - Bicol University GEC 14 MMW: Logic 26 / 34


Valid Arguments

J.B.E. Riñon - Bicol University GEC 14 MMW: Logic 27 / 34


Invalid Arguments
Any argument that has one of these symbolic forms is invalid.

1. fallacy of the converse


p→q
q

∴p
2. fallacy of the inverse
p→q

∴ q̄
J.B.E. Riñon - Bicol University GEC 14 MMW: Logic 28 / 34
Logically Equivalent Statements
• Idempotent Laws • Associative properties
p∧p ≡p p ∧ (q ∧ r ) ≡ (p ∧ q) ∧ r
p∨p ≡p p ∨ (q ∨ r ) ≡ (p ∨ q) ∨ r
• Double Negation • Distributive properties
p̄ ≡ p p ∧ (q ∨ r ) ≡ (p ∧ q) ∨ (p ∧ r )
• De Morgan’s Laws p ∨ (q ∧ r ) ≡ (p ∨ q) ∧ (p ∨ r )
(p ∨ q) ≡ p̄ ∧ q̄ • Equivalence of Contrapositive
(p ∧ q) ≡ p̄ ∨ q̄ p → q ≡ q̄ → p̄
• Commutative Properties • Other useful properties
p∧q ≡q∧p p → q ≡ p̄ ∨ q
p∨q ≡q∨q p ↔ q ≡ (p → q) ∧ (q → p)

J.B.E. Riñon - Bicol University GEC 14 MMW: Logic 29 / 34


Exercises
1. Show that the hypotheses ”It is not sunny this morning
and it is colder than yesterday”, ”We will run in the park only
if it is sunny”, ”If we do not run in the park, then we will go
swimming”, and ” If we go swimming, then we will be home
by nighttime” lead to the conclusion ”We will be home by
nighttime.”
Solution:

p: It is sunny this morning. p̄ ∧ q


q: It is colder than yesterday. r →p
r: We will run in the park. r¯ → s
s: We will go swimming. s→t
t: We will be home by nighttime. ∴t
J.B.E. Riñon - Bicol University GEC 14 MMW: Logic 30 / 34
Solution: (solution is not unique)
Statement Reason
1. p̄ ∧ q premise
2. r → p premise
3. r¯ → s premise
4. s → t premise
5. p̄ step 1, Simplification
6. r¯ steps 2 & 5, Modus Tollens
7. r¯ → t steps 3 & 4, Hypothetical Syllogism
8. t steps 6 & 7, Modus Ponens

J.B.E. Riñon - Bicol University GEC 14 MMW: Logic 31 / 34


2. Prove the argument is valid.

p
p→q
s ∨r
r → q̄

∴s ∨t

J.B.E. Riñon - Bicol University GEC 14 MMW: Logic 32 / 34


Logic is a science of the necessary laws of thought, without
which no employment of the understanding and the reason
takes place.
– Immanuel Kant, 1785

J.B.E. Riñon - Bicol University GEC 14 MMW: Logic 33 / 34


Thank you very much!

J.B.E. Riñon - Bicol University GEC 14 MMW: Logic 34 / 34

You might also like