Professional Documents
Culture Documents
11/10/22
Course goals
• Mathematical reasoning
– Logic, Inference, proof
• Combinatorial analysis
– Count, Probability
• Discrete structures
– Sets, Functions, Relations, Graphs
Logic
Sets, Functions and Matrices
Number Theory and Cryptography
Counting
Discrete Probability
Relations
Graphs
11/10/22
Logic
• Mathematical Logic is a tool for working with
compound statements
• Logic is the study of correct reasoning
• Use of logic
– In mathematics:
to prove theorems
– In computer science:
to prove that programs do what they are
supposed to do
p q q p q p q (p q) (p q)
F F T T F F
F T F F F T
T F T T F F
T T F T T T
F F F T F T
F F T F F T
F T F T T T
F T T F T F
T F F T T T
T F T F T F
T T F T T T
T T T F T F
Arab Open University – Faculty of Computer Studies MT131 - Discrete Mathematics
Understanding Implication
• In p q there does not need to be any connection
between the antecedent or the consequent. The
“meaning” of p q depends only on the truth values
of p and q.
• These implications are perfectly fine, but would not be
used in ordinary English.
– “If the moon is made of green cheese, then I have more
money than Bill Gates.”
– “If the moon is made of green cheese then I’m on
welfare.”
– “If 1 + 1 = 3, then your grandma wears combat boots.”
Arab Open University – Faculty of Computer Studies MT131 - Discrete Mathematics
Examples of Implications
• “If this lecture ever 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 Trump is the president of
USA.” True or False?
p q is logically equivalent to p q
p q p q pq
F F T T
F T T T
T F F F
T T T T
p (q r)
¬p ¬q
(p q) (¬r s)
Operator Precedence
() 1
2
, , 3
, 4
Left to Right 5
p q pq ppq
F F F T
F T T T
T F T T
T T T T
• Distributive: p (q r) (p q) (p r)
p (q r) (p q) (p r)
• De Morgan’s:
(p q) p q
(p q) p q
• Trivial tautology/contradiction:
Augustus
p p T , p p F De Morgan
(1806-1871)
• p q p q
(p q) (p q) p q
• p q q p (contrapositive)
• p q (p q) (q p)
(p q) p q
( (p q) q)
( (p q) q) Equivalence
( (p q) q) De Morgan
( (p q) q) Equivalence
(p q q) De Morgan
(p T) Trivial Tautology
(T) Domination
F Contradiction
Arab Open University – Faculty of Computer Studies MT131 - Discrete Mathematics
Predicates and Quantifiers
Predicates: “x is greater than 3” has two parts
First part: x , is a variable.
Second part: “is greater than 3”, is a predicate.
“x is greater than 3” can be denoted by the
propositional function P(x).
P(x): x > 3, let x = 4, then P(4) is true,
let x = 1, then P(1) is false.
Example: If R(x, y, z) : x + y = z then
R(1, 2, 3), 1 + 2 = 3, is true.
• x P(x, 2):
P(1, 2) P(2, 2) P(3, 2)
• y P(3, y):
P(3, 1) P(3, 2) P(3, 3)
Examples:
- P(x, y), x and y are free variables.
- x P(x, y), x is bound and y is free.
- “P(x), where x = 3” is another way to bind x.
- x (x + y = 1), x is bound and y is free.