LOGICS

You might also like

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

CHAPTER 2 ⃒ SETS AND LOGIC

______________________________________________________________________________________________

Warning!!! This is for NORSU students copy only,


please do not share or reproduce.

Statements in Logic

A statement is a simple declarative sentence that is either true or false but not both.
We usually name a statement by the letters 𝑝, 𝑞, or 𝑟.

Example 2.3 Which of the following are statements?


1. NORSU main campus is in Dumaguete City.
2. 1 + 2 = 3
3. Where do you live?
4. That turtle runs fast.
5. 2𝑥𝑦 = 1

Solution 1. It is a statement since it is true.


2. It is a statement since it is true.
3. It is not a statement since it is not a declarative sentence.
4. It is not a statement since we do not know whether it is true or false.
5. It is not a statement since we do not know whether it is true or false.

The truth or falsity of a statement is called truth value.

Example 2.4 Determine the truth value of the following statements.


1. NORSU students are not genius.
2. 23+77=100
3. Dumaguete City is in Spain.
4. Fishes can swim.

Solution 1. False
2. True
3. False
4. True
Sets and Logic
______________________________________________________________________________________________

Two statements 𝑝 and 𝑞 may be joined using connectives (i.e. and, or, implies that) to form
a compound statement. When 𝑝 and 𝑞 are joined using the connective “and”, the resulting
compound statement is called a conjunction. While when 𝑝 and 𝑞 are joined using the
connective “or”, the resulting compound statement is called a disjunction. Furthermore,
when 𝑝 and 𝑞 are joined using the connective “implies that”, the resulting compound
statement is called a conditional statement. The truth value of the sub statements and the
connective used.

Example 2.5 Consider the following statements.


𝑝: Birds can fly.
𝑞: Fishes can swim.
a. Write the conjunction of 𝑝 and 𝑞.
b. Write the disjunction of 𝑝 and 𝑞.
c. Write the conditional statement of 𝑝 and 𝑞.
Solution a. Birds can fly and fishes can swim.
b. Birds can fly or fishes can swim.
c. Birds can fly implies that fishes can swim.

Negation of a Statement

Let 𝑝 be a statement. The negation of 𝑝, denoted by ∼ 𝑝, is a statement that is true


precisely when 𝑝 is false. This means that a statement and its negation always have
opposite truth values.
𝑝 ∼𝑝
T F
F T

Example 2.6 Negate and determine the truth value of the following statements.
1. 2 is positive.
2. Seoul is the capital city of North Korea.

Solution 1. Let 𝑝 be the statement “2 is positive”. Then ∼ 𝑝 is the statement “2 is


not positive. Since 𝑝 is true because it is obvious that 2 is positive. Thus, ∼
𝑝 is false.
2. Let 𝑝 be the statement “Seoul is the capital city of North Korea”. Then
∼ 𝑝 is the statement “Seoul is not the capital city of North Korea”. Since 𝑝
Sets and Logic
______________________________________________________________________________________________

is false because in geography, Seoul is the capital city of South Korea.


Thus, ∼ 𝑝 is true.

Properties of conjunction, disjunction, conditional and


biconditional statements

The truth value of a compound statement depends on the truth value of the sub
statements and the connective used.

1. Conjunction
Let 𝑝 and 𝑞 be statements. The conjunction of 𝑝 and 𝑞, denoted by 𝑝 ∧ 𝑞, is a
statement formed by joining the statements 𝑝 and 𝑞 using the word “and”. The
statement 𝑝 ∧ 𝑞 is true if both 𝑝 and 𝑞 are true, otherwise false.
𝑝 𝑞 𝑝∧𝑞
T T T
T F F
F T F
F F F

Example 2.7 Determine the truth value of the following statements.


1. Washington D.C. is the capital city of the USA and USA is in North
America.
2. 19 is an even number and 36 is a multiple of 6.

Solution 1. Let 𝑝 be the statement “Washington D.C. is the capital city of the USA”
and 𝑞 be the statement “USA is in North America.” Since 𝑝 and 𝑞 are both
true. Thus, 𝑝 ∧ 𝑞 is true.
2. Let 𝑝 be the statement “19 is an even number” and 𝑞 be the statement
“36 is a multiple of 6. Since 𝑝 is false and 𝑞 is true. Thus, 𝑝 ∧ 𝑞 is false.

