Elementary Logic

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

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!

Which of the following is/are proposition/s?


1. 0 is a counting number.
2. Who is next?
3. Let’s go!
4. √3 is a rational number.
5. 𝑥 + 2 = 7
The following statements are propositions. Identify which of the given propositions is true and which is false.
1. −32 ≤ −15 True 5≥ 5 True -8≥ −3 False 20≤ 12 False
2. A quadrilateral has four interior angles.
3. 23 + (−47) = −24
4. Three is an even number.
5. √3 is a rational number.

A predicate or propositional function is a statement containing variables. The independent variable of a


propositional function must have a universe of discourse, which is a set from which the variable can take values. Below
are some examples of predicates.
1. 𝑥 + 2 = 7
2. 𝑥 is an even number.
3. 𝑥 < 2
4. p is a prime number.

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.

Connectives, Truth Tables

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.

Name Representation Meaning


Negation ~𝑝 “not p”
Conjunction 𝑝˄𝑞 “p and q”
Disjunction(Inclusive or) 𝑝˅𝑞 “p or q (or both)”
Exclusive Or 𝑝⨁𝑞 “either p or q, but not both”
Implication(Conditional) 𝑝→𝑞 “if p then q”
Biconditional 𝑝↔𝑞 “p if and only if q”

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.

p q ~q ~p 𝑝˄𝑞 𝑝˅𝑞 𝑝⨁𝑞 𝑝→𝑞 𝑝↔𝑞


T T F F T T F T T
T F T F F T T F F
F T F T F T T T F
F F T T F F F T T

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

Example. Write the negation of each of the following statements.


1. √3 is a rational number. Answer: √3 is not a rational number. / √3 is an irrational number.
2. Three is an even number.
3. 18 < 7
4. −12 + 8 = 5
5. The square of −3 is negative. In symbol (−3)2 is negative.
Conjunction
Conjunction is a compound proposition combining two or more simple propositions using the word “and”. Truth
value for this compound proposition is true whenever both of its simple propositions/components are true, otherwise, it
is false. If 𝑝 and 𝑞 are two propositions, 𝑝 ∧ 𝑞 symbolizes the conjunction of 𝑝 and 𝑞.

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”.

Example. Study the following conjunctions.


1. Let 𝑝: 6 is an even number and 𝑞: 7 is a prime number. Then 𝑝 ∧ 𝑞 is true.
2. Let 𝑝: 𝑥 > 3 and 𝑞: 𝑥 < 5 where 𝑥 = 8. Then 3 < 𝑥 < 5 is false.
3. Let 𝑟 ∧ 𝑠: −5 < 3𝑥 + 7 ≤ 22 where 𝑥 = −5. Then 𝑟 ∧ 𝑠 is false.
4. Let 𝑟: −2 ≤ −5 and 𝑠: −4 > −3. Then 𝑟 ∧ 𝑠 is false.

Disjunction/Inclusive or (“p or q (or both)”)


Disjunction is a compound proposition combining two or more simple propositions using the word “or”. Truth
value for this compound proposition is true whenever both of its simple propositions/components are true, or when any
of 𝑝, 𝑞 is true. If 𝑝 and 𝑞 are two propositions, 𝑝 ∨ 𝑞 symbolizes the disjunction of 𝑝 or 𝑞.

p q 𝑝˅𝑞
T T T
T F T
F T T
F F F

Example. Study the following disjunctions.


1. Let 𝑝: 2 is an even number and 𝑞: 2 is a prime number. Then 𝑝 ∨ 𝑞 is true.
2. Let 𝑝: 𝑥 > 3 and 𝑞: 𝑥 = 3 where 𝑥 = 5. Then 𝑥 ≥ 3 is true.
3
3. Let 𝑟: 2𝑥 + 3 ≥ 7 and 𝑠: 2𝑥 + 9 > 11 where 𝑥 = . Then 𝑟 ∨ 𝑠 is true.
2
4. Let 𝑟: 4𝑥 < −12 and 𝑠: 𝑥 = −3 where 𝑥 = 0. Then 𝑥 ≤ −3 is false.

Exclusive or (“either p or q, but not both”)


Exclusive or is a compound proposition combining two or more simple propositions using the word “either or”.
Truth value for this compound proposition is true when exactly one of its simple propositions/components is true, but not
both. If 𝑝 and 𝑞 are two propositions, 𝑝 ⨁ 𝑞 symbolizes the exclusive or of 𝑒𝑖𝑡ℎ𝑒𝑟 𝑝 or 𝑞.

