Professional Documents
Culture Documents
Faculty of Engineering
Department of Computer Engineering
Fall 2011
ECOM 2311: Discrete Mathematics
Eng. Ahmed Abumarasa
Discrete Mathematics
Sec 1.1-1.6
The Foundations: Logic and Proof, Sets, and Functions
Chapter 1:
1.1: Logic
Propositions must have clearly defined truth values (True or False), so a proposition must
be a declarative sentence with no free variables.
Not: the negative of the propositions.
Exclusive OR:
Conditional Statements: p q
o CONVERSE: q p
o CONTRAPOSITIVE: ꜚq ꜚp
o INVERSE: ꜚp ꜚq
Biconditional:
(p ↔ q)p if and only if q.
consistent System:
System is consistent if all its propositions are true.
a b c d e f g
Not p pᶺ (not p) p q not p not q p q qᶺ (not p) q p
A
p not p output
T F F
F T F
C
E
a) A
p q R pvq (p v q) v r p q R qvr p v (q v r)
T T T T T T T T T T
T T F T T T T F T T
T F T T T T F T T T
T F F T T T F F F T
F T T T T F T T T T
F T F T T F T F T T
F F T F T F F T T T
F F F F F F F F F F
.False يمكنا محاولة إثبات العكس أي يعني بحالة وجود إحتمال للمتغيرات تجعل ال الجملة, أم الtautology لمعرفة هل هو
.T و األيسرF في هذه الحالة يجب جعل الطرف األيمن
.T يجب ان تكونq يعني
.P = f يجب انا يكونT و لجعل الطرف األيسر
. , q =t P = f و هذا يتوفر بحالة كانت, T يجب ان تكونp q باإلضافة ل
.tautology لذا الجملة ليستfalse إذا وجدنا حالة يكون الناتج
To make it false
5) 1.2.34 Find a compound proposition involving the propositions p, q, and r that is true when p
and q are true and r is false, but is false otherwise.
Solution: p ᴧ q ᴧ (not r)
Need discussion with student.
(p =t) , (q =t) and (r =f) فقط في حالة كانtrue تجعل النات النهائيcompound proposition في هذا السؤال يطلب عمل
و تكون بحالةconjunction في حالة وحدة فقط هي الtrue من الروابط التي تجعل الجواب
T ᴧ T ᴧ T == T ᴧ T ᴧ (not) F == p ᴧq ᴧ (not) r
1.3 Predicates and Quantifiers
The statement P(x) is said to be the value of the propositional function P at x. Once a value has been
assigned to the variable x, the statement P(x) becomes a proposition and has a truth value.
QUANTIFIERS:
THE UNIVERSAL QUANTIFIER
∀x P(x): for any x in the universe of discourse p(x) is true.
E.g. p(x): x^2 >= 0, where the universe of discourse consists of all real numbers.
∀x P(x) is true.
True False
∀x p(x) When P(x) is true for every x. When there is an x for which P(x) is false.
∃x p(x) When there is an x for which P(x) is true. When P{x) is false for every x.
BINDING VARIABLES:
When a quantifier is used on the variable x or when we assign a value to this variable,
we say that this occurrence of the variable is bound.
Variable that is not bound by a quantifier or set equal to a particular value is said to be
free.
E.g.:
∀x ∃y p(x, y): both x and y are pound.
∀x p(x, y): x is pound, but y is free.
NEGATIONS:
Exercises:
1) 1.3.1 Let P(x) denote the statement "x < 4." What are the truth values?
a) P (0).
b) P (4).
c) P (6).
a b C
true false False
2) 1.3.5 Let P(x) be the statement "x spends more than five hours every weekday in class,"
where the universe of discourse for x consists of all students. Express each of these
quantifications in English.
a) ∃x p(x)
b) ∀x p(x)
c) ∃x ꜚp(x)
d) ∀x ꜚp(x)
A There is a student who spends more than five hours every weekday in class.
B All students spend more than five hours every weekday in class.
C There is a student who does not spend more than five hours every weekday in class.
D All students don’t spend more than five hours every weekday in class.
3) 1.3.7 Translate these statements into English, where C(x) is "x is a comedian" and F(x) is "x is
funny" and the universe of discourse consists of all people.
a) ∀x (C(x) F(x)). b) ∀x (C(x) ᴧ F(x)).
c) ∃x (C(x) F(x)). d) ∃x (C(x) ᴧ F(x)).
a For every one if he/she is a comedian then he/she a funny. (Every comedian is funny).
b Every one is a comedian and funny.
c There exists person if he/she is comedian then he/she funny.
d There exists comedian and funny.
4) 1.3.11 Let P (x) be the statement "x = x^2." If the universe of discourse consists of the
integers, what are the truth values?
e) ∃x p(x) f) ∀x p(x)
e True, If x =1 then 1 =1^2 =1 so there exist x where x=x^2
f False, sense if x=2 so 2 !=2^2, there exist x where p(x) false so ∀x p(x) false.
5) 1.3.22 Translate in two ways each of these statements into logical expressions using
predicates, quantifiers, and logical connectives. First, let the universe of discourse consist of
the students in your class and second, let it consist of all people.
a) Everyone in your class has a cellular phone.
b) Somebody in your class has seen a foreign movie.
c) There is a person in your class who cannot swim.
To make the two ways we suppose that C(x) be the propositional function
“x is in your class.” So
a) ∀x p(x)
Let P(x) is “x has a cellular phone." ∀x (c(x) p(x))
B ∃x P(x)
Let P(x) is “x has seen a foreign movie.” ∃x (C(x) ᴧ P(x)).
C ∃x ꜚP(x)
Let P(x) is “x can swim.” ∃x (C(x) ᴧ ꜚP(x)).
6) 1.3.32 Express the negation of these propositions using quantifiers, and then express the
negation in English.
a) Some drivers do not obey the speed limit.
b) All Swedish movies are serious.
c) No one can keep a secret.
d) There is someone in this class who does not have a good attitude.
Statements involving nested quantifiers can be negated by successively applying the rules
for negating statements involving a single quantifier.
ꜚ ∀x ∃y f(x, y) ≡ ∃xꜚ∃y f(x, y) ≡ ∃x ∀y ꜚf(x, y).
It is important to note that the order of the quantifiers is important, unless all the
quantifiers are universal quantifiers or all are existential quantifiers.
Exercises:
1.4.1 Translate these statements into English, where the universe of discourse for each variable consists
of all real numbers.
a. ∀x ∃y (x< y)
b. ∀x ∀y ( ( (x>=0) ᴧ (y>=0) ) (xy >=0)):
c. ∀x ∀y ∃z (xy=z).
a For every real number x there exist another real number less than x.
b For any two non-negative real numbers the multiplication of them is a non-negative real
number
c For any two real numbers the multiplication of them is real number.
1.4.8 Let Q(x, y) be the statement "student x has been a contestant on quiz show y." Express each of
these sentences in terms of Q(x, y), quantifiers, and logical connectives, where the universe of discourse
for x consists of all students at your school and for y consists of all quiz shows on television.
a. There is a student at your school who has been a contestant on a television quiz show.
b. No student at your school has ever been a contestant on a television quiz show.
c. There is a student at your school who has been a contestant on Jeopardy and on Wheel of
Fortune.
d. Every television quiz show has had a student from your school as a contestant.
e. At least two students from your school have been contestants on Jeopardy.
a ∃x ∃y Q(x, y)
b ꜚ ∃x ∃y Q(x, y)
c ∃x (Q(x, Jeopardy) ᴧ Q(x, Wheel of Fortune))
d ∀y ∃x Q(x, y)
e ∃x1 ∃x2 (Q(x1, Jeopardy) ᴧ Q(x2, Jeopardy) ᴧ (x1 ≠ x2))
1.4.21 Use predicates, quantifiers, logical connectives, and mathematical operators to express the
statement that every positive integer is the sum of the squares of four integers.
Solution:
∀x ∃a ∃b ∃c ∃ ((x x = a2 + b2 + c2 + d2) where the universe of discourse consists of all integers.
1.4.26 Let Q(x, y) be the statement "x + y = x - y." If the universe of discourse for both variables consists
of all integers, what are the truth values?
a False, 1 + 1≠1-1.
b True, 2 + 0=2-0.
c False, 1 + y≠1-y.
d False, x+2 ≠ x-2
e True, 2 + 0=2-0.
f True, x + 0=x-0.
g True, x + 0=x-0.
h False, x+2 ≠ x-2
i False, 1+2 ≠ 1-2
1.4.30 Rewrite each of these statements so that negations appear only within predicates (that is, so that
no negation is outside a quantifier or an expression involving logical connectives).
a. ꜚ ∃x ∃y p(x, y)
b. ꜚ ∀x ∃y p(x, y)
c. ꜚ ∃y (Q(y) ᴧ ∀x ꜚR(x, y))
d. ꜚ∃y (∃x R(x, y) ˅ ∀x S(x, y))
e. ꜚ∃y (∀x ∃z T(x, y, z) ˅ ∃x ∀z U(x, y, z))
a ∀x ∀y ꜚp(x, y)
b ∃x ∀y ꜚ p(x, y)
c ∀y (ꜚQ(y) ˅ ∃x R(x, y))
d ∀y (∀x ꜚR(x, y) ᴧ ∃x ꜚS(x, y))
e ∀y (∃x ∀z ꜚT(x, y, z) ᴧ ∀x ∃z ꜚU(x, y, z))
Sec 1.5: Rules of Inference
Solution:
a Addition rule.
b Simplification rule.
c Modus ponens.
d Modus tollens.
E Hypothetical syllogism.
1.5.6 Use rules of inference to show that the hypotheses "If it does not rain or if it is not foggy, then
the sailing race will be held and the lifesaving demonstration will go on," "If the sailing race is held,
then the trophy will be awarded," and "The trophy was not awarded" imply the conclusion "It
rained."
Solution:
1.5.14 for each of these arguments, explain which rules of inference are used for each step.
a) "Linda, a student in this class, owns a red convertible. Everyone who owns a red convertible has
gotten at least one speeding ticket. Therefore, someone in this class has gotten a speeding
ticket."
Solution:
c(x):“x is in this class,"
r(x):”x owns a red convertible,"
t(x): “x has gotten a speeding ticket."
1. Hypothesis
2. Universal instantiation using Step 1
3. r(Linda) Hypothesis
4. t(Linda) Modus ponens using Steps 2 and 3
5. c(Linda) Hypothesis
6. c(Linda) ᴧ t(Linda) Conjunction using Steps 4 and 5
7. ∃x (c(x) ᴧ t(x)) Existential generalization using Step 6
Sec 1.6: Introduction to Proofs
1.16.10 Use a direct proof to show that the product of two rational numbers is rational.
Solution:
First number x = a/b, b ≠0
Second number y =c/d, d≠0
X*y = a*c/b*d sense b ≠0 and d≠0 then b*d≠0.
Let a*c = l and b*d = m so x = l/m so x is rational number.
1.16.11 Prove or disprove that the product of two irrational numbers is irrational.
Solution:
1.6.16 Prove that if m and n are integers and m n is even, then m is even or n is even.
Solution:
From the two cases we found that n is odd if and only if 5n + 6 is odd.
External question: Prove that if x and y are real numbers, then max(x, y) + min(x, y) = x + y.
Solution:
Like this question we cane analysis it to its cases.
Max(x, y) has two cases if x is the max or y is max
Min(x, y) has two cases if y is the min or x is min
Case 1:
Let x is the max so y is the min so max(x, y) + min(x, y) = x +y.
Case 2:
Let y is the max so x is the min so max(x, y) + min(x, y) = y +x = x +y.