You are on page 1of 36

Discrete Mathematics

Prepared by
Mrs.S.Alagusala,
Sr.Asst Prof,
Department of Matheatics.
Topics
• Logic
• Proposition
• Logical operators and truth table
• Well Formed Formula
• Tautology
• Contradiction
Discrete Mathematics
It considers objects that vary in a discrete way.
Example: digital wristwatch.
On a digital watch, there are only finitely
many possible different times between 1 :25 P.M.
and 1:27 P.M. A digital watch does not show split
seconds: - no time between 1 :25:03 and 1 :25:04.
The watch moves from one time to the next.
computer science – computers are digital!
(numbers as finite bit strings; data
structures, all discrete! Historical aside:
earliest computers were analogue.)
Answer the following questions orally.

1.Divide 30 by half and add 10. What do you get?


2.Imagine you are in a sinking rowboat surrounded
by sharks. How would you survive?
3.Eskimos are very good hunters, but they never
hunt penguins. Why not?
4.There was an airplane crash. Every single person
died, but two people survived. How is this possible?
5.If John’s son is my son’s father, what am I to John?
What is Logic?
The branch of philosophy concerned with
analysing the patterns of reasoning by which a
conclusion is drawn from a set of premises,
without reference to meaning or context
Foundations of Logic
Mathematical Logic is a tool for working
with complicated compound statements. It
includes:
• A language for expressing them.
• A concise notation for writing them.
• A methodology for objectively reasoning
about their truth or falsity.
• It is the foundation for expressing formal
proofs in all branches of mathematics.
Mathematical Logic
A set of precise rules that governs the operations of
computers (and our mind).

Propositional Calculus Predicate Calculus


A proposition is a A predicate is a sentence that
sentence that is either contains variables, and when
true or false but not the variables are substituted by
both.(In particular, it numbers or actual objects, it
cannot be a question.) becomes a proposition.
Examples: Examples:
•2+2=5 •x>4
• sin(π/6) = 0.5 • a2 + b2 = c2
Propositional Calculus Predicate Calculus
A proposition cannot Predicate calculus on the
have free variables. other hand is analogous to
Propositional calculus Algebra, which is more
is analogous to complex than arithmetic but
Arithmetic where we it requires the knowledge of
do not deal with arithmetic.
variables

Note: a proposition is also called a statement.


Propositional Logic
Propositional Logic is the logic of compound
statements built from simpler statements using
so-called Boolean connectives.

Some applications in computer science:


• Design of digital electronic circuits.
• Expressing conditions in programs.
• Queries to databases & search engines.
Definition of a Proposition
A proposition is simply a statement (i.e., a
declarative sentence) with a definite meaning,
having a truth value that’s either true (T) or false
(F) (never both, neither, or somewhere in
between).
•A proposition (statement) may be denoted by a
variable like P, Q, R,…, called a proposition
(statement) variable.
Examples of a Proposition
1. Manila is the capital city of the Philippines.
2. A is a consonant.
3. Virgil wrote Iliad and Odyssey.
4. Sun rises in east.
5. 6 + 9 = 15
6. 𝜋 is an irrational number.
7. Pneumonoultramicroscopicsilicovolcanoconiosis
is the longest word in a major dictionary.
Proposition or Not?
1.Clean the room.
2.Scientifically, eggplant is not a vegetable.
3.Can’t leopard remove its own spots?
4.What a magnificent building!
5.Litotes is an exaggerated statement.
6. The Passion of the Christ directed by Mel Gibson.
7.x=3
8.x +y >4
9.Verb is a word that denotes an action.
10.This statement is false.
Operators / Connectives
•An operator or connective combines one or
more operand expressions into a larger
expression. (E.g., “+” in numeric expressions)
•Unary operators take 1 operand (e.g., −3)
•Binary operators take 2 operands (e.g., 3 × 4).
•Propositional or Boolean operators operate on
propositions or truth values instead of on
numbers.
Some Popular Boolean Operators
Formal Name Nickname Arity Symbol
•Negation operator NEGATION/ NOT Unary (¬)
•Conjunction operator AND Binary (∧)
•Disjunction operator OR Binary (∨)
•Implication operator IMPLIES Binary (→)
•Biconditional operator IFF/ IF AND ONLY IF
Binary (⇔).
The Negation Operator
The unary negation operator “¬” (NOT)
transforms a property into its logical negation.
E.g. If p = “I have brown hair.”
then ¬p = “I do not have brown hair.”
Truth table for NOT:
P P
true (T) false (F)
false (F) true (T)
The Conjunction Operator
The binary conjunction operator “∧” (AND)
combines two propositions to form their logical
conjunction.
E.g.
If p=“I will have salad for lunch.” and q=“I will
have steak for dinner.”, then p ∧ q=“I will have
salad for lunch and I will have steak for dinner.”
Conjunction Truth Table.
P Q PQ
Example:
T T T • Either the train is late
T F F or my watch is fast.
• You can find me in the
F T F office or the library
F F F

Note that a conjunction p1 ∧ p2 ∧ … ∧ pn of n propositions will


have 2𝑛 rows in its truth table.
The Disjunction Operator
The binary disjunction operator “∨” (OR)
combines two propositions to form their logical
disjunction.
p = “My car has a bad engine.”
q = “My car has a bad carburetor.”
p ∨ q = “Either my car has a bad engine, or my
car has a bad carburetor.”
Disjunction Truth Table
P Q PQ • Example:
• Either the train is late
T T T or my watch is fast.
T F T • You can find me in the
office or the library.
F T T
F F F
Note that p ∨ q means that p is true, or q is true, or both
are true! So, this operation is also called inclusive or,
because it includes the possibility that both p and q are
true.
The Implication Operator
antecedent consequence

