Sunteți pe pagina 1din 95

DISCRETE

MATHEMATICS
AND
ITS APPLICATIONS
Book: Discrete Mathematics and Its Applications
Author: Kenneth H. Rosen
Sixth Edition
McGraw-Hill International Edition
Goals
Mathematical Reasoning.
Combinatorial Analysis.
Discrete Structures: Sets, permutations,
relations, graphs, trees, finite-state
machines.
Algorithmic Thinking.
Applications and Modeling.

Contents
1- The Foundation: Logic and Proofs
2- Basic Sructures: Sets, Functions, Sequences
and Sum
3- The Fundamentals: Algorithms, the Integers,
and Matrices.
4- Induction and Recursion
5- Counting
6- Discrete Probability
7- Advanced Counting Techniques
Chapter 1
The Foundations:
Logic and Proofs
Objectives
Explain what makes up a correct
mathematical argument
Introduce tools to construct arguments
Develop an arsenal of different proof
methods
Introduce some strategies for
constructing proofs
Contents
1.1-Propositional Logic Logic mnh
1.2-Propositonal Equivalences
1.3-Predicates and Quantifiers (v ng v lng t)
1.4-Nested Quantifiers
1.5-Rules and Inference Quy tc v din dch
1.6-Introduction to Proof
1.7-Proof Methods and Strategies
E1- Axioms for the Real Numbers and the Positive
Integers


1.1- Propositional Logic
1.1.1- Definitions and Truth Table
1.1.2- Precedence of Logical Operators

1.1.1- Definitions and Truth Table
Proposition is a declarative sentence that is either
true or false but not both.
Proposition is a sentence that declares a fact.
Examples:
* I am a girl
* Ha noi is not the capital of Vietnam
* 1+5 < 4
* What time is it?
* X+Y=Z
OK
No OK
1.1.1- Definitions
Truth table
I am a girl
p
True/ T / 1
False / F / 0
1.1.1- Definitions
Negation of proposition p ( denoted by
p or

p ) is the statement It is not


case that p




p

p
1 0
0 1
1.1.1- Definitions
Conjunction (hi/hp ni) of propositions p and q is
the proposition p and q and denoted by p^q
p q p^q
0 0 0
0 1 0
1 0 0
1 1 1
1.1.1- Definitions
Disjunction (tuyn/hp ri) of propositions p and q is
the proposition p or q and denoted by p v q


p q pvq
0 0 0
0 1 1
1 0 1
1 1 1
1.1.1- Definitions
Exclusive-or (hoc loi tr/ xor) of propositions p and
q, denoted by p q






q

p q p q
0 0 0
0 1 1
1 0 1
1 1 0
1.1.1- Definitions
Conditional statement p q ( also called implication ng
) asserts that q is true on the condition that p holds.
p is called the hypothesis (or antecedent or premise) and q is
called the conclusion (or consequence).






Exercise. Find some terminologies that used to express p
q . For example, q whenever p.
p q p q
0 0 1
0 1 1
1 0 0
1 1 1
Exp. If 1 + 1 = 3, then dogs can fly.
(p q)
p=0, q=0 ,
so (pq)=true.
1.1.1- Definitions
Biconditional statement p q is the proposition p if and
only if q
p q (p only if q) and p q (p if q)

p q pq qp (pq) ^ (qp) p q
0 0 1 1 1 1
0 1 1 0 0 0
1 0 0 1 0 0
1 1 1 1 1 1
1.1.2- Precedence of Logical Operators
(1) Parentheses from inner to outer
(2)
(3) ^
(4) v
(5)
(6)

Logic Puzzle- (example 19, p.14)
A father te lls his two children, a boy and a girl, to play in
their backyard without getting dirty. However, while playing,
both children get mud on their foreheads. When the
children stop playing, the father says "At least one of you
has a muddy forehead," and then asks the children to
answer "Yes" or "No" to the question: "Do you know
whether you have a muddy forehead? The father asks this
question twice. What will the children answer each time this
question is asked, assuming that a child can see whether
his or her sibling has a muddy forehead, but cannot see
his or her own forehead? Assume that both children are
honest and that the chil dren answer each question
simultaneously.

