Beruflich Dokumente
Kultur Dokumente
Srikrishnan Divakaran
School of Engineering and Applied Sciences
Ahmedabad University
Content
1. Propositional Logic
1. Propositional Equivalences
1. Nested Quantifiers
1. Rules of Inference
1. Introduction to Proofs
What is a Proposition?
Non-examples: x+1 = 2
P ⌐P
T F
F T
Logic Operator (AND)
P Q p^q
T T T
T F F
F T F
F F F
Logic Operator (OR)
P Q
T T T
T F T
F T T
F F F
Logic Operator (Exclusive OR)
P Q
T T F
T F T
F T T
F F F
Conditional Statement (Implication)
Example: Let p: “Maria learns Discrete Mathematics” and q: “Maria will find a
good job”. Then is the proposition “If Maria learns discrete
mathematics then she will find a good job”.
P Q
T T T
T F F
F T T
F F T
Different ways of expressing Implication
“p implies q”, “if p then q”, “p is sufficient for q”, “q is necessary for p”, “q
follows from p”, “q unless ~p”,
“p only if q” = p cannot be true when q is not true.
Converse, Contra-positive and Inverse
Definition: When two compound propositions have the same truth value we
call them equivalent.
Example:
Bi-conditional Statement
Example: Let p: “You can take the flight” and q: “You buy a ticket”. Then
is the proposition “You can take the flight if and only if you buy a
ticket”.
P Q
T T T
T F F
F T F
F F T
Different ways of expressing Double Implication
“p necessary and sufficient for q”, “if p then q and conversely”, “p iff q”.
Equivalent Expression for Exclusive-Or
T T F F F F
T F T T F T
F T T F T T
F F F F F F
Logical equivalence: Two boxed logical expressions have the same truth table.
There are many different ways of writing the same logical expression.
Logical Expression Corresponding to a bit adder
Digital logic:
Given a digital circuit, we can easily construct the truth table. However, if we
Know the truth table, can we construct the logical expression corresponding to
That truth table.
Logical Expression Corresponding to a bit adder
P Q Sum carry
1 1 0 1
1 0 1 0
0 1 1 0
0 0 0 0
Given a digital circuit, we can easily construct the truth table. However, if we
Know the truth table, can we construct the logical expression corresponding to
That truth table.
Writing Logical Expression for a Truth Table
p q r output
T T T F
T T F T
T F T T
T F F F
F T T T
F T F T
F F T T
F F F F
The formula is true exactly when the input is one of the true rows.
Writing Logical Expression for a Truth Table
Idea 1: Look at the false rows negate and take the “and”.
p q r output
T T T F
T T F T
T F T T
T F F F
F T T T
F T F T
F F T T
F F F F
The formula is true exactly when the input is not one of the false row.
Logic Puzzles
Puzzle 1: In an island there are two kinds of inhabitants, knights, who
always tell the truth and knaves, who always lie. You encounter two people
A and B. what are A and B if A says “B is a knight” and B says “the two of us
are opposite types”?
A B Statement 1 Statement 2
Knight Knight T F
Knight Knave F T
Knave Knight F T
Knave Knave F T
Tautology, Contradiction and Contingency
Examples: p p Tautology
p p Contradiction
Logical Equivalences
x y P(x,y) y x P(x,y)
x y P(x,y) y x P(x,y)
Example: Express the statements “Some student in this class has visited
Mexico” and “Every student in this class has visited either Canada or
Mexico” using predicates and quantifiers.
Example: Let F(a,b): “a and b are friends”. Let x, y and z are variables
whose domain consists of all students at DAIICT. Translate the statement
Translating English sentences into Logical Expressions
Example: Express the statement “If a person is female and is a parent,
then this person is someone’s mother”.
Example: Express the statement “Everyone has exactly one best friend”.
Let B(x,y): y is the best friend of x. Then the above statement can be
logically expressed as follows:
Acknowledgements
1. Introduction to Discrete Mathematics, Lectures of Prof. Lap Chi Lau,
Chinese University of Honk Kong.
2. Mathematics for Computer Science, Lectures of Prof. Tom Leighton,
MIT open courseware.
3. Discrete Mathematics and its Applications, Kenneth Rosen, 6 th
edition, McGraw Hill Publishing.