2. Disjunction
Let 𝑝 and 𝑞 be statements. The disjunction of 𝑝 and 𝑞, denoted by 𝑝 ∨ 𝑞, is a
statement formed by joining the statements 𝑝 and 𝑞 using the word “or”. The
statement 𝑝 ∨ 𝑞 is true at least one of the statements 𝑝 and 𝑞 is true.
Sets and Logic
______________________________________________________________________________________________

𝑝 𝑞 𝑝∨𝑞
T T T
T F T
F T T
F F F

Example 2.8 Determine the truth value of the following statements.


1. 2 is either an even or an odd number.
2. Birds can’t fly or fishes can’t swim.

Solution 1. Let 𝑝 be the statement “2 is an even number” and 𝑞 be the statement


“2 is an odd number. Since 𝑝 is true and 𝑞 is false. Thus, by definition, 𝑝 ∨ 𝑞
is true.
2. Let 𝑝 be the statement “birds can’t fly” and 𝑞 be the statement “fishes
can’t swim. Since it is obvious that 𝑝 and 𝑞 are both false. Thus, 𝑝 ∨ 𝑞 is
false.

3. Conditional Statement
Let 𝑝 and 𝑞 be statements. The implication or a condition of 𝑝 and 𝑞, denoted by
𝑝 → 𝑞, is a statement of the form “if 𝑝, then 𝑞” in which 𝑝 is the hypothesis and 𝑞 is
the conclusion. The implication 𝑝 → 𝑞 is considered false when the hypothesis 𝑝 is
true and the conclusion 𝑞 is false, otherwise it is considered true.
𝑝 𝑞 𝑝→𝑞
T T T
T F F
F T T
F F T

Converse, Inverse, and Contrapositive


Let 𝑝 and 𝑞 be statements.
1. The statement 𝑞 → 𝑝 is called the converse of the implication 𝑝 → 𝑞.
2. The statement ∼ 𝑝 →∼ 𝑞 is called the inverse of the implication 𝑝 → 𝑞.
3. The statement ∼ 𝑞 →∼ 𝑝 is called the contrapositive of the implication 𝑝 → 𝑞.

Example 2.9 Determine the truth value of the following statements.


1. If 18 is an even number, then 36 is an odd number.
2. If Sheena is a man, then Jun Klein is a man.
Sets and Logic
______________________________________________________________________________________________

Solution 1. Let 𝑝 be the statement “18 is an even number” and 𝑞 be the statement
“36 is an odd number”. Since 𝑝 is true and 𝑞 is false. Thus, by definition, 𝑝 →
𝑞 is false.
2. Let 𝑝 be the statement “Sheena is a man” and 𝑞 be the statement “Jun
Klein is a man”. Since 𝑝 is false and 𝑞 is true. Thus, 𝑝 → 𝑞 is true.

Example 2.10 Write the following conditional statement into converse, inverse, and
contrapositive.
𝑝 → 𝑞: If Febb is a woman, then Febb is beautiful.

Solution 𝑞 → 𝑝: If Febb is beautiful, then Febb is a woman.


∼ 𝑝 →∼ 𝑞: If Febb is not a woman, then Febb is not beautiful.
∼ 𝑞 →∼ 𝑝: If Febb is not beautiful, then Febb is not a woman.

4. Biconditional Statement
Let 𝑝 and 𝑞 be statements. The biimplication or biconditional statement of 𝑝 and
𝑞, denoted by 𝑝 ↔ 𝑞, is a statement of the form “𝑝 if and only if 𝑞” in which both
sub statements 𝑝 and 𝑞 have the same truth value.
𝑝 𝑞 𝑝↔𝑞
T T T
T F F
F T F
F F T

Example 2.11 Determine the truth value of the following statements.


1. 0.7 is an integer if and only if 0.5 is a rational number.
2. 7+3=10 if and only if 122=144.