Exercises
7, 8, 9, 10 p.17
18,25 p.18
28 p.19
45, 55, 56 p.20

1.2- Propositional Equivalences
1.2.1- Tautology and Contradiction
1.2.2- Logical Equivalences
1.2.3- De Morgans Laws
1.2.1- Tautology and Contradiction
Tautology is a proposition that is always true
Contradiction is a proposition that is always false
p p pvp p^p
0 1 1 0
1 0 1 0
1.2.2- Logical Equivalences
Compound propositions that have the same truth values in
all possible case.
They have the same truth tables
Propositions p and q are called logically equivalence if p
q is tautology
Notation: p q
Example: page 22
1.2.2- Logical Equivalences
How to show the equivalence of two
propositions?
How to show a proposition is a tautology
or a contradiction?
See examples in pages 26, 27

Example 3 p.23
Show that p q and p v q are logically
equivalent.

1.2.2- Logical Equivalences
Equivalence Name
p ^ T p p v F p Identity laws- Lut ng nht
p v T T p ^ F F Domination Laws Lut chi phi
p v p p p ^ p p Idempotent Laws Lut bt bin
(p) p Double Negation Laws Lut o kp
p v q q v p p ^ q q ^ p Commutative Laws Lut giao hon
(p v q) v r p v (q v r)
(p ^ q) ^ r p^(q^r)
Associative Laws Lut kt hp
pv (q^r) (pvq) ^ (pvr)
p^ (qvr) (p^q) v (p^r)
Distributive Laws Lut phn phi
(p^q) pvq (1) (pvq) p^q De Morgan Laws
pv (p^q) p p^(pvq) p Absortion Laws Lut hp th
pvp T p^p F Negation Laws - Lut nghch o
1.2.2- Logical Equivalences
Equivalences Equivalences
pq pvq pq (pq) ^ (qp)
pq q p (2) pq p q
pvq p q pq (p ^ q) v (p ^ q)
p^q (p q) (pq) p q
(pq) p^q
(pq) ^(pr) p (q^r)
(pr) ^ (qr) (pvq) r
(pq) v (pr) p (qvr)
(pr) v (qr) (p^q) r
Exercises. Show that the statements (1) and (2) true.
Example 8 p.27
Show that (p ^ q) (p v q) is a tautology.

Examples
Show that (p q)^q p is not a tautology
Show that (p q)^q p is a tautology
Show that (p q)^p q is not a tautology

Exercises
26, 30, 31 p.29
1.3- Predicates and Quantifiers
Introduction
Predicates
Quantifiers
1.3.1- Introduction
1.3.2- Predicates v t
X > 0
P(X)=X is a prime number , called
propositional function at X.
P(2)=2 is a prime number True
P(4)=4 is a prime number False

Q(X
1
,X
2
,,X
n
) , n-place/ n-ary predicate
Example: x=y+3 Q(x,y)
Q(1,2) 1=2+3 false
Q(5,2) 5=2+3 true

1.3.2- Predicates v t
1.3.2- Predicates
Predicates are pre-conditions and post-
conditions of a program.
If x>0 then x:=x+1
Predicate: x>0 P(x)
Pre-condition: P(x)
Post-condition: P(x)
T:=X;
X:=Y;
Y:=T;
- Pre-condition: x=a and y=b P(x,y)
- Post-condition: x=b and y=a Q(x,y)

Pre-condition (P()) : condition describes
valid input.
Post-condition (Q()) : condition
describe valid output of the codes.
Show the verification that a program
always produces the desired output:
P() is true
Executing Step 1.
Executing Step 2.
..
Q() is true
1.3.3- Quantifiers Lng t
The words in natural language: all, some, many, none,
few, .are used in quantifications.
Predicate Calculus : area of logic that deals with
predicates and quantifiers.
The universal quantification (lng t ph dng) of
P(x) is the statement P(x) for all values of x in the
domain. Notation : xP(x)
The existential quantification (lng t tn ti) of P(x)
is the statement There exists an element x in the
domain such that P(x). Notation : -xP(x)
Uniqueness quantifier: -!x P(x) or -
1
xP(x)
xP(x) v Q(y) :
x is a bound variable
y is a free variable
1.3.4- Quantifiers and Restricted
Domains
x<0(x
2
> 0), y = 0(y
3
= 0), -z>0(z
2
=2)

