Module 6 Mathematical Logic
Module 6 Mathematical Logic
Introduction
Logic is the study of the principles of correct reasoning. It helps us to differentiate
correct reasoning from poor reasoning. Logic allows us to determine the validity of
arguments in and out of mathematics. It illustrates the importance of precision and
conciseness of the language of mathematics.
Learning Outcomes
At the end of this module, the students should be able to:
a. Translate English sentences into logical sentences;
b. Create a truth table of a given logical proposition;
c. Identify the given proposition whether it is tautology, contingency, or
contradiction; and
d. Apply artificial intelligence in mathematical logic.
131
For Example,
1. The sun rises in the East and sets in the West.
2. 1 + 1 = 2
3. 'b' is a vowel.
All of the above sentences are propositions, where the first two are Valid(True)
and the third one is Invalid(False). Some sentences that do not have a truth value or may
have more than one truth value are not propositions. For Example,
1. What time is it?
2. Go out and play.
3. x + 1 = 2.
The above sentences are not propositions as the first two do not have a truth value,
and the third one may be true or false. To represent propositions, propositional variables
are used. By Convention, these variables are represented by small alphabets such as p, q,
r, s. The area of logic which deals with propositions is called propositional calculus or
propositional logic. It also includes producing new propositions using existing ones.
Propositions constructed using one or more propositions are called compound
propositions. The propositions are combined together using Logical Connectives or
Logical Operators.
Examples
Statements Explanations
1. San Fernando City is the Capital of La Proposition because it has a truth value
Union. (TRUE).
2. Cielo is beautiful and sexy. Not proposition because it neither true nor
false.
3. Where are you going? Not proposition because it is interrogative.
4. Please give me some water. Not proposition because it is imperative.
5. Mt. Apo is the tallest mountain in the Not Proposition because it neither true nor
Philippines. false.
6. 1+1=2 Proposition because the sentence has a
truth value (TRUE).
7. x>5 if x=3. Proposition because the sentence has a
truth value (FALSE).
Copy the link to see the solution:
https://poe.com/s/u7iZlK2FCVrFxMjnfx3c
Remark: If a proposition is true, then we say its truth value is TRUE, and if a proposition
is false, we say its truth value is FALSE.
132
II. Truth Table
Since we need to know the truth value of a proposition in all possible scenarios,
we consider all the possible combinations of the propositions which are joined together
by Logical Connectives to form the given compound proposition. This compilation of all
possible scenarios in a tabular format is called a truth table.
1. Negation – If p is a proposition, then the negation of p is denoted by ¬p , which
when translated to simple English means- “It is not the case that p ” or simply
“not p ”. The truth value of ¬p is the opposite of the truth value of p . The truth
table of ¬p is,
133
4. Exclusive Or – For any two propositions p and q , their exclusive or is denoted by p
⊕ q , which means “either p or q but not both”. The exclusive or p ⊕ q is True
when either p or q is True, and False when both are true, or both are false. The
truth table of p ⊕ q is,
Truth Table for Exclusive Or
p q 𝑝⊕𝑞
T T F
T F T
F T T
F F F
Example, The exclusive or of the propositions p - “Today is Friday” and q - “It is
raining today”, p ⊕ q is “Either today is Friday or it is raining today, but not both”. This
proposition is true on any day that is a Friday or a rainy day(not including rainy Fridays)
and is false on any day other than Friday when it does not rain or rainy Fridays.
5. Implication – For any two propositions p and q , the statement “if p then q ” is
called an implication and it is denoted by p → q . In the implication p → q , p is
called the hypothesis or antecedent or premise and q is called
the conclusion or consequence. The implication is p → q is also called
a conditional statement. The implication is false when p is true, and q is false
otherwise it is true. The truth table of p → q is,
Truth Table for Implication
p q 𝑝→𝑞
T T T
T F F
F T T
F F T
Example, “If it is Friday then it is raining today” is a proposition which is of the
form p → q . The above proposition is true if it is not Friday(premise is false) or if it is
Friday and it is raining, and it is false when it is Friday, but it is not raining.
6. Biconditional or Double Implication – For any two propositions p and q , the
statement “p if and only if(iff) q ” is called a biconditional and it is denoted by p ↔
q . The statement p ↔ q is also called a bi implication. p ↔ q has the same truth
value as (p → q)∧(q → p) The implication is true when p and q have same truth
values and is false otherwise. The truth table of p ↔ q is,
Truth Table for Biconditional
p q 𝑝↔𝑞
T T T
T F F
F T F
F F T
Some other common ways of expressing p ↔ q are,
"p is necessary and sufficient for q" " if p then q, and conversely ""p if q"
134
Example, “It is raining today if and only if it is Friday today.” is a proposition which
is of the form p ↔ q . The above proposition is true if it is not Friday and it is not raining
or if it is Friday and it is raining, and it is false when it is not Friday or it is not raining.
Examples
Construct the truth table for each of the following statements.
1. ¬𝑝 ∨ ¬𝑞
p Q ¬𝒑 ¬𝒒 ¬𝒑 ∨ ¬𝒒
T T F F F
T F F T T
F T T F T
F F T T T
135
IV. Tautologies, Contradictions and Contingencies
For more
A statement is called, information, copy
the link or scan
1. Tautology – A proposition, which is always true, the QR code:
is called a tautology. https://www.geeksforge
2. Contradiction – A proposition, which is always eks.org/mathematical-
false, is called a contradiction. logic-propositional-
3. Contingency – A proposition that is neither a equivalences/?ref=lbp
tautology nor a contradiction is called a
contingency.
Examples
Which of the fallowing forms are tautology, contradiction, or
contingency?
i. 𝑝∨∼𝑝
ii. ∼ 𝑝 ⇒ ∼ 𝑞
iii. 𝑝 ∧∼ 𝑝
iv. [𝑝 ⇒ (𝑞 ∧∼ 𝑞)] ⇒∼ 𝑝
Solution:
Let p be the proposition “You can access the Internet from campus.”
q be the proposition “You are an Info Tech student.”
r be the proposition “You are a freshman.”
Therefore, 𝒑 → (𝒒 ∨ 𝒓).
136
2. You cannot access the Internet if you are a sophomore unless you are an Info tech
student.
Solution:
Let p be the proposition “You are sophomore.”
q be the proposition “You can access the Internet.”
r be the proposition “You are an Info tech student.”
Therefore, ¬[𝒑 → (¬𝒒)] → 𝒓.
137
Assessment Task
I. Determine whether each of the sentences below is a proposition or not.
Explain your answer.
Statements Answers
1. All multiples of 5 are odd numbers.
2. x is a real number.
3. Sketch the graph of f.
4. Five is greater than 4.
5. -1<0
6. The sun is shining.
7. The sum of two prime numbers is even.
8. 3+4=7
9. It rained in Manila on October 30, 1999.
10. x + y >10
11. Is it raining?
12. Come to class!
13. n is a prime number.
14. The moon is made of green cheese.
15. All even numbers are multiples of 2.
II. State whether or not the following are propositions. In case of a proposition,
indicate if it is true or false.
Statements Answers
1. All perfect squares are even numbers.
2. Every decimal number is a rational number.
3. The summation ∑100 𝑖=1 𝑖
4. Either x is divisible by 3 or it is not.
5. If 2x+7=x then x=-7.
6. 12𝑒 𝑥
7. {𝑥: 𝑥 ∈ ℕ}
8. The sum of two real numbers is a real number.
9. The function F
10. The sine function is an odd function.
III. Construct truth table for the following logical formulas. Determine whether
they are tautology, a contradiction, or a contingency.
1. (𝑝 ↔ 𝑞) → (¬𝑝 ↔ 𝑞)
2. (𝑝 ↔ 𝑞) ∨ (¬𝑝 ↔ ¬𝑟)
4. [(𝑝 ∨ 𝑟) ∧ (𝑝 → 𝑠)] ∨ (𝑝 ↔ 𝑞)
138
IV. Show that the following pairs of statements are logically equivalent.
1. (𝑝 ⇒ 𝑞), (∼ 𝑞 ⇒ ~𝑝)
2. You get a 95 on the final examination, you do every exercise in the class, and you
get 95 in MMW.
3. To get a 95 on the final examination, it is necessary for you to get 95 on the final
examination.
4. You get a 95 on the final examination, but you do not do every exercise in the
class, nevertheless you get a 95 in MMW.
5. Getting a 95 on the final examination and doing every exercise in the class is
sufficient for getting a 95 in MMW.
139
VI. State the converse, inverse and contrapositive of the following propositions.
Statements Converse Inverse Contrapositive
1. If you will review
your lessons,
then you will
pass MMW.
4. Ensuring that
your products
are of good
quality implies
you will have a
high amount of
sales and profit.
5. I attend my class
whenever there
is a quiz.
140
References
Auflrann, R.N., Lockwood J.S., Nation, R.D., and Clegg,D.K., 2013 Cengage Learning:
Mathematical
Excursions, 14"’ Edition Epp, S.S., 2011 Brooks/Cole, Cengage Learning: Discrete
Mathematics: An
141