Solution 1. Let 𝑝 be the statement “0.7 is an integer” and 𝑞 be the statement “0.5 is
a rational number. Since 𝑝 is false because an integer is a whole number
1
and 𝑞 is true because 0.5 is equivalent to that is a rational number. Thus,
2
𝑝 ↔ 𝑞 is false.
2. Let 𝑝 be the statement “7+3=10” and 𝑞 be the statement “122=144”.
Since 𝑝 is true by addition and 𝑞 is true by squaring a number. Thus, 𝑝 ↔ 𝑞
is true.
Sets and Logic
______________________________________________________________________________________________

A statement formula 𝐴 is said to be tautology if the truth value of 𝐴 is true for any
assignment of the truth values T and F to the statement variables occurring in 𝐴. A
statement formula 𝐴 is said to be a contradiction if the truth value of 𝐴 is false for any
assignment of the truth value T and F to the statement variables occurring in 𝐴.

Example 2.12 Let 𝑝, 𝑞 are 𝑟 be statements. Construct a truth table of the following and
determine if the following is either a tautology or a contradiction.
1. (∼ 𝑝 ∧ 𝑞) → 𝑟
2. ∼ 𝑝 ∧ 𝑝

Solution 1. (∼ 𝑝 ∧ 𝑞) → 𝑟
𝑝 𝑞 𝑟 ∼𝑝 ∼𝑝∧𝑞 (∼ 𝑝 ∧ 𝑞) → 𝑟
T T T F F T
T T F F F T
T F T F F T
T F F F F T
F T T T T T
F T F T T T
F F T T F T
F F F T F T
Thus, (∼ 𝑝 ∧ 𝑞) → 𝑟 is a tautology.

2. ∼ 𝑝 ∧ 𝑝
𝑝 ∼𝑝 ∼𝑝∧𝑝
T F F
F T F
Thus, ∼ 𝑝 ∧ 𝑝 is a contradiction.

A statement formula 𝐴 is said to be logically imply to a statement 𝐵 if the statement


𝐴 → 𝐵 is a tautology. If 𝐴 logically implies 𝐵, then symbolically we write 𝐴 → 𝐵. A statement
formula 𝐴 is said to be logically equivalent to a statement formula 𝐵 if the statement
formula 𝐴 ↔ 𝐵 is a tautology. If 𝐴 is equivalent to 𝐵, then symbolically we write 𝐴 ≡ 𝐵 or
𝐴 ↔ 𝐵.

Example 2.13 Show by truth table that


1. The statement formula 𝐴 = 𝑝 ∧ (𝑝 → 𝑞) logically implies statement
formula 𝐵 = 𝑞.
Sets and Logic
______________________________________________________________________________________________

2. The statement formula 𝐴 = 𝑝 → 𝑞 is logically equivalent to the


statement formula 𝐵 =∼ 𝑝 ∨ 𝑞.
Solution 1.
𝐵 𝐴
𝑝 𝑞 𝑝→𝑞 𝑝 ∧ (𝑝 → 𝑞) 𝐴→𝐵
T T T T T
T F F F T
F T T F T
F F T F T
Thus, 𝐴 → 𝐵.
2.
𝐴 𝐵
𝑝 𝑞 𝑝→𝑞 ∼𝑝 ∼𝑝∨𝑞 𝐴≡𝐵
T T T F T T
T F F F F T
T T T T T T
T F T T T T
Thus, 𝐴 ≡ 𝐵.

Theorem Let 𝑝, 𝑞, and 𝑟 be statements. Then the following logical equivalences hold:
1. Commutative Laws
𝑝∧𝑞 ≡𝑞∧𝑝
𝑝∨𝑞 ≡𝑞∨𝑝

2. Associative Laws
(𝑝 ∧ 𝑞) ∧ 𝑟 ≡ 𝑝 ∧ (𝑞 ∧ 𝑟)
(𝑝 ∨ 𝑞) ∨ 𝑟 ≡ 𝑝 ∨ (𝑞 ∨ 𝑟)