x(x<0 ^x
2
> 0), y(y = 0 ^y
3
= 0), -z(z>0 ^ z
2
=2)

Restricted domains
1.3.5- Precedence of Quantifiers
Quantifier have higher precedence than all
logical operators from propositional
calculus.
xP(x) v Q(x) (xP(x)) v Q(x)
has higher precedence. So, affects on
P(x) only.
1.3.6- Logical Equivalences
Involving Quantifiers
Statements involving predicates and quantifiers are
logically equivalent if and only if they have the same
truth value no matter which predicates are substituted
into the statements and which domain of discourse is
used for the variables in these propositional functions.
x (P(x) ^ Q(x)) xP(x) ^ xQ(x)
Proof: page 39
Expression Equivalence Expression Negation
-xP(x) x P(x) -xP(x) x P(x)
xP(x) -x P(x) xP(x) -x P(x)
1.3.7- Translating
For every student in the class has studied
calculus
For every student in the class, that student
has studied calculus
For every student x in the class, x has
studied calculus
x (S(x) C(x))
Translating
Exp. Let B(x), L(x), M(x), and D(x) be the statements "x is a baby," "x is
logical," "x is able to manage a crocodile, and "x is despised,"
respectively. Suppose that the domain consists of all people. Express
each of these statements using quantifiers; logical connectives; and
B(x), L(x), M(x), and D(x).
a)Babies are illogical. x(B(x)L(x))
b)Nobody is despised who can manage a crocodile x(M(x)D(x))
Do yourself
c)illogical people are despised. D(x)
d)Babies cannot manage crocodiles. M(x)


1.4- Nested Quantifiers
x-y(x+y=0): For every real number has an additive real inverse.
xy((x>0)^(y<0) (xy<0)):
For every real number x, for every real number y, if x>0 and y<0
then xy<0
The product of a positive number and a negative number is
always a negative real number.


Nested quantitives as nested loops
Let x, y be variables that can be 1, 2, 3, 4.
Consider the truth value of the statements
x y (x + y = 5)
x y (x + y = 5)
x y (x + y = 5)
Solution.
Translating example 7 p.54
Translate the statement "Every real number except zero has a
multiplicative inverse." (A multiplicative inverse of a real
number x is a real number y such that x y = 1. )
Solution.

Negating nested quantifiers
x-y(xy=1) -x -y (xy=1) // De Morgan laws
(-x) (y) (xy=1)
(-x) (y) (xy = 1)

Translating-Do yourself

Exercises
22, 26 p.61
Read example 12 p.91 (Chomp game)

1.5- Rules of Inference Quy tc
din dch
Definitions
Rules of Inferences
Chuyn vui: Mt gio s mn logic hc b mt knh. ng bn suy
lun: Ai ly cp? ng nhin l k cp ri. V tn ny c th b
cn th, c th khng. C th hn c knh, c th cha c.
Nhng nu cha c lm sao hn c th trng thy knh ca
mnh? iu ny chng t hn khng b cn th. M khng b cn
th th u cn ti knh. T nhng gi thuyt trn, c th kt lun
l khng ai ly knh ca mnh c. Chc chn n nm u y
thi. Nhng mnh nhn khp ri, khng thy g c. M mnh
nhn c nh vy c ngha l mnh ang eo knh. A ng ri,
knh ang nm trn mi mnh y...
Suy lun nh vy c hp l khng?
1.5.1- Definitions
Proposition 1 // Hypothesis gi thit
Proposition 2
Proposition 3
Proposition 4
Proposition 5

