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

PMAT 11223 Discrete Mathematics

DISCRETE MATHEMATICS
PMAT 11223
Lesson 01
1. LOGIC
Symbolic logic is a system of rules and notation to simplify reasoning [George Boole
(1815-1864) generally credited with its invention].

1.1 PROPOSITIONS
A proposition is a statement that is true or false, but not both. Propositions are
denoted by symbols - 𝑝, 𝑞, 𝑟, 𝑠 etc.
e.g. 𝑝 : Today is Tuesday
𝑞 ∶3+4 =8
are prepositions, whereas
𝑟 : Is it raining?
is not.
Compound prepositions are formed by joining one or more prepositions with the
symbols
∼ not (negation)
∧ and (conjunction)
∨ or (disjunction)
Here, ∧ and ∼ have the usual English meanings, while ∨ is the ‘inclusive or’,
i.e. 𝑝 ∨ 𝑞 means ‘𝑝 or 𝑞 or both’.
The ‘exclusive or’ is denoted by ⨁,
e.g. 𝑝⨁𝑞 means ‘𝑝 or 𝑞 but not both’.

Example: Express in English.


I. 𝑝 ∧∼ 𝑞 ; 𝑝 and not 𝑞
II. ∼ 𝑝 ∨∼ 𝑞 ; not 𝑝 or not 𝑞
III. 𝑞 ∧∼ 𝑝 ; 𝑞 and not 𝑝

1.2 CONDITIONALS
A statement containing the word ‘if’ is a conditional statement. The symbol ‘⟶’
denotes the conditional.
i.e. 𝑝 ⟶ 𝑞 means ‘if 𝑝, then 𝑞’.
i.e. 𝑝 implies 𝑞.

Similarly, the bi-conditional is denoted by ‘⟷’.


i.e. 𝑝 ⟷ 𝑞 means ‘𝑝 implies 𝑞, and 𝑞 implies 𝑝 ’, read as ‘𝑝 if and only if 𝑞’.

J Munasinghe, Department of Mathematics, University of Kelaniya


PMAT 11223 Discrete Mathematics

1.2.1 NOTE: 𝑝 ⟷ 𝑞 is equivalent to (𝑝 ⟶ 𝑞) ∧ (𝑞 ⟶ 𝑝).


‘𝑝 if and only if 𝑞’ is sometimes written as ‘𝑝 is necessary and sufficient for 𝑞’.
(𝑝 ⟶ 𝑞) and (𝑞 ⟶ 𝑝) are NOT the same. The order is important.

e.g. 𝑝: It rains.
𝑞: I stay inside.
𝑝 ⟶ 𝑞 means ‘If it rains, I stay inside’.
𝑞 ⟶ 𝑝 means ‘If I stay inside, it rains’.

Note also the position of ‘if’ in the sentence.


i.e. ‘I stay inside if it rains’ is the same as ‘If it rains, I stay inside’.
Both are 𝑝 ⟶ 𝑞.

Example: Given that 𝑝, 𝑞, 𝑟, 𝑠 are defined by,


𝑝: They do aerobics.
𝑞: They lift weights.
𝑟: They run.
𝑠: They swim.

a) Express in symbolic form.

I. They run or swim, but don’t lift weights.


(𝑟 ∨ 𝑠) ∧ ∼ 𝑞
II. If they swim and lift weights, they don’t run.
(𝑠 ∧ 𝑞) ⟶∼ 𝑟
III. They swim or don’t run, if they do aerobics.
𝑝 ⟶ (𝑠 ∨ ∼ 𝑟)
IV. They swim if and only if they lift weights and don’t run.
𝑠 ⟷ (𝑞 ∧ ∼ 𝑟)

b) Translate into English

I. ∼ 𝑟 ⟶ (𝑠 ∨ ∼ 𝑝)
If they don’t run, they swim or don’t do aerobics.
II. 𝑟 ∧∼ (𝑠 ∨ 𝑞)
They run, but they neither swim nor lift weights.
III. (𝑟 ∨ 𝑠) ⟶ (𝑞 ∧ ∼ 𝑝)
If they run or swim, then they lift weights, but don’t do aerobics.
IV. 𝑟 ⟶ (𝑠 ⟶ 𝑞)
If they run, then they lift weights if they swim.

J Munasinghe, Department of Mathematics, University of Kelaniya


PMAT 11223 Discrete Mathematics

1.3 TRUTH TABLES


A truth table gives the truth value (T or F) of a compound preposition or conditional
in terms of the truth value of its component parts.

