0% found this document useful (0 votes)
7 views13 pages

Propositions

Uploaded by

Saransh Kapoor
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)
7 views13 pages

Propositions

Uploaded by

Saransh Kapoor
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/ 13

2/17/2023

Logic

Prepared by: Dr. Adeel Hashmi, MSIT


Discrete Mathematics

1.1. Proposition
• Any statement which can be said to be either True or False is a proposition.

• Examples of propositions: “Today is Sunday”, “Mumbai is capital of India”.

• Examples of not propositions: “What time is it?”, “Read this carefully”.


Prepared by: Dr. Adeel Hashmi, MSIT

• A proposition can be represented by a propositional variable. We use small case


letters to denote propositional variables. For example, “p: John is intelligent” i.e. p
represents the proposition “John is intelligent”.

1
2/17/2023

1.2. Logical Operators


• Negation: equivalent to NOT, represented by ~ or ¬

• Conjunction: equivalent to AND, represented by ∧

• Disjunction: equivalent to OR, represented by ∨

Prepared by: Dr. Adeel Hashmi, MSIT


• Implication: equivalent to IF-THEN, represented by →

• Bi-implication: : equivalent to bi-directional IF-THEN, represented by ↔

1.3. Compound Propositions


• Compound propositions are formed by combining existing propositions by logical
operators.

• For example, “Today is Monday and today is not a holiday”. This compound
proposition can be represented as “p ∧ ¬q” where p: Today is Sunday, q: Today is a
Prepared by: Dr. Adeel Hashmi, MSIT

holiday.

2
2/17/2023

1.4. Implication/Bi-implication
• p→q denotes if p is true then q is true (but if q is true p may or may not be true).

• For example, “If today is Sunday then today is a holiday”. (If today is a holiday then it
may or may not be Sunday as it can be a Saturday or a gazette holiday, etc).

• The proposition on the left is called “hypothesis” and the proposition on the right is
called as “conclusion”.

Prepared by: Dr. Adeel Hashmi, MSIT


• p↔q denotes if p is true then q is true and if q is true then p is true.

• For example, “If today is Saturday then tomorrow is Sunday”. (If we know tomorrow
is Sunday then we can also conclude today is Saturday).

1.5. Truth Tables


p q ¬q p∧q p∨q p→q p↔q
T T F T T T T
T F T F T F F
F T F T T F
F F F F T T
Prepared by: Dr. Adeel Hashmi, MSIT

Explanation of truth values of p→q:


If p is T then q is T, so p→q is T. If p is T then q can’t be F, so p→q is F.
If p is F then q can be either T or F, so p→q is T for both cases.

Explanation of truth values of p↔q:


If today is Saturday then tomorrow is Sunday, is a correct statement.
If today is not Saturday then tomorrow is not Sunday, is a correct statement.
The other two combinations are false.

3
2/17/2023

1.6. Terminologies for p→q


• p implies q
• if p then q
• if p, q
• p is sufficient for q

Prepared by: Dr. Adeel Hashmi, MSIT


• p only if q (p can be T only when q is T, when q is F then p is F)
• q if p
• q when p
• q whenever p
• q follows from p
• q is necessary for p (if q is F then p is F but if q is true then p may be T or F)

1.7. Terminologies for p↔q


• If p then q, and conversely

• p if and only if q

• p iff q

• p is necessary and sufficient for q


Prepared by: Dr. Adeel Hashmi, MSIT

4
2/17/2023

Conversion to logical expression


Q1. Convert the statement “You can access the internet from campus only if you are a
computer science major or you are not a freshman” into logical expression.

Answer

• I: You can access the internet from campus

C: you are a computer science major

Prepared by: Dr. Adeel Hashmi, MSIT


• F: You are a freshman

• I → (C ∨ ¬F)

Conversion from logical expression


Q2. Let, P: It is snowing, Q: I will go to town, R: I have time

Convert following logical expressions into English statements.

i. Q ↔ (R ∧ ¬P)

ii. ¬(R ∨ Q)
Prepared by: Dr. Adeel Hashmi, MSIT

Answer

i. I will go to town if and only if I have time and it is not snowing.

ii. It is not true that I have time or it is snowing.

5
2/17/2023

1.8. Converse, Inverse, Contrapositive


• Converse of p→q: q→p

• Inverse of p→q : ¬p → ¬q

• Contrapositive of p→q : ¬q → ¬p

Prepared by: Dr. Adeel Hashmi, MSIT


Q3. Write converse, inverse, contrapositive of “If John is a poet then he is poor”.

Answer

• Converse: If John is poor then he is a poet.

• Inverse: If John is not a poet then he is not poor.

• Contrapositive: If John is not poor then he is not a poet.

2.1. Logical Equivalence


• Two compound propositions are called logically equivalent if they have
identical truth tables.

• p→q ≡ ¬p∨q ≡ ¬q → ¬p (important)

p q ¬q ¬p p→q ¬p∨q ¬q→¬p


Prepared by: Dr. Adeel Hashmi, MSIT

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

6
2/17/2023