Conclusion
Argument s suy lun
Propositional
Equivalences
Arguments 2,3,4 are
premises (tin ) of
argument 5
1.5.2- Rules Inferences
Rule Tautology Name
p
p q
q
[p^ (pq)] q
You work hard
If you work hard then you will pass the examination
you will pass the examination
Modus ponen
q
p q
p
[q ^(p q)] p
She did not get a prize
If she is good at learning she will get a prize
She is not good at learning
Modus tollen
p q
q r
p r
[(p q) ^(q r)] (pr)
If the prime interest rate goes up then the stock prices go
down.
If the stock prices go down then most people are
unhappy.
If the prime interest rate goes up then most people are
unhappy.
Hypothetical
syllolism Tam
don lun gi
thit,
Quy tc bc cu
Mt ngi nh r th him
Ci g him th t
Mt ngi nh r th t.
If Socrates is human, then Socrates is mortal.
Socrates is human.
Socrates is mortal.
Rules Inferences
Rule Tautology Name
pvq
p
q
[(pvq) ^p] q
Power puts off or the lamp is malfunctional
Power doesnt put off
the lamp is malfunctional
Disjunctive syllogism
Tam on lun ca
php hi
p
pvq
p (pvq)
It is below freezing now
It is below freezing now or raining now
Addition
Php kt thm
p^q
p
(p^q) p
It is below freezing now and raining now
It is below freezing now
Simplication
Php gin lc
p
q
p^q
[(p) ^(q)) (p^q)

Conjunction
Php giao
pvq
pvr
qvr
[(pvq) ^(pvr)] (qvr)
Jasmin is skiing OR it is not snowing
It is snowing OR Bart is playing hockey
Jasmin is skiing OR Bart is playing hockey
Resolution
Php phn gii
1.5.3- Fallacies ngy bin sai logic
If you do every problem in this book then you will learn discrete
mathematic
You learned mathematic
(p q) ^q
=( p v q) ^ q
(absortion law)
= q
No information for p
p can be true or false You may learn discrete mathematic but
you might do some problems only.


Fallacies
(p q)^q p is not a tautology
( it is false when p = 0, q = 1)
(p q)^p q is not a tautology
(it is false when p = 0, q = 1)
Hn chi nh nhng ngi say ru ht. Gi hn bit ht
th hn c l hn khng cn chi. Kh cho hn v kh cho
ngi, hn li khng bit ht. Th hn chi, cng nh
chiu nay hn chi.. (Nam Cao, Ch Pho, trang 78)
p q
p
(q) = q l khng hp logic

1.5.4- Rules of Inference for
Quantified Statements
Rule Name
xP(x)
P(c)
Universal Instantiation
C th ha lng t ph dng
P(c) for arbitrary c
xP(x)
Universal generalization
Tng qut ha bng lng t ph dng
-xP(x)
P(c) for some element c
Existential instantiation
Chuyn bit ha
P(c) for some element c
-xP(x)
Existential generalization
Khi qut ha bng lng t tn ti
Rules of Inference for Quantified Statements
All student are in this class had taken the
course PFC
HB is in this class
Had HB taken PFC?
x(P(x) Q(x))
P(HB) Q(HB)
P(HB)
Q(HB) // conclusion
Premise

Universal Instantiation

Modus ponens
exercises
16 p.73
20 p.74
1.6- Introduction To Proofs
Definitions
Methods of Proving Theroems
1.6.1- Proofs: Definitions
Theorem (nh l)proposition/ fact/ result : statement
that can be shown to be true.
Proof(chng minh) : a demonstration for the validation of
a theorem
Axiom/ postulate (tin ) : statements we assume to be
true.
Lemma ( lemmas, lemmata, b ) : less important
theorem
Corollary(h qu) : theorem that can be established
directly from other theorem
Conjecture(phng on) : statement thai is proposed to
be true. After a conjecture is proved, it becomes
theorem.
1.6.2- Methods of Proving Theorems
Direct Proofs
Proof by Contraposition CM bng tng
phn
Proof by Contradiction CM bng mu
thun
Direct Proofs
To show P Q
P // precise
. // arguments
.
Q