1) ∼ 𝑝
𝑝 ∼𝑝
T F
F T
i.e. ∼ 𝑝 is True if 𝑝 is False.

2) 𝑝 ∧ 𝑞
𝑝 𝑞 𝑝∧𝑞
T T T
T F F
F T F
F F F
i.e. 𝑝 ∧ 𝑞 is True if 𝑝 and 𝑞 are both True.

3) 𝑝 ∨ 𝑞
𝑝 𝑞 𝑝∨𝑞
T T T
T F T
F T T
F F F
i.e. 𝑝 ∨ 𝑞 is True if 𝑝 or 𝑞 or both are True.

4) 𝑝 ⟶ 𝑞
𝑝 𝑞 𝑝⟶𝑞
T T T
T F F
F T T
F F T

i.e. 𝑝 ⟶ 𝑞 is False only in the case where a True 𝑝 leads to a False 𝑞.


This is the only case in which the REASONING (the ⟶ ) cannot be true.

J Munasinghe, Department of Mathematics, University of Kelaniya


PMAT 11223 Discrete Mathematics

Consider, 𝑝: It is raining.
𝑞: He stays at home.
Lines 3 and 4 of the table indicate that, if it is not raining, he can choose to go out or
stay at home, and still not be lying.
Line 2, however, indicates lying. i.e. Even though it is raining, he doesn’t stay at
home. Hence, the REASONING (the ⟶ ) is False.

5) 𝑝 ⟷ 𝑞
𝑝 𝑞 𝑝⟷𝑞
T T T
T F F
F T F
F F T
i.e. 𝑝 ⟷ 𝑞 is True if 𝑝 and 𝑞 have the same truth values (both T or both
F). The above table can be checked using the fact that,
𝑝 ⟷ 𝑞 means (𝑝 ⟶ 𝑞) ∧ (𝑞 ⟶ 𝑝).

𝑝 𝑞 𝑝⟶𝑞 𝑞⟶𝑝 𝑝⟷𝑞


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

6) 𝑝 ⨁ 𝑞
𝑝 𝑞 𝑝⨁𝑞
T T F
T F T
F T T
F F F
i.e. 𝑝⨁𝑞 is True if 𝑝 and 𝑞 have different truth values (one T, one F).

1.3.1 NOTE: For a proposition involving n variables, 2𝑛 rows are needed for the table.
e.g. For 3 variables, 8 rows are needed.
For 3 variables 𝑝, 𝑞, 𝑟 use
3rd variable 𝑟 : T in blocks of 1
2nd variable 𝑞: T in blocks of 2
1st variable 𝑝 : T in blocks of 4

J Munasinghe, Department of Mathematics, University of Kelaniya


PMAT 11223 Discrete Mathematics

i.e.
𝑝 𝑞 𝑟
T T T
T T F
T F T
T F F
F T T
F T F
F F T
F F F

Example: Construct truth tables for,


i. 𝑝∧∼𝑝

𝑝 ∼𝑝 𝑝∧∼𝑝
T F F
F T F

ii. 𝑝∧∼𝑞

𝑝 𝑞 ∼𝑞 𝑝∧∼𝑞
T T F F
T F T T
F T F F
F F T F

iii. 𝑝 ∨ (𝑞 ∧ ∼ 𝑝)

𝑝 𝑞 ∼𝑝 𝑞 ∧∼ 𝑝 𝑝 ∨ (𝑞 ∧ ∼ 𝑝)
T T F F T
T F F F T
F T T T T
F F T F F

J Munasinghe, Department of Mathematics, University of Kelaniya


PMAT 11223 Discrete Mathematics

iv. 𝑝 ⟶ (∼ 𝑞 ∨ 𝑝)

𝑝 𝑞 ∼𝑞 ∼𝑞∨𝑝 𝑝 ⟶ (∼ 𝑞 ∨ 𝑝)
T T F T T
T F T T T
F T F F T
F F T T T

v. (𝑝 ∧ 𝑞) ⟶ 𝑟

𝑝 𝑞 𝑟 𝑝∧𝑞 (𝑝 ∧ 𝑞) ⟶ 𝑟
T T T T T
T T F T F
T F T F T
T F F F T
F T T F T
F T F F T
F F T F T
F F F F T

vi. (𝑝 ∨ 𝑞) ⟷ 𝑟

𝑝 𝑞 𝑟 𝑝∨𝑞 (𝑝 ∨ 𝑞) ⟷ 𝑟
T T T T T
T T F T F
T F T T T
T F F T F
F T T T T
F T F T F
F F T F F
F F F F T

J Munasinghe, Department of Mathematics, University of Kelaniya

You might also like