Unit 1 Part 2
Unit 1 Part 2
UNIT-1-B
Sets and
Propositions
Mathematical Logic
The development of formal logic and its implementation is
essential in computer science.
It is true that ……
Or
It is false that ……
(p ↔ q)
p q pq pq p→q
(q ↔ p)
F F F F T T
F T F T T F
T F F T F F
T T T T T T
Converse and Contrapositive
For a proposition p → q, the proposition q → p is called its
converse and the proposition q → p is called contrapositive.
Propositional Logic
Truth table for converse and contrapositive
p→q q→p q → p
p q
F F T T T
F T T F T
T F F T F
T T T T T
Propositional Logic
Some of the logically equivalent propositions are listed below.
They are also called identities. The symbol shows the logical
equivalence.
1. p (p p) ( idempotence of )
2. p (p p) ( idempotence of )
3. (p q) (q p) ( commutativity of )
4. (p q) (q p) ( commutativity of )
5. (p q) r p (q r) (associativity of )
6. (p q) r p (q r) (associativity of )
18. (p → q) (p q)
19. (p ↔ q) [(p → q) (q → p)]
20. (p → q) (q → p)
Propositional Logic
Q1)Using the following statements
p:Raju is tall.
q:Raju is strong.
What is the symbolic form of the following statement?
“Raju is tall but week.”
Answer: (p p) (p → (q q)) p (p → q)
p (¬p q)
(p ¬p) ( p q)
F ( p q)
(p q)
Q4) p → (q → r) (p q) → r
Propositional Logic
Answer: Let us explore the L.H.S first
p → (q → r) p (q r)
(p q) r
(p q) r
(p q) → r
Answer: There are two ways to solve the problem. The first
method is by drawing the Truth-table for each option given and
thereby finding the tautology. This approach sometimes
becomes a time and space consuming approach.
Answer: We need to draw truth tables for all the options given.
p q r pq p→r q→r X Y ¬Y X → Y Y → X ¬Y → X
F F F F T T T T F T T T
F F T F T T T T F T T T
F T T T T T T T F T T T
T T T T T T T T F T T T
T F F T F F F T F T F T
T T F T F F F F T T T F
F T F T T T F T F T F T
T F T T T T T T F T T T
Propositional Logic
3) Let a, b, c and d be propositions. Assume that equivalences
a (b ¬b) and b c hold. What is the truth value of the
formula (a b) → ((a c) d) ?
Answer: The first equivalence a (b ¬b) shows that a is a
tautology as (b ¬b)is a tautology.
b c shows that b is false when c is false and b is true when c
is true.
(a b) → ((a c) d) (T b) → ((T c) d)
b → (c d)
¬b (c d)
(¬b c) d
Td
Answer: (p p) (p q)
End of proof.
Mathematical Induction
Q1) Using mathematical induction, prove that
1 + 2 + … + n = n (n + 1)/2