0% found this document useful (0 votes)
3 views

1. Propositional Logic (Part 1)

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)
3 views

1. Propositional Logic (Part 1)

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
You are on page 1/ 25

Propositional Logic

Charles Aunkan Gomes


Lecturer, Dept. of CSE
United International University

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


What is a Proposition?
A proposition is a declarative sentence that:
• can be either true or false
• cannot be both
• cannot be neither

Let p be the statement “The sun rises in the east”


• p is a proposition as it can be clearly classified as either true or false.
• P is true proposition

Again, let q be the statement “2 plus 2 equals 5”


• q is also a proposition as it can be classified as either true or false.
• q is false proposition

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


What is not a Proposition?
Statements that cannot be assigned True or False values

▪ What is your name?


• A question. Hence not a declarative sentence.

▪ Tell me your name.


• An order. Hence not a declarative sentence.

▪ x+1=y
• An equation. Neither true or false.

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


Are these propositions?
❖x + 1 = y, given that x = 5 and y = 6
• An equation with values of each variable. A proposition.

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


Are these propositions?
❖I am lying.
• If "I am lying" is true:
▪ If you are telling the truth when you say "I am lying," then you must
actually be lying. But if you're lying, then the statement "I am lying"
cannot be true. BAM!!!

• If "I am lying" is false:


▪ If you're lying when you say "I am lying," then you are not lying (because
a liar would be lying about lying). But if you're not lying, then the
statement "I am lying" must be true. DOUBLE BAM!!!

Both true and false. Not a proposition.

This is known as “Liar Paradox”

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


Propositional Variables
We can use variable or symbol to represent a proposition without writing the
actual sentence.
For example:
• Consider a propositional variable p
• It can denote the proposition “The earth is round”
• Hence, p = The earth is round
• Easy representation

More examples:
a = Argentina won the world cup
b = Brazil lost to Germany
e = Emi Martinez plays well

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


Atomic Proposition and
Compound Proposition
Atomic propositions: Propositions that cannot be further expressed in terms of
simpler propositions.
•I live in Dhaka.
•I am a lecturer of UIU.
•I went to Mars.

Compound propositions: Propositions that are formed from combining two or


more atomic propositions.
•I live in Dhaka and I am a lecturer of UIU.
•I live in Dhaka but I went to Mars.
•I am a lecturer of UIU or I live in Dhaka.

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


Logical Operator
Logical operator: word or phrase used either to modify one proposition to make a
different proposition or join multiple propositions together to form a compound
proposition. It is also known as connectives.
There are several ways in which we commonly modify or combine simple
propositions into compound ones. The words/phrases and, or, not, if ... then..., and
...if and only if ... can be added to one or more propositions to create a new
proposition.
We will study the following logical connectives:
•Negation/ Logical Not
•Conjunction/ Logical And
•Disjunction / Logical Or
•Conditional / Implication
•Bi-conditional

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


Negation (NOT)
The negation of p, denoted by ¬p. It means “It is not the case that p.”
For example:
•“The earth is flat”
•The negation is: “It is not the case that, the earth is flat.”
•Simpler negation : “The earth is not flat”.

True if the actual proposition is false.

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


Conjunction (AND)
The conjunction of p and q can be denoted by p ∧ q. It means “p and q”.
For example:
p = Messi is playing
q = Argentina is winning
p ∧ q = Messi is playing and Argentina is winning

True if both propositions are individually true.

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


Disjunction (OR)
The conjunction of p and q can be denoted by p ∨ q. It means “p or q”.
For example:
p = 2 + 2 equals 4
q=4>5
p ∨ q = 2 + 2 equals 4 or 4 > 5.

True if any proposition is true.

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


Exclusive OR
It is a special type of Disjunction. The exclusive or of p and q can be denoted by
p ⊕ q.
Example:
p = Bangladesh will win the match.
q = England will win the match.
p ⊕ q = Either Bangladesh or England will win the match.