Read definition 1 and solution of page 77
Proofs by Contraposition
We show the equivalence q p instead of p q
Example
n is an integer
To show If 3n+2 is odd then n is odd
We will show if n is even then 3n+2 is even
n is even n= 2k
3n+2 = 6k+2= 2(3k+1) = 2k 3n+2 is even
Conclusion:
If n is even then 3n+2 is even
If 3n+2 is odd then n is odd
Proofs by Contradiction
If p is
false then
p is true
Example:
Prove \

2
is irrational

Suppose \

2 is rational
\

2 = a/b and they have no common factors


2= a
2
/b
2

2b
2
= a
2

a
2
is even
a is even / a= 2c
2b
2
= 4c
2
b
2
= 2c
2
b
2
is even
b is even
a and b have common factor
FALSE
\

2 is irrational
Do yourself
1.Show that if n is an integer and 3n+ 2 is even, then n is even using
a) a proof by contraposition;
b) a proof by contradiction.
2.Use a proof by contradiction to prove that the sum of an irrational
number and a rational number is irrational.
3.Prove that if x is irrational, then 1/ x is irrational.
4. Use a proof by contraposition to show that if x + y >2, where x and y
are real numbers, then x >1 or y >1 .


1.7- Proof Methods and Strategies
Exhaustive proof and Proof by Cases Vt cn
Existence Proofs
Uniqueness Proofs
Proof Strategies
Do yourself
Looking for Conterexamples
Proof Strstegy in Action
Tilings
The Role of Open Problems
Additional Proof Methods
1.7.1- Exhaustive Proofs and Proof by Cases
Form of statement:
(p
1
vp
2
v p
3
v vp
n
) q
Tautology:
[(p
1
vp
2
v p
3
v vp
n
) q]
[(p
1
q)^(p
2
q)^( p
3
q)^ ^(p
n
q)]
Prove If n is an integer, then n
2
>=n
Because n is an integer, n will fall into one of three cases:
Case (i): n=0 0
2
>= 0 : TRUE
Case (ii): n >=1 n
2
>= n : TRUE
Case (iii): n<-1 n
2
>= n : TRUE
Conclusion: If n is an integer, then n
2
>=n

1.7.2- Existence Proofs
Form of propositon: -xP(x)
Constructive existence proof: Find an
element a such that P(a) is true base on a
considerable computation.
Nonconstructive existence proof: Do not
find an element a such that P(a) is true,
but prove that -xP(x) is true in some other
way.
Show that if the first 10 positive integers
are placed around a circle, in any order,
there exist three integers in consecutive
locations around the circle that have a
sum greater than or equal to 17.
Example 1 2 p.91 Chomp game

1.7.3- Uniqueness Proofs
2 steps for uniqueness proof:
Show an element x with the desired property exist.
Show that if y = x then y does not have the desired
property.
Prove that given a real number x there exist unique numbers n and c
such that x = n + c, n is an integer, and 0 s c < 1.
Answer: -n'Z: n s x< n+1. Let c=x-n then x = n + c and 0 s c < 1.
Suppose there exist c such that x = n + c and 0 s c < 1. Then x = n + c=
n + c. Then c= c. Proved.
1.7.4- Proof Strategies
Replace terms with their definitions
Carefully analyze to pick out: Hypotheses,
Conclusion.
Try proving it using one of available
methods of proof ( direct proof or indirect
proof)
E1- Axioms (tin ) for Real
Numbers and Positive Integers
Axioms for Real Numbers
Axioms for Positive Integers
Conventions:
Sum of x and y : x+y
Product of x and y : x.y
Multiplications are performed before
additions unless parentheses are used
Comparative operators: < = >

