Upload
quinny-tran
View
192
Download
7
Embed Size (px)
Citation preview
DISCRETEMATHEMATICS
ANDITS APPLICATIONS
Book: Discrete Mathematics and Its Applications
Author: Kenneth H. RosenSixth 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 mệnh đề1.2-Propositonal Equivalences1.3-Predicates and Quantifiers (vị ngữ và lượng
từ)1.4-Nested Quantifiers1.5-Rules and Inference – Quy tắc và diễn dịch1.6-Introduction to Proof1.7-Proof Methods and StrategiesE1- 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 (hội/hợp nối) of propositions p and q is the proposition “ p and q” and denoted by p^q
p q p^q0 0 00 1 01 0 01 1 1
1.1.1- Definitions…
Disjunction (tuyển/hợp rời) of propositions p and q is the proposition “ p or q” and denoted by p v q
p q pvq0 0 00 1 11 0 11 1 1
1.1.1- Definitions…
Exclusive-or (hoặc loại trừ/ xor) of propositions p and q, denoted by p q
q
p q p q0 0 00 1 11 0 11 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 → q0 0 10 1 11 0 01 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 pq (p if q)
p q p→q q→p (p→q) ^ (q→p) 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.1718,25 p.1828 p.1945, 55, 56 p.20
1.2- Propositional Equivalences
1.2.1- Tautology and Contradiction
1.2.2- Logical Equivalences
1.2.3- De Morgan’s 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 pv¬p 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- Luật đồng nhất
p v T ≡ T p ^ F ≡ F Domination Laws – Luật chi phối
p v p ≡ p p ^ p ≡ p Idempotent Laws – Luật bất biến
¬(¬p) ≡ p Double Negation Laws – Luật đảo kép
p v q ≡ q v p p ^ q ≡ q ^ p Commutative Laws – Luật giao hoán
(p v q) v r ≡ p v (q v r) (p ^ q) ^ r ≡p^(q^r)
Associative Laws – Luật kết hợp
pv (q^r) ≡ (pvq) ^ (pvr) p^ (qvr) ≡ (p^q) v (p^r)
Distributive Laws – Luật phân phối
¬ (p^q) ≡ ¬pv¬q (1) ¬(pvq) ≡ ¬p^¬q De Morgan Laws
pv (p^q)≡ p p^(pvq)≡ p Absortion Laws – Luật hấp thụ
pv¬p ≡ T p^¬p≡ F Negation Laws - Luật nghịch đảo
1.2.2- Logical Equivalences…
Equivalences Equivalences
p→q ≡ ¬pvq p↔q ≡ (p→q) ^ (q→p)
p→q ≡ ¬q → ¬p (2) p↔q ≡ ¬p ↔ ¬q
pvq ≡ ¬ p → q p↔q ≡ (p ^ q) v (¬p ^ ¬q)
p^q ≡ ¬ (p → ¬q) ¬ (p↔q) ≡ p↔ ¬q
¬(p→q) ≡ p^¬q
(p→q) ^(p→r) ≡ p → (q^r)
(p→r) ^ (q→r) ≡ (pvq) → r
(p→q) v (p→r) ≡ p→ (qvr)
(p→r) v (q→r) ≡ (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
IntroductionPredicatesQuantifiers
1.3.1- Introduction
1.3.2- Predicates – vị từ
X > 0P(X)=“X is a prime number” , called
propositional function at X.P(2)=”2 is a prime number” ≡TrueP(4)=“4 is a prime number” ≡False
Q(X1,X2,…,Xn) , 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 – Lượng 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 (lượng từ phổ dụng) of P(x)
is the statement “P(x) for all values of x in the domain”. Notation : xP(x)
The existential quantification (lượng từ tồn tại) 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 1xP(x) xP(x) v Q(y) :
x is a bound variabley is a free variable
1.3.4- Quantifiers and Restricted Domains
x<0(x2 > 0), y 0(y3 0), z>0(z2 =2)x(x<0 ^x2 > 0), y(y 0 ^y3 0), z(z>0 ^ z2 =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 calculusFor every student in the class, that student has studied
calculusFor every student x in the class, x has studied calculusx (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
xy(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) xy (x + y = 5) xy (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
¬ xy(xy=1) ≡ x ¬y (xy=1) // De Morgan laws ≡ (x) (y) ¬(xy=1) ≡ (x) (y) (xy 1)
Translating-Do yourself
Exercises
22, 26 p.61Read example 12 p.91 (Chomp game)
1.5- Rules of Inference – Quy tắc diễn dịch
DefinitionsRules of Inferences
Chuyện vui: Một giáo sư môn logic học bị mất kính. Ông bèn suy luận: Ai lấy cắp? Đương nhiên là kẻ cắp rồi. Và tên này có thể bị cận thị, có thể không. Có thể hắn đã có kính, có thể chưa có. Nhưng nếu chưa có làm sao hắn có thể trông thấy kính của mình? Điều này chứng tỏ hắn không bị cận thị. Mà không bị cận thị thì đâu cần tới kính. Từ những giả thuyết trên, có thể kết luận là không ai lấy kính của mình cả. Chắc chắn nó nằm ở đâu đây thôi. Nhưng mình đã nhìn khắp rồi, không thấy gì cả. Mà mình nhìn được như vậy có nghĩa là mình đang đeo kính. A đúng rồi, kính đang nằm trên mũi mình đây...Suy luận như vậy có hợp lí không?
1.5.1- Definitions
Proposition 1 // Hypothesis – giả thiếtProposition 2Proposition 3Proposition 4Proposition 5………Conclusion
Argument s– suy luậnPropositional Equivalences
Arguments 2,3,4 are premises (tiên đề) of
argument 5
1.5.2- Rules Inferences
Rule Tautology Name
p p →qq
[p^ (p→q)] → qYou work hardIf you work hard then you will pass the examinationyou will pass the examination
Modus ponen
¬q p → q¬p
[¬q ^(p → q)] → ¬pShe did not get a prizeIf 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)] →(p→r)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 doạn luận giả thiết,Quy tắc bắc cầu
Một ngôi nhà rẻ thì hiếmCái gì hiếm thì đắt Một ngôi nhà rẻ thì đắt.
If Socrates is human, then Socrates is mortal.Socrates is human. Socrates is mortal.
Rules Inferences…Rule Tautology Name
pvq ¬pq
[(pvq) ^¬p] → qPower puts off or the lamp is malfunctionalPower doesn’t put offthe lamp is malfunctional
Disjunctive syllogismTam đoạn luận của phép hội
ppvq
p →(pvq)It is below freezing nowIt is below freezing now or raining now
AdditionPhép kết thêm
p^qp
(p^q) →pIt is below freezing now and raining nowIt is below freezing now
SimplicationPhép giản lược
p qp^q
[(p) ^(q)) → (p^q) ConjunctionPhép giao
pvq ¬pvrqvr
[(pvq) ^(¬pvr)] →(qvr)Jasmin is skiing OR it is not snowingIt is snowing OR Bart is playing hockey Jasmin is skiing OR Bart is playing hockey
ResolutionPhép phân giải
1.5.3- Fallacies – ngụy biện – 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)
Hắn chửi như những người say rượu hát. Giá hắn biết hát thì hắn có lẽ hắn không cần chửi. Khổ cho hắn và khổ cho người, hắn lại không biết hát. Thì hắn chửi, cũng như chiều nay hắn chửi….. (Nam Cao, Chí Phèo, trang 78) p → ¬ q ¬ p ¬(¬q) = q là không hợp logic
1.5.4- Rules of Inference for Quantified Statements
Rule Name
xP(x)P(c)
Universal InstantiationCụ thể hóa lượng từ phổ dụng
P(c) for arbitrary cxP(x)
Universal generalizationTổng quát hóa bằng lượng từ phổ dụng
xP(x)P(c) for some element c
Existential instantiationChuyên biệt hóa
P(c) for some element cxP(x)
Existential generalizationKhái quát hóa bằng lượng từ tồn tại
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
DefinitionsMethods of Proving Theroems
1.6.1- Proofs: Definitions
Theorem (định lý)proposition/ fact/ result : statement that can be shown to be true.
Proof(chứng minh) : a demonstration for the validation of a theorem
Axiom/ postulate (tiên đề) : 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(phỏng đoán) : statement thai is proposed to be true. After a conjecture is proved, it becomes theorem.
1.6.2- Methods of Proving Theorems
Direct ProofsProof by Contraposition – CM bằng tương
phảnProof by Contradiction – CM bằng mâu
thuẫn
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 integerTo 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 evenConclusion: 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= a2 /b2 2b2 = a2 a2 is even a is even / a= 2c 2b2 = 4c2
b2 = 2c2
b2 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 – Vét cạn 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:
(p1vp2v p3v … vpn) → q
Tautology:
[(p1vp2v p3v … vpn) → q] ↔
[(p1 →q)^(p2→q)^( p3→q)^ … ^(pn→q)]Prove “ If n is an integer, then n2 >=n ”Because n is an integer, n will fall into one of three cases: Case (i): n=0 02 >= 0 : TRUECase (ii): n >=1 n2 >= n : TRUECase (iii): n<-1 n2 >= n : TRUEConclusion: “ If n is an integer, then n2 >=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 such that x = n + , n is an integer, and 0 < 1.
– Answer: n: n x< n+1. Let =x-n then x = n + and 0 < 1. Suppose there exist ’ such that x = n + ’ and 0 ’ < 1. Then x = n + = n + ’. Then = ’. Proved.
1.7.4- Proof Strategies
Replace terms with their definitionsCarefully analyze to pick out: Hypotheses, Conclusion.Try proving it using one of available methods of proof (
direct proof or indirect proof)
E1- Axioms (tiên đề) for Real Numbers and Positive Integers
Axioms for Real NumbersAxioms for Positive IntegersConventions:
– 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 DescriptionFor all real numbers x and y
Closure (luật đóng) Law for AdditionClosure Law for Multiplication
x+y is a real number x.y is a real number
Associative Law for Addition ( kết hợp)Associative Law for Multiplication
(x+y)+z = (x+y) + z(x.y).z = x.(y.z)
Commutative (giao hoán) Law for Addition Commutative Law for Mutiplication
x+y=y+x xy=yx
Additive Identity (đồng nhất) LawMultiplication 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 AdditionInverse (đảo) Law for Multiplication
x + (-x) = (-x) + x=0 x.(1/x) = (1/x).x=1
Distribute (phân phối) Law x.(y+z) = x.y + x.z (x+y).z = x.z + y.z
Axioms for Real Numbers:Order Axioms
Axiom DescriptionFor all real numbers x, y, z
Trichotomy (tam phân) Law Only one x=y, x<y, or x>y is true
Transitive (truyền) Law (x>y ^ y>z) → x>z
Additive Compatibility (tương hợp) LawMultiplicative 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 IntegersAxiom 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 tính có thứ tự hoàn hảo: 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 S and such that if n S, then n+1 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>1Using contradictional proof.Assuming n is positive integers, x: real number, n.x ≤ 1 for all nLet S = {n.x | nx ≤ 1}n.x ≤ 1 S is bounded above b is the least upper bound of
SFor all n>0, (n+1).x ≤ b n.x + x ≤ b nx ≤ b-x b-x ≤ b is also an upper bound of SContradicting 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ả. Giữa hai số hữu tỉ có một 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 – Luận lý mệnh đềPropositonal EquivalencesPredicates and QuantifiersNested QuantifiersRules and Inference – Quy tắc và diễn
dịchIntroduction to ProofProof 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) pv¬p c) (p v ¬ q)q d) (p vq)(pq) 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) (pq)p . Answer: (pq)p = ¬(pq)vp = (¬pv ¬q)vp =
¬pv¬qvp =¬pvpv¬q = Tv¬q = 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 tiên, biểu thức này nên hiểu đúng là [p(¬q)]v[q(¬p)]) (1)
¬pq=(¬pq)(q¬p)=(¬¬pvq)(¬qv¬p)=(pvq)(¬qv¬p) =[(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 con nectives; 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) xyQ(x, y) f) yxQ(x, y) g) xyQ(x, y). Answer: false-Q(1,1)=“1+1=1-1” h) xyQ(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 n2 > 1. Suppose that n2 > 1. Then n > 1.
b) Ifn is areal numberwith n > 3, then n2 > 9. Suppose that n2 9. Then n 3.
c) If n is a real number with n > 2, then n2 > 4. Suppose that n 2. Then n2 4. Answer: false- (-3 2 but (-3)2>22). 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 such that x = n + , n is an integer, and 0 < 1. Answer: n: n x< n+1. Let =x-n then x = n + and 0 < 1. Suppose there exist ’ such that x = n + ’ and 0 ’ < 1. Then x = n + = n + ’. Then = ’. 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