2.2. Laws based on Logical Equivalences


Name Representation
De Morgan’s Law ¬(p ∨ ¬q ∧ r) ≡ ¬p ∧ q ∨ ¬r
Commutative Law p∨q ≡ q∨p, p∧q ≡ q∧p
Associative Law (p∧q)∧r ≡ p∧(q∧r), (p∨q)∨r ≡ p∨(q∨r)

Prepared by: Dr. Adeel Hashmi, MSIT


Distributive Law p∧(q∨r) ≡ (p∧q)∨(p∧r), p∨(q∧r) ≡ (p∨q)∧(p∨r)
Idempotent Law p∧p≡p, p∨p≡p
Identity Law p∧T≡p, p∨F≡p
Domination Law p∧F≡F, p∨T≡T
Negation Law p∧¬p≡F, p∨¬p≡T
Absorption Law p∧(p∨q) ≡ p, p∨(p∧q) ≡ p

2.3. Tautologies
• A logical expression is said to be a tautology if it is always true.
• A logical expression is said to be a contradiction if it is always false.
• A logical expression is said to be a contingency if it can be either T or F.
Prepared by: Dr. Adeel Hashmi, MSIT

• A compound proposition is valid/verifiable if it is a tautology.


• A compound proposition is satisfiable if there is an assignment of truth
values to the variables in the compound proposition that makes the
compound proposition true.

• The dual of a compound proposition that contains only the logical operators
¬, ∨, and ∧ is the compound proposition obtained by replacing each ∨ by ∧,
each ∧ by ∨, each T by F, and each F by T.

7
2/17/2023

Example
• Show that [(p→q)∧(q→r)]→(p→r) is a tautology by rules of propositions.

Answer

• [(p→q)∧(q→r)]→(p→r)

• [(¬p∨q)∧(¬q∨r)]→(¬p∨r)

• ¬[(¬p∨q)∧(¬q∨r)]∨(¬p∨r)

Prepared by: Dr. Adeel Hashmi, MSIT


• [(p∧¬q)∨(q∧¬r)]∨(¬p∨r)

• [(p∧¬q)∨q]∧[(p∧¬q)∨¬r]∨(¬p∨r)

• [(p∨q)∧(¬q∨q)]∧ [(p∨¬r)∧(¬q∨¬r)]∨(¬p∨r)

• [(p∨q)∧T]∧ [(p∨¬r)∧(¬q∨¬r)]∨(¬p∨r)

• [(p∨q)∧(p∨¬r)∧(¬q∨¬r)]∨(¬p∨r)

• [(p∨q)∨(¬p∨r)]∧[(p∨¬r)∨(¬p∨r)]∧[(¬q∨¬r)∨(¬p∨r)]

• [T∨q∨r]∧[T∨T]∧[¬p∨¬q∨T] ≡ T ∧ T ∧ T ≡ T

3.1. Rules of Inference


Name Representation Example
Modus Ponens [(p→q) ∧ p] → q If today is Sunday then today is a holiday.
Today is Sunday.
So, today is a holiday.

Modus Tollens [(p→q) ∧ ¬q] → ¬p If today is Sunday then today is a holiday.


Today is not a holiday.
So, today is not Sunday.
Prepared by: Dr. Adeel Hashmi, MSIT

Hypothetical Syllogism [(p→q) ∧ (q→r)] → (p→r) If today is Sunday then today is holiday.
If today is holiday then I will watch a movie.
So, if today is Sunday then I will watch a movie.

Disjunctive Syllogism [(p∨q) ∧ ¬p] → q Today is either Monday or Tuesday.


Today is not Monday.
So, today is Tuesday.

Resolution [(p∨q) ∧ (¬q∨r)] → (p∨r) Today is either Saturday or Sunday.


Today is not Sunday or I am staying at home.
Today is either Saturday or I am staying at home.

Imp: All rules of inference are tautologies.

8
2/17/2023

3.2. Fallacies
Name Representation Example Why
incorrect?
Denying the [(p→q) ∧ ¬p] → ¬q If today is Sunday then today is a holiday. It can be a Saturday
Today is not Sunday. holiday or a gazetted
hypothesis So, today is not a holiday. holiday.

Affirming the [(p→q) ∧ q] → p If today is Sunday then today is a holiday. It can be a Saturday
Today is a holiday. holiday or a gazetted
conclusion

Prepared by: Dr. Adeel Hashmi, MSIT


So, today is Sunday. holiday.

Example-1
• Test the validity of the following argument.

• If two sides of a triangle are equal then the opposite angles are equal.

• The opposite angles are not equal.

• Therefore, two sides of a triangle are not equal.


Prepared by: Dr. Adeel Hashmi, MSIT

Answer

• Let p: two sides of a triangle are equal, q: the opposite angles are equal.

• The given conclusion is of the form [(p→q)⋀¬q]→¬p i.e. modus tollens.

• Hence, the given conclusion is correct according to law of modus tollens.

9
2/17/2023

Example-2
Determine whether the following arguments are valid or invalid.

