Elementary Logic
Elementary Logic
Elementary Logic
LEARNING OUTCOME(S):
• Understand concepts such as logic, propositions, predicate/propositional function, truth table, truth value, and
logical connectives.
• Identify the truth value of compound propositions and perform basic operations on logic.
Logic is the study of how to critically think about propositions that are either true or false. A proposition is a
declarative sentence which is either true or false, but not both simultaneously. Propositions are sometimes called
statements.
The following are examples of propositions .
1. The tree is tall.
2. Three is an even number.
3. A quadrilateral has four interior angles.
4. 23 + (−47) = 24
5. −32 ≤ −15
However, questions, demands and exclamations are not propositions. The following are examples which are not
propositions.
1. What is your favorite subject?
2. Do your assignment.
3. I want more ice cream!
Recall that the sentence 𝑥 + 2 = 7 is not a proposition, but if we assign a value for 𝑥 then it becomes a
proposition. The sentence 𝑥 + 2 = 7 can be treated as a function for which the input is a value of x and the output is a
proposition. The truth value of the predicate depends on the value assigned to its variables. For instance if we replace x
with 1 in the predicate “𝑥 + 2 = 7” we obtain “1 + 2 = 7”, which is false, but if we replace it with 5 we get “5 + 2 =
7”, which is true. We represent a predicate by a letter followed by the variable/s enclosed between parentheses like
𝑃(𝑥), 𝑄(𝑥, 𝑦), etc.
Examples.
1. Suppose 𝑃(𝑥) is the sentence “𝑥 has four legs” and the universe of discourse for 𝑥 is the set of all animals.
Then 𝑃(𝑥) is a true statement if 𝑥 is a dog. However, if 𝑥 is a chicken then 𝑃(𝑥) is false.
2. The propositional 𝑃(𝑥) is given by “2𝑥 − 4 = −12” and the universe of discourse for 𝑥 is the set of integers.
To create a proposition from 𝑃, we may assign a value for 𝑥. Assigning 𝑥 = 3, we get 𝑃(3): 2(3) − 4 = −12,
which is false. But if 𝑥 = −4, 𝑃(−4): 2(−4) − 4 = −12, which is true.
3. The propositional 𝑄(𝑥, 𝑦) is given by “𝑥 − 23 = 𝑦” and the universe of discourse for 𝑥 and 𝑦 is the set of
whole numbers. Assigning 𝑥 = 45 and 𝑦 = 8, we get 𝑄(45,8): 45 − 23 = 8, which is false. But if 𝑥 = 45 and
𝑦 = 22, we get 𝑄(45,22): 45 − 23 = 22, which is true.
The truth(T) or falsehood(F) of a proposition is called its truth value. A table that summarizes truth values of
propositions is called a truth table.
A simple proposition is a single statement while a compound proposition is a combination of simple
propositions(called components) that are linked using connectives like and, or, not, either or, if then, if and only if. The
operations which are used to link pairs of propositions are called logical connectives and the truth value of any compound
proposition is completely determined by the truth values of its components and the particular connective used to linked
them. Simple proposition: Three is an even number.
Compound proposition: Three is an even number and four is a prime number.
Throughout the discussion, letters like p and q are used to represent propositions. Below shows the name of
logical connectives with their corresponding meanings and notations.
The truth value of a compound proposition depends only on the value of its components. Writing F for “false” and
T for “true”, we can summarize the meaning of the connectives in the following table.
Negation
If 𝑝 is a proposition, then ~𝑝 symbolizes the negation of 𝑝. Meaning, negation is the effect of reversing the truth
value of the proposition. The following truth table gives the truth value for ~𝑝.
𝑝 ~𝑝
T F
F T
p q 𝑝˄𝑞
T T T
T F F
F T F
F F F
Note that other words used in conjunction besides “and” include some uses of “but,” “although,” “however,” “yet,”
“nevertheless,” and “neither nor”.
p q 𝑝˅𝑞
T T T
T F T
F T T
F F F
p q 𝑝⨁𝑞
T T F
T F T
F T T
F F F
Although the statement does not contain the phrase “but not both”, it is pretty obvious that it is not possible for
John to be sleeping and studying at the same time. Hence, this statement is an exlusive disjunction.
Difference of Disjunction(Inclusive or) and Exclusive or
Waiter: “Would you like tea or coffee?” (exclusive or)
Customer: “Coffee, please.”
Waiter: “Would you like cream or sugar?” (inclusive or)
Customer: “I’d like both, thank you.”
Implication(Conditional)
Implication is a compound proposition combining two or more simple propositions using the word “if then”. Truth
value for this compound proposition is true when both of its simple propositions/components are true, and when 𝑝 is
false no matter what truth value 𝑞 has. Here 'p' refers to 'hypothesis, premise or the antecedent' and 'q' refers to
'conclusion or consequent'. If 𝑝 and 𝑞 are two propositions, 𝑝 → 𝑞 symbolizes the implication of 𝑖𝑓 𝑝 then 𝑞.
Because implication statements play such an essential role in mathematics, a variety of terminology is used to
express, 𝑝 → 𝑞 like “q, if p”, “p, only if q”, “p implies q”, “p is sufficient for q”, “q is necessary for p” and “q follows from
p.
p q 𝑝→𝑞
T T T
T F F
F T T
F F T
Biconditional
Biconditional is a compound proposition combining two or more simple propositions using the word “𝑝 if and only
if 𝑞”. Truth value for this compound proposition is true when both of its simple propositions/components are true, and
when both of its simple propositions/components are false. If 𝑝 and 𝑞 are two propositions, 𝑝 ↔ 𝑞 symbolizes the
biconditional of 𝑝 if and only if 𝑞.
p q 𝑝↔𝑞
T T T
T F F
F T F
F F T
Example.
Let p: A number is divisible by two and q: A number is even.
Example. Write the following statement in symbolic form using the following propositions:
r: The water is warm.
s: The sun is shining.
t: We go swimming.
2. A proposition is said to be a contradiction if its truth value is F for any assignment of truth values to its components.
Example: The proposition 𝑝˄~𝑝 is a contradiction.
p ~𝑝 𝑝˅~𝑝 𝑝˄~𝑝
T
T
F
F
tautology contradiction
Logical Equivalence.
Note that the compound propositions 𝑝 → 𝑞 and ~𝑝˅𝑞 have the same truth values:
p q ~p ~𝑝˅𝑞 𝑝→𝑞
T T
T F
F T
F F
When two compound propositions have the same truth values no matter what truth value their constituent propositions
have, they are called logically equivalent. For instance p→q and ~p∨q are logically equivalent, and we write it:
𝑝 → 𝑞 ≡ ~𝑝˅𝑞
Example: De Morgan’s Laws for Logic. The following propositions are logically equivalent:
~(𝑝˅𝑞) ≡ ~𝑝˄~𝑞
~(𝑝˄𝑞) ≡ ~𝑝˅~𝑞
Note that the converse is not equivalent to the given conditional proposition, for instance “if John is from Malaybalay
then John is from Bukidnon” is true, but the converse “if John is from Bukidnon then John is from Malaybalay” may be
false.
The contrapositive of a conditional proposition p→q is the proposition ~q→ ~p. They are logically equivalent. For instance
the contrapositive of “if John is from Malaybalay then John is from Bukidnon” is “if John is not from Bukidnon then John
is not from Malaybalay”.
p q ~p ~𝑞 𝑝→𝑞 ~q→ ~p
T T
T F
F T
F F