3. Distributive Laws
𝑝 ∨ (𝑞 ∧ 𝑟) ≡ (𝑝 ∨ 𝑞) ∧ (𝑝 ∨ 𝑟)
𝑝 ∧ (𝑞 ∨ 𝑟) ≡ (𝑝 ∧ 𝑞) ∨ (𝑝 ∧ 𝑟)

4. Absorptivity Laws
𝑝 ∧ (𝑝 ∨ 𝑞) ≡ 𝑝
𝑝 ∨ (𝑝 ∧ 𝑞) ≡ 𝑝

5. Idempotency Laws
𝑝∧𝑝 ≡𝑝
Sets and Logic
______________________________________________________________________________________________

𝑝∨𝑝 ≡𝑝

6. Double Negation
∼ (∼ 𝑝) ≡ 𝑝

7. De Morgan’s Laws
∼ (𝑝 ∧ 𝑞) ≡ (∼ 𝑝) ∨ (∼ 𝑞)
∼ (𝑝 ∨ 𝑞) ≡ (∼ 𝑝) ∧ (∼ 𝑞)

Open Sentence

An open sentence is a declarative sentence containing a variable. It becomes a


statement when the value of the variable is specified. It is usually denoted by 𝑝𝑥 , 𝑞𝑦 , 𝑟𝑧 , etc.
The truth set of an open sentence is the set of all values of the variable that will make the
open sentence true.

Example 2.14 The following sentences are open.


1. 𝑥 + 5 = 11.
2. 𝑦 3 ≥ 8.

Example 2.15 Find the truth set of the following open sentences.
1. 𝑥 + 5 = 11.
2. 𝑦 3 ≥ 8

Solution 1. {6}.
2. {𝑥 | 𝑥 ≥ 2}.

Quantifiers

Let 𝑝𝑥 be an open sentence. Note that if the phrase ”for all” or ”for some” is added
to an open sentence, then the resulting sentence is a statement. In this case, we call the
statement a quantified statement.

Example 2.16 The following are quantified statements.


1. 𝑥 + 5 = 11 for all real number 𝑥.
2. 𝑦 3 ≥ 8 for some real number 𝑦 (this may be expressed as “there exists
a real number 𝑦 such that 𝑦 3 ≥ 8.”)
Sets and Logic
______________________________________________________________________________________________

The phrase “for all” is called a universal quantifier, while the phrase “for some” or “there
exists” is called an existential quantifier. A statement with the quantifier “for all” is true if
the truth set of its open sentence is the universal set, while a statement with the
quantifier “for some” is true if the truth set of its open sentence is non-empty.

Example 2.17 Find the truth value of the following statements.


1. 𝑥 + 7 = 35 for all real number 𝑥.
2. 𝑦 2 ≥ 2 for some real number 𝑦.
3. 3𝑥 + 8 = 14 for some real number 𝑥.
4. 𝑦 2 > −1 for all real number 𝑦.

Solution 1. false
2. true
3. true
4. false

Notation 1. The statement “𝑝𝑥 for all 𝑥” is written in symbols “∀𝑥, 𝑝𝑥 ”.


2. The statement “𝑝𝑥 for some 𝑥” is written in symbols “∃𝑥, 𝑝𝑥 ”.

Remark 1. ∼ (∀𝑥, 𝑝𝑥 ) ≡ ∃𝑥, ∼ 𝑝𝑥


2. ∼ (∃𝑥, 𝑝𝑥 ) ≡ ∀𝑥, ∼ 𝑝𝑥

Example 2.18 Restate the following.


1. ∼ (∀𝑥, 𝑥 + 5 = 11)
2. ∼ (∃𝑦, 𝑦 3 ≥ 8)

Solution 1. ∼ (∀𝑥, 𝑥 + 5 = 11) ≡ ∃𝑥, 𝑥 + 5 ≠ 11. That is, 𝑥 + 5 ≠ 11 for some real
number 𝑥. Equivalently, there exists a real number 𝑥 such that 𝑥 + 5 ≠ 11.
2. ∼ (∃𝑦, 𝑦 3 ≥ 8) ≡ ∀𝑦, 𝑦 3 < 8. That is, 𝑦 3 < 8 for all real number 𝑦.
Sets and Logic
______________________________________________________________________________________________

You might also like