Axioms for Real Numbers:
Field (algebraic) Axioms
Axiom Description
For all real numbers x and y
Closure (lut ng) Law for Addition
Closure Law for Multiplication
x+y is a real number
x.y is a real number
Associative Law for Addition ( kt hp)
Associative Law for Multiplication
(x+y)+z = (x+y) + z
(x.y).z = x.(y.z)
Commutative (giao hon) Law for Addition
Commutative Law for Mutiplication
x+y=y+x
xy=yx
Additive Identity (ng nht) Law
Multiplication Identity Law
x+0 = 0+x=x (0: addition identity)
x.1=1.x=x (1: multiplication
identity)
Identity Elements Axiom 0 1
Inverse (o) Law for Addition
Inverse (o) Law for Multiplication
x + (-x) = (-x) + x=0
x.(1/x) = (1/x).x=1
Distribute (phn phi) Law x.(y+z) = x.y + x.z
(x+y).z = x.z + y.z
Axioms for Real Numbers:
Order Axioms
Axiom Description
For all real numbers x, y, z
Trichotomy (tam phn) Law Only one x=y, x<y, or x>y is
true
Transitive (truyn) Law (x>y ^ y>z) x>z
Additive Compatibility (tng hp)
Law
Multiplicative Compatibility Law
x>y (x+z > y+z)
(x>y^ z>0) x.z > y.z
Completeness (y ) Property Every nonoempty set of real
numbers that is bounded
above has a least upper bound
Axioms for Real Numbers:
Theorems ( Using axioms to prove them)
Theorem Description
1 The additive identity element 0 of the real numbers is
unique
2 The additive inverse of a real number x is unique
3 The multiplicative identity element 1 of the real numbers is
unique
4 The multiplicative inverse of a nonzero real number x is
unique
5 For every real number x, x.0=0
6 For all real number x and y, if x.y=0 then x=0 or y=0
7 The multiplicative identity element 1 in the set of real
numbers is greater than the additive identity element 0
8 ARCHIMEDEAN PROPERTY: For every real number x there
exists an integer n such that n>x
Axioms for Positive Integers
Axiom Description
1 The number 1 is a positive integer
2 If n is a positive integer, then n+1, the successor
of n, is also a positive integer
3 Every positive integer other than 1 is the
successor of a positive integer
4 The Well-Ordering Property c tnh c th t
hon ho: Every nonempty subset of the set of
positive integers has a least element
5 Mathematical Induction Axiom: If S is a set such
that 1 e S and such that if n e S, then n+1 e S,
then S is the subset of positive integers
Demo
Prove: (-x).y= x.(-y)=-x.y
(-x).y + x.y = (x+(-x)).y // distributive law
= 0.y // Addition identity
= 0 // Multiplication identity
(-x).y= -x.y
x.(-y) + x.y= x.((-y)+y) // distributive law
= x.0 // Mutiplication identity law
= 0
x.(-y) = -x.y
(-x).y= x.(-y)=-xy



Demo
Prove -(x+y)= (-x) + (-y)
-(x+y) + (x+y) = 0 // Inverse law of addition
(-x) + (-y) + (x+y) = (-x) + x + (-y) + y // commutative law
= 0 + 0 // inverse law of addition
= 0 // Additive identity law
-(x+y) = (-x) + (-y)
Similarly, we can prove: (-x).(-y) = xy
(-x).(-y) + (-(x.y)) = (-x).(-y) + (-x).(y) = (-x) ( (-y) + (y))
= (-x).0
=0
(-x).(-y) = xy



Demo
Prove that for all real number x, there exists a positive integer n such that
n.x>1
Using contradictional proof.
Assuming n is positive integers, x: real number, n.x 1 for all n
Let S = {n.x | nx 1}
n.x 1 S is bounded above b is the least upper bound of S
For all n>0, (n+1).x b n.x + x b nx b-x
b-x b is also an upper bound of S
Contradicting with the definition b is the least upper bound of S
n.x 1 for all positive integer n is FALSE
nx > 1 for some positive integer n is TRUE
Proved


