Lesson 5. The Language of Logic
Lesson 5. The Language of Logic
Source: google.com
Logic
What is logic?
Logic is the study of correct thinking and reasoning. It uses principles and methods to
distinguish valid arguments from those that are not. It is the foundation for expressing logical
methods used to prove theorems, design computer software, and to solve mathematical
problems.
Logic is a tool for working with complicated statements. It illustrates the importance of
precision and conciseness. It allows us to determine the validity of an argument in and out of
mathematics. For lawyers, they use logic to communicate more effectively, construct
arguments, analyze legal contracts, and make decisions.
In logic, assertions are made by combining words and symbols in the form of sentences.
Such assertions are called statements or propositions, which are declarative sentences that are
either true or false – but not both.
A statement or proposition may be denoted by a variable like P, Q, R,…
Examples:
P: University of Northern Philippines is in Vigan City.
Q: Light is faster than sound.
R: 1 + 3 = 4.
S: 7 is an even number.
Examples:
1. 20 is divisible by 4.
2. Taylor Swift is a singer and Stephen Curry is a basketball player.
3. If a polygon has three sides, then it is a triangle.
4. Mark goes to gym or stays at home every Friday.
Connecting simple statements with words and phrases such as and, or, if…then, and
if and only if created a compound statement. For instance, “My mother attends a meeting or
buys in a grocery store”. The word or is a connective for the two simple statements.
Logical connective is a word or symbol that joins two sentences to produce a new one.
George Boole uses symbols such as p, q, r, and s to represent simple statements and the
symbols ˄, ˅, ⁓, →, ↔ to represent connectives.
Example1:
Let p: I review my lessons.
q: I play video games.
r: I go to the beach.
s: I get a reward.
The following are compound statements formed by using logical connectives. Write
the following statements:
a. q ˄ p
b. q ˅ r
c. ⁓ r
d. p → s
e. s ↔ p
Solutions:
a. I play video games and review my lessons.
b. I play video games or go to the beach.
c. I do not go to the beach.
d. If I review my lessons, then I get a reward.
e. I get a reward if and only if I review my lessons.
Example 2. Indicate the simple statements by p and q and express the compound statement
in symbolic form of the following compound statements.
a. John can program in C++ and he can program in Java.
b. If x is an even number then it is a multiple of 2.
3
Solution:
a. p: John can program in C++.
q: John can program in Java.
p ˄q
b. p: x is an even number.
q: x is a multiple of 2.
p→s
Exercise:
In every item, indicate what statements p, q, or r might stand for and then express
the item using the correct symbol (⋀, ⋁, →, ↔, ~).
1. r ≠ −10
2. 2 and -3 are rational zeroes of 𝑓.
3. y ≤ x
4. If x = y, then y = x.
5. Triangle ABC is a right triangle if and only if c 2 = a2 + b2.
The truth values of a compound statement are respectively determined by the truth
values of the original statements and the connectives used to form them. The decision of
accepting or rejecting a statement depends on the truth values of a proposition. An acceptable
statement is given a truth value “true” and unacceptable statement is given a truth value
“false”.
a. Negation.
If a proposition p is true, then the proposition ⁓ p is false. However, if p is false, then
⁓ p is true.
For example:
Let p: “I study at University of Northern Philippines.” be a true statement. Then, ⁓ p
is stated as “ I do not study at the University of Northern Philippines.” or “It is false that I
study at the University of Northern Philippines.” Which is a negation of the original
proposition p.
p q ~p ~q
T T F F
T F F T
F T T F
F F T T
The negation of the statement p is denoted by ~𝑝 where ~ is the symbol for “not”. The truth
value of the negation is always the reverse of the truth value of the original statement.
4
b. Conjunction
The conjunction of two statements p and q denoted by 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
The only condition for p ⋀ q to be a true statement is when both p and q are true.
c. Disjunction
The disjunction of two statements p and q denoted by 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
This means that the disjunction of two statements is only false when both p and q are
false.
d. Implication or Conditional
In a conditional statement, the truth of p implies the truth of q. If p is true, then q must
be true. The only way that this can fail (or be false) is when p is true while q is false. The truth
table of p → q is given in the following table.
p q p →q
T T T
T F F
F T T
F F T
e. Biconditional
The biconditional statement p ↔ 𝑞, is defined by the following truth table.
p q p ↔𝐪
T T T
T F F
F T F
F F T
It is a compound statement “p if and only if q”, denoted as 𝑝 ↔ 𝑞 which is true only when
both p and q have the same truth values.
5
Summary of truth values of simple and compound statements using logical connectives
P q ~𝒑 ~𝒒 p⋀q p⋁q p →q p ↔𝐪
T T F F T T T T
T F F T F T F F
F T T F F T T F
F F T T F F T T
Example 1. Given the truth values of the propositions A, B, C, and D. If A is true, B is false,
C is true, and D is false, give the truth value of the following:
a. [(⁓A ⋀ B) → C ] ⋁ D
b. [ (A → B) → ⁓ C] ↔ [⁓ B → ⁓ ( C ⋀ D)]
Solutions:
We simply substitute the truth value of each proposition, i.e.
a. [(⁓A ⋀ B) → C ] ⋁ D
[(⁓T ⋀ F) → T ] ⋁ F
[(F ⋀ F) → T ] ⋁ F
(F → T) ⋁ F
T ⋁F
T
b. [ (A → B) → ⁓ C] ↔ [⁓ B → ⁓ ( C ⋀ D)]
[ (T → F) → ⁓ T] ↔ [⁓ F → ⁓ ( T ⋀ F)]
(F → F) ↔ (T → ⁓ F)
T ↔ (T → T)
T ↔T
T
b. [(p ↔ q) ⋁ (p → r)] → ⁓ (q ⋀ r)
Since it involves 3 propositions, there are 8 combinations.
Exercise:
A. Give the truth value if A is false, B is true, C is false and D is true.
a. [(C → B) → ⁓ C] ↔ [B → (C ⋀ A)]
b. [(D ⋀ B) ⋁ (A ⋀ C)] ⋀ B
c. [(A ⋁ B) → C] → [ B → (A ⋁ B)]
B. Construct the truth table for the following:
a. [(p ⋁ q) → r] ⋀ [ (r ⋀ p) → r]
b. (r ⋀ p) ↔ [(p ⋁ q) → ⁓ p] ⋀ (p ⋁ q)
References:
Alejan, R. O. et al. (2018). Mathematics in the Modern World. Mutya Publishing House,
Inc. Malabon City.
Aufmann,R.,et al. (2016). Mathematical Excursion 4th Edition. Cengage Learning, USA.
Nocon, R. C. & Nocon, E. G. (2016). Essential Mathematics for the Modern World. First
Edition. C & E Publishing, Inc. Quezon City.
Ymas, S. E. Jr. et al. (2006). Discrete Mathematics.Revised Edition. Ymas Publishing House.
Zorilla, R. S. & Partible, F. G. (2018). Mathematics in the Modern World. Mutya Publishing
House, Inc. Malabon City.