0% found this document useful (0 votes)
26 views16 pages

Propositional Logic (Part 2)

Uploaded by

tasnuvamim01
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views16 pages

Propositional Logic (Part 2)

Uploaded by

tasnuvamim01
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Propositional Logic

Charles Aunkan Gomes


Lecturer, Dept. of CSE
United International University

CHARLES AUNKAN GOMES (LECTURER, DEPT OF CSE, UIU) 1


Converse, Contrapositive and Inverse
p : I am in Dhaka
q : I am in Bangladesh
“If I am in Dhaka then I am in Bangladesh.”
𝑝→𝑞
•Converse: 𝑞 → 𝑝
If I am in Bangladesh, then I am in Dhaka.
•Inverse:¬𝑝 → ¬𝑞
If I am not in Dhaka then I am not in Bangladesh.
•Contrapositive: ¬𝑞 → ¬𝑝
If I am not in Bangladesh, then I am not in Dhaka.

CHARLES AUNKAN GOMES (LECTURER, DEPT OF CSE, UIU) 2


Converse, Contrapositive and Inverse
p : It rains
q : I will stay home
“If it rains then I will stay home”
𝑝→𝑞
•Converse: 𝑞 → 𝑝
If I stay home, then it is raining.
•Inverse:¬𝑝 → ¬𝑞
If it does not rain, I will not stay home.
•Contrapositive: ¬𝑞 → ¬𝑝
If I do not stay home, it is not raining.

CHARLES AUNKAN GOMES (LECTURER, DEPT OF CSE, UIU) 3


Converse, Contrapositive and Inverse

CHARLES AUNKAN GOMES (LECTURER, DEPT OF CSE, UIU) 4


Precedence of Logical Operators
There may be several logical operators in a sentence
We will keep the precedence in mind while translating as a strategy.

CHARLES AUNKAN GOMES (LECTURER, DEPT OF CSE, UIU) 5


Translating Sentences into Propositions
1. It is raining and John is sick r∧j

r j
2. I will stay home or go outside s∨g

s g
3. I will stay home or go outside or watch movie s∨g∨m

s g m
4. Dhaka is capital of Bangladesh and it is raining or it is sunny d∧r∨s
d r s
5. It is raining and Tasmin is sick that she stayed at home (r ∧ t) → s
r t s

CHARLES AUNKAN GOMES (LECTURER, DEPT OF CSE, UIU) 6


Translating Sentences into Propositions
“You can access the Internet from campus only if you are a computer science major or you are not
a freshman.”
Let,
a: “You can access the Internet from campus”
c: “You are a computer science major”
f: “You are a freshman”

(c ∨ ¬f ) → a

CHARLES AUNKAN GOMES (LECTURER, DEPT OF CSE, UIU) 7


Translating Sentences into Propositions
“You will fail unless you study hard and pray.”
Let,
f: “You will fail”
s: “You study hard”
p: “You pray”

“If you do not study hard and do not pray, you will fail”

(¬s ∧ ¬p) → f

CHARLES AUNKAN GOMES (LECTURER, DEPT OF CSE, UIU) 8


Translating Sentences into Propositions
“You cannot ride the roller coaster if you are under 4 feet tall unless you are older than 16 years
old.”
Let,
q : “You can ride the roller coaster”
r : “You are under 4 feet tall”
s : “You are older than 16 years old”

1st way: ¬s → (r → ¬q)


2nd way: (r ∧ ¬s) → ¬q

CHARLES AUNKAN GOMES (LECTURER, DEPT OF CSE, UIU) 9


Translating Sentences into Propositions
“You can graduate only if you have completed the requirements of your major and you do not
owe money to the university and you do not have an overdue library book.”
Let,
g : “You can graduate”
r : “You have completed the requirements of your major”
m : “You owe money to the university”
o : “You have an overdue library book”

g → (r ∧ ¬m ∧ ¬o)

CHARLES AUNKAN GOMES (LECTURER, DEPT OF CSE, UIU) 10


Translating Sentences into Propositions
“To use the wireless network in the airport you must pay the daily fee unless you are a subscriber
to the service.”
Let,
w : “You use the wireless network in the airport”
p : “You must pay the daily fee”
s : “You are a subscriber to the service”

¬s → (w → p)

CHARLES AUNKAN GOMES (LECTURER, DEPT OF CSE, UIU) 11


Truth Table of Compound Propositions
•A truth table is used to observe the behavior of a compound proposition at a glance
•The different possible truth values of the simple propositions are compiled in the table, and for each
combination, the truth value of the compound one is found out.

Let, find out the truth table of (p∨q)∧¬r


To solve this, we should divide it into small sections.
•(p∨q)
•¬r
•(p∨q)∧¬r

CHARLES AUNKAN GOMES (LECTURER, DEPT OF CSE, UIU) 12


Construct truth table for (p ∨ q) ∧ ¬r
𝒑 𝒒 𝒓 (p∨q) ¬r (p∨q)∧¬r

T T T T F F

T T F T T T

T F T T F F

T F F T T T

F T T T F F

F T F T T T

F F T F F F

F F F F T F

CHARLES AUNKAN GOMES (LECTURER, DEPT OF CSE, UIU) 13


Construct truth table for (a→b) ∧ ¬(a→b)

𝒂 𝒃 (a→b) ¬(a→b) (a→b) ∧ ¬(a→b)

T T T F F

T F F T F

F T T F F

F F T F F

CHARLES AUNKAN GOMES (LECTURER, DEPT OF CSE, UIU) 14


Construct truth table for p ∧ (q r)

𝒑 𝒒 𝒓 (q r) p ∧ (q r)
T T T T T

T T F F F

T F T F F

T F F T T

F T T T F

F T F T F

F F T F F

F F F T F

CHARLES AUNKAN GOMES (LECTURER, DEPT OF CSE, UIU) 15


CHARLES AUNKAN GOMES (LECTURER, DEPT OF CSE, UIU) 16

You might also like