• If I read the newspaper in the kitchen, my glasses would be on the kitchen table.

• I did not read the newspaper in the kitchen.

• Conclusion: My glasses are not on the kitchen table.

Prepared by: Dr. Adeel Hashmi, MSIT


• Answer.

• Let, p: I read the newspaper in the kitchen, q: my glasses would be on the kitchen table.

• The given conclusion is of the form [(p→q)⋀¬p]→¬q.

• This is the fallacy of denying the hypothesis. Hence, the given conclusion is incorrect.

Example-3
Q4. Given that T→(M∨E), S →¬E, T∧S prove M.
Answer
T∧S can be simplified as T, S. So, we get the following facts:
i. T→(M∨E) ii. S →¬E iii. T iv. S
Applying modus ponens on T→(M∨E) and T, we get
Prepared by: Dr. Adeel Hashmi, MSIT

v. M∨E
Applying modus ponens on S →¬E and S, we get
vi. ¬E
Applying disjunctive syllogism on M∨E and ¬E, we get
vii. M

10
2/17/2023

Example-4
Q5. Show that the hypothesis “It is not sunny this afternoon and it is colder than
yesterday”, “We will go swimming only if it is sunny”, “If we do not go swimming then we
will take a canoe trip”, and “If we take a canoe trip then we will be home by sunset” lead to
the conclusion “We will be home be sunset”.
Answer
p: It is sunny this afternoon, q: It is colder than yesterday

Prepared by: Dr. Adeel Hashmi, MSIT


r: We will go swimming, s: we will take a canoe trip, t: we will be home by sunset
Propositional forms of given statements are ¬p∧q, r→p, ¬r→s, s→t.
We can simplify ¬p∧q to get ¬p, q.
Applying modus tollens on r→p and ¬p, we get ¬r.
Applying modus ponens on ¬r→s and ¬r, we get s.
Applying modus ponens on s→t and s, we get t i.e. “We will be home by sunset”.

4.1. Normal Forms


• Conjunctive Normal Form (CNF): conjunctions of disjunctions e.g.

(p∨q∨r) ∧ (a∨b∨c) ∧ (x∨y∨z)

• Disjunctive Normal Form (DNF): disjunctions of conjunctions e.g.

(p∧q∧r) ∨ (a∧b∧c) ∨ (x∧y∧z)


Prepared by: Dr. Adeel Hashmi, MSIT

• Conversion to Normal Form


 Remove implication/bi-implication: replace p→q by ¬p∨q
 Apply De Morgan’s Law
 Apply distributive law

11
2/17/2023

Example
• Find CNF and then DNF of [p ∧ (¬q ∧ r)] ∨ ¬r.

• Answer

• (p ∧ ¬q ∧ r) ∨ ¬r

• (p ∨ ¬r) ∧ (¬q ∨ ¬r) ∧ (r ∨ ¬r) CNF

Prepared by: Dr. Adeel Hashmi, MSIT


• (p ∨ ¬r) ∧ (¬q ∨ ¬r) ∧ T

• (p ∨ ¬r) ∧ (¬q ∨ ¬r)

• [ p ∧ (¬q ∨ ¬r) ] ∨ [¬r ∧ (¬q ∨ ¬r)]

• (p ∧ ¬q) ∨ (p ∧ ¬r) ∨ (¬r ∧ ¬q) ∨ (¬r ∧ ¬r) DNF

4.2. Principal Normal Forms


• Literal: a variable or negation of a variable is called a literal.

• Maxterm: a disjunctive term containing all literals.

• Minterm: a conjunctive term containing all literals.


Prepared by: Dr. Adeel Hashmi, MSIT

• Principal CNF: conjunctions of maxterms.

• Principal DNF: disjunctions of minterms.

12
2/17/2023

Example
• Obtain PCNF and PDNF for p→(q∧r).

• Answer.

• p→(q∧r) ≡ ¬p∨(q∧r)

• PCNF: (¬p∨q)∧(¬p∨r) ≡ [(¬p∨q)∨(r∧¬r)] ∧ [(¬p∨r)∨(q∧¬q)]

Prepared by: Dr. Adeel Hashmi, MSIT


≡ (¬p∨q∨r)∧(¬p∨q∨¬r)∧(¬p∨r∨q)∧(¬p∨r∨¬q)

• PDNF: ¬p∨(q∧r) ≡ [¬p∧(q∨¬q)] ∨ [(q∧r)∧(p∨¬p)]

≡ [(¬p∧q)∨(¬p∧¬q)] ∨ [(q∧r∧p)∨(q∧r∧¬p)]

≡ [[(¬p∧q)∨(¬p∧¬q)]∧(r∨¬r)] ∨ [(q∧r∧p)∨(q∧r∧¬p)]

≡ (¬p∧q∧r)∨(¬p∧q∧¬r)∨(¬p∧¬q∧r)∨(¬p∧¬q∧¬r) ∨ [(q∧r∧p)∨(q∧r∧¬p)]

Prepared by: Dr. Adeel Hashmi, MSIT

13

You might also like