True if exactly one proposition is true.

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


Conditional Statement
If it rains, I will stay home.
WHEN IS THIS SENTENCE TRUE?

•The sentence is true if it is raining, and you are staying home.

What if it doesn’t rain?

The sentence does not say anything about what if it does not rain
•So if it does not rain, we can say you have not broken any condition
•So if it does not rain, the sentence is true whether you stay home or not

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


Conditional Statement
So when is this sentence false?
•The sentence is false if it rains, and you go out anyway

If it rains, I will stay home.

Let P and Q be propositions.


• p : It rains
• q : I will stay home
• p → q : If it rains, I will stay home.

𝑝→𝑞
• P is called premise/hypothesis
• Q is called conclusion/consequence Hypothesis Conclusion

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


Hypothesis and conclusion
If it rains, I will stay home

Hypothesis Conclusion

The if clause is called the hypothesis / premise, and the remaining clause is
called the conclusion/consequence
We assume that the hypothesis is true in order to verify the validity of the
conclusion
The conclusion is the outcome of the hypothesis.

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


Sufficient condition
Generally, the hypothesis is a sufficient condition for the conclusion.
For the proposition p→q, p is the sufficient condition for q.
For example: If it rains, I will stay home.
While I may stay home for any reason, if it rains, you know that you will find me
home.
In other words, knowing that it is raining is sufficient to know that I am home.

“Raining is sufficient for me staying home.”

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


Necessary Condition
You will pass only if you study.

WHEN IS THIS SENTENCE TRUE?

The sentence is true if you study, and you pass

What if you don’t study?

Fail

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


Necessary Condition
You will pass only if you study.
What if you don’t pass?

You may not pass even if you have studied


(probably because you became sick)

• Even though you have studied, you may not pass for a variety of reasons
• So if you do not pass, that does not violate any condition
• So if you do not pass, the sentence is true whether you have studied or
not

Note that while you may fail for any possible reason, you must study in order to
pass
In another word, in order to pass, it is necessary that you study

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


Necessary condition and
sufficient condition
if p then q

sufficient Necessary

p only if q

sufficient Necessary

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


Necessary condition and
sufficient condition
Generally, the conclusion is a necessary condition for the hypothesis, and the
hypothesis is a sufficient condition for the conclusion
• For 𝑝 → 𝑞, 𝑞 is a necessary condition for 𝑝, and 𝑝 is a sufficient condition for
𝑞
In our first example (If it rains, I will stay home), staying home is necessary for you
if it rains
• It is raining only if I stay home
In our second example (You will pass only if you study), passing is sufficient to
realize that you have studied
• If you have passed, you have studied

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


DIFFERENT WAYS OF EXPRESSING
CONDITIONAL STATEMENT
1. if p, then q 8. q provided that p
2. if p, q 9. q unless ¬p
3. p implies q 10. p only if q
4. q if p 11. p is sufficient for q
5. q when p 12. a sufficient condition for q is p
6. q whenever p 13. q is necessary for p
7. q follows from p 14. a necessary condition for p is q

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


BICONDITIONAL
You can take the train if and only if you buy ticket.
WHEN IS THIS SENTENCE TRUE?

If you have a ticket, and you board the train


OR
If you don’t have a ticket, and the ticket checker does not let you board

When is this sentence false?

If you have a ticket, and the ticket checker still refused to take you
OR
If you don’t have a ticket, and you board the train anyway

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


BICONDITIONAL
You can take the train if and only if you buy ticket.
𝑝 𝑞
: equivalent
𝑝 and 𝑞 are necessary and sufficient conditions for each other

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

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


BICONDITIONAL
Different ways to express p ⇔q :
• p if and only if q
• p iff q
• p is necessary and sufficient for q
• if p then q, and if q, then p

Example:
p: "The number is divisible by 2"
q: "The number is even"
Statement: “The number being divisible by 2 is necessary and sufficient for
the number to be even.”

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


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

You might also like