H qu. Gia hai s hu t c mt s v t
Suppose a<b are two rational numbers. So, b-a>0.
There exist n such that n(b-a)>pi. So, (b-a)>pi/n b>a+pi/n>a.
Clearly, a+pi/n is irrational number between a and b.
Summary
Propositional Logic Lun l mnh
Propositonal Equivalences
Predicates and Quantifiers
Nested Quantifiers
Rules and Inference Quy tc v din
dch
Introduction to Proof
Proof Methods and Strategies


Exercise
1. Which of these sentences are propositions? What are the truth values
of those that are propositions?
a) Boston is the capital of Massachusetts.
b) Miami is the capital of Florida.
c) 2 + 3 = 5. d) 5 + 7 = 10.
e) x + 2 = 11 ()
f) Answer this question(not proposition)
Exercise
2. Let p and q be the propositions ,p : It is below freezing; q : It is
snowing. Write these propositions using p and q and logical
connectives.
a) It is below freezing and snowing.
b) It is below freezing but not snowing.
c) It is not below freezing and it is not snowing.
d) It is either snowing or below freezing (or both).
e) If it is below freezing, it is also snowing.
f) It is either below freezing or it is snowing, but it is not snowing if it is
below freezing. Answer: (pvq). (pq)
g) That it is below freezing is necessary and sufficient for it to be
snowing. Answer: pq
Exercise
3. Determine whether each of these conditional statements is true or
false.
a) If 1 + 1= 2, then 2 + 2 = 5.
b) If 1 + 1 = 3, then 2 + 2 = 4.
c) If 1 + 1 = 3, then 2 + 2 = 5.
d) If monkeys can fly, then 1 + 1 = 3. Answer: (00)= true
Exercise
4. Construct a truth table for each of these compound propositions.
a) p.p
b) pvp
c) (p v q)q
d) (p vq)(p.q)
e) (pq)(q p)
f) (pq)(qp). Answer:
p q pq qp (pq)(qp)
0 0 1 1 1
0 1 1 0 0
1 0 0 1 1
1 1 1 1 1
Exercise
5. Show that each of these conditional statements is a tautology without
using truth tables.
a) (p.q)p . Answer: (p.q)p = (p.q)vp = (pv q)vp = pvqvp
=pvpvq = Tvq = T
b) p (pvq)
c) p (p q)
d) [p.(p v q)] q
e)