The implication p → q states that p implies q.


i.e., If p is true, then q is true; but if p is not true,
then q could be either true or false.
E.g., let p = “You study hard.”
q = “You will get a good grade.”
p→ q = “If you study hard, then you will get a
good grade.” (else, it could go either way)
Implication Truth Table
Examples:
P Q PQ • If I win the super lotto, I
T T T will quit my job.
• If the waves are good,
T F F we go surfing
F T T
F F T
Examples of Implications
•“If this lecture ends, then the sun will rise
tomorrow.” True or False?
• “If Tuesday is a day of the week, then I am a
penguin.” True or False?
• “If 1+1=6, then Obama is president.” True or
False?
• “If the moon is made of green cheese, then I am
richer than Bill Gates.” True or False?
Converse, Inverse, Contrapositive
Some terminology, for an implication p → q:
• Its converse is: q →p.
• Its inverse is: ¬p → ¬q.
• Its contrapositive: ¬q → ¬ p.
• One of these three has the same meaning
(same truth table) as p → q. Can you figure out
which?
How do we know for sure?
• Proving the equivalence of p →q and its
contrapositive using truth tables:
The biconditional operator
The biconditional p⇔q states that p is true if
and only if (IFF) q is true.
p = “You can take the flight.”
q = “You buy a ticket”
p ⇔ q = “You can take the flight if and only if
you buy a ticket.”
Biconditional Truth Table
p ⇔ q means that p and q have the same truth
value.
• Note this truth table is the exact opposite of
→’s!
− p ⇔ q means ¬(p ⇔ q)
• p ⇔ q does not imply p and q are true, or
cause each other.
Biconditional Truth Table
Examples:
• A differentiable
P Q PQ
function is non-
T T T decreasing if and
T F F only if its derivative
is always non-
F T F
negative
F F T
Well-formed Formula (WFF)
A well-formed formula (Syntax of compound
proposition)
1. Any statement variable is a WFF.
2. For any WFF α, ¬α is a WFF.
3. If α and β are WFFs, then (α ⋀β), (α ∨β), (α
→β) and (α ⇔β) are WFFs.
4. A finite string of symbols is a WFF only when
it is constructed by steps 1, 2, and 3.
Order of operations
In the absence of parenthesis,
the decreasing order of priority is Precedence of
• negation  logical operators
• conjunction 
• disjunction 
¬ 1
• implication (conditional) → ⋀ 2
• biconditional 
∨ 3
→ 4
↔ 5
Tautology
Definition:
A tautology is a statement that is always
true.

Ex.
• R(R)
• (PQ)(P)(Q)
If ST is a tautology, we write ST.
If ST is a tautology, we write ST.
Contradiction
Definition:
A contradiction is a statement that is always
false.
Ex.
• R(R)
• ((PQ)(P)(Q))
The negation of any tautology is a contra-
diction, and the negation of any contradiction is
a tautology.
Logical Equivalence
Theorem:
If a formula A is equivalent to a formula B
then A↔B
Proving Equivalence via Truth Tables
• Ex. Prove that p∨q ↔ ¬(¬p ∧¬q).
Logical Equivalences
• Identity Laws: p  T  p and p  F  p.

• Domination Laws: p  T  T and p  F  F.

• Idempotent Laws: p  p  p and p  p  p.

• Double Negation Law: ( p)  p.

• Commutative Laws:

(p  q)  (q  p) and (p  q)  (q  p).

• Associative Laws:

(p  q)  r  p  (q  r) and (p  q)  r  p  (q r).
• Distributive Laws:
p  (q  r)  (p  q)  (p  r) and
p  (q  r)  (p  q)  (p  r).
• DeMorgan’s Laws:
(p  q)  ( p   q) and
(p  q)  ( p   q).
• Absorption Laws:
p  (p  q)  p and p  (p  q)  p.
• Negation Laws: p   p  T and p   p  F.
• Implication conversion law: 𝑝 → 𝑞 ⇔ ¬𝑝 ∨ 𝑞
• Contra positive: 𝑝 → 𝑞 ⇔ ¬𝑞 → ¬𝑝
• 𝑝→𝑞 ∧ 𝑝→𝑟 ⟺𝑝→ 𝑞∧𝑟

• 𝑝→𝑟 ∧ 𝑞 →𝑟 ⟺ 𝑝∨𝑞 →𝑟

• 𝑝→𝑞 ∨ 𝑝→𝑟 ⟺𝑝→ 𝑞∨𝑟

• 𝑝→𝑟 ∨ 𝑞 →𝑟 ⟺ 𝑝∧𝑞 →𝑟

• (𝑝 ⟷ 𝑞) ⇔ (𝑝 → 𝑞) ∧ (𝑞 → 𝑝)

• (𝑝 ⟷ 𝑞) ⇔ ¬𝑝 → ¬𝑞

• 𝑝 ⟷ 𝑞 ⇔ 𝑝 ∧ 𝑞 ∨ ¬𝑝 ∧ ¬𝑞

• ¬ 𝑝 ⟷ 𝑞 ⇔ 𝑝 ↔ ¬𝑞

You might also like