p q 𝑝⨁𝑞
T T F
T F T
F T T
F F F

Example: Either John is studying or he is sleeping.

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

Meaning, if p is true, then q should be true because p is necessary condition for q.


But if p is false then q may or may not be true.
Example.
Let p: John lives in Malaybalay City and q: John is in Bukidnon.

p q 𝑝→𝑞 If John lives in Malaybalay City then he is in Bukidnon.


T T T If John lives in Malaybalay City then he is in Bukidnon.
T F F If John lives in Malaybalay City then he is not in Bukidnon.
F T T If John does not live in Malaybalay City then he is in Bukidnon.
F F T If John does not live in Malaybalay City then he is not in Bukidnon.

Here are two more conditional statement examples.


Example 1: If I win the lottery then I’ll be a millionaire.
Example 2: If a triangle is equiangular, then it is equilateral.

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.

p q 𝑝↔𝑞 A number is divisible by two if and only if it is even.


T T T A number is divisible by two if and only if it is even.
T F F A number is divisible by two if and only if it is not even.
F T F A number is not divisible by two if and only if it is even.
F F T A number is not divisible by two if and only if it is not even.
Rules of Logic
●Negation– Change the truth value.
●Conjunction– True only if both are true.
●Disjunction– False only if both are false.
●Exclusive or– False only if both are true or both are false.
●Implication (Conditional)– False only if true points to false.
●Biconditional– True only if both are true or both are false.

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.

Statement Symbolic form


1. If the water is not warm, then the sun is not shining or we go swimming. ~𝑟 → (~𝑠 ∨ 𝑡)
2. The sun is shining if and only if the water is warm, and we go swimming. (𝑠 ↔ 𝑟) ∧ 𝑡
3. The water is warm and the sun is shining, or we go swimming. (𝑟 ∧ 𝑠) ⋁ 𝑡
4. If we don’t go swimming, then the sun is shining and the water is warm. ~𝑡 → (𝑠 ∧ 𝑟)
5. The water is warm or the sun is shining, and we don’t go swimming. (𝑟 ∨ 𝑠) ∧ ~ 𝑡

Tautology, Contradiction, Contingency.


1. A proposition is said to be a tautology if its truth value is T for any assignment of truth values to its components.
Example: The proposition 𝑝˅~𝑝 is a tautology.

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.

3. A proposition that is neither a tautology nor a contradiction is called a contingency.

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:
~(𝑝˅𝑞) ≡ ~𝑝˄~𝑞
~(𝑝˄𝑞) ≡ ~𝑝˅~𝑞

We can check it by examining their truth tables:


p q ~p ~q 𝑝˅𝑞 ~(𝑝˅𝑞) ~𝑝˄~𝑞 𝑝˄𝑞 ~(𝑝˄𝑞) ~𝑝˅~𝑞
T T
T F
F T
F F

Thus ~(𝑝˅𝑞) ≡ ~𝑝˄~𝑞, and ~(𝑝˄𝑞) ≡ ~𝑝˅~𝑞.

Example: The following propositions are logically equivalent: p↔q ≡ (p→q)˄(q→p)


Again, this can be checked with the truth tables:

p q (p→q) (q→p) (p→q)˄(q→p) p↔q


T T
T F
F T
F F

That is p↔q ≡ (p→q)˄(q→p).


Converse and Contrapositive

The converse of a conditional proposition 𝑝 → 𝑞 is the proposition 𝑞 → 𝑝.


Example.
𝑝: 𝐽𝑜ℎ𝑛 𝑖𝑠 𝑚𝑎𝑟𝑟𝑖𝑒𝑑.
𝑞: 𝐽𝑜ℎ𝑛 ℎ𝑎𝑠 𝑎 𝑠𝑝𝑜𝑢𝑠𝑒.
Conditional proposition(𝑝 → 𝑞): If John is married then he has a spouse.
Converse(𝑞 → 𝑝): If John has a spouse then he is married.
Notice also that the biconditional proposition is equivalent to the conjunction of a conditional proposition and its
converse. That is,
𝑝 ↔ 𝑞 ≡ (𝑝 → 𝑞)˄(𝑞 → 𝑝)
For instance, saying that “John is married if and only if he has a spouse” is the same as saying “if John is married then he
has a spouse” and “if John has a spouse then he is married”.

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

Thus p→q ≡ ~q→ ~p

You might also like