Exercise
6. (= means )
a) Show that p q and q p are logically equivalent.
b) Show that (p q) and p q are logically equivalent.
Hint: To do this, either show that both sides are true, or that both sides
are false, for exactly the same combinations of truth values of the
propositional variables in these expressions (whichever is easier).
b)(pq)=[(pq).(qp)]=[(pvq).(qvp)]=(pvq)v(qvp)
=p.qvq.p (theo th t u tin, biu thc ny nn hiu ng l
[p.(q)]v[q.(p)]) (1)
pq=(pq).(qp)=(pvq).(qvp)=(pvq).(qvp)
=[(pvq).q]v[(pvq).p]=[(p.q)v(q.q)]v[(p.p)v(q.p)]
=[(p.q)vF]v[Fv(q.p)] = (p.q)v(q.p) (2)
Comparing (1) and (2) we have the conclusion.
Exercise
7. Let C(x) be the statement x has a cat, let D(x) be the statement x has
a dog and let F(x) be the statement "x has a ferret." Express each of
these statements in terms of C(x), D(x), F(x), quantifiers, and logical
connectives. Let the domain consist of all students in your class.
a) A student in your class has a cat, a dog, and a ferret.
b) All students in your class have a cat, a dog, or a ferret.
e) Some student in your class has a cat and a ferret, but not a dog.
d) No student in your class has a cat, a dog, and a ferret. Answer:
x[C(x) .D(x) .F(x)]
e) For each of the three animals, cats, dogs, and ferrets, there is a
student in your class who has one of these animals as a pet. Answer:
-xC(x).-xD(x).-xF(x)
Exercise
8. Let Q(x) be the statement "x + 1 > 2x." If the domain consists of all
integers, what are these truth values?
a) Q(0)
b) Q(-1)
c) Q(1)
d) -xQ(x)
e) xQ(x)
f) -xQ(x). Answer: true -Q(2) false (2+1 > 2.2)
g) x Q(x). Answer: false - exp.: 0+1> 2.0 (Q(0) true).
Exercise
9. Suppose the domain of the propositional function P(x , y) consists of
pairs x and y, where x is 1, 2, or 3 and y is 1, 2, or 3. Write out these
propositions using disjunctions and conjunctions.
a) -xP(x,3)
e) -yP(2,y)
b) yP(1,y)
d) xP(x,2). Answer: P(1,2).P(2,2) .P(3,2)
Exercise
10. Let P(x), I(x), and V(x) be the statements "x is a professor," "x is
ignorant," and "x is vain," respectively. Express each of these statements
using quantifiers; logical connectives; and P(x), Q(x), and R(x), where
the domain consists of all people.
a) No professors are ignorant.
b) All ignorant people are vain.
c) No professors are vain. Answer: x[P(x)V(x)]or -x[P(x).V(x)]
d) Does (c) follow from (a) and (b)? Answer: no.
Exercise
11. Let Q(x, y) be the statement "x + y = x - y." If the domain for both
variables consists of all integers, what are the truth values?
a) Q( 1, 1)
b) Q(2,0)
c) yQ( 1, y)
d) -xQ(x,2)
e) -x-yQ(x, y)
f) -yxQ(x, y)
g) xyQ(x, y). Answer: false-Q(1,1)=1+1=1-1
h) x-yQ(x, y). Answer: true-x(-y=0)Q(x,0) (x+0=x-0)
Exercise
12. For each of these arguments determine whether the argument is
correct or incorrect and explain why.
a) Everyone enrolled in the university has lived in a dormitory. Mia has
never lived in a dormitory. Therefore, Mia is not enrolled in the university.
b) A convertible car is fun to drive. Isaac's car is not a convertible.
Therefore, Isaac's car is not fun to drive.
c) Quincy likes all action movies. Quincy likes the movie Eight Men Out.
Therefore, Eight Men Out is an action movie.
d) All iobstennen set at least a dozen traps. Hamilton is a lobstennan.
Therefore, Hamilton sets at least a dozen traps. Answer: true-(pq).p
q.
Exercise
13. Detennine whether each of these arguments is valid. If an argument
is correct, what rule of inference is being used? If it is not, what logical
error occurs?
a) If n is a real number such that n > 1, then n
2
> 1. Suppose that n
2
> 1.
Then n > 1.
b) Ifn is areal numberwith n > 3, then n
2
> 9. Suppose that n
2
s 9. Then n
s 3.
c) If n is a real number with n > 2, then n
2
> 4. Suppose that n s 2. Then
n
2
s4. Answer: false- (-3 s 2 but (-3)
2
>2
2
). Logical error: (pq)(qp)
Exercise
14.Show that if a, b, and c are real numbers and a = 0, then there is a
unique solution of the equation ax + b = c.
Suppose that a and b are odd integers with a = b. Show there is a unique
integer c such that la - cl = Ib - cl.
Show that if r is an irrational number, there is a unique integer n such
that the distance between r and n is less than 1/2.
Prove that given a real number x there exist unique numbers n and c
such that x = n + c, n is an integer, and 0 s c < 1. Answer: -n'Z: n s x<
n+1. Let c=x-n then x = n + c and 0 s c < 1. Suppose there exist c such
that x = n + c and 0 s c < 1. Then x = n + c= n + c. Then c= c. Proved.
A boy and a girl are talking.

"I am a boy" - said the child with black hair.

"I am a girl" - said the child with white hair.

At least one of them lied. Who is the boy
and who is the girl?
There are three people (Alex, Brook and Cody), one of
whom is a knight, one a knave, and one a spy.

The knight always tells the truth, the knave always lies,
and the spy can either lie or tell the truth.

Alex says: "Cody is a knave."
Brook says: "Alex is a knight."
Cody says: "I am the spy."

Who is the knight, who the knave, and who the spy?
THANK YOU

S-ar putea să vă placă și