Upload
others
View
1
Download
0
Embed Size (px)
Citation preview
Undergraduate Notes in Mathematics
Arkansas Tech UniversityDepartment of Mathematics
Introductory Notes in DiscreteMathematics
Solution Guide
Marcel B. Financ©All Rights Reserved
2015 Edition
Contents
Fundamentals of Mathematical Logic 51 Propositions and Related Concepts . . . . . . . . . . . . . . . . . 52 Digital Logic Design . . . . . . . . . . . . . . . . . . . . . . . . . 133 Conditional and Biconditional Propositions . . . . . . . . . . . . 234 Related Propositions: Inference Logic . . . . . . . . . . . . . . . . 295 Predicates and Quantifiers . . . . . . . . . . . . . . . . . . . . . . 40
Fundamentals of Mathematical Proofs 476 Methods of Direct Proof . . . . . . . . . . . . . . . . . . . . . . . 477 More Methods of Proof . . . . . . . . . . . . . . . . . . . . . . . 538 Methods of Indirect Proofs: Contradiction and Contraposition . . 609 Method of Proof by Induction . . . . . . . . . . . . . . . . . . . . 66
Number Theory and Mathematical Proofs 7710 Divisibility. The Division Algorithm . . . . . . . . . . . . . . . . 7711 The Euclidean Algorithm . . . . . . . . . . . . . . . . . . . . . . 83
Fundamentals of Set Theory 8912 Basic Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . 8913 Properties of Sets . . . . . . . . . . . . . . . . . . . . . . . . . . 9614 Boolean Algebra . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Relations and Functions 11115 Binary Relations . . . . . . . . . . . . . . . . . . . . . . . . . . . 11116 Equivalence Relations . . . . . . . . . . . . . . . . . . . . . . . . 11917 Partial Order Relations . . . . . . . . . . . . . . . . . . . . . . . 12618 Bijective and Inverse Functions . . . . . . . . . . . . . . . . . . . 13319 The Pigeonhole Principle . . . . . . . . . . . . . . . . . . . . . . 139
3
4 CONTENTS
20 Recursion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
Fundamentals of Counting 15521 The Fundamental Principle of Counting . . . . . . . . . . . . . . 15522 Permutations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16323 Combinations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
Elements of Graph Theory 17124 Graphs, Paths, and Circuits . . . . . . . . . . . . . . . . . . . . 17125 Paths and Circuits . . . . . . . . . . . . . . . . . . . . . . . . . 18526 Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
Fundamentals of MathematicalLogic
1 Propositions and Related Concepts
Problem 1.1Indicate which of the following sentences are propositions.(a) 1,024 is the smallest four-digit number that is a perfect square.(b) She is a mathematics major.(c) 128 = 26.(d) x = 26.
Solution.(a) Proposition with truth value (T). Note that 322 = 1024 and 312 = 961.(b) Not a proposition since the truth or falsity of the sentence depends onthe reference for the pronoun “she.” For some values of “she” the statementis true; for others it is false.(c) A proposition with truth value (F).(d) Not a proposition
Problem 1.2Consider the propositions:
p: Juan is a math major.q: Juan is a computer science major.
Use symbolic connectives to represent the proposition“Juan is a math majorbut not a computer science major.”
Solution.p∧ ∼ q
5
6 FUNDAMENTALS OF MATHEMATICAL LOGIC
Problem 1.3In the following sentence is the word “or” used in its inclusive or exclusivesense? “A team wins the playoffs if it wins two games in a row or a total ofthree games.”
Solution.Inclusive. For example, a team can win 1, lose 1, and then wins two
Problem 1.4Write the truth table for the proposition: (p ∨ (∼ p ∨ q))∧ ∼ (q∧ ∼ r).
Solution.Let s = (p ∨ (∼ p ∨ q))∧ ∼ (q∧ ∼ r).p q r ∼ p ∼ r ∼ p ∨ q q∧ ∼ r ∼ (q∧ ∼ r) p ∨ (∼ p ∨ q) sT T T F F T F T T TT T F F T T T F T FT F T F F F F T T TT F F F T F F T T TF T T T F T F T T TF T F T T T T F T FF F T T F T F T T TF F F T T T F T T T
Problem 1.5Let t be a tautology. Show that p ∨ t ≡ t.
Solution.
p t p ∨ tT T TF T T
Problem 1.6Let c be a contradiction. Show that p ∨ c ≡ p.
Solution.
p c p ∨ cT F TF F F
1 PROPOSITIONS AND RELATED CONCEPTS 7
Problem 1.7Show that (r ∨ p) ∧ ((∼ r ∨ (p ∧ q)) ∧ (r ∨ q)) ≡ p ∧ q.
Solution.Let s = (∼ r ∨ (p ∧ q)) ∧ (r ∨ q).
p q r r ∨ p r ∨ q ∼ r ∨ (p ∧ q) s (r ∨ p) ∧ s p ∧ qT T T T T T T T TT T F T T T T T TT F T T T F F F FT F F T F T F F FF T T T T F F F FF T F F T T F F FF F T T T F F F FF F F F F T F F F
Problem 1.8Use De Morgan’s laws to write the negation for the proposition: “This com-puter program has a logical error in the first ten lines or it is being run withan incomplete data set.”
Solution.“This computer program is error free in the first ten lines and it is being runwith complete data.”
Problem 1.9Use De Morgan’s laws to write the negation for the proposition: “The dollaris at an all-time high and the stock market is at a record low.”
Solution.“The dollar is not at an all-time high or the stock market is not at a recordlow.”
Problem 1.10Assume x ∈ R. Use De Morgan’s laws to write the negation for the proposition:−5 <x ≤ 0.
Solution.x ≤ −5 or x > 0
8 FUNDAMENTALS OF MATHEMATICAL LOGIC
Problem 1.11Show that the proposition s = (p ∧ q) ∨ (∼ p ∨ (p∧ ∼ q)) is a tautology.
Solution.
p q ∼ p ∼ q ∼ p ∨ (p∧ ∼ q) p ∧ q sT T F F F T TT F F T T F TF T T F T F TF F T T T F T
Problem 1.12Show that the proposition s = (p∧ ∼ q) ∧ (∼ p ∨ q) is a contradiction.
Solution.
p q ∼ p ∼ q p∧ ∼ q) ∼ p ∨ q sT T F F F T FT F F T T F FF T T F F T FF F T T F T F
Problem 1.13(a) Find simpler proposition forms that are logically equivalent to p⊕ p andp⊕ (p⊕ p).(b) Is (p⊕ q)⊕ r ≡ p⊕ (q ⊕ r)? Justify your answer.(c) Is (p⊕ q) ∧ r ≡ (p ∧ r)⊕ (q ∧ r)? Justify your answer.
Solution.(a) Constructing the truth table for p⊕ p we find
p p⊕ pT FF F
Hence, p⊕ p ≡ c, where c is a contradiction.Now, (p⊕ p)⊕ p ≡ c⊕ p ≡ p.
1 PROPOSITIONS AND RELATED CONCEPTS 9
(b) (p⊕ q)⊕ r ≡ p⊕ (q ⊕ r) because of the following truth table.
p q r p⊕ q (p⊕ q)⊕ r p⊕ (q ⊕ r)T T T F T TT T F F F FT F T T F FT F F T T TF T T T F FF T F T T TF F T F F TF F F F F F
(c) (p⊕ q) ∧ r ≡ (p ∧ r)⊕ (q ∧ r) because of the following truth table.
p q r p⊕ q (p ⊕ q) ∧ r (p ∧ r)⊕ (q ∧ r)T T T F F FT T F F F FT F T T T TT F F T F FF T T T T TF T F T F FF F T F F FF F F F F F
Problem 1.14Show the following:(a) p ∧ t ≡ p, where t is a tautology.(b) p ∧ c ≡ c, where c is a contradiction.(c) ∼ t ≡ c and ∼ c ≡ t, where t is a tautology and c is a contradcition.(d) p ∨ p ≡ p and p ∧ p ≡ p.
Solution.(a)
p t p ∧ tT T TF T F
(b)p c p ∧ cT F FF F F
10 FUNDAMENTALS OF MATHEMATICAL LOGIC
(c)
t ∼ t cT F FT F F
c ∼ c tF T TF T T
(d)
p p ∧ pT TF F
p p ∨ pT TF F
Problem 1.15Which of the following statements are propositions?(a) The Earth is round.(b) Do you know how to swim?(c) Please leave the room.(d) x + 3 = 5.(e) Canada is in Asia.
Solution.(a) Proposition with truth value (T).(b) This is a question and not a proposition.(c) This is a command and not a proposition.(d) This is not a proposition since it is true for x = 2 but false otherwise.(e) This is a proposition with true value (F)
Problem 1.16Write the negation of the following propositions:(a) ∼ p ∧ q.(b) John is not at work or Peter is at the gym.
1 PROPOSITIONS AND RELATED CONCEPTS 11
Solution.(a) ∼ (∼ p ∧ q) ≡∼ (∼ p)∨ ∼ q ≡ p∨ ∼ q.(b) John is at work and Peter is not at the gym
Problem 1.17Construct the truth table of the compound proposition (p ∧ q) ∨ (∼ p).
Solution.
p q p ∧ q ∼ p (p ∧ q) ∨ (∼ p)T T T F TT F F F FF T F T TF F F T T
Problem 1.18Show that p⊕ q ≡ (p ∨ q)∧ ∼ (p ∧ q).
Solution.
p q p ∨ q p ∧ q ∼ (p ∧ q) (p ∨ q)∧ ∼ (p ∧ q) p⊕ pT T T T F F FT F T F T T TF T T F T T TF F F F T F F
Problem 1.19Show that p∨ ∼ (p ∧ q) is a tautology.
Solution.
p q p ∧ q ∼ (p ∧ q) p∨ ∼ (p ∧ q)T T T F TT F F T TF T F T TF F F T T
Problem 1.20Show that ∼ p ∧ (p ∧ q) is a contradiction.
12 FUNDAMENTALS OF MATHEMATICAL LOGIC
Solution.By De Morgan’s Law, ∼ p ∧ (p ∧ q) =∼ [p∨ ∼ (p ∧ q)]. From the previousproblem, p∨ ∼ (p ∧ q) is a tuatology. Hence, its negation ∼ p ∧ (p ∧ q) is acontradiction
2 DIGITAL LOGIC DESIGN 13
2 Digital Logic Design
Problem 2.1Write the input/output table for the circuit of Example 2.2 where P,Q, andR are any inputs.
Solution.
P Q R S1 1 1 11 1 0 11 0 1 11 0 0 10 1 1 10 1 0 00 0 1 00 0 0 0
Problem 2.2Construct the circuit corresponding to the Boolean expression: (P ∧Q)∨ ∼R.
Solution.
Problem 2.3For the following input/output table, construct (a) the corresponding Booleanexpression and (b) the corresponding circuit:
14 FUNDAMENTALS OF MATHEMATICAL LOGIC
P Q R S1 1 1 01 1 0 11 0 1 01 0 0 00 1 1 00 1 0 00 0 1 00 0 0 0
Solution.(a) (P ∧Q)∧ ∼ R.(b)
Problem 2.4Consider the following circuit
2 DIGITAL LOGIC DESIGN 15
Complete the following table
P Q R S1 11 00 10 0
Solution.
P Q R S1 1 1 01 0 0 10 1 0 10 0 0 0
Problem 2.5(a) Convert 104310 to base 2.(b) Convert 011011012 to base 10.
Solution.(a) We have
a b q r1043 2 521 1521 2 260 1260 2 130 0130 2 65 065 2 32 132 2 16 016 2 8 08 2 4 04 2 2 02 2 1 01 2 0 1
Hence, 104310 = 100000100112.(b) We have
011011012 = 0 · 27 + 1 · 26 + 1 · 25 + 0 · 24 + 1 · 23 + 1 · 22 + 0 · 2 + 1 = 10910
16 FUNDAMENTALS OF MATHEMATICAL LOGIC
Problem 2.6Express the numbers 104 and −104 in two’s complement representation with8 bits.
Solution.+10410 = 01101000−10410 = 10011000
Problem 2.7Construct the input/output table of the circuit given below.
Solution.We have
A B S Z1 1 1 11 1 0 11 0 1 01 0 0 10 1 1 10 1 0 00 0 1 00 0 0 0
Problem 2.8The negation of the exclusive or is the exclusive nor (abbreviated by XNOR)whose gate is shown below.
2 DIGITAL LOGIC DESIGN 17
Contruct the input/output table of this gate.
Solution.
A B Z =∼ (A⊕B)1 1 11 0 00 1 00 0 1
Problem 2.9Show that A⊕ A and A⊕ (∼ A) are constants.
Solution.We have A⊕ A = 0 and A⊕ ∼ A = 1
Problem 2.10Construct a circuit whose Boolean expression is Q = (A ∧ B) ∨ [(B ∧ C) ∧(B ∨ C)].
Solution.A possible circuit is shown below.
18 FUNDAMENTALS OF MATHEMATICAL LOGIC
Problem 2.11Find the Boolean expression that corresponds to the circuit.
Solution.The Boolean expression is (A ∧B) ∨ [(C ∨D) ∧ E]
Problem 2.12Find the Boolean expression S that corresponds to the input output table,where P,Q, and R are the Boolean variables.
P Q R S1 1 1 11 1 0 01 0 1 11 0 0 00 1 1 00 1 0 00 0 1 00 0 0 0
2 DIGITAL LOGIC DESIGN 19
Solution.The Boolean expression is S = P ∧R
Problem 2.13Show that the following two circuits are equivalent:
Solution.The truth table is
A B S1 1 01 0 10 1 10 0 0
which is the same as the truth table of A⊕B
Problem 2.14Show that the following two circuits are equivalent:
20 FUNDAMENTALS OF MATHEMATICAL LOGIC
Solution.The truth table is
A B Q Z1 1 1 11 0 0 00 1 0 00 0 1 1
which is the same of the truth table of ∼ (A⊕B)
Problem 2.15Let A,B,C and D be the Boolean variables of the circuit below. Find theBoolean Expressions: X, Y, Z,W, and Q.
Solution.We have
X =(∼ A) ∧ (∼ D)
Y =D ∧B
Z =(∼ D) ∧ C
W =(D ∧B) ∨ [(∼ D) ∧ C]
Q =[(∼ A) ∧ (∼ D)] ∨ {(D ∧B) ∨ [(∼ D) ∧ C]}
Problem 2.16(a) Write the number 51310 in base 2.(b) Write the number 11102 in base 10.
Solution.(a) Let q denote the quotient of the division of a by b and r denote theremainder. We have
2 DIGITAL LOGIC DESIGN 21
a b q r513 2 256 1256 2 128 0128 2 64 064 2 32 032 2 16 016 2 8 08 2 4 04 2 2 02 2 1 01 2 0 1.
Hence,51310 = 10000000012.
(b) We have
11102 = 1× 23 + 1× 22 + 1× 2 + 0 = 14
Problem 2.17Write the two’s complement values of the numbers 7 and −2 in (a) 4-bitformat (b) 8-bit format (c) 16-bit format.
Solution.Two’s complement values are extended to larger formats by copying the signbit to all new positions:
Number 4-bit 8-bit 16-bit7 0111 00000111 0000000000000111−2 1110 11111110 1111111111111110
Problem 2.18Represent the integer −7210 as an 8-bit two’s complement.
Solution.Convert the magnitude to binary obtaining 7210 = 10010002 or 010010002
in the 8-bit format. The one’s complement is 101101112. Increase by 1 toobtain 10111000
Problem 2.19Convert 8110 to an 8-bit two’s complememt.
22 FUNDAMENTALS OF MATHEMATICAL LOGIC
Solution.Convert the magnitude to binary obtaining 8110 = 10100012 or 010100012 inthe 8-bit format. The answer is 01010001
Problem 2.20What is the decimal representation for the integer with 8-bit two’s comple-ment 10010011?
Solution.The two’s complement of 10010011 is 01101101 = (1 · 26 + 1 · 25 + 1 · 23 + 1 ·22 + 1) = 109. Thus, the number is −109
Problem 2.21What is the decimal representation for the integer with 8-bit two’s comple-ment 01001000?
Solution.Since the integer is positive, 01001000 = 10010002 = 1 · 26 + 1 · 23 = 7210
3 CONDITIONAL AND BICONDITIONAL PROPOSITIONS 23
3 Conditional and Biconditional Propositions
Problem 3.1Construct the truth table for the proposition: (∼ p) ∨ q → r.
Solution.
p q r ∼ p ∼ p ∨ q ∼ p ∨ q → rT T T F T TT T F F T FT F T F F TT F F F F TF T T T T TF T F T T FF F T T T TF F F T T F
Problem 3.2Construct the truth table for the proposition: (p→ r)↔ (q → r).
Solution.
p q r p→ r q → r (p→ r)↔ (q → r)T T T T T TT T F F F TT F T T T TT F F F T FF T T T T TF T F T F FF F T T T TF F F T T T
Problem 3.3Write negations for each of the following propositions.(a) If 2 + 2 = 4, then 2 is a prime number.(b) If 1 = 0 then
√2 is rational.
Solution.(a) 2 + 2 = 4 and 2 is not a prime number.(b) 1 = 0 and
√2 is irrational
24 FUNDAMENTALS OF MATHEMATICAL LOGIC
Problem 3.4Write the contrapositives for the propositions of Problem 3.3.
Solution.(a) If 2 is not a prime number then 2 + 2 6= 4.(b) If
√2 is irrational then 1 6= 0
Problem 3.5Write the converse for the propositions of problem 3.3
Solution.(a) If 2 is a prime number then 2 + 2 = 4.(b) If
√2 is rational then 1 = 0
Problem 3.6Write the inverse for the propositions of problem 3.3
Solution.(a) If 2 + 2 6= 4 then 2 is not a prime number.(b) If 1 6= 0 then
√2 is irrational
Problem 3.7Show that p ∨ q ≡ (p→ q)→ q.
Solution.We have
p q p→ q (p→ q)→ q p ∨ qT T T T TT F F T TF T T T TF F T F F
The last two columns show that p ∨ q ≡ (p→ q)→ q
Problem 3.8Show that ∼ (p↔ q) ≡ (p∧ ∼ q) ∨ (∼ p ∧ q).
Solution.We have
∼ (p↔ q) ≡ ∼ [(p→ q) ∧ (q → p)]
≡[∼ (p→ q)] ∨ [∼ (q → p)]
≡(p∧ ∼ q) ∨ (∼ p ∧ q)
3 CONDITIONAL AND BICONDITIONAL PROPOSITIONS 25
Problem 3.9Let p : 2 > 3 and q : 0 < 5. Find the truth value of p→ q and q → p.
Solution.Since p is false, the conditional proposition p→ q is vacuously true. Since qis true and p is false, the conditional proposition q → p is false
Problem 3.10Assuming that p is true, q is false, and r is true, find the truth value of eachproposition.(a) p ∧ q → r.(b) p ∨ q →∼ r.(c) p ∨ (q → r).
Solution.(a) Since p ∧ q is false, p ∧ q → r is vacuously true.(b) Since p ∨ q is true and ∼ r is false, p ∨ q →∼ r is false.(c) Since q → r is vacuously true, p ∨ (q → r) is true
Problem 3.11Show using a chain of logical equivalences that (p→ r)∧(q → r) ≡ (p∨q)→r.
Solution.We have
(p ∨ q)→ r ≡[∼ (p ∨ q)] ∨ r
≡[(∼ p) ∧ (∼ q)] ∨ r
≡[(∼ p) ∨ r] ∧ [(∼ q) ∨ r]
≡(p→ r) ∧ (q → r)
Problem 3.12Show using a chain of logical equivalences that p↔ q ≡ (p∧q)∨ (∼ p∧ ∼ q).
Solution.
26 FUNDAMENTALS OF MATHEMATICAL LOGIC
Let c denote a contradiction. Using Example 1.10 and Problem 1.6, We have
p↔ q ≡(p→ q) ∧ (q → p)
≡(∼ p ∨ q) ∧ (∼ q ∨ p)
≡[∼ p ∧ (∼ q ∨ p)] ∨ [q ∧ (∼ q ∨ p)]
≡[(∼ p∧ ∼ q) ∨ (∼ p ∧ p)] ∨ [(q∧ ∼ q) ∨ (q ∧ p)]
≡[(∼ p∧ ∼ q) ∨ c] ∨ [c ∨ (q ∧ p)]
≡(∼ p∧ ∼ q) ∨ (p ∧ q)
≡(p ∧ q) ∨ (∼ p∧ ∼ q)
Problem 3.13(a) What are the truth values of p and q for which a conditional propositionand its inverse are both true?(b) What are the truth values of p and q for which a conditional propostionand its inverse are both false?
Solution.(a) By Example 3.6, this is the case when either both p and q are true orboth are false.(b) None
Problem 3.14Show that p↔ q ≡∼ (p⊕ q).
Solution.We have
p q p↔ q ∼ (p⊕ q)T T T TT F F FF T F FF F T T
Problem 3.15Determine whether the following propostion is true or false: “If the moon ismade of milk then I am smarter than Einstein.”
Solution.Vacuously true since the hypothesis is false
3 CONDITIONAL AND BICONDITIONAL PROPOSITIONS 27
Problem 3.16Construct the truth table of ∼ p ∧ (p→ q).
Solution.We have
p q ∼ p p→ q ∼ p ∧ (p→ q)T T F T FT F F F FF T T T TF F T T T
Problem 3.17Show that (p→ q) ∨ (q → q) is a tautology.
Solution.We have
p q p→ q q → p (p→ q) ∨ (q → q)T T T T TT F F T TF T T F TF F T T T
Problem 3.18Construct a truth table for (p→ q) ∧ (q → r).
Solution.We have
p q r p→ q q → r (p→ q) ∧ (q → r)T T T T T TT T F T F FT F T F T FT F F F T FF T T T T TF T F T F FF F T T T TF F F T T T
28 FUNDAMENTALS OF MATHEMATICAL LOGIC
Problem 3.19Find the converse, inverse, and contrapositive of“It is raining is a necessarycondition for me not going to town.
Solution.The hypothesis here is “Me not going to town” and the conclusion is “It israining”. Hence, the converse proposotion is “If it is raining then I am notgoing to town.” The inverse is “If I am going to town then it is not raining.”The contrapositive is “If it is not raining then I am going to town”
Problem 3.20Show that (p∧ ∼ q) ∨ q ↔ p ∨ q is a tautology.
Solution.We have
p q ∼ q p∧ ∼ q (p∧ ∼ q) ∨ q p ∨ q (p∧ ∼ q) ∨ q ↔ p ∨ qT T F F T T TT F T T T T TF T F F T T TF F T F F F T
4 RELATED PROPOSITIONS: INFERENCE LOGIC 29
4 Related Propositions: Inference Logic
Problem 4.1Show that the propositions “Abraham Lincolm was the president of theUnited States, and blueberries are blue. My car is yellow” do not forman argument.
Solution.Indeed, the truth or falsity of each of the propositions has no bearing on thatof the others
Problem 4.2Show that the propositions: “Steve is a physician. So Steve went to medicalschool since all doctors have gone to medical school” form an argument.Identify the premises and the conclusion.
Solution.The premises are “Steve is a physician” and “All doctors have gone to medicalschool.” The conclusion is “Steve went to medical school.”
Problem 4.3Show that the argument
∼ p ∨ q → r
∼ p ∨ q
.̇. r
is valid.
Solution.This follows from Modus Ponens
Problem 4.4Show that the argument
p→ q
q
.̇. p
is invalid.
30 FUNDAMENTALS OF MATHEMATICAL LOGIC
Solution.The truth table is as follows.
p q p→ qT T TT F FF T TF F T
Because of the third row the argument is invalid
Problem 4.5Show that the argument
p→ q
∼ p
.̇. ∼ q
is invalid.
Solution.The truth table is as follows.
p q p→ q ∼ q ∼ pT T T F FT F F T FF T T F TF F T T T
The third row shows that the argument is invalid
Problem 4.6Show that the argument
q
.̇. p ∨ q
is valid.
4 RELATED PROPOSITIONS: INFERENCE LOGIC 31
Solution.The truth table is as follows.
p q p ∨ qT T TT F TF T TF F F
The first and third rows show that the argument is valid
Problem 4.7Show that the argument
p ∧ q
.̇. q
is valid.
Solution.The truth table is as follows.
p q p ∧ qT T TT F FF T FF F F
The first row shows that the argument is valid
Problem 4.8Show that the argument
p ∨ q
∼ p
.̇. q
is valid.
32 FUNDAMENTALS OF MATHEMATICAL LOGIC
Solution.The truth table is as follows.
p q ∼ p ∼ q p ∨ qT T F F TT F F T TF T T F TF F T T F
The third row shows that the argument is valid
Problem 4.9Use modus ponens or modus tollens to fill in the blanks in the argumentbelow so as to produce valid inferences.
If√
2 is rational, then√
2 = ab
for some integers a and b.
It is not true that√
2 = ab
for some integers a and b.
.̇.
Solution.If√
2 is rational, then√
2 = ab
for some integers a and b.
It is not true that√
2 = ab
for some integers a and b.
.̇.√
2 is irrational
Problem 4.10Use modus ponens or modus tollens to fill in the blanks in the argumentbelow so as to produce valid inferences.
If logic is easy, then I am a monkey’s uncle.I am not a monkey’s uncle..̇.
Solution.If logic is easy, then I am a monkey’s uncle.I am not a monkey’s uncle..̇. Logic is not easy
4 RELATED PROPOSITIONS: INFERENCE LOGIC 33
Problem 4.11Use truth table to determine whether the argument below is invalid.
p→ q
q → p
.̇. p ∧ q
Solution.The truth table is
p q p→ q q → p p ∧ qT T T T TT F F T TF T T F TF F T T F
Because of the last row, the given argument is invalid
Problem 4.12Use truth table to determine whether the argument below is valid.
p
p→ q
∼ q ∨ r
.̇. r
Solution.The truth table is
p q r p→ q ∼ q ∨ rT T T T TT T F T FT F T F TT F F F TF T T T TF T F T FF F T T TF F F T T
Because of the first row, the given argument is valid
34 FUNDAMENTALS OF MATHEMATICAL LOGIC
Problem 4.13Use symbols to write the logical form of the given argument and then use atruth table to test the argument for validity.If Tom is not on team A, then Hua is on team B.If Hua is not on team B, then Tom is on team A..̇. Tom is not on team A or Hua is not on team B.
Solution.Let
p : Tom is on team A.q : Hua is on team B.
Then the given argument is of the form
∼ p→ q
∼ q → p
.̇. ∼ p∨ ∼ q
The truth table is
p q ∼ p→ q ∼ q → p ∼ p∨ ∼ qT T T T FT F T T TF T T T TF F F F T
Because of the first row, the given argument is invalid
Problem 4.14Use symbols to write the logical form of the given argument and then use atruth table to test the argument for validity.If Jules solved this problem correctly, then Jules obtined the answer 2.Jules obtined the answer 2..̇. Jules solved this problem correctly.
Solution.Let
p : Jules solved this problem correctly.q : Jules obtained the answer 2.
4 RELATED PROPOSITIONS: INFERENCE LOGIC 35
Then the given argument is of the form
p→ q
q
.̇. p
Its truth table isp q p→ qT T TT F FF T TF F T
From the third row we see that the argument is invalid
Problem 4.15Use symbols to write the logical form of the given argument and then use atruth table to test the argument for validity.If this number is larger than 2, then its square is larger than 4.This number is not larger than 2..̇. The square of this number is not larger than 4.
Solution.Let
p : This number is larger than 2.q : The square of this number is larger than 4.
Then the given argument is of the form
p→ q
∼ p
.̇. ∼ q
Its truth table isp q p→ q ∼ p ∼ qT T T F FT F F F TF T T T FF F T T T
From the third row we see that the argument is invalid
36 FUNDAMENTALS OF MATHEMATICAL LOGIC
Problem 4.16Use the valid argument forms of this section to deduce the conclusion fromthe premises.
∼ p ∨ q → r
s∨ ∼ q
∼ t
p→ t
∼ p ∧ r →∼ s
.̇. ∼ q
Solution.
(1) p→ t premise∼ t premise
.̇. ∼ p by modus tollens(2) ∼ p by (1).̇. ∼ p ∨ q by disjunctive addition
(3) ∼ p ∨ q → r premise∼ p ∨ q by (2)
.̇. r by modus ponens(4) ∼ p by (1)
r by (3).̇. ∼ p ∧ r by conjunctive addition
(5) ∼ p ∧ r →∼ s premise∼ p ∧ r by (4)
.̇. ∼ s by modus ponens(6) s∨ ∼ q premise
∼ s by (5).̇. ∼ q by disjunctive syllogism
Problem 4.17Use the valid argument forms of this section to deduce the conclusion from
4 RELATED PROPOSITIONS: INFERENCE LOGIC 37
the premises.
∼ p→ r∧ ∼ s
t→ s
u→∼ p
∼ w
u ∨ w
.̇. ∼ t ∨ w
Solution.
(1) ∼ w premiseu ∨ w premise
.̇. u by disjunctive syllogism(2) u→∼ p premise
u by (1).̇. ∼ p by modus ponens
(3) ∼ p→ r∧ ∼ s premise∼ p by (2)
.̇. r∧ ∼ s by modus ponens(4) r∧ ∼ s by (3).̇. ∼ s by conjunctive simplification
(5) t→ s premise∼ s by (4)
.̇. ∼ t by modus tollens(6) ∼ t by (5).̇. ∼ t ∨ w by disjunctive addition
Problem 4.18Use the valid argument forms of this section to deduce the conclusion fromthe premises.
∼ (p ∨ q)→ r
∼ p
∼ r
.̇. q
38 FUNDAMENTALS OF MATHEMATICAL LOGIC
Solution.
(1) ∼ (p ∨ q)→ r Premise∼ r Premise
.̇. p ∨ q Modus tollens(2) ∼ p Premise
p ∨ q by (1).̇. q Disjunctive syllogism
Problem 4.19Use the valid argument forms of this section to deduce the conclusion fromthe premises.
p ∧ q
p→∼ (q ∧ r)
s→ r
.̇. ∼ s
Solution.
(1) p ∧ q Premise.̇. p Conjunctive simplification
(2) p ∧ q Premise.̇. q Conjunctive simplification
(3) p→∼ (q ∧ r) Premisep by (1)
.̇. ∼ (q ∧ r) Modus tonens(4) ∼ r∨ ∼ q DeMorgan′s
q by (2).̇. ∼ r Disjunctive syllogism
(5) s→ r Premise∼ r by (4)
.̇. ∼ s by Modus tollens
Problem 4.20
4 RELATED PROPOSITIONS: INFERENCE LOGIC 39
Show that
p→ q → r
∼ (q → r)
.̇. ∼ p
Solution.This follows from Modus tollens
40 FUNDAMENTALS OF MATHEMATICAL LOGIC
5 Predicates and Quantifiers
Problem 5.1By finding a counterexample, show that the proposition: “For all positiveintegers n and m,m.n ≥ m + n” is false.
Solution.Let m = n = 1. Then m.n = 1 < m + n = 2
Problem 5.2Consider the statement
∃x ∈ R such that x2 = 2.
Which of the following are equivalent ways of expressing this statement?(a) The square of each real number is 2.(b) Some real numbers have square 2.(c) The real number x has square 2.(d) If x is a real number, then x2 = 2.(e) There is at least one real number whose square is 2.
Solution.(b), (c), and (e) mean the same thing
Problem 5.3Rewrite the following propositions informally in at least two different wayswithout using the symbols ∃ and ∀ :(a) ∀ squares x, x is a rectangle.(b) ∃ a set A such that A has 16 subsets.
Solution.(a) All squares are rectangles.Every square is a rectangle.(b) There exists a set A which has 16 subsets.Some sets have 16 subsets
Problem 5.4Rewrite each of the following statements in the form “∃ x such that ”:(a) Some problems have answers.(b) Some real numbers are rational numbers.
5 PREDICATES AND QUANTIFIERS 41
Solution.(a) ∃ a problem x such that x has an answer.(b) ∃x ∈ R such that x is rational
Problem 5.5Rewrite each of the following statements in the form “∀ , if then .”:(a) All COBOL programs have at least 20 lines.(b) Any valid argument with true premises has a true conclusion.(c) The sum of any two even integers is even.(d) The product of any two odd integers is odd.
Solution.(a) ∀x, if x is a COBOL program then x has at least 20 lines.(b) ∀x, if x is a valid argument with true premises then x has a true conclu-sion.(c) ∀ integers m and n, if m and n are even then m+n is also an even integer.(d) ∀ integers m and n, if m and n are odd then m ·n is also an odd integer
Problem 5.6Which of the following is a negation for “Every polynomial function is con-tinuous”?(a) No polynomial function is continuous.(b) Some polynomial functions are discontinuous.(c) Every polynomial function fails to be continuous.(d) There is a non-continuous polynomial function.
Solution(b) and (d)
Problem 5.7Determine whether the proposed negation is correct. If it is not, write acorrect negation.Proposition : For all integers n, if n2 is even then n is even.Proposed negation : For all integer n, if n2 is even then n is not even.
Solution.Correct negation : There exists an integer n such that n2 is even and n isnot even
42 FUNDAMENTALS OF MATHEMATICAL LOGIC
Problem 5.8Let D = {−48,−14,−8, 0, 1, 3, 16, 23, 26, 32, 36}. Determine which of the fol-lowing propositions are true and which are false. Provide counterexamplesfor those propositions that are false.(a) ∀x ∈ D, if x is odd then x > 0.(b) ∀x ∈ D, if x is less than 0 then x is even.(c) ∀x ∈ D, if x is even then x ≤ 0.(d) ∀x ∈ D, if the ones digit of x is 2, then the tens digit is 3 or 4.(e) ∀x ∈ D, if the ones digit of x is 6, then the tens digit is 1 or 2.
Solution.(a) True.(b) True.(c) False. 26 is even and positive.(d) True.(e) False. A counterexample is 36
Problem 5.9Write the negation of the proposition :∀x ∈ R, if x(x + 1) > 0 then x > 0 orx < −1.
Solution.∃x ∈ R such that x(x + 1) > 0 and −1 ≤ x ≤ 0
Problem 5.10Write the negation of the proposition : If an integer is divisible by 2, then itis even.
Solution.Note that the given proposition can be written in the form: ∀n ∈ Z, if n isdivisible by 2 then n is even. The negation to this proposition is: “ ∃ aninteger n such that n is divisible by 2 and n is not even”
Problem 5.11Given the following true propostion: “∀ real numbers x, ∃ an integer n suchthat n > x.” For each x given below, find an n to make the predicate n > xtrue.(a) x = 15.83 (b) x = 108 (c) x = 101010 .
5 PREDICATES AND QUANTIFIERS 43
Solution.(a) n = 16 (b) n = 108 + 1 (c) n = 101010 + 1
Problem 5.12Given the proposition: ∀x ∈ R,∃ a real number y such that x + y = 0.(a) Rewrite this proposition in English without the use of the quantifiers.(b) Find the negation of the given proposition.
Solution.(a) For all real numbers x, there exists a real number y such that x + y = 0.(b) ∃x ∈ R, ∀y ∈ R, x + y 6= 0
Problem 5.13Given the proposition: ∃x ∈ R,∀y ∈ R, x + y = 0.(a) Rewrite this proposition in English without the use of the quantifiers.(b) Find the negation of the given proposition.
Solution.(a) There exists a real number x such that for all real numbers y we havex + y = 0.(b) For every real number x there exists a real number y such that x+y 6= 0
Problem 5.14Consider the proposition “Somebody is older than everybody.” Rewrite thisproposition in the form “∃ a person x such that ∀ .”
Solution.“∃ a person x such that ∀ persons y, x is older than y”
Problem 5.15Given the proposition: “There exists a program that gives the correct answerto every question that is posed to it.”(a) Rewrite this proposition using quantifiers and variables.(b) Find a negation for the given proposition.
Solution.(a) ∃ a program x such that ∀ question y that is posed to x the programgives a correst answer.(b) ∀ programs x, ∃ a question y for which the program gives a wrong answer
44 FUNDAMENTALS OF MATHEMATICAL LOGIC
Problem 5.16Given the proposition: ∀x ∈ R,∃y ∈ R such that x < y.(a) Write a proposition by interchanging the symbols ∀ and ∃.(b) State which is true: the given proposition, the one in part (a), neither,or both.
Solution.(a) ∃x ∈ R, ∀y ∈ R, x < y.(b) The given proposition is correct whereas the one given in a. is false
Problem 5.17Find the contrapositive, converse, and inverse of the proposition “∀x ∈ R, ifx(x + 1) > 0 then x > 0 or x < −1.”
Solution.Contrapositive: ∀x ∈ R, if −1 ≤ x ≤ 0 then x(x + 1) ≤ 0.Converse : ∀x ∈ R, if x > 0 or x < −1 then x(x + 1) > 0.Inverse : ∀x ∈ R, if x(x + 1) ≤ 0 then −1 ≤ x ≤ 0
Problem 5.18Find the truth set of the predicate P (x) : x + 2 = 2x where the domain ofdiscourse is the set of real numbers.
Solution.Solving the given equation, we find x = 2. Hence, the truth set is TP = {2}
Problem 5.19Let P (x) be the predicate x + 2 = 2x, where the domain of discourse is theset {1, 2, 3}. Which of the following statements are true?(i) ∀x, P (x) (ii) ∃x, P (x).
Solution.(i) This is false since P (2) and P (3) are false.(ii) This is true since P (1) is true
Problem 5.20Let P (x, y) be the predicate x+ y = 10 where x and y are any real numbers.Which of the following statements are true?(a) (∀x)(∃y), P (x, y).(b) (∃y)(∀x), P (x, y).
5 PREDICATES AND QUANTIFIERS 45
Solution.(a) True. If x ∈ R, then y = 10− x ∈ R and x + y = 10.(b) False. If y ∈ R and x = −y then x + y = 0 6= 10
46 FUNDAMENTALS OF MATHEMATICAL LOGIC
Fundamentals of MathematicalProofs
6 Methods of Direct Proof
A real number r is called rational if there exist two integers a and b 6= 0such that r = a
b. A real number that is not rational is called irrational.
Problem 6.1Show that there exist integers m and n such that 3m + 4n = 25.
Solution.Using a constructive proof, we find m = 3 and n = 4
Problem 6.2Show that there is a positive integer x such that x4 + 2x3 + x2− 2x− 2 = 0.Hint: Use the rational zero test.
Solution.By the rational zero test, possible rational zeros are: ±1,±2. One can easilycheck that x = 1 is a solution to the given equation
Problem 6.3Show that there exist two prime numbers whose product is 143.
Solution.Using a constructive proof, the two prime numbers are 11 and 13
Problem 6.4Show that there exists a point in the Cartesian system that is not on the liney = 2x− 3.
47
48 FUNDAMENTALS OF MATHEMATICAL PROOFS
Solution.One such a point is (1, 1)
Problem 6.5Using a constructive proof, show that the number r = 6.32152152... is arational number.
Solution.Note first that 100r = 632 + 0.152152.... Let x = 0.152152... then 1000x =152.152152... that is 1000x = 152+x and solving for x we find x = 152
999. Thus,
r = 632100
+ 15299900
= 63152099900
Problem 6.6Show that the equation x3 − 3x2 + 2x − 4 = 0 has at least one solution inthe interval (2, 3).
Solution.This follows from the Intermediate Value theorem where f(x) = x3 − 3x2 +2x − 4, a = 2, and b = 3. Note that f(2) = −4 and f(3) = 2 so thatf(2) < 0 < f(3). The IVT asserts the existence of a number 2 < c < 3 suchthat f(c) = 0. That is, c is a solution to the given equation
Problem 6.7Use a non-constructive proof to show that there exist irrational numbers a
and b such that ab is rational. Hint: Look at the number q =√
2√2. Consider
the cases q is rational or q is irrational.
Solution.
If q =√
2√2
is rational then a = b =√
2, an irrational number. If q =√
2√2
is irrational, let a =√
2√2
and b =√
2. In this case, ab = (√
2√2)√2 =
√2√2·√2
=√
22
= 2, a rational number
Problem 6.8Use the method of exhaustion to show: ∀n ∈ N, if n is even and 4 ≤ n ≤ 21then n can be written as the sum of two prime numbers.
Solution.We have
6 METHODS OF DIRECT PROOF 49
n Sum4 2+26 3 + 38 3 + 510 5 + 512 7 + 514 7 + 716 11 + 518 11 + 720 13 + 7
Problem 6.9Use the method of exhaustion to show: ∀n ∈ N, if n is prime and n < 7 then2n + 1 is prime.
Solution.We have
n 2n + 12 53 75 11
Problem 6.10Prove the following theorem: The product of two rational numbers is a ra-tional number.
Proof.Let p and q be two rational numbers. Then there exist integers a, b, c, and dwith b 6= 0, d 6= 0 and p = a
b, q = c
d. Hence, pq = ac
bd∈ Q
Problem 6.11Use the previous problem to prove the following corollary: The square of anyrational number is rational.
Proof.Let a = b in the previous theorem to find that a2 = a.a ∈ Q
Problem 6.12Use the method of constructive proof to show that if r and s are two realnumbers then there exists a real number x such that r < x < s.
50 FUNDAMENTALS OF MATHEMATICAL PROOFS
Solution.Indeed, one can easily check that x = r+s
2satisfies the inequality r < x < s
Problem 6.13Disprove the following statement by finding a counterexample: ∀x, y, z ∈ R,if x > y then xz > yz.
Solution.Let x = 5, y = 2, and z = −1. Then x > y but xz = −5 < −2 = yz
Problem 6.14Disprove the following statement by finding a counterexample: ∀x ∈ R, ifx > 0 then 1
x+2= 1
x+ 1
2.
Solution.Let x = 1. Then x > 0 and
1
x + 2=
1
36= 1
x+
1
2=
3
2
Problem 6.15Show that for any even integer n, we have (−1)n = 1.
Solution.Since n is even, there is an integer k such that n = 2k. Hence, (−1)n =(−1)2k = [(−1)2]k = 1k = 1
Problem 6.16Show that the product of two odd integers is odd.
Solution.Let n1 = 2k1 + 1 and n2 = 2k2 + 1 be two odd integers where k1 and k2 areintegers. Then
n1 · n2 = (2k1 + 1)(2k2 + 1) = 2(2k1k2 + k1 + k2) + 1 = 2k3 + 1
where k3 = 2k1k2 + k1 + k2 is an integer. Hence, n1 · n2 is odd
Problem 6.17Identify the error in the following proof:“For all positive integer n, the prod-uct (n− 1)n(n + 2) is divisible by 3 since 3(4)(5) is divisible by 3.”
6 METHODS OF DIRECT PROOF 51
Solution.Proving a general property can not be done by just showing it to be true insome special cases
Problem 6.18Identify the error in the following proof:“ If n amd m are two different oddintegers then there exists an integer k such that n = 2k+1 and m = 2k+1.”
Solution.By using the same letter k we end up having n = m which contradicts thestatement that the two integers are distinct
Problem 6.19Identify the error in the following proof:“Suppose that m and n are integerssuch that n + m is even. We want to show that n −m is even. For n + mto be even, n and m must be even. Hence, n = 2k1 and m = 2k2 so thatn−m = 2(k1 − k2) which is even.”
Solution.If the sum of two integers is even this does not mean the the integers arenecessarily even. For example, n = m = 1 are odd and n + m = 2 is even.The author here jumps to a conclusion without justification
Problem 6.20Identify the error in proving that if a product of two integers x and y isdivisible by 5 then x is divisible by 5 or y is divisible by 5:“ Since xy isdivisible by 5, there is an integer k such that xy = 5k. Hence, x = 5k1 forsome k1 or y = 5k2 for some k2. Thus, either x is divisible by 5 or y is divisibleby 5.”
Solution.We are trying to proof that x or y is divisible by 5 and this does not merelyfollow from the fact that the product is divisible by 5. Yhis is an example ofcircular reasoning fallacy
Problem 6.21Consider the system of integers where the numbers are considered as theundefined terms of the mathematical system. Examples of axioms are thearithmetic properties of addition such as commutativity, associativity, etc.
52 FUNDAMENTALS OF MATHEMATICAL PROOFS
In this system, consider the following definitions:Definition 1: “A number is even if it can be written as an integer multipleof 2.”Definition 2: “A number is odd if it can be written as 2k + 1 for someunique integer k.”Prove each of the following:(a) Lemma: The product of two odd integers is always odd.(b) Theorem: If the product of two integers m and n is even, then either mis even or n is even.(c) Corollary: If n2 is even then n is even.
Solution.(a) Suppose that m and n are odd integers. Then m = 2k1+1 and n = 2k2+1for some integers k1 and k2. Since mn = (2k1 + 1)(2k2 + 1) = 2(2k1k2 + k1 +k2) + 1 = 2k + 1, where k is the integer 2k1k2 + k1 + k1, it follows that mnis odd.(b) Suppose m and n are two integers such that mn is even. If both m andn are odd then by (a) mn is odd which is not possible since we are told thatmn is even. Hence, either m is even or n is even.(c) This follows from (b) by letting n = m
7 MORE METHODS OF PROOF 53
7 More Methods of Proof
Problem 7.1Using the method of vacuous proof, show that if n is a positive integer andn = −n then n2 = n.
Solution.If n is a positive integer then n > 0 and −n < 0. Thus, the statement n = −nis false and by the method of vacuous proof, the given implication is alwaystrue
Problem 7.2Show that for all x ∈ R, x2 + 1 < 0 implies x2 ≥ 4.
Solution.Since x2 + 1 < 0 is false for all x ∈ R, the implication is vacuously true
Problem 7.3Let x ∈ R. Show that if x2 − 2x + 5 < 0 then x2 + 1 < 0.
Solution.Since x2 − 2x + 5 = (x − 1)2 + 4 > 0, the hypothesis is false and thereforethe implication is vacuously true
Problem 7.4Use the method of trivial proof to show that if x ∈ R and x > 0 thenx2 + 1 > 0.
Solution.For all x ∈ R, we have x2 + 1 > x2 ≥ 0. Hence, x2 + 1 > 0. Note that theimplication is proved without using the hypothesis x > 0
Problem 7.5Show that if 6 is a prime number then 62 = 36.
Solution.Since the conclusion 62 = 36 is always true, the implication is trivially trueeven though the hypothesis is false
54 FUNDAMENTALS OF MATHEMATICAL PROOFS
Problem 7.6Use the method of proof by cases to prove that for any integer n the productn(n + 1) is even.
Solution.We use the method of proof by cases.
Case 1. Suppose n is even. Then there is an integer k such that n = 2k.Thus, n(n+1) = 2k(2k+1) = 2k′ where k′ = k(2k+1) ∈ Z. That is, n(n+1)is even.Case 2. Suppose that n is odd. Then there exists an integer k such thatn = 2k+1. So, n(n+1) = 2(2k+1)(k+1) = 2k′ where k′ = (2k+1)(k+1) ∈ Z.Again, n(n + 1) is even
Problem 7.7Use the method of proof by cases to prove that the square of any integer hasthe form 4k or 4k + 1 for some integer k.
Solution.We use the method of proof by cases.
Case 1. Suppose n is even. Then there is an integer m such that n = 2k1.Taking the square of n we find n2 = 4k2
1 = 4k where k = k21 ∈ Z.
Case 2. Suppose n is odd. Then there is an integer k2 such that n = 2k2 + 1.Taking the square of n we find n2 = 4k2
2 + 4k2 + 1 = 4(k22 + k2) + 1 = 4k′+ 1
where k′ = k22 + k2 ∈ Z
Problem 7.8Use the method of proof by cases to prove that for any integer n, n(n2 −1)(n + 2) is divisible by 4.
Solution.We use the method of proof by cases.
Case 1. Suppose n is even. Then there is an integer k1 such that n = 2k1 Thisimplies that n(n2−1)(n+2) = 2k1(4k
21−1)(2k1+2) = 4k1(4k
21−1)(k1+1) = 4k
where k = k1(4k21 − 1)(k1 + 1) ∈ Z. Thus, n(n2 − 1)(n + 2) is divisible by 4.
Case 2. Suppose n is odd. Then there is an integer k2 such that n = 2k2 + 1.Thus, n(n2 − 1)(n + 2) = (2k2 + 1)(4k2
2 + 4k2)(2k2 + 3) = 4k′ where k′ =(2k2 + 1)(k2
2 + k2)(2k2 + 3) ∈ Z. Thus, n(n2 − 1)(n + 2) is divisible by 4
7 MORE METHODS OF PROOF 55
Problem 7.9State a necessary and sufficient condition for the floor function of a realnumber to equal that number.
Solution.Theorem. bxc = x if and only if x ∈ Z.
Proof. Suppose that bxc = x. From the definition of the floor function,x ∈ Z. Conversely, if x ∈ Z then x is the largest integer less than or equal tox. That is, bxc = x
Problem 7.10Prove that if n is an even integer then dn
2e = n
2.
Solution.If n is an even integer then there is an integer k such that n = 2k. In thiscase,
dn2e = dke = k =
n
2
Problem 7.11Show that the equality bx− yc = bxc − byc is not valid for all real numbersx and y.
Solution.As a counterexample, let x = 0 and y = −1
2. Then
bx− yc = b12c = 0
whereas
bxc − byc = −b−1
2c = −(−1) = 1
Problem 7.12Show that the equality dx + ye = dxe+ dye is not valid for all real numbersx and y.
Solution.As a counterexample, let x = y = 1
2. Then
dx + ye = d1e = 1
whereasdxe+ dye = 2
56 FUNDAMENTALS OF MATHEMATICAL PROOFS
Problem 7.13Prove that for all real numbers x and all integers m, dx + me = dxe+ m.
Solution.Suppose that x ∈ R and m ∈ Z. Let n = dxe. By definition of ceil function,n ∈ Z and
n− 1 < x ≤ n.
Add m to all sides to obtain
(n + m)− 1 < x + m ≤ n + m.
Since n + m ∈ Z, we find
dx + me = n + m = dxe+ m
Problem 7.14Show that if n is an odd integer then dn
2e = n+1
2.
Solution.Let n be an odd integer. Then there is an integer k such that n = 2k − 1.Hence, n
2= k − 1
2. By the previous problem
dn2e = dk − 1
2e = k + d−1
2e = k =
n + 1
2
Problem 7.15Prove that all of the following statements are equivalent:(i) x2 − 4 = 0.(ii) (x− 2)(x + 2) = 0.(iii) x = −2 or x = 2.
Solution.(i) =⇒ (ii): Suppose that x2 − 4 = 0. Then x2 − 2x + 2x − 4 = 0. Thus,x(x− 2) + 2(x− 2) = . Hence, (x− 2)(x + 2) = 0.(ii) =⇒ (iii): If (x− 2)(x + 2) = 0 then by the zero product property eitherx− 2 = 0 or x + 2 = 0. That is, either x = −2 or x = 2.(iii) =⇒ (i): Suppose x = −2 or x = 2. Then x + 2 = 0 or x− 2 = 0. Hence,(x− 2)(x + 2) = 0. Expanding on the left, we find x2 − 4 = 0
7 MORE METHODS OF PROOF 57
Problem 7.16Let x and y be two real numbers. Show that all the following are equivalent:(a) x < y (b) x+y
2> x (c) x+y
2< y.
Solution.(a) =⇒ (b): Suppose x < y. Then 2x = x + x < x + y. Hence, x+y
2> x.
(b) =⇒ (c): Suppose x+y2
> x. Then x + y > 2x and this implies x < y.Hence, x + y < y + y = 2y. Dividing through by 2, we find x+y
2< y.
(c) =⇒ (a): Suppose x+y2
< y. Then x + y < 2y. Subtracting y from bothsides, we find x < y
Problem 7.17Show that all the following are equivalent:(a) x2 − 5x + 6 = 0.(b) (x− 2)(x− 3) = 0.(c) x− 2 = 0 or x− 3 = 0.(d) x = 2 or x = 3.
Solution.(a) =⇒ (b): Suppose x2−5x+6 = 0. This can be written as x2−2x−3x+6 = 0or x(x− 2)− 3(x− 2) = 0. Hence, (x− 2)(x− 3) = 0.(b) =⇒ (c): Suppose (x − 2)(x − 3) = 0. By the zero product property,x− 2 = 0 or x− 3 = 0.(c) =⇒ (d): Suppose x− 2 = 0 or x− 3 = 2. Adding 2 to the first equationyields x = 2. Adding 3 to the second equation yields x = 3.(d) =⇒ (a): Suppose x = 2 or x = 3. Then (x − 2)(x − 3) = 0. Expandingthe righthand side to obtain x2 − 5x + 6 = 0
Problem 7.18Use the method of proof by cases to show that for all x ∈ R, we have−5 ≤ |x + 2| − |x− 3| ≤ 5.
Solution.Note that |x + 2| = x + 2 in [−2,∞) and |x + 2| = −(x + 2) in (−∞,−2).Likewise, |x− 3| = x− 3 in [3,∞) and |x− 3| = −(x− 3) in (−∞, 3).Case 1. x < −2.We have |x + 2| − |x − 3| = −(x + 2) − [−(x − 3)] − x − 2 + x − 3 = −5.Hence, −5 ≤ |x + 2| − |x− 3| ≤ 5 is true.Case 2. −2 ≤ x < 3.
58 FUNDAMENTALS OF MATHEMATICAL PROOFS
We have |x + 2| = x + 2 and |x + 3| = −(x + 3). Thus, |x + 2| − |x − 3| =x + 2 − [−(x − 3)] = x + 2 + x − 3 = 2x − 1. From −2 ≤ x < 3, we have−4 ≤ 2x < 6 and −5 ≤ 2x− 1 < 5. Hence, −5 ≤ |x+ 2|− |x− 3| ≤ 5 is true.Case 3. x ≥ 3.We have |x + 2| = x + 2 and |x − 3| = x − 3. Hence, |x + 2| − |x − 3| =x + 2− x + 3 = 5. Therefore, −5 ≤ |x + 2| − |x− 3| ≤ 5 is true
Problem 7.19Use the method of proof by cases to show that
∣∣ab
∣∣ = |a||b| for all a, b ∈ R with
b 6= 0.
Solution.Case 1: a ≥ 0 and b > 0. Then a
b≥ 0. In this case, |a| = a, |b| = b, and∣∣a
b
∣∣ = ab
= |a||b| .
Case 2: a ≥ 0 and b < 0. Then ab≤ 0. In this case, |a| = a, |b| = −b, and∣∣a
b
∣∣ = −ab
= a−b = |a|
|b| .
Case 3: a < 0 and b > 0. Then ab< 0. In this case, |a| = −a, |b| = b, and∣∣a
b
∣∣ = −ab
= −ab
= |a||b| .
Case 4: a < 0 and b < 0. Then ab> 0. In this case, |a| = −a, |b| = −b, and∣∣a
b
∣∣ = ab
= −a−b = |a|
|b|
Problem 7.20Using truth tables, show that (p↔ q)∧ (q ↔ r)∧ (r ↔ p) ≡ (p→ q)∧ (q →r) ∧ (r → p).
Solution.We have
p q r p↔ q q ↔ r p↔ r (p↔ q) ∧ (q ↔ r) ∧ (r ↔ p)T T T T T T TT T F T F F FT F T F F T FT F F F T F FF T T F T F FF T F F F T FF F T T F F FF F F T T T T
and
7 MORE METHODS OF PROOF 59
p q r p→ q q → r r → p (p→ q) ∧ (q → r) ∧ (r → p)T T T T T T TT T F T F T FT F T F T T FT F F F T T FF T T T T F FF T F T F T FF F T T T F FF F F T T T T
60 FUNDAMENTALS OF MATHEMATICAL PROOFS
8 Methods of Indirect Proofs: Contradiction
and Contraposition
Problem 8.1Use the proof by contradiction to prove the proposition “There is no greatesteven integer.”
Solution.Suppose the contrary. That is, suppose there is a greatest even integer N.Then for any even integer n we have N ≥ n. Define the number M := N + 2.Since the sum of two even integers is again an even integer, M is even.Moreover, M > N. This contradicts the supposition that N is the largesteven integer. Hence, there in no greatest even integer
Problem 8.2Prove by contradiction that the difference of any rational number and anyirrational number is irrational.
Solution.Suppose the contrary. That is, suppose there exist a rational number x andan irrational number y such that x − y is rational. By the definition ofrational numbers, there exist integers a, b, c, and d with b 6= 0 and d 6= 0 suchthat x = a
band x− y = c
d. Thus,
a
b− y =
c
d.
Solving for y we find
y =ad− bc
bd=
p
q
where p = ad − bc ∈ Z and q = bd ∈ Z and q 6= 0. This contradicts theassumption that y is irrational
Problem 8.3Use the proof by contraposition to show that if a product of two positive realnumbers is greater than 100, then at least one of the numbers is greater than10.
8 METHODS OF INDIRECT PROOFS: CONTRADICTION AND CONTRAPOSITION61
Solution.We must prove by the method of contraposition the implication “if x and yare positive real numbers such that xy > 100 then either x > 10 or y > 10.Instead, we will show that if x ≤ 10 and y ≤ 10 then xy ≤ 100. Indeed,if 0 < x ≤ 10 and 0 < y ≤ 10 then by the algebra of inequalities we havexy ≤ 100
Problem 8.4Use the proof by contradiction to show that the product of any nonzerorational number and any irrational number is irrational.
Solution.Suppose the contrary. That is, suppose there exist a rational number x and anirrational number y such that xy ∈ Q. By the definition of rational numbersthere exist integers a, b 6= 0, c, and d 6= 0 such that x = a
band xy = c
d. Since
x 6= 0, it has a multiplicative inverse, that is we can multiply both side ofthe equality xy = c
dby b
ato obtain y = bc
ad= p
qwhere p = bc ∈ Z and
q = ad ∈ Z− {0}. This shows that y ∈ Q which contradcits the assumptionthat y is irrational
Problem 8.5Show that if n is an integer and n2 is divisible by 3 then n is also divisibleby 3.
Solution.Suppose not. That is, suppose that n is not divisible by 3. Then eithern = 3k + 1 or n = 3m + 2 for some integers k and m. If n = 3k + 1then n2 = 9k2 + 6k + 1 = 3(3k2 + 2k) + 1 = 3k′ + 1. This means thatn2 is not divisible by 3, a contradiction. Likewise, if n = 3m + 2 thenn2 = 9m2 + 12m + 4 = 3(3m2 + 4m + 1) + 1 = 3m′ + 1. Again, this meansthat n2 is not divisible by 3, a contradiction. We conclude that n must bedivisible by 3
Problem 8.6Show that the number
√3 is irrational.
Proof.Suppose not. That is, suppose that
√3 is rational. Then there exist two
integers m and n with no common divisors such that√
3 = mn. Squaring
62 FUNDAMENTALS OF MATHEMATICAL PROOFS
both sides of this equality we find that 3n2 = m2. Thus, m2 is divisible by3. By the previous problem, m is divisible by 3. But then m = 3k for someinteger k. Taking the square we find that 3n2 = m2 = 9k2, that is n2 = 3k2.This says that n2 is divisible by 3 and so n is divisible by 3. We concludethat 3 divides both m and n and this contradicts our assumption that m andn have no common divisors. Hence,
√3 must be irrational
Problem 8.7Use the proof by contrapositive to show that if n and m are two integers forwhich n + m is even then either both n and m are even or both are odd.
Proof.Suppose that n is even and m is odd. Then n = 2k and m = 2k′ + 1. Thus,n + m = 2k + 2k′ + 1 = 2(k + k′) + 1 = 2k′′ + 1. That is, m + n is odd
Problem 8.8Use the proof by contrapositive to show that for any integer n, if 3n + 1 iseven then n is odd.
Proof.Suppose that n is even. Then n = 2k for some integer k. Then 3n + 1 =6k + 1 = 2(3k) + 1 = 2k′ + 1. That is, 3n + 1 is odd
Problem 8.9Use the proof by contradiction to show that there are no positive integers nand m such that n2 −m2 = 2.
Proof.Suppose the contrary. Then (n−m)(n+m) = 2 implies one the two systemsof equations {
n−m = 2n + m = 1
or {n−m = 1n + m = 2.
Solving the first system we find n = 32
and m = −12, contradicting our
assumption that n and m are positive integers. Likewise, solving the secondsystem, we find n = 3
2and m = 1
2which again contradicts our assumption
8 METHODS OF INDIRECT PROOFS: CONTRADICTION AND CONTRAPOSITION63
Problem 8.10Use the proof by contradiction to show that for any integers n and m, wehave n2 − 4m 6= 2.
Proof.Suppose the contrary. Let n and m be integers such that n2 − 4m = 2. Thisimplies that n2 = 4m + 2 = 2(2m + 1) = 2k. That is, n2 is even. Hence,n is also even. Thus, n = 2b for some integer b. In this case, n2 − 4m =4b2− 4m = 2 and this implies 2b2− 2m = 1. The lefthand side is even whereas the righthand side is odd, a contradiction
Problem 8.11Prove by contrapositive: If n is a positive integer such that the remainder ofthe division of n by 3 is 2 then n is not a perfect square.
Proof.Suppose that n is a perfect square. Then n = k2 for some k ∈ Z.• If the remainder of the division of k by 3 is 0 then k = 3m1 and n = 9m2
1 =4(4m2
1) so that the remainder of the division of n by 3 is 0.• If the remainder of the division of k by 3 is 1 then k = 3m2 + 1 andn = 3(3m2
2 + 2m2) + 1 so that the remainder of the division of n by 3 is 1.• If the remainder of the division of k by 3 is 2 then k = 3m3 + 2 andn = 3(3m2
3 + 2m3 + 1) + 1 so that the remainder of the division of n by 4 is1
Problem 8.12Prove by contrapositive: Suppose that a, b ∈ Z. If a · b is not divisible by 5then both a and b are not divisible by 5.
Proof.Suppose that either a or b is divisible by 5. Let’s say that a is divisible by 5.Then a = 5m for some m ∈ Z. Hence, ab = 5(mb) and mb ∈ Z. This saysthat a · b is divisible by 5. Likewise, if we assume that b is divisible by 5 thenb = 5n for some n ∈ Z. Hence, ab = 5(na) and na ∈ Z. This says that a · bis divisible by 5
Problem 8.13Prove by contradiction: Suppose that n ∈ Z. If n3 + 5 is odd then n is even.
64 FUNDAMENTALS OF MATHEMATICAL PROOFS
Proof.Suppose that n is odd. Then n = 2k + 1 for some integer k. Hence, n3 + 5 =8k3 + 12k + 6k2 + 1 + 5 = 2(4k3 + 3k2 + 6k + 3) = 2k′ where k′ = 4k3 +3k2 + 6k+ 3 ∈ Z. Hence, n3 + 5 is even. This contradicts the hypothesis thatn3 + 5 is odd. Hence, n must be even
Problem 8.14Prove by contradiction: There exist no integers a and b such that 18a+6b = 1.
Proof.Suppose the contrary. That is, there exist integers a and b such that 18a +6b = 1. Dividing through by 6, we obtain 3a+ b = 1
6. This shows that 3a+ b
is not an integer. But 3a+ b is an integer since a and b are. Hence, we reacha contradiction. We conclude that the equation 18a + 6b = 1 has no integersolutions
Problem 8.15Prove by contrapositive: If a and b are two integers such that a · b is notdivisible by n then a and b are not divisible by n.
Proof.Suppose that either a or b is divisible by n. Let’s say a is divisible by n. Thena = nk for some integer k. Hence, ab = n(ak) = nk′ where k′ = ak ∈ Z. Thissays that ab is divisible by n
Problem 8.16Prove by contradiction: Suppose that a, b, and c are positive real numbers.Show that if ab = c then a ≤
√c or b ≤
√c.
Proof.Suppose that a >
√c and b >
√c. Mulitplying the two inequalities, we find
ab > c. This contradicts the hypothesis that ab = c
Problem 8.17Prove by contrapositive: Let n ∈ Z. If n2 − 6n + 5 is even then n is odd.
Proof.Suppose that n is even. Then there exists an integer k such that n = 2k. Inthis case, n2− 6n+ 5 = 4k2− 12k + 5 = 2(2k2− 6k + 2) + 1 = 2k′+ 1, wherek′ = 2k2 − 6k + 2 ∈ Z. Hence, n2 − 6n + z is odd
8 METHODS OF INDIRECT PROOFS: CONTRADICTION AND CONTRAPOSITION65
Problem 8.18Prove by contradiction: There is no largest even integer.
Proof.Suppose not. That is, suppose that there were a largest even integer. Lets callit k. Then k = 2n for some integer n. In this case, k+ 2 = 2n+ 2 = 2(n+ 1).Hence, n+2 is an even integer and k+2 > k, a contradiction to the hypothesisthat k is the largest even integer
Problem 8.19Prove by contrapositive: Let a, b ∈ Z. If a + b ≥ 15 then a ≥ 8 or b ≥ 8.
Proof.Suppose that a < 8 and b < 8. Since a and b are integers, we have a ≤ 7 andb ≤ 7. Hence, a + b ≤ 14 < 15
Problem 8.20Prove by contradiction: Let a ∈ Z. If p is a prime number that divides athen p does not divide a + 1.
Proof.Suppose the contrary. That is, suppose that p divides a+1. Then a+1 = pmfor some integer m. Since p divides a, we have a = pn for some integer n.Thus, p(m−n) = a+ 1− a = 1. This shows that p divides 1, a contradictionsince p is a prime number
66 FUNDAMENTALS OF MATHEMATICAL PROOFS
9 Method of Proof by Induction
Problem 9.1Use the method of induction to show that
2 + 4 + 6 + · · ·+ 2n = n2 + n
for all integers n ≥ 1.
Solution.Let P (n) = 2 + 4 + 6 + · · · + 2n. We will show that P (n) = n2 + n for alln ≥ 1 by the method of mathematical induction.(i) (Basis of induction) P (1) = 2 = 12 + 1. So P (n) holds for n = 1.(ii) (Induction hypothesis) Assume P (k) is true for 1 ≤ k ≤ n.(iii) (Induction step) We must show that P (n+1) = (n+1)2 +n+1. Indeed,
P (n + 1) = 2 + 4 + · · ·+ 2n + 2(n + 1)= P (n) + 2(n + 1)= n2 + n + 2n + 2= n2 + 2n + 1 + (n + 1)= (n + 1)2 + (n + 1)
Problem 9.2Use mathematical induction to prove that
1 + 2 + 22 + · · ·+ 2n = 2n+1 − 1
for all integers n ≥ 0.
Solution.Let P (n) = 1 + 2 + 22 + · · ·+ 2n. We will show, by induction on n ≥ 0 thatP (n) = 2n+1 − 1.(i) (Basis of induction) P (0) = 1 = 20+1 − 1. That is, P (1)is true.(ii) (Induction hypothesis) Assume P (k) is true for 1 ≤ k ≤ n.(iii) (Induction step) We must show that P (n + 1) = 2n+2 − 1. Indeed,
P (n + 1) = 1 + 2 + · · ·+ 2n + 2n+1
= P (n) + 2n+1
= 2n+1 − 1 + 2n+1
= 2.2n+1 − 1= 2n+2 − 1
9 METHOD OF PROOF BY INDUCTION 67
Problem 9.3Use mathematical induction to show that
12 + 22 + · · ·+ n2 =n(n + 1)(2n + 1)
6
for all integers n ≥ 1.
Solution.Let P (n) = 12 + 22 + · · ·+ n2. We will show by mathematical induction that
P (n) = n(n+1)(2n+1)6
for all integers n ≥ 1.
(i) (Basis of induction) P (1) = 1 = 1(1+1)(2+1)6
. That is, P (1)is true.(ii) (Induction hypothesis) Assume P (k) is true for 1 ≤ k ≤ n.
(iii) (Induction step) We must show that P (n + 1) = n(n+1)(2n+1)6
. Indeed,
P (n + 1) = 12 + 22 + · · ·+ (n + 1)2
= P (n) + (n + 1)2
= n(n+1)(2n+1)6
+ (n + 1)2
= (n+1)(n+2)(2n+3)6
Problem 9.4Use mathematical induction to show that
13 + 23 + · · ·+ n3 = (n(n + 1)
2)2
for all integers n ≥ 1.
Solution.Let P (n) = 13 + 23 + · · ·+ n3. We will show by mathematical induction that
P (n) = (n(n+1)2
)2 for all integers n ≥ 1.
(i) (Basis of induction) P (1) = 1 = (1(1+1)2
)2. That is, P (1)is true.(ii) (Induction hypothesis) Assume P (k) is true for 1 ≤ k ≤ n.
(iii) (Induction step) We must show that P (n + 1) = ( (n+1)(n+2)2
)2. Indeed,
P (n + 1) = 13 + 23 + · · ·+ (n + 1)3
= P (n) + (n + 1)3
= (n(n+1)2
)2 + (n + 1)3
= ( (n+1)(n+2)2
)2
68 FUNDAMENTALS OF MATHEMATICAL PROOFS
Problem 9.5Use mathematical induction to show that
1
1 · 2+
1
2 · 3+ · · ·+ 1
n(n + 1)=
n
n + 1
for all integers n ≥ 1.
Solution.Let P (n) = 1
1·2 + 12·3 + · · ·+ 1
n(n+1). We will show by mathematical induction
that P (n) = nn+1
for all integers n ≥ 1.
(i) (Basis of induction) P (1) = 11·2 = 1
1+1. That is, P (1)is true.
(ii) (Induction hypothesis) Assume P (k) is true for 1 ≤ k ≤ n.(iii) (Induction step) We must show that P (n + 1) = n+1
n+2. Indeed,
P (n + 1) = 11·2 + 1
2·3 + · · ·+ 1n(n+1)
+ 1(n+1)(n+2)
= P (n) + 1(n+1)(n+2)
= nn+1
+ 1(n+1)(n+2)
= n(n+2)+1(n+1)(n+2)
= (n+1)2
(n+1)(n+2)
= n+1n+2
Problem 9.6Use the formula
1 + 2 + · · ·+ n =n(n + 1)
2to find the value of the sum
3 + 4 + · · ·+ 1, 000.
Solution.Indeed,
3 + 4 + · · ·+ 1, 000 = (1 + 2 + · · ·+ 1, 000)− 3
= 1,000(1,000+1)2
− 3= 500, 497
Problem 9.7Find the value of the geometric sum
1 +1
2+
1
22+ · · ·+ 1
2n
9 METHOD OF PROOF BY INDUCTION 69
Solution.Indeed,
1 + 12
+ 122
+ · · ·+ 12n
=1−( 1
2)n+1
1− 12
= 2− 12n
Problem 9.8Let S(n) =
∑ni=1
i(i+1)!
. Evaluate S(1), S(2), S(3), S(4), and S(5). Make aconjecture about a formula for this sum for general n, and prove your con-jecture by mathematical induction.
Solution.By substitution we find S(1) = 1
2, S(2) = 5
6, S(3) = 23
24, S(4) = 119
120, S(5) =
719720
. We claim that P (n) : S(n) = 1 − 1(n+1)!
. We will prove this formula byinduction on n ≥ 1.(i) (Basis of induction) S(1) = 1
1·2 = 1− 1(1+1)!
. That is, P (1)is true.
(ii) (Induction hypothesis) Assume P (k) is true for 1 ≤ k ≤ n.(iii) (Induction step) We must show that P (n + 1) : S(n + 1) = 1 − 1
(n+2)!.
Indeed,
n+1∑i=1
i
i(i + 1)!=
n∑i=1
i
i(i + 1)!+
n + 1
(n + 2)!
=1− 1
(n + 1)!+
n + 1
(n + 1)!(n + 2)
=1− (n + 2− n− 1
(n + 2)(n + 1)!
=1− 1
(n + 2)!
Problem 9.9For each positive integer n let P (n) be the proposition 4n−1 is divisible by 3.
(a) Write P (1). Is P (1) true?(b) Write P (k).(c) Write P (k + 1).(d) In a proof by mathematical induction that this divisibility property holdsfor all integers n ≥ 1, what must be shown in the induction step?
70 FUNDAMENTALS OF MATHEMATICAL PROOFS
Solution.(a) P (1) : 41 − 1 is divisible by 3. P (1) is true.(b) P (k) : 4k − 1 is divisible by 3.(c) P (k + 1) : 4k+1 − 1 is divisible by 3.(d) We must show that if 4k− 1 is divisible by 3 then 4k+1− 1 is divisible by3
Problem 9.10For each positive integer n let P (n) be the proposition 23n− 1 is divisible by7. Prove this property by mathematical induction.
Solution.(i) (Basis of induction) P (1) : 23 − 1. P (1)is true since 7 is divisible by 7.(ii) (Induction hypothesis) Assume P (k) is true for 1 ≤ k ≤ n.(iii) (Induction step) We must show that P (n+ 1) is true. That is, 23n+3− 1is divisible by 7. Indeed,
23n+3 − 1 = (1 + 7) · 23n − 1= 23n − 1 + 7 · 23n
Since 7|(23n − 1) and 7|7 · 23n, we find 7 divides the sum. that is, 7 divides23n+3 − 1
Problem 9.11Show that 2n < (n + 2)! for all integers n ≥ 0.
Solution.Let P (n) = (n + 2)! − 2n. We use mathematical induction to show thatP (n) > 0 for all n ≥ 0.(i) (Basis of induction) P (0) = 2!− 1 = 1 > 0 so that P (1) is true.(ii) (Induction hypothesis) Assume P (k) is true for 1 ≤ k ≤ n.(iii) (Induction step) We must show that P (n + 1) = (n + 3)! − 2n+1 > 0.Indeed,
P (n + 1) = (n + 3)!− 2n+1
= (n + 3)(n + 2)!− 2n+1
≥ 2(n + 2)!− 2 · 2n
= 2((n + 2)!− 2n)> 0
9 METHOD OF PROOF BY INDUCTION 71
Problem 9.12(a) Use mathematical induction to show that n3 > 2n + 1 for all integersn ≥ 2.(b) Use mathematical induction to show that n! > n2 for all integers n ≥ 4.
Solution.(a) Let P (n) = n3 − 2n− 1. We want to show that P (n) > 0 for all integersn ≥ 2.(i) (Basis of induction) P (2) = 23 − 4− 1 = 3 > 0 so that P (1) is true.(ii) (Induction hypothesis) Assume P (k) is true for 1 ≤ k ≤ n.(iii) (Induction step) We must show that P (n + 1) > 0. Indeed,
P (n + 1) = (n + 1)3 − 2(n + 1)− 1= n3 + 3n2 + 3n + 1− 2n− 3= n3 − 2n− 1 + 3n2 + 3n− 1> 3n2 + 3n− 1> 0
note that for n ≥ 2, 3n2 + 3n− 1 ≥ 15
(b) Let P (n) = n! − n2. We want to show that P (n) > 0 for all integersn ≥ 4.(i) (Basis of induction) P (4) = 4!− 42 = 8 > 0 so that P (1) is true.(ii) (Induction hypothesis) Assume P (k) is true for 1 ≤ k ≤ n.(iii) (Induction step) We must show that P (n + 1) > 0. Indeed,
P (n + 1) = (n + 1)!− (n + 1)2
= (n + 1)n!− n2 − 2n− 1> n!− n2 + nn!− 2n− 1> nn!− 2n− 1= n(n!− 2)− 1> 0
note that for n ≥ 4, n! ≥ 24 so that n(n!− 2)− 1 ≥ 87
Problem 9.13A sequence a1, a2, · · · is defined by a1 = 3 and an = 7an−1 for n ≥ 2. Showthat an = 3 · 7n−1 for all integers n ≥ 1.
72 FUNDAMENTALS OF MATHEMATICAL PROOFS
Solution.Listing the first few terms of the sequence we find, a1 = 3 = 3 · 71−1, a2 =3 · 72−1, etc. We will use induction on n ≥ 1 to show that the formula for anis valid for all n ≥ 1.(i) (Basis of induction) a1 = 3 = 3 ·71−1 so that the formula is true for n = 1.(ii) (Induction hypothesis) Assume that ak = 3 · 7k−1 for 1 ≤ k ≤ n.(iii) (Induction step) We must show that an+1 = 3 · 7n.
an+1 = 7an= 7 · 3 · 7n−1
= 3 · 7n
Problem 9.14Show by using mathematical induction: For all integers n ≥ 1, 22n − 1 isdivisible by 3.
Solution.Let P (n) : 22n − 1 is divisible by 3. Then(i) (Basis of induction) P (1) is true since 3 is divisible by 3.(ii) (Induction hypothesis) Assume P (k) is true for 1 ≤ k ≤ n.(iii) (Induction step) We must show that 22n+2 − 1 is divisible by 3. Indeed,
22n+2 − 1 =22n(4)− 1
=22n(3 + 1)− 1
=22n · 3 + (22n − 1)
=22n · 3 + P (n)
=3(22n + m)
where we used the induction hypothesis that 3|(22n−1). That is, 22n−1 = 3mfor some integer m. Since 22n+k is an integer, we conclude that 3|(22n+1−1)
Problem 9.15Define the following sequence of numbers: a1 = 2 and for n ≥ 2, an = 5an−1.Find a formula for an and then prove its validity by mathematical induction.
Solution.Listing the first few terms we find, a1 = 2, a2 = 5a1 = 5(2), a3 = 5a2 =52(2), a4 = 5a3 = 53(2). Thus, an = 2(5n−1). We will show that P (n) : an =
9 METHOD OF PROOF BY INDUCTION 73
2(5n−1) is valid for all n ≥ 1 by the method of mathematical induction.(i) (Basis of induction) a1 = 2 = 2(51−1). That is, P (1) is true.(ii) (Induction hypothesis) Assume P (k) is true for 1 ≤ k ≤ n.(iii) (Induction step) We must show that an+1 = 2(5n). Indeed,
an+1 =5an
=5[2(5n−1)]
=2(5n)
Problem 9.16Prove by mathematical induction that n3+5n is divisible by 3 for all positiveinteger n.
Solution.Let P (n) : n3 + 5n is divisible by 3. We use mathematical induction.(i) (Basis of induction) P (1) is true since 6 is divisible by 3.(ii) (Induction hypothesis) Assume P (n) is true for 1 ≤ k ≤ n.(iii) (Induction step) We must show that P (n+1) is true. That is, (n+1)3 +5(n + 1) is divisible by 3. Indeed, we have
(n + 1)3 + 5(n + 1) = (n3 + 5n) + 3n2 + 3n + 6 = (n3 + 5n) + 3(n2 + n + 2).
By the induction hypothesis, n3 + 5n is divisible by 3 so that n3 + 5n = 3k,where k ∈ N. Hence, (n + 1)3 + 5(n + 1) = 3(k + n2 + n + 2) = 3k′. That is,n3 + 5n is divisible by 3
Problem 9.17Use mathematical induction to show that the sum of the first n odd positiveintegers is equal to n2.
Solution.Let P (n) : 1 + 3 + · · ·+ 2(n− 1) + 1 for n ≥ 1 represent the sum of the firstn odd positive integers. We use mathematical induction.(i) (Basis of induction) P (1) is true since 1 = 12.(ii) (Induction hypothesis) Assume P (k) is true for 1 ≤ k ≤ n.(iii) (Induction step) We want to show that P (n + 1) is also true. That is,the sum of the first n + 1 odd positive integers is (n + 1)2. Indeed, the sumof the first n + 1 odd positive integers is
1 + 3 + 5 + · · ·+ 2(n− 1) + 1 + 2n + 1 =[1 + 3 + 5 + · · ·+ 2(n− 1) + 1] + 2n + 1
=n2 + 2n + 1 = (n + 1)2
74 FUNDAMENTALS OF MATHEMATICAL PROOFS
Problem 9.18Use mathematical induction to show that 23n − 1 is divisible by 11 for allpositive integer n.
Solution.Let P (n) : 23n − 1 is divisible by 11. We use mathematical induction.(i) (Basis of induction) P (1) is true since 231 − 1 = 22 is divisible by 11.(ii) (Induction hypothesis) Assume P (k) is true for 1 ≤ k ≤ n.(iii) (Induction step) We want to show that P (n+1) is true. That is, 23n+1−1is divisible by 11. Indeed,
23n+1 − 1 =23 · 23n − 1 = (22 + 1) · 23n − 1
=22 · 23n + (23n − 1)
=11 · 2 · 23n + (23n − 1).
Since both 11 · 2 · 23n and 23n − 1 are divisible by 11, their sum 23n+1 − 1 isalso divisible by 11
Problem 9.19Define the following sequence of numbers: a1 = 1, a2 = 8 and for n ≥ 3,an = an−1 + 2an−2. Use induction to show that an = 3 · 2n−1 + 2(−1)n for allpositive integers n.
Solution.Let P (n) : an = 3 ·2n−1 + 2(−1)n. We use mathematical induction as follows.(i) (Basis of induction) P (1) is true since a1 = 1 = 3 · 21−1 + 2(−1)1.(ii) (Induction hypothesis) Assume P (k) is true for 1 ≤ k ≤ n.(iii) (Induction step) We want to show that P (n+1) is true. That is, an+1 =3 · 2n + 2(−1)n+1. Indeed, we have
an+1 =an + 2an−1
=3 · 2n−1 + 2(−1)n + 2[3 · 2n−2 + 2(−1)n−1]
=3 · (2n−1 + 2n−1) + 2[(−1)n + 2(−1)n−1]
=3 · 2n + 2[(−1)n − 2(−1)n]
=3 · 2n + 2(−1)n+1
Problem 9.20Consider the sequence of real numbers defined by the relations a1 = 1 andan+1 =
√1 + 2an for all n ≥ 1. Use mathematical induction to show that
an < 4 for all n ≥ 1.
9 METHOD OF PROOF BY INDUCTION 75
Solution.Let P (n) : an < 4. We use mathematical induction as follows.(i) (Basis of induction) P (1) is true since a1 = 1 < 4.(ii) (Induction hypothesis) Assume P (k) is true for 1 ≤ k ≤ n.(iii) (Induction step) We want to show that P (n+1) is true. That is, an+1 < 4.Indeed, we have
an+1 =√
1 + 2an <√
1 + 2(4) =√
9 = 3 < 4
76 FUNDAMENTALS OF MATHEMATICAL PROOFS
Number Theory andMathematical Proofs
10 Divisibility. The Division Algorithm
Problem 10.1Show that the set of all positive real numbers does not have a least element.
Solution.Let R+ denote the set of all positive real numbers. If x ∈ R+ then x
2∈
R+ and x2< x. Thus, R+ does not have a least element
Problem 10.2Use the well-ordering principle to show that every positive integer n ≥ 8 canbe written as sums of 3’s and 5’s.
Solution.Let S be the set of positive integers n ≥ 8 that cannot be written as sumsof 3’s and 5’s. We must show that S is the empty set. Suppose the contrary.Then by Theorem 10.1, S has a smallest element m ∈ S. Since 8 = 3 + 5, 9 =3 + 3 + 3 and 10 = 5 + 5, we must have m ≥ 11. This implies that m− 3 ≥ 8.If m−3 can be written as sums of 3’s and 5’s so does m which is not possiblesince m ∈ S. Hence, m−3 ∈ S and m−3 < m. This contradicts the definitionof m. Hence, we must have S = ∅
Problem 10.3Let a and b be positive integers such that a
b=√
2. Let S = {n ∈ N :√
2n ∈N}. Show that S is the empty set. Hence, concluding that
√2 is irrational.
77
78 NUMBER THEORY AND MATHEMATICAL PROOFS
Solution.Since a ∈ S, S is non-empty subset of N and so by Theorem 10.1, S has asmallest element m. In this case, c =
√2m for some positive integer c. Note
that c > m since√
2 > 1. Hence, c2 = 2m2 so that c2 is even and hencec is even. Thus, c = 2kwith k ∈ N and k < c < m. Hence, 4k2 = 2m2
or m2 = 2k2. Hence, m =√
2k. It follows that k ∈ S with k < m. Thiscontradicts the definition of m. We conclude that S is empty
Problem 10.4Let n and m be integers such that n|m where n 6= 0. Show that n|(−m).
Solution.Since n|m, we have m = nq for some q ∈ Z. Thus, −m = (n)(−q) and hencen|(−m)
Problem 10.5Let n, a and b be integers such that n|a and n|b where n 6= 0. Show thatn|(a± b).
Solution.Suppose that n|a and n|b. Then a = nq and b = nq′ for some q, q′ ∈ Z. Thus,a± b = n(q ± q′). Hence, n|(a± b)
Problem 10.6Let n,m and p be integers such that n|m and m|p where n,m 6= 0. Showthat n|p.
Solution.Suppose that n|m and m|p. Then m = nq and p = mq′ for some q, q′ ∈ Z.Thus, p = n(qq′). Since qq′ ∈ Z then n|p
Problem 10.7Let n and m be integers such that n|m and m|n where n,m 6= 0. Show thateither n = m or n = −m.
Solution.If n|m and m|n then m = nq and n = mq′ for some q, q′ ∈ Z. Thus, m = mqq′
or (1 − qq′)m = 0. Since m 6= 0, qq′ = 1. This only true if either q = q′ = 1or q = q′ = −1. That is, n = m or n = −m
10 DIVISIBILITY. THE DIVISION ALGORITHM 79
Problem 10.8Write the first 7 prime numbers.
Solution.The numbers are : 2, 3, 5, 7, 11, 13, 17
Problem 10.9Show that 227 is a prime number.
Solution.The prime numbers less that or equal to
√227 are: 2, 3, 5, 7, 11, 13. Since
none of them divides 227, by Theorem 10.5, we conclude that 227 is prime
Problem 10.10Write the prime factorization of 42 and 105.
Solution.Writing the prime factorization of each number, we find
42 =2× 3× 7
105 =3× 5× 7
Problem 10.11Find the greatest common divisor of 42 and 105.
Solution.Using the previous problem, we find that D42 = {±1,±2,±3,±7,±6,±14,±21,±42}and D105 = {±1,±3,±5,±7,±15,±21,±35,±105}. Hence, gcd(42, 105) =21
Problem 10.12Are the numbers 27 and 35 relatively prime?
Solution.We have D27 = {±1,±3,±9,±27} and D35 = {±1,±5,±7,±35}. Hence,gcd(27, 35) = 1 and the numbers 27 and 35 are relatively prime
80 NUMBER THEORY AND MATHEMATICAL PROOFS
Problem 10.13We say that an integer n is even if and only if there exists an integer k suchthat n = 2k. An integer n is said to be odd if and only if there exists aninteger k such that n = 2k + 1.Let m and n be two integers.(a) Is 6m + 8n an even integer?(b) Is 6m + 4n2 + 3 odd?
Solution.(a) Since 6m+ 8n = 2(3m+ 4n) and 3m+ 4n ∈ Z, we have 6m+ 8n is even.(b) Since 6m+4n2+3 = 2(3m+2n2+2)+1 = 2k+1 where k = 3m+2n2+2,we have 6m + 4n2 + 3 is odd
Problem 10.14Let a, b, and c be integers such that a|b where a 6= 0. Show that a|(bc).
Solution.If a|b then there is an integer k such that b = ka. Multiply both sides of thisequality by c to obtain bc = (kc)a. Thus, a|bc
Problem 10.15Let m and n be positive integers with m > n. Is m2 − n2 composite?
Solution.If m = 2 and n = 1 then m2 − n2 = 3 which is prime. Depending on m andn the number m2 − n2 can be either prime or composite
Problem 10.16Show that if a|b and a|c then a|(mb + nc) for all integers m and n.
Solution.Since a|b and a|c, there exist integers k1 and k2 such that b = ak1 andc = ak2. Hence, mb + nc = mak1 + nak2 = a(mk1 + nk2) = ak′. This saysthat a|(mb + nc)
Problem 10.17If two integers a and b have the property that their difference a−b is divisibleby an integer n, i.e., a − b = nq for some integer q, we say that a and b arecongruent modulo n. Symbolically, we write a ≡ b(mod n). Show that ifa ≡ b(mod n) and c ≡ d(mod n) then a + c ≡ b + d(mod n).
10 DIVISIBILITY. THE DIVISION ALGORITHM 81
Solution.If a ≡ b(mod n) and c ≡ d(mod n) then there exist integers k1 and k2such that a − b = k1n and c − d = k2n. Adding these equations we find(a+ c)− (b+ d) = kn where k = k1 + k2 ∈ Z. Hence, a+ c ≡ b+ d(mod n)
Problem 10.18Show that if a ≡ b(mod n) and c ≡ d(mod n) then ac ≡ bd(mod n).
Solution.Using the notation of the previous problem, we he ac−bc = k1cn and cb−bd =k2bn. Adding these equations we find ac− bd = kn where k = k1c+ k2b ∈ Z.Hence, ac ≡ bd(mod n)
Problem 10.19Show that if a ≡ a(mod n) for all integer a.
Solution.Since a− a = n(0), we have a ≡ a(mod n)
Problem 10.20Show that if a ≡ b(mod n) then b ≡ a(mod n).
Solution.From a ≡ b(mod n), we have a − b = nq for some q ∈ Z. Multiply throughby −1 to obtain b− a = n(−q) = nq′. That is, b ≡ a(mod n)
Problem 10.21Show that if a ≡ b(mod n) and b ≡ c(mod n) then a ≡ c(mod n).
Solution.From a ≡ b(mod n) and b ≡ c(mod n), we obtain a− b = nq1 and b− c = nq2where q1, q2 ∈ Z. Adding these two equations, we find a−c = n(q1+q2) = nq.Hence, a ≡ c (mod n)
Problem 10.22What are the solutions of the linear congruences 3x ≡ 4(mod 7)?
Solution.By the previous problem, we have 9x ≡ 12(mod 7). By Problem 10.17,7x ≡ 0(mod 7). Using Problem 10.17 for a second time, we have 9x − 7x =2x ≡ 12(mod 7). This, the given equation, and Problem 10.17 lead tox ≡ −8(mod 7). Hence, x = 7k − 8 where k ∈ Z
82 NUMBER THEORY AND MATHEMATICAL PROOFS
Problem 10.23Solve 2x + 11 ≡ 7(mod 3)?
Solution.From −11 ≡ −11(mod 3) and −4 ≡ 2(mod 3) we can write 2x ≡ 2(mod 3).Multiply by 2 to obtain 4x ≡ 4(mod 3). Thus, 4x ≡ 1(mod 3). From −3x ≡0(mod 3) we obtain x ≡ 1(mod 3). Hence x = 3q + 1, where k ∈ Z
11 THE EUCLIDEAN ALGORITHM 83
11 The Euclidean Algorithm
Problem 11.1(i) Find gcd(120, 500).(ii) Show that 17 and 22 are relatively prime.
Solution.(i) Using the Euclidean algorithm, we find gcd(120, 500) = 20.(ii) Using the Euclidean algorithm, we find gcd(17, 22) = 1. Hence, 17 and22 are relatively prime
Problem 11.2Use the Euclidean algorithm to find gcd(414, 662).
Solution.Using the division algorithm we have
662 = 414× 1 + 248
414 = 248× 1 + 166
248 = 166× 1 + 82
166 = 82× 2 + 2
82 = 2× 41.
Hence, gcd(414, 662) = 2
Problem 11.3Use the Euclidean algorithm to find gcd(287, 91).
Solution.Using the division algorithm we have
287 = 91× 3 + 14
91 = 14× 6 + 7
14 = 7× 2 + 0
Hence, gcd(287, 91) = 7
Problem 11.4Use the Euclidean algorithm to find gcd(−24, 25).
84 NUMBER THEORY AND MATHEMATICAL PROOFS
Solution.Using the division algorithm we have
−24 =− 1(25) + 1
25 =1(25).
Hence, gcd(−24, 25) = 1
Problem 11.5Use the Euclidean algorithm to find gcd(−6,−15).
Solution.Note that gcd(−6,−15) = gcd(6, 15)(Problem 11.7). Using the division al-gorithm we have
15 =2(6) + 3
6 =2(3).
Hence, gcd(−6,−15) = 3
Problem 11.6Prove that if n ∈ Z, then gcd(3n + 4, n + 1) = 1.
Solution.Using Theorem 11.1, we have
gcd(3n + 4, n + 1) = gcd(3n + 4− 3(n + 1), n + 1) = gcd(1, n + 1) = 1
Problem 11.7Show that gcd(a, b) = gcd(|a|, |b|).
Solution.Let d1 = gcd(a, b) and d2 = gcd(|a|, |b|). Since d1|a, by Problem 10.4, d1|(−a).Hence, d1||a|. Likewise, d1||b|. By the definition of d2, we have d1 ≤ d2. If|a| = a then d2|a. If |a| = −a then d2|(−a) and by Problem 10.4, d2|a.Likewise, d2|b. By the definition of d1, d2 ≤ d1. Hence, we have shown thatd1 ≤ d2 and d2 ≤ d1 so that d1 = d2
Problem 11.8Show that if d = gcd(a, b) then a
dand b
dare relatively prime.
11 THE EUCLIDEAN ALGORITHM 85
Solution.Since d|a and d|b, we can write a = kd and b = k′d for some integers kand k′. Thus, gcd
(ad, bd
)= gcd(k, k′). Let p be a positive integer such that
p|k and p|k′. Then k = k1p and k′ = k2p. Hence, a = k1pd and b = k2pd.This shows that dp|a and dp|b. By the definition of d, we must have d ≥ dpor p ≤ 1. Since p is a positive interger, we have p = 1. Since 1 is the onlypositive common divisor of k and k′, we conclude that gcd(k, k′) = 1. Hence,gcd
(ad, bd
)= 1
Problem 11.9Show that if a|bc and gcd(a, b) = 1 then a|c.
Solution.Since a|bc, we have bc = ak for some k ∈ Z. Since gcd(a, b) = 1, by Theorem11.3, there are integers m and n such that ma + nb = 1. Multiply this lastequation by c to obtain c = mac + akn = a(mc + kn). Since mc + kn ∈ Z,we conclude that a|c
Problem 11.10Show that if a|c and b|c and gcd(a, b) = 1 then ab|c.
Solution.Since gcd(a, b) = 1, there are integers m and n such that ma+ nb = 1. Sincec = ak1 and c = bk2, we have
c = cma + cnb = abmk2 + abnk1 = ab(mk2 + nk1).
Since mk2 + nk1 ∈ Z, we conclude that ab|c
Problem 11.11Show that if gcd(a, c) = 1 and gcd(b, c) = 1 then gcd(ab, c) = 1.
Solution.Let d = gcd(ab, c). Since gcd(a, c) = 1 and gcd(b, c) = 1, there are integersm1,m2, n1, and n2 such that m1a + n1c = 1 and m2b + n2c = 1. Hence,
1 = (m1a+n1c)(m2b+n2c) = ab(m1m2)+c(m1n2a+n1m2b+n1n2c) = abm+cn.
Now, d|ab and d|c so that d|(abm+ cn). That is, d|1. Hence, gcd(ab, c) = 1
86 NUMBER THEORY AND MATHEMATICAL PROOFS
Problem 11.12Show that there are integers m and n such that 121m + 38n = 1.
Solution.Using the division algorithm we have
121 = 38× 3 + 7
38 = 7× 5 + 3
7 = 2× 3 + 1
2 = 1× 2 + 0.
Hence, gcd(121, 38) = 1. By Theorem 11.3, there are integers m and n suchthat 121n + 38n = 1
Problem 11.13Find integers m and n such that 121m + 38n = 1.
Solution.We have
1 =7− 2 · 3=7− (38− 7 · 5) · 2=7 · 11− 38 · 2=(121− 38 · 3) · 11− 38 · 2=121 · 11− 38 · 35.
Hence, m = 11 and n = −35
Problem 11.14Show that gcd(ma, na) = a · gcd(m,n), where a is a positive integer.
Solution.Let d1 = gcd(m,n) and d2 = gcd(ma,mb). Since d1|m and d2|n, we havem = d1k1 and n = d1k2. Hence, ma = (ad1)k1 and na = (ad1)k2. That is,ad1|ma and ad2|na. By the definition of d2, we have ad1 ≤ d2. On the otherhand, let r, s be two integers such that rm+sn = d1. Then rma+sna = ad1.Now, d2|ma and d2|na so d2|(rma + sna). Hence, d2|ad1 so that d2 ≤ ad1.We have shown that ad1 ≤ d2 and d2 ≤ ad1. Hence, ad1 = d2
11 THE EUCLIDEAN ALGORITHM 87
Problem 11.15Show that gcd(a, bc)|gcd(a, b)gcd(a, c).
Solution.Let d = gcd(a, bc), e = gcd(a, b), and f = gcd(a, c). By Theorem 11.3, thereare integers m1,m2, n1, n2 such that m1a+n1b = e and m2a+n2c = f. Hence,ef = (m1a+n1b)(m2a+n2c) = a(m1m2a+m1n2c+m2n1b)+bc(n1n2). Sinced|a and d|bc, we have d|ef
Problem 11.16Give an example where ma + nb = d but d 6= gcd(a, b).
Solution.Let m = n = a = b = 1. Then ma + nb = 2 and gcd(a, b) = 1
Problem 11.17Let p be a prime number. Find gcd(a, p) where a ∈ Z.
Solution.The only divisors of p are 1 and p. If p divides a then gcd(a, p) = p. If p doesnot divide a then gcd(a, p) = 1, that is a and p are relatively prime
Problem 11.18Show that if gcd(a, b) = 1 then xa ≡ 1(mod b) has a solution.
Solution.By Theorem 11.3, there are integers x and y such that xa + yb = 1. Hence,xa = −yb + 1 and this implies that xa ≡ 1(mod b)
Problem 11.19Show that if ma + nb = d then gcd(a, b)|d.
Solution.Let e = gcd(a, b). Then e|a and e|b. Hence e|(ma+ nb). That is, e|d. Thus, dis an integer multiple of e
Problem 11.20Let p be a prime number such that p|ab. Show that p|a or p|b.
Solution.If p|a then we are done. Suppose that p does not divide a. Then gcd(a, p) = 1.By Problem 11.9, p|b
88 NUMBER THEORY AND MATHEMATICAL PROOFS
Fundamentals of Set Theory
12 Basic Definitions
Problem 12.1Write each of the following sets in tabular form:(a) A = {x ∈ N|x < 0}.(b) A consists of the first five prime number.(c) A = {x ∈ Z|2x2 + x− 1 = 0}.
Solution.(a) A = ∅.(b) A = {2, 3, 5, 7, 11}.(c) A = {−1}
Problem 12.2Write each of the following sets in set-builder notation.(a) A = {1, 2, 3, 4, 5}.(b) A = {4, 6, 8, 9, 10}.
Solution.(a) A = {x ∈ N|x ≤ 5}.(b) A = {x ∈ N|x is composite ≤ 10}
Problem 12.3Which of the following sets are equal?(a) {a, b, c, d}(b) {d, e, a, c}(c) {d, b, a, c}(d) {a, a, d, e, c, e}
89
90 FUNDAMENTALS OF SET THEORY
Solution.{a, b, c, d} = {d, b, a, c} and {d, e, a, c} = {a, a, d, e, c, e}
Problem 12.4Let A = {c, d, f, g}, B = {f, j}, and C = {d, g}. Answer each of the followingquestions. Give reasons for your answers.(a) Is B ⊆ A?(b) Is C ⊆ A?(c) Is C ⊆ C?(d) Is C is a proper subset of A?
Solution.(a) B is not a subset of A since j ∈ B but j 6∈ A.(b) C ⊆ A.(c) C ⊆ C.(d) C is a proper subset of A since C ⊆ A and c ∈ A but c 6∈ C
Problem 12.5(a) Is 3 ∈ {1, 2, 3}?(b) Is 1 ⊆ {1}?(c) Is {2} ∈ {1, 2}?(d) Is {3} ∈ {1, {2}, {3}}?(e) Is 1 ∈ {1}?(f) Is {2} ⊆ {1, {2}, {3}}?(g) Is {1} ⊆ {1, 2}?(h) Is 1 ∈ {{1}, 2}?(i) Is {1} ⊆ {1, {2}}?(j) Is {1} ⊆ {1}?
Solution.(a) 3 ∈ {1, 2, 3}.(b) 1 6⊆ {1}.(c) {2} ⊆ {1, 2}(d) {3} ∈ {1, {2}, {3}}(e) 1 ∈ {1}(f) {2} ∈ {1, {2}, {3}}(g) {1} ⊆ {1, 2}(h) 1 6∈ {{1}, 2}(i) {1} ⊆ {1, {2}}(j) {1} ⊆ {1}
12 BASIC DEFINITIONS 91
Problem 12.6Let A = {b, c, d, f, g} and B = {a, b, c}. Find each of the following:(a) A ∪B.(b) A ∩B.(c) A\B.(d) B\A.
Solution.(a) A ∪B = {a, b, c, d, f, g}.(b) A ∩B = {b, c}.(c) A\B = {d, f, g}.(d) B\A = {a}
Problem 12.7Indicate which of the following relationships are true and which are false:(a) Z+ ⊆ Q.(b) R− ⊂ Q.(c) Q ⊂ Z.(d) Z+ ∪ Z− = Z.(e) Q ∩ R = Q.(f) Q ∪ Z = Z.(g) Z+ ∩ R = Z+
(h) Z ∪Q = Q.
Solution.(a) True (b) False (c) False (d) False (e) True (f) False (g) True (h)True
Problem 12.8Let A = {x, y, z, w} and B = {a, b}. List the elements of each of the followingsets:(a) A×B(b) B × A(c) A× A(d) B ×B.
Solution.(a) A×B = {(x, a), (x, b), (y, a), (y, b), (z, a), (z, b), (w, a), (w, b)}.(b) B × A = {(a, x), (b, x), (a, y), (b, y), (a, z), (b, z), (a, w), (b, w)}.
92 FUNDAMENTALS OF SET THEORY
(c) A× A = {(x, x), (x, y), (x, z), (x,w), (y, x), (y, y), (y, z), (y, w),(z, x), (z, y), (z, z), (z, w), (w, x), (w, y), (w, z), (w,w)}.(d) B ×B = {(a, a), (a, b), (b, a), (b, b)}
Problem 12.9(a) Find all possible subsets of the set A = {a, b, c}.(b) How many proper subsets are there?
Solution.(a) {∅, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, A}.(b) There are 7 proper subsets, namely,
{∅, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}}
Problem 12.10Subway prepared 60 4-inch sandwiches for a birthday party. Among thesesandwiches, 45 of them had tomatoes, 30 had both tomatoes and onions,and 5 had neither tomatoes nor onions. Using a Venn diagram, how manysandwiches did he make with(a) tomatoes or onions?(b) onions?(c) onions but not tomatoes?
Solution.
(a) 55 sandwiches with tomatoes or onions.(b) There are 40 sandwiches with onions.(c) There are 10 sandwiches with onions but not tomatoes
12 BASIC DEFINITIONS 93
Problem 12.11A camp of international students has 110 students. Among these students,
75 speak english,52 speak spanish,50 speak french,33 speak english and spanish,30 speak english and french,22 speak spanish and french,13 speak all three languages.
How many students speak(a) english and spanish, but not french,(b) neither english, spanish, nor french,(c) french, but neither english nor spanish,(d) english, but not spanish,(e) only one of the three languages,(f) exactly two of the three languages.
Solution.(a) Students speaking English and spanish, but not french, are in the brownregion; there are 20 of these.(b) Students speaking none of the three languages are outside the three cir-cles; there are 5 of these.(c) Students speaking french, but neither english nor spanish, are in the blueregion; there are 11 of these.(d) Students speaking english, but not spanish, are in the yellow and grayregions; there are 25 + 17 = 42 of these. (e) Students speaking only one ofthe three languages are in the yellow, green, and blue regions; there are 25+ 10 + 11 = 46 of these.(f) Students speaking two of the three languages are in the pink, gray, andbrown regions; there are 9 + 17 + 20 = 46 of these
94 FUNDAMENTALS OF SET THEORY
Problem 12.12Let A be the set of the first five composite numbers and B be the set ofpositive integers less than or equal to 8. Find A\B and B\A.
Solution.First, writing the tabular form of each set, we find A = {4, 6, 8, 9, 10} andB = {1, 2, 3, 4, 5, 6, 7, 8}. Thus, A\B = {9, 10} and B\A = {1, 2, 3, 5, 7}
Problem 12.13Let U be a universal set. Find U c and ∅c.
Solution.We have U c = ∅ and ∅c = U
Problem 12.14Let A be the set of natural numbers less than 0 and B = {1, 3, 7}. Find A∪Band A ∩B.
Solution.Note that A = ∅ so that A ∪B = B and A ∩B = ∅
Problem 12.15Let
A ={x ∈ N|4 ≤ x ≤ 8}B ={x ∈ N|x even andx ≤ 10}.
Find A ∪B and A ∩B.
Solution.We have A ∪B = {2, 4, 5, 6, 7, 8} and A ∩B = {4, 6, 8}
12 BASIC DEFINITIONS 95
Problem 12.16Using a Venn diagram, show that A∆B = (A\B)∪ (B\A) = (A∩Bc)∪ (B∩Ac).
Solution.
Problem 12.17Let A = {a, b, c}. Find A× A.
Solution.We have
A× A = {(a, a), (a, b), (a, c), (b, a), (b, b), (b, c), (c, a), (c, b), (c, d)}Problem 12.18Find the symmetric difference of the two sets A = {1, 3, 5} and B = {1, 2, 3}.Solution.We have
A∆B = {2, 5}Problem 12.19Let A = {1, 2, 3} and B = {2, 5} be two subsets of a universal set U ={1, 2, 3, 4, 5}. Compare (A ∪B)c and Ac ∩Bc.
Solution.We have
(A ∪B)c = Ac ∩Bc = {4}Problem 12.20Let A and B be two subsets of a universal set U. Compare A\B and A∩Bc.
Solution.Using a Venn diagram, one can easily see that A\B = A ∩Bc
96 FUNDAMENTALS OF SET THEORY
13 Properties of Sets
Problem 13.1Let A,B, and C be sets. Prove that if A ⊆ B then A ∩ C ⊆ B ∩ C.
Solution.Let x ∈ A ∩ C. Then x ∈ A and x ∈ C. Since A ⊆ B, we have x ∈ B. Thus,x ∈ B and x ∈ C so that x ∈ B ∩ C
Problem 13.2Find sets A,B, and C such that A ∩ C = B ∩ C but A 6= B.
Solution.Let A = {1}, B = {2}, and C = {3}. Then A∩C = B ∩C = ∅ and A 6= B
Problem 13.3Find sets A,B, and C such that A ∩ C ⊆ B ∩ C and A ∪ C ⊆ B ∪ C butA 6= B.
Solution.Let A be a proper subset of a set B and let C = ∅. Then ∅ = A ∩ C ⊆B ∩ C = ∅ and A = A ∪ C ⊆ B ∪ C. However, A 6= B
Problem 13.4Let A and B be two sets. Prove that if A ⊆ B then Bc ⊆ Ac.
Solution.Let x ∈ Bc. If x 6∈ Ac then x ∈ A. Since A ⊆ B, we have x ∈ B. That is,x 6∈ Bc. This contradicts our assumption that x ∈ Bc. Hence, x ∈ Ac
Problem 13.5Let A,B, and C be sets. Prove that if A ⊆ C and B ⊆ C then A ∪B ⊆ C.
Solution.Let x ∈ A ∪ B. Then either x ∈ A or x ∈ B. In either case we have x ∈ Csince both A and B are subsets of C. This shows that A ∪B ⊆ C
Problem 13.6Let A,B, and C be sets. Show that A× (B ∪ C) = (A×B) ∪ (A× C).
13 PROPERTIES OF SETS 97
Solution.We first show that A×(B∪C) ⊆ (A×B)∪(A×C). Let (x, y) ∈ A×(B∪C).Then x ∈ A and y ∈ B ∪C. So either y ∈ B or y ∈ C. Hence, we have either(x, y) ∈ A×B or (x, y) ∈ A× C. Thus, (x, y) ∈ (A×B) ∪ (A× C).Next we show that (A×B)∪ (A×C) ⊆ A× (B ∪C). Let (x, y) ∈ (A×B)∪(A × C). Then either (x, y) ∈ A × B or (x, y) ∈ A × C. If (x, y) ∈ A × Bthen x ∈ A and y ∈ B. This implies that x ∈ A and y ∈ B ∪ C and so(x, y) ∈ A× (B ∪ C). Similar argument if (x, y) ∈ A× C
Problem 13.7Let A,B, and C be sets. Show that A× (B ∩ C) = (A×B) ∩ (A× C).
Solution.Let (x, y) ∈ A×(B∩C). Then x ∈ A, y ∈ B, and y ∈ C. Thus, (x, y) ∈ A×Band (x, y) ∈ A × C. It follows that (x, y) ∈ (A × B) ∩ (A × C). This showsthat A× (B ∩ C) ⊆ (A×B) ∩ (A× C).Conversely, let (x, y) ∈ (A×B)∩ (A×C). Then (x, y) ∈ A×B and (x, y) ∈A× C. Thus, x ∈ A, y ∈ B and y ∈ C. That is, (x, y) ∈ A× (B ∩ C)
Problem 13.8(a) Is the number 0 in ∅? Why?(b) Is ∅ = {∅}? Why?(c) Is ∅ ∈ {∅}? Why?
Solution.(a) The empty set contains no elements. Thus 0 6∈ ∅.(b) The set {∅} has one element, namely ∅, whereas ∅ contains no elements.Thus ∅ 6= {∅}.(c) The set {∅} has one element, namely ∅. That is, ∅ ∈ {∅}
Problem 13.9Let A and B be two sets. Prove that (A\B) ∩ (A ∩B) = ∅.
Solution.Suppose not. Then there is an x ∈ (A\B) ∩ (A ∩ B). This implies thatx ∈ A\B, x ∈ A, and x ∈ B. But x ∈ A\B implies that x ∈ A and x 6∈ B.So we have x ∈ B and x 6∈ B a contradiction. Hence, (A\B)∩ (A∩B) = ∅
Problem 13.10Let A and B be two sets. Show that if A ⊆ B then A ∩Bc = ∅.
98 FUNDAMENTALS OF SET THEORY
Solution.Suppose that A ∩ Bc 6= ∅. Then there is an x ∈ A ∩ Bc. This implies thatx ∈ A and x ∈ Bc. Thus, x ∈ A and x 6∈ B. Since A ⊆ B and x ∈ A, wehave x ∈ B. It follows that x ∈ B and x 6∈ B which is impossible
Problem 13.11Let A,B and C be three sets. Prove that if A ⊆ B and B ∩ C = ∅ thenA ∩ C = ∅.
Solution.Suppose the contrary. That is, A ∩ C 6= ∅. Then there is an element x ∈ Aand x ∈ C. Since A ⊆ B, we have x ∈ B. So we have that x ∈ B and x ∈ C.This yields that x ∈ B ∩ C which contradicts the fact that B ∩ C = ∅
Problem 13.12Find two sets A and B such that A ∩B = ∅ but A×B 6= ∅.
Solution.Let A = {1} and B = {2}. Then A ∩B = ∅ and A×B = {(1, 2)} 6= ∅
Problem 13.13Suppose that A = {1, 2} and B = {2, 3}. Find each of the following:(a) P(A ∩ B).(b) P(A).(c) P(A ∪ B).(d) P(A× B).
Solution.(a) Since A ∩B = {2}, we have P(A) = {∅, {2}}.(b) P(A) = {∅, {1}, {2}, A}.(c) Since A ∪B = {1, 2, 3}, we have
P(A ∪ B) = {∅, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}}.
(d) Since A×B = {(1, 2), (1, 3), (2, 2), (2, 3)}, we have
P(A× B) = {∅, {(1, 2)}, {(1, 3)}, {(2, 2)}, {(2, 3)}, {(1, 2), (1, 3)},{(1, 2), (2, 2)}, {(1, 2), (2, 3)}, {(1, 3), (2, 2)}, {(1, 3), (2, 3)},{(2, 2), (2, 3)}, {(1, 2), (1, 3), (2, 2)}, {(1, 2), (1, 3), (2, 3)},{(1, 2), (1, 3), (2, 3)}, {(1, 3), (2, 2), (2, 3)}, A×B}
13 PROPERTIES OF SETS 99
Problem 13.14(a) Find P(∅).(b) Find P(P(∅)).(c) Find P(P(P(∅))).
Solution.(a) P(∅) = {∅}.(b) P(P(∅)) = {∅, {∅}}.(c) P(P(P(∅))) = {∅, {∅}, {{∅}}, {∅, {∅}}}
Problem 13.15Determine which of the following statements are true and which are false.Prove each statement that is true and give a counterexample for each state-ment that is false.(a) P(A ∪ B) = P(A) ∪ P(B).(b) P(A ∩ B) = P(A) ∩ P(B).(c) P(A) ∪ P(B) ⊆ P(A ∪ B).(d) P(A× B) = P(A)× P(B).
Solution.(a) Let A = {1, 2} and B = {1, 3}. Then A ∪B = {1, 2, 3} andP(A ∪ B) = {∅, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}} whereasP(A) ∪ P(B) = {∅, {1}, {2}, {1, 2}, {3}, {1, 3}}.(b) Let X ∈ P(A ∩ B). Then X ⊆ A ∩ B and therefore X ⊆ A and X ⊆ B.This implies that X ∈ P(A) and X ∈ P(B) and hence X is in the intersec-tion. This completes a proof of P(A ∩ B) ⊆ P(A) ∩ P(B).Conversely, let X ∈ P(A) ∩ P(B). Then X ∈ P(A) and X ∈ P(B). Hence,X ⊆ A and X ⊆ B. It follows that X ⊆ A∩B and therefore X ∈ P(A ∩ B).This ends a proof for P(A) ∩ P(B) ⊆ P(A ∩ B).(c) Let X ∈ P(A) ∪ P(B). Then X ⊆ A and X ⊆ B. Thus, X ⊆ A ∪B andthis implies that X ∈ P(A ∪ B).(d) Let A = {1} and B = {2}. Then A×B = {(1, 2)}. So we have
P(A× B) = {∅, {(1, 2)}}
whereas
P(A)× P(B) = {(∅, ∅), (∅, {2}), ({1}, ∅), ({1}, {2})}
100 FUNDAMENTALS OF SET THEORY
Problem 13.16Find two sets A and B such that A ∈ B and A ⊆ B.
Solution.Let A = {x} and B = {x, {x}}
Problem 13.17Let A be a subset of a universal set U. Prove:(a) A ∪ Ac = U.(b) A ∩ Ac = ∅.
Solution.(a) It is clear that A ∪Ac ⊆ U. Conversely, suppose that x ∈ U. Then eitherx ∈ A or x 6∈ A. But this is the same as saying that x ∈ A ∪ Ac.(b) By definition ∅ ⊆ A∩Ac. Conversely, the conditional proposition “x ∈ Aand x 6∈ A implies x ∈ ∅” is vacuously true since the hypothesis is false. Thisshows that A ∩ Ac ⊆ ∅
Problem 13.18Let A and B be subsets of U. Prove:(a) A ∪B = B ∪ A.(b) (A ∪B) ∪ C = A ∪ (B ∪ C).
Solution.(a) If x ∈ A ∪ B then x ∈ A or x ∈ B. But this is the same thing as sayingx ∈ B or x ∈ A. That is, x ∈ B ∪ A. Now interchange the roles of A and Bto show that B ∪ A ⊆ A ∪B.(b) Let x ∈ (A∪B)∪C. Then x ∈ (A∪B) or x ∈ C. Thus, (x ∈ A or x ∈ B)or x ∈ C. This implies x ∈ A or (x ∈ B or x ∈ C). Hence, x ∈ A ∪ (B ∪ C).The converse is similar
Problem 13.19Let A,B, and C b subsets of U. Prove A ∪ (B ∩ C) = (A ∪B) ∩ (A ∪ C).
Solution.Let x ∈ A ∪ (B ∩ C). Then x ∈ A or x ∈ B ∩ C. Thus, x ∈ A or (x ∈ Band x ∈ C). This implies that (x ∈ A or x ∈ B) and (x ∈ A or x ∈ C).Hence, x ∈ A ∪ B and x ∈ A ∪ C, i.e. x ∈ (A ∪ B) ∩ (A ∪ C). The converseis similar
13 PROPERTIES OF SETS 101
Problem 13.20Suppose that A ⊆ B. Prove:(a) A ∩B = A.(b) A ∪B = B.
Solution.(a) If x ∈ A ∩ B then by the definition of intersection of two sets we havex ∈ A. Hence, A ∩ B ⊆ A. Conversely, if x ∈ A then x ∈ B as well sinceA ⊆ B. Hence, x ∈ A ∩B. This shows that A ⊆ A ∩B.(b) If x ∈ A ∪ B then x ∈ A or x ∈ B. Since A ⊆ B we have x ∈ B.Hence, A ∪ B ⊆ B. Conversely, if x ∈ B then x ∈ A ∪ B. This shows thatB ⊆ A ∪B
102 FUNDAMENTALS OF SET THEORY
14 Boolean Algebra
Problem 14.1Show that x� x = x.
Solution.We have
x� x =(x� x)⊕ 0 = (x� x)⊕ (x� x)
=x� (x⊕ x)
=x� 1 = x
Problem 14.2Show that x� 0 = 0.
Solution.We have
x� 0 =x� (x� x)
=(x� x)� x
=x� x = 0
Problem 14.3Show that (x⊕ y)� x = x.
Solution.We have
(x⊕ y)� x =(x� x)⊕ (x� y)
=x⊕ (x� y)
=x
where we used Example 14.5
Problem 14.4Show that x⊕ (x� y) = x⊕ y.
14 BOOLEAN ALGEBRA 103
Solution.We have
x⊕ (x� y) =(x⊕ x)� (x⊕ y)
=1� (x⊕ y)
=x⊕ y
Problem 14.5Let v ∈ S such that x� v = x for all x ∈ S. Show that v = 1.
Solution.Since x�v = x for all x ∈ S, we can choose x = 1 and obtain 1 = 1�v = v
Problem 14.6Show that x⊕ y = x� y.
Solution.We have
(x⊕ y)� (x� y) =[x� (x� y)]⊕ [y � (x� y)]
=[(x� x)� y]⊕ [x� (y � y)]
=(0� y)⊕ (0� x)
=0⊕ 0 = 0
and
(x⊕ y)⊕ (x� y) =[(x⊕ y)⊕ x]� [(x⊕ y)⊕ y]
=[(x⊕ x)⊕ y]� [x⊕ (y ⊕ y)]
=(1⊕ y)� (x⊕ 1)
=1� 1 = 1.
Hence, by Example 14.6, we have x⊕ y = x� y
Problem 14.7Show that 1 = 0 and 0 = 1.
Solution.Let y = 0 and x = 1 in Example 14.6 and notice that 1⊕0 = 1 and 1�0 = 0to conclude that 1 = 0. Similar argument for 0 = 1
104 FUNDAMENTALS OF SET THEORY
Problem 14.8Show that x� (x⊕ y) = x� y.
Solution.We have x� (x⊕ y) = (x� x)⊕ (x� y) = 0⊕ (x� y) = x� y
Problem 14.9Show that x� y = x⊕ y.
Solution.By DeMorgan’s Law, we have
x� y = x⊕ y = x⊕ y
Problem 14.10Simplify [(x⊕ y ⊕ z)� s⊕ t]⊕ [(x⊕ y ⊕ z)� (s⊕ t)].
Solution.We have
[(x⊕ y ⊕ z)� s⊕ t]⊕ [(x⊕ y ⊕ z)� (s⊕ t)] =(x⊕ y ⊕ z)� [s⊕ t⊕ (s⊕ t)]
=(x⊕ y ⊕ z)� 1 = x⊕ y ⊕ z
Problem 14.11Simplify x⊕ x� y.
Solution.We have
x⊕ x� y =x⊕ (x⊕ y)
=(x⊕ x)⊕ (x⊕ y)
=1⊕ (x⊕ y)
=1
Problem 14.12Simplify x� y � (x⊕ y)� (y ⊕ y).
14 BOOLEAN ALGEBRA 105
Solution.We have
x� y � (x⊕ y)� (y ⊕ y) =x� y � (x⊕ y)� 1
=x� y � (x⊕ y)
=(x⊕ y)� (x⊕ y)
=(x� x)⊕ [x� (y ⊕ y)]⊕ (y � y)
=x⊕ (x� 1)⊕ 0
=x⊕ x = x
Problem 14.13Simplify (a⊕ b)� (a⊕ c).
Solution.We have
(a⊕ b)� (a⊕ c) =a� a⊕ a� c⊕ b� a⊕ b� c
=a⊕ a� c⊕ b� a⊕ b� c
=a� (1⊕ c)⊕ a� b⊕ b� c
=a� 1⊕ a� b⊕ b� c
=a� (1⊕ b)⊕ b� c
=a⊕ b� c
Problem 14.14Find the resulting circuit simplification of the circuit below.
Solution.The output of the given circuit is (a + b) · (a + c) which, by the previousproblem, simplifies to a+ (b · c). The resulting circuit simplification is shown
106 FUNDAMENTALS OF SET THEORY
below
Problem 14.15Simplify (a� b)⊕ [a� (b⊕ c)]⊕ [b� (b⊕ c)].
Solution.We have
(a� b)⊕ [a� (b⊕ c)]⊕ [b� (b⊕ c)] =(a� b)⊕ (a� b)⊕ (a� c)⊕ (b� b)⊕ (b� c)
=(a� b)⊕ (a� c)⊕ b⊕ (b� c)
=(a� b)⊕ (a� c)⊕ b� (1⊕ c)
=(a� b)⊕ (a� c)⊕ b
=b� (a⊕ 1)⊕ (a� c)
=b⊕ (a� c)
Problem 14.16Find the resulting circuit simplification of the circuit below.
Solution.The output of the given circuit is (a ·b)+[a ·(b+c)]+[b ·(b+c)] which, by theprevious problem, simplifies to b+ (a · c). The resulting circuit simplification
14 BOOLEAN ALGEBRA 107
is shown below
Problem 14.17Simplify a⊕ (a� b)⊕ [a� (a⊕ c)].
Solution.We have
a⊕ (a� b)⊕ [a� (a⊕ c)] =a⊕ (a� b)⊕ [(a� a)⊕ (a� c)]
=a⊕ (a� b)⊕ [a⊕ (a� c)]
=[a� (1⊕ b)]⊕ [a� (1⊕ c)]
=a⊕ a = 1
Problem 14.18Simplify a� b⊕ b� c� (b⊕ c).
Solution.We have
a� b⊕ b� c� (b⊕ c) =a� b⊕ b� b� c⊕ b� c� c
=a� b⊕ b� c⊕ b� c
=a� b⊕ b� c
=b� (a⊕ c)
Problem 14.19Find the resulting circuit simplification of the circuit below.
108 FUNDAMENTALS OF SET THEORY
Solution.The output of the given circuit is a · b + b · c · (b + c) which, by the previousproblem, simplifies to b · (a+ c). The resulting circuit simplification is shownbelow
Problem 14.20Simplify (a� b)⊕ (a� b)⊕ b.
Solution.We have
(a� b)⊕ (a� b)⊕ b =[a� (b⊕ b)]⊕ b
=a⊕ b
=a� b
=a� b
Problem 14.21Simplify: (A ·B · C) · C + A ·B · C + D.
14 BOOLEAN ALGEBRA 109
Solution.We have
(A�B � C)� C ⊕ A�B � C ⊕D =(A⊕B ⊕ C)� C ⊕ A⊕B ⊕ C ⊕D
=(A⊕B ⊕ C)� C ⊕ A⊕B ⊕ C ⊕D
=A�B ⊕B � C ⊕ C � C ⊕ A⊕B ⊕ C ⊕D
=A�B ⊕B � C ⊕ (C ⊕ C)⊕ A⊕B ⊕D
=A� (B ⊕ 1)⊕B � (C ⊕ 1)⊕ C ⊕D
=A� 1⊕B � 1⊕ C ⊕D = A⊕B ⊕ C ⊕D
Problem 14.22Reduce the following logic circuit with a simple logic circuit.
Solution.The ouput of this circuit design is (A�B � C)�C⊕A�B � C⊕D whichaccording to the previous problem, simplifies to A⊕B ⊕C ⊕D. Hence, thesimplified logic circuit is
110 FUNDAMENTALS OF SET THEORY
Relations and Functions
15 Binary Relations
Problem 15.1Suppose that |A| = 3 and |A×B| = 24. What is |B|?
Solution.We have
|B| = |A×B||A|
=24
3= 8
Problem 15.2Let A = {1, 2, 3}. Find A× A.
Solution.We have
A× A = {(1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3), (3, 1), (3, 2), (3, 3)}
Problem 15.3Find x and y so that (3x− y, 2x + 3y) = (7, 1).
Solution.The problem reduces to solving the system{
3x− y = 7
2x + 3y = 1.
Solving by the method of elimination one finds x = 2 and y = −1
Problem 15.4Find the domain and range of the relation R = {(5, 6), (−12, 4), (8, 6), (−6,−6), (5, 4)}.
111
112 RELATIONS AND FUNCTIONS
Solution.Dom(R) = {−12,−6, 5, 8} and Range(R) = {−6, 4, 6}
Problem 15.5Let A = {1, 2, 3} and B = {a, b, c, d}.(a) Is the relation f = {(1, d), (2, d), (3, a)} a function from A to B? If so,find its range.(b) Is the relation f = {(1, a), (2, b), (2, c), (3, d)} a function from A to B? Ifso, find its range.
Solution.(a) f is a function from A to B since every element in A maps to exactly oneelement in B. The range of f is the set {a, d}.(b) f is not a function since the element 2 is related to two members of B
Problem 15.6Let R be the divisibility relation on the set A = {1, 2, 3, 4, 5, 6, 7, 8, 9}. Con-struct the digraph of R.
Solution.The digraph of R is shown below.
Problem 15.7Find the inverse relation of R = {(a, 1), (b, 5), (c, 2), (d, 1)}. Is the inverserelation a function?
Solution.We have
R−1 = {(1, a), (5, b), (2, c), (1, d)}.R−1 is not a function since 1 is related to a and d
15 BINARY RELATIONS 113
Problem 15.8Let
A ={1, 2, 3, 4}B ={1, 2, 3}R ={(1, 2), (1, 3), (1, 4), (2, 2), (3, 4), (4, 1), (4, 2)}S ={(1, 1), (1, 2), (1, 3), (2, 3)}.
Find (a) R ∪ S (b) R ∩ S (c) R\S and (d) S\R.
Solution.We have
R ∪ S ={(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 3), (3, 4), (4, 1), (4, 2)}R ∩ S ={(1, 2), (1, 3)}R\S ={(1, 4), (2, 2), (3, 4), (4, 1), (4, 2)}S\R ={(1, 1), (2, 3)}
Problem 15.9Let
A ={a, b, c}B ={1, 2}C ={a, b, g}R ={(a, 1), (a, 2), (b, 2), (c, 1)}S ={(1, a), (2, b), (2, g)}.
Find S ◦R.
Solution.We have
S ◦R = {(a, a), (a, b), (a, g), (b, b), (b, g), (c, a)}
Problem 15.10Let X = {a, b, c}. Recall that P(X) is the power set of X. Define a binaryrelation R on P(X) as follows:
A,B ∈ P(x), A R B ⇔ |A| = |B|.
(a) Is {a, b}R{b, c}?(b) Is {a}R{a, b}?(c) Is {c}R{b}?
114 RELATIONS AND FUNCTIONS
Solution.(a) {a, b}R{b, c} since |{a, b}| = |{b, c}| = 2.(b) Since 1 = |{a}| 6= 2 = |{a, b}|, we have {a} 6 R{a, b}.(c) Since |{c}| = |{b}|, we have {c}R{b}
Problem 15.11Let A = {4, 5, 6} and B = {5, 6, 7} and define the binary relations R, S, andT from A to B as follows:
(x, y) ∈ A×B, (x, y) ∈ R⇔ x ≥ y.
(x, y) ∈ A×B, x S y ⇔ 2|(x− y).
T = {(4, 7), (6, 5), (6, 7)}.
(a) Draw arrow diagrams for R, S, and T.(b) Indicate whether any of the relations S,R, or T are functions.
Solution.(a) We have
(b) R is not a function since (4, y) 6∈ R for any y ∈ B. Also, (6, 5) ∈ R
15 BINARY RELATIONS 115
and (6, 6) ∈ R but 5 6= 6. S does not define a function since (5, 5) ∈ Sand (5, 7) ∈ S but 5 6= 7. Finally, T is not a function since (6, 5) ∈ R and(6, 7) ∈ R but 5 6= 7
Problem 15.12Let A = {3, 4, 5} and B = {4, 5, 6} and define the binary relation R asfollows:
(x, y) ∈ A×B, (x, y) ∈ R⇔ x < y.
List the elements of the sets R and R−1.
Solution.We have
R ={(3, 4), (3, 5), (3, 6), (4, 5), (4, 6), (5, 6)}R−1 ={(4, 3), (5, 3), (6, 3), (5, 4), (6, 4), (6, 5)}
Problem 15.13Let A = {2, 4} and B = {6, 8, 10} and define the binary relations R, S, andT from A to B as follows:
(x, y) ∈ A×B, (x, y) ∈ R⇔ x|y.
(x, y) ∈ A×B, x S y ⇔ y − 4 = x.
List the elements of A×B,R, S,R ∪ S, and R ∩ S.
Solution.We have
A×B = {(2, 6), (2, 8), (2, 10), (4, 6), (4, 8), (4, 10)}R = {(2, 6), (2, 8), (2, 10), (4, 8)}
S = {(2, 6), (4, 8)}R ∪ S = R
R ∩ S = S
Problem 15.14A couple is planning their wedding. They have four nieces (Sara, Cindy,Brooke, and Nadia) and three nephews (Mike, John, and Derik). How manydifferent pairings are possible to have one boy and one girl as a ring bearerand flower girl? List the possible choices as a Cartesian product.
116 RELATIONS AND FUNCTIONS
Solution.We have
{(Sarah,Mike), (Sara, John), (Sara,Derik), (Cindy,Mike), (Cindy, John)
(Cindy,Derik), (Brooke,Mike), (Brooke, John), (Brooke,Derik), (Nadia,Mike)
(Nadia, John), (Nadia,Derik)}.
Hence, there are 12 possibilities
Problem 15.15Let R be a relation on a set A. We define the complement of R to be therelation ∼ R = (A × A)\R. Let A = {1, 2, 3} and R be the relation xRy ifand only if x ≤ y. Find ∼ R.
Solution.Since
A× A = {(1, 1, ), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3), (3, 1), (3, 2), (3, 3)}
andR = {(1, 1, ), (1, 2), (1, 3), (2, 2), (2, 3), (3, 3)}
we have∼ R = {(2, 1), (3, 1), (3, 2)}
Problem 15.16Let R = {(x, y) ∈ R×R : y = x2} and S = {(x, y) ∈ R×R : y = −x}. FindR ∩ S.
Solution.R ∩ S is the intersection of the parabola y = x2 with the line y = −x. Thus,we need to solve the equation x2 = −x whose roots are x = 0 and x = −1.Hence,
R ∩ S = {(0, 0), (−1, 1)}
Problem 15.17Consider a family A with five children, Amy, Bob, Charlie, Debbie, and Eric.We abbreviate the names to their first letters so that
A = {a, b, c, d, e}.
Let R be the brother-sister relation on A. Find R and draw the directedgraph.
15 BINARY RELATIONS 117
Solution.We have
R = {(b, a), (b, d), (c, a), (c, d), (e, a), (e, d)}.
The digarph is shown below
Problem 15.18If |A| = n, where n is a positive integer, then how many binary relations arethere on the set A?
Solution.Recall that a binary relation on A is any subset of A×A. Thus, the numberof binary relations on A is the number of elements of the power sets A × Awhich is 2n2
Problem 15.19Let R = {(a, b), (b, a), (b, c)} be a relation on the set A = {a, b, c}. Find R◦R.
Solution.The answer is
R ◦R = {(a, a), (b, b), (a, c)}
Problem 15.20Let A = {1} and B = {4, 3, 2}. Find all the binary relations from A to B.
118 RELATIONS AND FUNCTIONS
Solution.All the binary relations from A to B are the elements of P(A×B) :
P(A×B) ={∅, {(1, 4)}, {(1, 3)}, {(1, 2)}, {(1, 4), (1, 3)},{(1, 4), (1, 2)}, {(1, 3), (1, 2)}, {(1, 4), (1, 3), (1, 2)}}
Problem 15.21Let f be the relation on R defined by x f y if and only f(x) = −4x + 9. Letg be the relation on R defined by x g y if and only g(x) = 2x− 7. Find f ◦ gand g ◦ f.
Solution.We have
f ◦ g ={(x, z)|(x, y) ∈ gand(y, z) ∈ f forsomey ∈ R}={(x, z) : y = 2x− 7 and z = −4y + 9}={(x, z) : z = −8x + 37}
g ◦ f ={(x, z)|(x, y) ∈ fand(y, z) ∈ g forsomey ∈ R}={(x, z) : y = −4x + 9 and z = 2y − 7}={(x, z) : z = −8x + 11}
16 EQUIVALENCE RELATIONS 119
16 Equivalence Relations
Problem 16.1Consider the binary relation on R defined as follows:
x, y ∈ R, x R y ⇔ x ≥ y.
Is R reflexive? symmetric? transitive?
Solution.Since x ≥ x for any number x ∈ R, R is reflexive. R is not symmetric since2 ≥ 1 but 1 6> 2. Finally, R is transitive because if x ≥ y and y ≥ z thenx ≥ z
Problem 16.2Consider the binary relation on R defined as follows:
x, y ∈ R, x R y ⇔ xy ≥ 0.
Is R reflexive? symmetric? transitive?
Solution.Since xx ≥ 0 for all x ∈ R, R is reflexive. If x, y ∈ R are such that xy ≥ 0then yx ≥ 0 since multiplication of real numbers is commutative. Thus, R issymmetric. Finally, R is transitive for if xy ≥ 0 then x and y have the samesign. Similarly, if yz ≥ 0 then y and z have the same sign. It follows that allthree numbers x, y, and z have the same sign
Problem 16.3Let A 6= ∅ and P(A) be the power set of A. Consider the binary relation onP(A) defined as follows:
X, Y ∈ P(A), X R Y ⇔ X ⊆ Y.
Is R reflexive? symmetric? transitive?
Solution.Since every set is a subset of itself, R is reflexive. However, R is not symmetricsince it is possible to find two subsets X and Y of P(A) such that X ⊂ Y.Finally, for A ⊆ B and B ⊆ C then A ⊆ C. That is, R is transitive
120 RELATIONS AND FUNCTIONS
Problem 16.4Let E be the binary relation on Z defined as follows:
a E b⇔ m ≡ n (mod 2).
Show that E is an equivalence relation on Z and find the different equivalenceclasses.
Solution.R is reflexive: For all m ∈ Z, m ≡ m (mod 2) since m−m = 2 · 0.R is symmetric: If m,n ∈ Z are such that m ≡ n(mod 2) then there is aninteger k such that m − n = 2k. Multiplying this equation by −1 to obtainn−m = 2(−k) so that n ≡ m (mod 2). That is, n R m.R is transitive: Let m,n, p ∈ Z be such that m ≡ n (mod 2) and n ≡p (mod 2). Then there exist integers k1 and k2 such that m − n = 2k1 andn− p = 2k2. Add these equalities to obtain m− p = 2(k1 + k2) which meansthat m ≡ p (mod 2).If x ∈ [a] then x = 2k+a so that a is the remainder of the division of x by 2.Thus the only possible values of a are 0 and 1 and so the equivalence classesare [0] and [1]
Problem 16.5Let I be the binary relation on R defined as follows:
a I b⇔ a− b ∈ Z.
Show that I is an equivalence relation on R and find the different equivalenceclasses.
Solution.R is reflexive: For all a ∈ R we have a I a since a− a = 0 ∈ Z.R is symmetric: If a, b ∈ R are such that a I b then a − b ∈ Z. But thenb− a = −(a− b) ∈ Z. That is, b I a.R is transitive: If a, b, c ∈ R are such that a I b and b I c then a− b ∈ Z andb− c ∈ Z. Adding to obtain a− c ∈ Z that is a I c.For a ∈ R, [a] = {b ∈ R|a = b + n, for some n ∈ Z}
Problem 16.6Let A be the set all straight lines in the cartesian plane. Let || be the binaryrelation on A defined as follows:
l1||l2 ⇔ l1 is parallel to l2.
16 EQUIVALENCE RELATIONS 121
Show that || is an equivalence relation on A and find the different equivalenceclasses.
Solution.|| is reflexive: Any line is parallel to itself.|| is symmetric: If l1 is parallel to l2 then l2 is parallel to l1.|| is transitive: If l1 is parallel to l2 and l2 is parallel to l3 then l1 is parallelto l3.If l ∈ A then [l] = {l′ ∈ A|l′||l}
Problem 16.7Let A = N× N. Define the binary relation R on A as follows:
(a, b) R (c, d)⇔ a + d = b + c.
(a) Show that R is reflexive.(b) Show that R is symmetric.(c) Show that R is transitive.(d) List five elements in [(1, 1)].(e) List five elements in [(3, 1)].(f) List five elements in [(1, 2)].(g) Describe the distinct equivalence classes of R.
Solution.(a) R is reflexive since a + a = a + a, i.e. (a, a) R (a, a).(b) R is symmetric: If (a, b) R (c, d) then a + d = b + c which implies thatc + b = d + a. That is, (c, d) R (a, b).(c) R is transitive: Suppose (a, b) R (c, d) and (c, d) R (e, f). Then a+d = b+cand c + f = d + e. Multiply the first equation by −1 and add to the secondto obtain a + f = d + e. That is, (a, b) R (e, f).(d) (1, 1), (2, 2), (3, 3), (4, 4), (5, 5) ∈ [(1, 1)].(e) (3, 1), (4, 2), (5, 3), (6, 4), (7, 5) ∈ [(3, 1)].(f) (0, 1), (1, 2), (2, 3), (3, 4), (4, 5) ∈ [(1, 2)].(g) [(a, b)] = {(c, d)|d− c = b− a}
Problem 16.8Let R be a binary relation on a set A and suppose that R is symmetric andtransitive. Prove the following: If for every x ∈ A there is a y ∈ A such thatx R y then R is reflexive and hence an equivalence relation on A.
122 RELATIONS AND FUNCTIONS
Solution.We must show that x R x for all x ∈ A. Let x ∈ A. Then there is a y ∈ Asuch that x R y. Since R is symmetric, y R x. The facts that x R y, y R xand R transitive imply that x R x
Problem 16.9Prove Theorem 16.1.
Solution.We have • R is reflexive: If x ∈ A then by (i) x ∈ Ak for some 1 ≤ k ≤ n.Thus, x and x belong to Ak so that x R x.• R is symmetric: Let x, y ∈ A such that x R y. Then there is an index ksuch that x, y ∈ Ak. But then y, x ∈ Ak. That is, y R x.• R is transitive: Let x, y, z ∈ A such that x R y and y R z. Then there existindices i and j such that x, y ∈ Ai and y, z ∈ Aj. Since y ∈ Ai ∩ Aj, by (ii)we must have i = j. This implies that x, y, z ∈ Ai and in particular x, z ∈ Ai.Hence, x R z
Problem 16.10Let R and S be two equivalence relations on a non-empty set A. Show thatR ∩ S is also an equivalence relation on A.
Solution.• If a ∈ A then (a, a) ∈ R and (a, a) ∈ S. Hence, (a, a) ∈ R∩S so that R∩Sis reflexive.• If (a, b) ∈ R ∩ S then (a, b) ∈ R and (a, b) ∈ S. Since both R and S aresymmetric, we have (b, a) ∈ R and (b, a) ∈ S. Hence, (b, a) ∈ R∩S and R∩Sis symmetric.• If (a, b) ∈ R ∩ S and (b, c) ∈ R ∩ S then (a, b) and (b, c) are both in R andS. Since R and S are transitive, we have (a, c) ∈ R and (a, c) ∈ S. Hence,(a, c) ∈ R ∩ S so that R ∩ S is transitive.We conclude that R ∩ S is an equivalence relation
Problem 16.11Let A be a set of 10 elements and let R be an equivalence relation on A.Suppose that a, b, c ∈ A with |[a]| = 3, |[b]| = 5, and |[c]| = 1. . How manyequivalence classes does A contain?
16 EQUIVALENCE RELATIONS 123
Solution.Every element belongs to exactly one equivalence class. We have nine ele-ments accounted for, so there must be one more class. That is, there are fourequivalence classes
Problem 16.12Define the relation R on Z by a R b if and only id 2a+ 5b ≡ 0(mod 7). Showthat R is an equivalence relation on Z.
Solution.• For all a ∈ Z, we have 2a + 5a = 7a so that a ≡ a(mod 7).• Let a, b ∈ Z such that a R b. Then 2a + 5b = 7k for some k ∈ Z. Hence,2b + 5a = (−5b − 2a) + 7(b + a) = 7k′ where k′ = a + b − k ∈ Z. Hence,b ≡ a(mod 7).• Let a, b, c ∈ Z such that a R b and b R c. Then 2a + 5b = 7k1 and2b+5c = 7k2. Hence, 2a+5c = (2a+5b)+(2b+5c)−7b = 7(k1+k2−b) = 7k3with k3 = k1 + k1 − b ∈ Z. Hence, a R c so that R is transitive.We conclude that R is an equivalence relation
Problem 16.13Consider the following relations on Z. Explain why each is not an equivalencerelation.(a) a R b if and only if a2 − b2 ≤ 7.(b) a R b if and only if a + b ≡ 0(mod 5).(c) a R b if and only if a2 + b2 = 0.
Solution.(a) R is not symmetric since (−1)2 − 32 = −8 ≤ 7 but 32 − (−1)2 = 8 > 7.Also, R is not transitive since 3 R 2 and 0 R 1 but 3 6R1.(b) R is not reflexive since 1 6R1. Also, R is not transitive since 1 + (−1) ≡0(mod 5) and (−1) + 6 ≡ 0(mod 5) but 1 + 6 6≡ 0(mod 5).(c) R is not reflexive since 12 + 12 6= 0
Problem 16.14Let A = {1, 2, 3, 4, 5} and R be an equivalence relation on A given by
R = {(1, 1), (1, 3), (1, 4), (2, 2), (2, 5), (3, 1), (3, 3), (3, 4), (4, 1), (4, 3), (4, 4), (5, 2), (5, 5)}.
Determine the equivalence classes of R.
124 RELATIONS AND FUNCTIONS
Solution.The equivalence classes are:
[1] = [3] = [4] = {1, 3, 4}
and[2] = [5] = {2, 5}
Problem 16.15Let R be the relation on N×N defined by (a, b) R (c, d) if and only if ad = bc.Show that R is an equivalence relation on N× N.
Solution.• (a, a) R (a, a) since a2 = a2.• If (a, b) R (c, d) then ad = bc. Hence, da = cb and (c, d) R (a, b).• Suppose (a, b) R (c, d) and (c, d) R (e, f). Then ad = bc and cf = ed. Henceadf = bcf and cfb = ebd. Hence, adf = ebd. Since d 6= 0, we find af = eb.That is (a, b) R (e, f)
Problem 16.16Let R be the relation on Z defined by x R y if and only if x2 = y2. Showthat R is an equivalence relation. Find [4].
Solution.• Reflexive: x R x since x2 = x2.• Symmetric: If x R y then x2 = y2. Thus, y2 = x2 and y R x.• Transitive: If x R y and y R z then x2 = y2 and y2 = z2. Hence, x2 = z2
and x R z.Finally,
[4] = {x ∈ Z : x R 4} = {x ∈ Z : x2 = 4} = {−4, 4}
Problem 16.17Let A = {a, b, c, d, e}. Suppose R is an equivalence relation on A. Supposealso that a R d and b R c, e R a and c R e. How many equivalence classesdoes R have?
Solution.There is only one equivalence class [a] = [b] = [c] = [d] = [e]
16 EQUIVALENCE RELATIONS 125
Problem 16.18Let R be the relation on R× R defined by
(x1, y1) R (x2, y2)⇔ x21 + y21 = x2
2 + y22.
Show that R is an equivalence relation and describe geometrically the equiv-alence classes of R.
Solution.• Reflexive: (x, x) R (x, x) since x2 + x2 = x2 + x2.• Symmetric: Suppose that (x1, y1) R (x2, y2). Then x2
1 + y21 = x22 + y22 which
is the same as x22 + y22 = x2
1 + y21. That is, (x2, y2) R (x1, y1).• Transitive: Suppose that (x1, y1) R (x2, y2) and (x2, y2) R (x3, y3). Thenx21 + y21 = x2
2 + y22 and x22 + y22 = x2
3 + y23. Hence, x21 + y21 = x2
3 + y23. That is(x1, y1) R (x3, y3).The equivalence classes are circles centered at the origin
Problem 16.19Define a relation R on R by
a R b⇔ |a|+ |b| = |a + b|.
Show that R is reflexive, symmetric, but not transitive.
Solution.• Reflexive: a R a since |x|+ |x| = |x + x| = 2|x|.• Symmetric: If a R b then |a|+ |b| = |a + b|. This is the same as |b|+ |a| =|b + a|. That is, b R a.• R is not transitive since 1 R 0 and 0 R (−1) but 1 6R(−1)
Problem 16.20Let R be the relation on R defined by
a R b⇔ a− b ∈ Z.
Show that of a R b and c R d then (a + c) R (b + d).
Solution.We have that a− b = k1 ∈ Z and c− d = k2 ∈ Z. Hence, (a + c)− (b + d) =(a− b)− (d− c) = k1 − k2 ∈ Z. That is, (a + c) R (b + d)
126 RELATIONS AND FUNCTIONS
17 Partial Order Relations
Problem 17.1Define a relation R on Z as follows: for all m,n ∈ Z
m R n⇔ m + n is even.
Is R a partial order? Prove or give a counterexample.
Solution.For all m ∈ Z we have that m+m is even and so m R m. This shows that Ris reflexive. R is not antisymmetric sine 2 R 4 and 4 R 2 but 2 6= 4. Hence,R is not a partial order relation
Problem 17.2Define a relation R on R as follows: for all m,n ∈ R
m R n⇔ m2 ≤ n2.
Is R a partial order? Prove or give a counterexample.
Solution.R is not antisymmetric since 2 R (−2) and (−2) R 2 but 2 6= −2. Hence, Ris not a partial order relation
Problem 17.3Let S = {0, 1} and consider the partial order relation R defined on S × S asfollows: for all ordered pairs (a, b) and (c, d) in S × S
(a, b) R (c, d)⇔ a ≤ c and b ≤ d.
Draw the Hasse diagram for R.
Solution.
17 PARTIAL ORDER RELATIONS 127
Problem 17.4Consider the “divides” relation defined on the set A = {1, 2, 22, · · · , 2n},where n is a nonnegative integer.a. Prove that this relation is a total order on A.b. Draw the Hasse diagram for this relation when n = 3.
Solution.a. Reflexivity: for all 0 ≤ i ≤ n, we have 2i|2i.Antisymmetry: Suppose that 2i|2j and 2j|2i. Then i ≤ j and j ≤ i. Since therelation ≤ is antisymmetric on N we conclude that i = j. That is 2i = 2j.Transitivity: Suppose that 2i|2j and 2j|2k. Then i ≤ j and j ≤ k. Since ≤ istransitive on N we conclude that i ≤ k. Hence, 2i|2k.Now, if 2i and 2j are element of A then either i ≤ j or j ≤ i. That is, either2i|2j or 2j|2i. So A is a totally ordered set.b.
Problem 17.5Let R be a partial order on A. Show that R−1 is also a partial order on A.
Solution.R−1 is reflexive: Since aRa for all a ∈ A, we have aR−1a.R−1 is antisymmetric: Suppose that aR−1b and bR−1a. Then aRb and bRa.Since R is antisymmetric, we have a = b.R−1 is reflexive: Suppose that aR−1b and bR−1c. Then cRb and bRa. SinceR is transitive, we must have cRa. Hence, aR−1c
Problem 17.6An order relation R is given by the following Hasse-diagram. Find the cor-
128 RELATIONS AND FUNCTIONS
responding digraph.
.
Solution.The digraph is shown in the figure below
Problem 17.7Let F be a collection of finite sets. On this set, we define the relation R by
A R B ⇔ |A| ≤ |B|.
Show that R is reflexive, transitive but is neither anti-symmetric nor sym-metric.
Solution.(1) R is reflexive since |A| ≤ |A| for all A ∈ F .(2) R is not anti-symmetric: Letting A = {1, 2} and B = {3, 4} we see that
17 PARTIAL ORDER RELATIONS 129
A R B and B R A but A 6= B.(3) R is not symmetric: Letting A = {1, 2} and B = {3, 4, 5} we see thatA R B but B not related to A.(4) R is transitive: Suppose A R B and B R C. Then |A| ≤ |B| and |B| ≤ |C|.Thus, |A| ≤ |C|. That is, A R C
Problem 17.8Let A = N× N and define R on A by
(a, b)R(c, d)⇔ a ≤ c and b ≥ d.
Show that (A,R) is a poset.
Solution.(1) Reflexive: For any (a, a) ∈ A, we have (a, a)R(a, a) because a ≤ a anda ≥ a.(2) Anti-symmetric: Suppose (a, b)R(c, d) and (c, d)R(a, b). Then a ≤ c, b ≥d, c ≤ a, and d ≥ b. Hence, a = c and b = d. That is (a, b) = (c, d).(3) Transitive: Suppose (a, b)R(c, d) and (c, d)R(e, f). Then a ≤ c, b ≥ d, c ≤e, and d ≥ f. Hence, a ≤ e and b ≥ f. That is, (a, b)R(e, f)
Problem 17.9Let A = {a, b, c} and consider the poset (P(A),⊆). Let S = {{a}, {a, c}, {a, b}}.Find the least element and the greatest element of S.
Solution.{a} is the least element of S. S does not have a greatest element
Problem 17.10Show that the relation ≤ on Z is not well-ordered.
Solution.The set of negative integers is a non-empty subset of Z with no least-element.Hence, the relation ≤ on Z is not well-ordered
Problem 17.11Show that if A is well-ordered under ≤ then ≤ is a total order on A.
130 RELATIONS AND FUNCTIONS
Solution.Let a, b ∈ A. Then the set {a, b} is a non-empty subset of A so that it hasa least element. That is, either a ≤ b or b ≤ a. But this shows that a and bare comparable. Hence, ≤ is a total order on A
Problem 17.12Suppose that (A,≤) is a poset and S is a non-empty subset of A. If S has aleast element then this element is unique.
Solution.Suppose that a and b are least elements of S. Then we have a ≤ b and b ≤ a.Since ≤ is anti-symmetric, we must have a = b
Problem 17.13Let R be thr relation on Z× Z defined by
(a, b)R(c, d)⇔ either a < c or (a = c and b ≤ d).
This relation is known as the dictionary order. Show that R is a totalorder.
Solution.Reflexive: (a, a)R(a, a) since the statement (a = a and a ≤ a) is true.Antisymmetric: Suppose (a, b)R(c, d) and (c, d)R(a, b). Since (a, b)R(c, d),either a < c or (a = c and b ≤ d). If a < c then both statements c < a and(c = a and b ≤ d) are false. This means that (c, d) 6hspace−0.04inR(a, b), a contradiction. Hence, we must have a = c. Hence,(a, b)R(a, d) implies b ≤ d and (a, d)R(a, b) implies d ≤ b. Hence, b = d andtherefore (a, b) = (c, d).Transitive: Suppose (a, b)R(c, d) and (c, d)R(e, f). We have(i) If a < c and c < e then a < e so that (a, b)R(e, f).(ii) If a < c and c = e then a < e so that (a, b)R(e, f).(iii) If a = c and c < e then a < e so that (a, b)R(e, f).(iv) If a = c and c = e then a = e and (b ≤ d and d ≤ f). Thus, a = e andb ≤ f so that (a, b)R(e, f).We conclude that (Z× Z, R) is a poset
Problem 17.14Define the relation R on R by
aRb⇔ a3 − 4a ≤ b3 − 4b.
Determine whether or not (R, R) is a poset.
17 PARTIAL ORDER RELATIONS 131
Solution.Reflexive: aRa since a3 − 4a ≤ a3 − 4a.Antisymmetric: 2R(−2) and (−2)R2 but 2 6= −2. Hence, R is not antisym-metric and therefore R is not a partial order on R
Problem 17.15Let A = {a, b, c, d} and consider the poset (P(A),⊆). Draw the Hasse dia-gram of this relation.
Solution.The Hasse diagram is shown below
Problem 17.16Let A be a non-empty set with |A| ≥ 2. Show that P(A) is not a total orderunder the relation of ⊆ .
Solution.Let a, b ∈ A with a 6= b. Then {a} 6⊆ {b} and {b} 6⊆ {a}. That is {a} and{b} are not comparable
Problem 17.17Let R be the relation on P(U) defined by
ARB ⇔ A ∩B = A.
Show that R is reflexive and antisymmetric.
132 RELATIONS AND FUNCTIONS
Solution.For all A ∈ P(U), we have A ∩ A = A so that R is reflexive. Now, if ARBand BRA then A∩B = A and B ∩A = B. Since, A∩B = B ∩A, we obtainA = B. Hence, A is antisymmetric .
Problem 17.18Let R be a relation on A. Show that if R is symmetric and transitive then itis an equivalence relation on A.
Solution.We just need to show that R is reflexive. Let a ∈ A. If aRa then we aredone. Suppose that aRb for some b ∈ A. Since R is symmetric, we havebRa. Hence, aRb and bRa. Since R is transitive, we have aRa. Hence, R isreflexive
Problem 17.19Draw the Hasse diagram for the partial order “divides” on the set A consistingof all the natural numbers less than or equal to 12.
Solution.The Hasse diagram is shown below
Problem 17.20Show that the set of positive real numbers is not well-ordered.
Solution.The set of positive real numbers does not have a least element. Hence, it isnot well-ordered
18 BIJECTIVE AND INVERSE FUNCTIONS 133
18 Bijective and Inverse Functions
Problem 18.1(a) Define g : Z→ Z by g(n) = 3n− 2.(i) Is g one-to-one? Prove or give a counterexample.(ii) Is g onto? Prove or give a counterexample.(b) Define G : R → R by G(x) = 3x − 2. Is G onto? Prove or give acounterexample.
Solution.(a) (i) Suppose that g(n1) = g(n2). Then 3n1 − 2 = 3n2 − 2. This impliesthat n1 = n2 so that g is one-to-one.(ii) g is not onto because there is no integer n such that g(n) = 2.(b) Let y ∈ R such that G(x) = y. That is, 3x− 2 = y. Solving for x we findx = y+2
3∈ R. Moreover, G(y+2
3) = y. So G is onto
Problem 18.2Determine whether the function f : R→ R given by f(x) = x+1
xis one-to-one
or not.
Solution.Suppose that f(x1) = f(x2). Then x1+1
x1= x2+1
x2. Cross multiply to obtain
x1x2 + x1 = x1x2 + x2. That is, x1 = x2 so that f is one-to-one
Problem 18.3Determine whether the function f : R → R given by f(x) = x
x2+1is one-to-
one or not.
Solution.Suppose that f(x1) = f(x2). Then x1
x21+1
= x2
x22+1
. Cross multiply to obtain
x1x22 + x1 = x2
1x2 + x2. That is, (x1 − x2)(x1x2 − 1) = 0. This is satisfied forexample for x1 = 2 and x1 = 1
2. Thus, f(2) = f(1
2) with 2 6= 1
2. Thus, f is
not one-to-one
Problem 18.4Let f : R→ Z be the floor function f(x) = bxc.(a) Is f one-to-one? Prove or give a counterexample.(b) Is f onto? Prove or give a counterexample.
134 RELATIONS AND FUNCTIONS
Solution.(a) Since f(0.2) = f(0.3) = 0 with 0.2 6= 0.3, f is not one-to-one.(b) f is onto since for any x ∈ Z, x ∈ R and f(x) = x
Problem 18.5If : R→ R and g : R→ R are one-to-one functions, is f + g also one-to-one?Justify your answer.
Solution.The answer is no. Let f(x) = x− 1 and g(x) = −x+ 1. Then both functionsare one-to-one but f + g = 0 is not one-to-one
Problem 18.6Define F : P{a, b, c} → N to be the number of elements of a subset of{a, b, c}.(a) Is F one-to-one? Prove or give a counterexample.(b) Is F onto? Prove or give a counterexample.
Solution.(a) Since F ({a}) = F ({b}) = 1 and {a} 6= {b}, F is not one-to-one.(b) Since Range(F ) = {0, 1, 2, 3} 6= N, F is not onto
Problem 18.7If f : Z → Z and g : Z → Z are onto functions, is f + g also onto? Justifyyour answer.
Solution.The answer is no. The functions f, g : Z → Z defined by f(n) = n + 2 andg(n) = n + 3 are both onto but (f + g)(n) = 2n + 5 is not onto since thereis no integer n such that (f + g)(n) = 2
Problem 18.8Show that the function F−1 : R → R given by F−1(y) = y−2
3is the inverse
of the function F (x) = 3x + 2.
Solution.We have (F ◦ F−1)(y) = F (F−1(y)) = F (y−2
3) = 3(y−2
3) + 2 = y. This shows
that F ◦ F−1 = IR. Similarly, (F−1 ◦ F )(x) = F−1(F (x)) = F−1(3x + 2) =3x+2−2
3= x. Hence, F−1 ◦ F = IR
18 BIJECTIVE AND INVERSE FUNCTIONS 135
Problem 18.9If f : X → Y and g : Y → Z are functions and g ◦ f : X → Z is one-to-one,must both f and g be one-to-one? Prove or give a counterexample.
Solution.Let f : {a, b} → {1, 2, 3} be the function given by f(a) = 2, f(b) = 3.Then f is one-to-one. Let g : {1, 2, 3} → {0, 1} be the function given byg(1) = g(2) = 0 and g(3) = 1. Then g is not one-to-one. However, thecomposition function g ◦ f : {a, b} → {0, 1} given by (g ◦ f)(a) = 0 and(g ◦ f)(b) = 1 is one-to-one
Problem 18.10If f : X → Y and g : Y → Z are functions and g ◦ f : X → Z is onto, mustboth f and g be onto? Prove or give a counterexample.
Solution.Let f : {a, b} → {1, 2, 3} be the function given by f(a) = 2, f(b) = 3.Then f is not onto. Let g : {1, 2, 3} → {0, 1} be the function given byg(1) = g(2) = 0 and g(3) = 1. Then g is onto. However, the compositionfunction g ◦ f : {a, b} → {0, 1} given by (g ◦ f)(a) = 0 and (g ◦ f)(b) = 1 isonto
Problem 18.11If f : X → Y and g : Y → Z are functions and g ◦ f : X → Z is one-to-one,must f be one-to-one? Prove or give a counterexample.
Solution.Let x1, x2 ∈ X such that f(x1) = f(x2). Then g(f(x1)) = g(f(x2)). That is,(g ◦ f)(x1) = (g ◦ f)(x2). Since g ◦ f is one-to-one, we have x1 = x2. Thisargument shows that f must be one-to-one
Problem 18.12If f : X → Y and g : Y → Z are functions and g ◦ f : X → Z is onto, mustg be onto? Prove or give a counterexample.
Solution.Let z ∈ Z. Since g ◦ f is onto, there is an x ∈ X such that (g ◦ f)(x) = z.That is, there is a y = f(x) ∈ Y such that g(y) = z. This shows that g isonto
136 RELATIONS AND FUNCTIONS
Problem 18.13Let f : W → X, g : X → Y and h : Y → Z be functions. Must h ◦ (g ◦ f) =(h ◦ g) ◦ f? Prove or give a counterexample.
Solution.Let w ∈ W. Then (h ◦ (g ◦ f))(w) = h((g ◦ f)(w)) = h(g(f(w))). Similarly,((h ◦ g) ◦ f)(w) = (h ◦ g)(f(w)) = h(g(f(w))). It follows that h ◦ (g ◦ f) =(h ◦ g) ◦ f
Problem 18.14Let f : X → Y and g : Y → Z be two bijective functions. Show that (g◦f)−1
exists and (g ◦ f)−1 = f−1 ◦ g−1.
Solution.By Example 18.8, g ◦ f is bijective. Hence, by Theorem 18.1 (g ◦ f)−1 exists.Since (f−1 ◦ g−1)◦ (g ◦f) = f−1 ◦ (g−1 ◦ g)◦f = f−1 ◦ (IY ◦f) = f−1 ◦f = IXand similalrly (g ◦ f) ◦ (f−1 ◦ g−1) = IY , we find (g ◦ f)−1 = f−1 ◦ g−1 by theuniqueness of the inverse function
Problem 18.15(a) Compare |A| and |B| when f : A→ B is one-to-one.(b) Compare |A| and |B| when f : A→ B is onto.(c) Compare |A| and |B| when f : A→ B is one-to-one correspondence.
Solution.(a) If f is one-to-one and |A| > |B| then some the elements of A share asame element in B. But this contradicts the fact that f is one-to-one. Hence,|A| ≤ |B.(b) If f is onto and |A| < |B| then there are at least two elements in B withthe same preimage in A. But this contradicts the definition of a function.Hence, |A| ≥ |B|.(c) It follows from (a) and (b) that |A| = |B|
Problem 18.16Let f : A→ B be a function. Define the relation R on A by
aRB ⇔ f(a) = f(b).
(a) Show that R is an equivalence relation.(b) Show that the function F : A/R → Range(f) defined by F ([a]) = f(a)is one-to-one correspondence.
18 BIJECTIVE AND INVERSE FUNCTIONS 137
Solution.(a) R is reflexive since f(a) = f(a) for all a ∈ A. That is, aRa for all a ∈ A.Now, suppose that aRB. Then f(a) = f(b) or f(b) = f(a). Hence, bRa andR is symmetric. Finally, suppose that aRb and bRc. Then f(a) = f(b) =f(c). Hence, aRc and R is transitive. We conclude that R is an equivalencerelation.(b) First, we show that F is a function. Suppose that [a] = [b]. Then aRband therefore f(a) = f(b). That is, F ([a]) = F ([b]). Next, we show that F isone-to-one. Suppose that F ([a]) = F ([b]). Then f(a) = f(b). That is, aRB.Hence, [a] = [b]. Finally, we show that F is onto. Suppose y ∈ Range(f).Then y = f(a) for some a ∈ A. But [a] ∈ A/R and F ([a]) = f(a) = y
Problem 18.17Let A = B = {1, 2, 3}. Consider the function f = {(1, 2), (2, 3), (3, 3)}. Is finjective? Is f surjective?
Solution.Since f(2) = f(3) and 2 6= 3, f is not injective. f is not surjective sincef(x) 6= 1 for any x ∈ A
Problem 18.18Show that f : Z→ N defined by f(x) = |x|+ 1 is onto but not one-to-one.
Solution.Let y ∈ N. Then y ≥ 1 and x = y − 1 ≥ 0. Hence, f(x) = |y − 1| + 1 =y − 1 + 1 = y. Thus, f is onto. Now, since f(−2) = f(2) = 3 and 2 6= −2, fis not one-to-one
Problem 18.19Let f : A → B. For any subset C of B we define f−1(C) = {a ∈ A : f(a) ∈C}. Show that f−1(S ∪ T ) = f−1(S) ∪ f−1(T ) where S, T ⊆ B.
Solution.Let a ∈ f−1(S ∪ T ). Then f(a) ∈ S ∪ T. Thus, either f(a) ∈ S or f(a) ∈ T.Hence, either a ∈ f−1(S) or a ∈ f−1(T ). That is, a ∈ f−1(S)∪f−1(T ). Nowmsuppose that a ∈ f−1(S) ∪ f−1(T ). Then a ∈ f−1(S) or a ∈ f−1(T ). Thus,either f(a) ∈ S or f(a) ∈ T. That is, f(a) ∈ S∪T and hence a ∈ f−1(S∪T )
Problem 18.20Find the inverse of the function f(x) = x+1
3x+2.
138 RELATIONS AND FUNCTIONS
Solution.Let y ∈ R. Since f is onto, there is x ∈ R such that f(x) = y. That is,y = x+1
3x+2. Solving for x, we find x = 1−2y
3y−1 . Thus, f−1(y) = x = 1−2y3y−1
19 THE PIGEONHOLE PRINCIPLE 139
19 The Pigeonhole Principle
Problem 19.1A family has 10 children. Show that at least two children were born on thesame day of the week.
Solution.The children are the pigeons (n = 10) and the number of days in the week(k = 7) are the pigeonholes. Since n > k, the Pigeonjole Principle assertsthat at least two children were born on the same day of the week
Problem 19.2Show that if 11 people take an elevator in a 10-story building then at leasttwo people exist the elevator on the same floor.
Solution.The 11 people are the pigeons and the 10 floors are the pigeonholes. By thePigeonhole principle, at least two people will exist the elevator on the samefloor
Problem 19.3A class of 11 students wrote a short essay. George Perry made 9 errors, eachof the other students made less than that number. Prove that at least twostudents made equal number of errors.
Solution.The pigeons are the 11 students. The smallest number of errors is 0 and thelargest number of errors is 9. The Pigeonholes are the number of errors ofeach student with one of them reserved to Gearoge Perry. By the Pigeonholeprinciple, there are at least two students that made equal number of errors
Problem 19.4Let A = {1, 2, 3, 4, 5, 6, 7, 8}. Prove that if five integers are selected from A,then at least one pair of integers have a sum of 9.
Solution.The pigeons are the five selected integers and the holes are the subsets{1, 8}, {2, 7}, {3, 6}, {4, 5}. By the Pigeonhole principle, there are at leasttwo must be from the same subset. But then the sum of these two integersis 9
140 RELATIONS AND FUNCTIONS
Problem 19.5Prove that, given any 12 natural numbers, we can chose two of them andsuch that their difference is divisible by 11.
Solution.The remainder of the division of a natural number by 11 are: 0,1,2,3,4,5,6,7,8,9,10.If we count these as the pigeongoles and the 12 numbers as the pigeons thenby the Pigeonhole principle there must be at least two numbers with thesame remainder. But in this case, the difference of these two numbers is amultiple of 11, i.e., the difference is divisible by 11
Problem 19.6In a group of 1500, find the least number of people who share the samebirthday.
Solution.We have n = 1500 and k = 365 or k = 366. Thus,
⌈1500365
⌉=⌈1500366
⌉= 5.
Hence, at least five people share the same birthday
Problem 19.7Suppose that every student in a class of 18 flipped a coin four times. Showthat at least two students would have the exact same sequence of heads andtails.
Solution.There are 16 combinations of heads and tails. Since there are more than16 students in this class, at least two of them had to have the exact samesequence. In this case, the “pigeons” are the students, and the “holes” intowhich they are being placed are the possible sequences of heads and tails
Problem 19.8Show that mong any N positive integers, there exists 2 whose difference isdivisible by N − 1.
Solution.The remainder of the division of a natural number by N−1 are: 0, 1, 2, 3, · · · , N−1. If we count these as the pigeongoles and the N numbers as the pigeonsand since
⌈N
N−1
⌉≥ 2, by the Pigeonhole principle there must be at least two
numbers with the same remainder. But in this case, the difference of thesetwo numbers is a multiple of N − 1, i.e., the difference is divisible by N − 1
19 THE PIGEONHOLE PRINCIPLE 141
Problem 19.9Given any six integers between 1 and 10, inclusive, show that 2 of them havean odd sum.
Solution.The pigeons are the six chosen integers so that n = 6. Consider two pigeon-holes: {1, 3, 5, 7, 9} and {2, 4, 6, 8, 10}. By the Pigeonhole Principle, if we picksix integers between 1 and 10, there must be at least one even integer andone odd integer. However, we know that the sum of an even integer and anodd integer is odd
Problem 19.10Show that among any 13 people, at least two share a birth month.
Solution.The pigeons are the 13 people and the pigeonholes are the months of theyear
Problem 19.11Suppose that more than kn marbles are distributed over n jars. Show thatone jar will contain at least k marbles.
Solution.Suppose that m is the number of marbles distributed. We know that m > kn.By the Pigeonhole Principle, there is a jar with at least
⌈mn
⌉> k. That is,
one the jar has at least k + 1 marbles
Problem 19.12Use the generalized pigeonhole principle to show that among 85 people, atleast 4 must have the same last initial.
Solution.The pigeons are the 85 people and the pigeonholes are the 26 letters of thealphabet
Problem 19.13How many students must be in a class to guarantee that at least two studentsreceive the same score on the final exam, if the exam is graded on a scalefrom 0 to 100 points.
142 RELATIONS AND FUNCTIONS
Solution.The pigeonholes are the 101 possible grades. Therefore there must be at least102 students in the class in order for at least two receive the same score
Problem 19.14Show that for any given N positive integers, the sum of some of these integers(perhaps one of the numbers itself) is divisible by N.
Solution.For any sum of integers from the list, the possible remainders of the divisionby N are: 0, 1, · · · , N − 1. If there is a sum with a zero remainder whendivided by N then we are done. Otherwise, let the N numbers be denotedby a1, a2, · · · , aN and define ri to be the remainder of the division of Si =a1 + a2 + · · · + ai by N with ri ∈ {1, 2, · · · , N − 1} and 1 ≤ i ≤ N. Thus,the pigeons are S1, S2, · · · , SN and the pigeonholes are 1, 2, · · · , N − 1. Bythe Pigeonhole Principle, there are two sums Si and Sj (i < j) such thatSi = Nqi + r and Sj = Nqj + r. Hence, ai+1 + · · ·+aj = Sj−Si = N(qj− qi).That is, ai+1 + · · ·+ aj is divisible by N
Problem 19.15If there are 6 people at a party, then show that either 3 of them knew eachother before the party or 3 of them were complete strangers before the party.
Solution.Let A be the group of people who knew each other before the party and Bthe group who were complete strangers before the party. Then n = 6 andk = 2. By the Pigeonhole Principle, either 3 of them knew each other beforethe party or 3 of them were complete strangers before the party
Problem 19.16How many cards must be selected from a standard deck of 52 cards to ensurethat we get at least 3 cards of the same suit?
Solution.Let n be the number of cards needed so that
⌈n4
⌉≥ 3 where k = 4 represents
the number of suits. By the Pigeonhole Principle, n must be at least 9
Problem 19.17Suppose we have 27 different odd positive integers all less than 100. Showthat there is a pair of numbers whose sum is 102.
19 THE PIGEONHOLE PRINCIPLE 143
Solution.There are 50 positive odd numbers less than 100:
{1, 3, 5, 7, · · · , 97, 99}.
We can partition these into subsets as follows:
{1}, {3, 99}, {5, 97}, · · · , {49, 53}, {51}.
Note that the sets of size 2 have elements which add to 102. There are26 subsets (pigeonholes) and 27 odd numbers (pigeons). So at least twonumbers (in fact, exactly two numbers) must lie in the same subset, andtherefore these add to 102
Problem 19.18Among 100 people, at least how many people were born in the same month?
Solution.With n = 100 and k = 12, we find
⌈10012
⌉= 9. Hence, at least 9 people were
born in the same month
Problem 19.19Show that an arbitrary subset A of n + 1 integers from the set {1, · · · , 2n}will contain a pair of consecutive integers.
Solution.A partition of {1, · · · , 2n} is
{1, 2}, {3, 4}, · · · , {2n− 1, 2n}.
These are the n pigeonholes and the elements of A are the pigeons. Accordingto the Pigeonhole Principle, there are two members of A that belong to apartition set. But, then these two numbers are consecutive
Problem 19.20Fifteen children together gathered 100 nuts. Prove that some pair of chil-dren gathered the same number of nuts. Hint: Use the method of proof bycontradiction.
Solution.Suppose all the children gathered a different number of nuts. Then the fewesttotal number is 0 + 1 + 2 + 3 + 4 + 5 + 6 + · · ·+ 14 = 105, but this more than100, a contradiction
144 RELATIONS AND FUNCTIONS
20 Recursion
Problem 20.1Find the first four terms of the following recursively defined sequence:{
v1 = 1, v2 = 2vn = vn−1 + vn−2 + 1, n ≥ 3
Solution.The first four terms are:
v1 =1
v2 =2
v3 =4
v4 =7
Problem 20.2Prove each of the following for the Fibonacci sequence:a. F 2
k − F 2k−1 = FkFk+1 − Fk+1Fk−1, k ≥ 1.
b. F 2k+1 − F 2
k − F 2k−1 = 2FkFk−1, k ≥ 1.
c. F 2k+1 − F 2
k = Fk−1Fk+2, k ≤ 1.d. Fn+2Fn − F 2
n+1 = (−1)n for all n ≥ 0.
Solution.a. We have
F 2k − F 2
k−1 =(Fk+1 − Fk−1)2 − F 2
k−1
=F 2k+1 − 2Fk+1Fk−1
=Fk+1(Fk+1 − 2Fk−1)
=Fk+1(Fk + Fk−1 − 2Fk−1)
=Fk+1(Fk − Fk−1)
=Fk+1Fk − Fk+1Fk−1.
b. We have
F 2k+1 − F 2
k − F 2k−1 =(Fk + Fk−1)
2 − F 2k − F 2
k−1
=2FkFk−1.
20 RECURSION 145
c. We have
F 2k+1 − F 2
k =(Fk+1 − Fk)(Fk+1 + Fk)
=(Fk + Fk−1 − Fk)Fk+2 = Fk−1Fk+2.
d. The proof is by induction on n ≥ 0.
Basis of induction: F2F0 − F 21 = (2)(1)− 1 = 1 = (−1)0.
Induction hypothesis: Suppose that Fn+2Fn − F 2n+1 = (−1)n.
Induction step: We must show that Fn+3Fn+1 − F 2n+2 = (−1)n+1. Indeed,
Fn+3Fn+1 − F 2n+2 =(Fn+2 + Fn+1)Fn+1 − F 2
n+2
=Fn+2Fn+1 + F 2n+1 − F 2
n+2
=Fn+2(Fn+1 − Fn+2) + F 2n+1
=− Fn+2Fn + F 2n+1
=− (−1)n = (−1)n+1
Problem 20.3Find limn→∞
Fn+1
Fnwhere F0, F1, F2, · · · is the Fibonacci sequence. (Assume
that the limit exists.)
Solution.Suppose that limn→∞
Fn+1
Fn= L. Since Fn+1
Fn> 1 then L ≥ 1.
On the other hand, we have
L = limn→∞
Fn + Fn−1
Fn
= limn→∞
(Fn−1
Fn
+ 1)
= limn→∞
(1Fn
Fn−1
+ 1)
=1
L+ 1.
Multiply both sides by L to obtain
L2 − L− 1 = 0.
Solving we find L = 1−√5
2< 1 and L = 1+
√5
2> 1
146 RELATIONS AND FUNCTIONS
Problem 20.4Define x0, x1, x2, · · · as follows:
xn =√
2 + xn−1, x0 = 0.
Find limn→∞ xn.
Solution.Suppose that L = limn→∞ xn. Then L =
√2 + L. Squaring both sides we
obtain L2 = L + 2. Solving this equation for L we find L = −1 and L = 2.Since L ≥ 0 we see that L = 2
Problem 20.5Find a formula for each of the following sums:a. 1 + 2 + · · ·+ (n− 1), n ≥ 2.b. 3 + 2 + 4 + 6 + 8 + · · ·+ 2n, n ≥ 1.c. 3 · 1 + 3 · 2 + 3 · 3 + · · · 3 · n, n ≥ 1.
Solution.a. 1 + 2 + · · ·+ (n− 1) = n(n−1)
2.
b. 3 + 2 + 4 + 6 + 8 + · · ·+ 2n = 3 + 2(1 + 2 + · · ·n) = 3 + n(n + 1).
c. 3 · 1 + 3 · 2 + 3 · 3 + · · ·+ 3 · n = 3n(n+1)2
Problem 20.6Find a formula for each of the following sums:a. 1 + 2 + 22 + · · ·+ 2n−1, n ≥ 1.b. 3n−1 + 3n−2 + · · ·+ 32 + 3 + 1, n ≥ 1.c. 2n + 3 · 2n−2 + 3 · 2n−3 + · · ·+ 3 · 22 + 3 · 2 + 3, n ≥ 1.d. 2n − 2n−1 + 2n−2 − 2n−3 + · · ·+ (−1)n−1 · 2 + (−1)n, n ≥ 1.
Solution.a. 1 + 2 + 22 + · · ·+ 2n−1 = 2n−1
2−1 = 2n − 1.
b. 3n−1 + 3n−2 + · · ·+ 32 + 3 + 1 = 3n−12
.c. 2n + 3 · 2n−2 + 3 · 2n−3 + · · ·+ 3 · 22 + 3 · 2 + 3 = 2n+1 − 3.d. 2n − 2n−1 + 2n−2 − 2n−3 + · · · + (−1)n−1 · 2 + (−1)n = 2n
∑nk=0(−
12)k =
2n+1
3(1− (−1
2)n+1)
Problem 20.7Use iteration to guess a formula for the following recusively defined sequenceand then use mathematical induction to prove the validity of your formula:c1 = 1, cn = 3cn−1 + 1, for all n ≥ 2.
20 RECURSION 147
Solution.Listing the first five terms of the sequence we find:
c1 =1
c2 =1 + 31
c3 =1 + 31 + 32
c4 =1 + 31 + 32 + 33
c5 =1 + 31 + 32 + 33 + 34.
Our guess is cn = 1 + 3 + 32 + · · ·+ 3n−1 = 3n−12
. Next, we prove by inductionthe validity of this formula.
Basis of induction: c1 = 1 = 31−12
.Induction hypothesis: Suppose that cn = 3n−1
2.
Induction step: We must show that cn+1 = 3n+1−12
. Indeed,
cn+1 =3cn + 1
=3(3n − 1)
2+ 1
=3n+1 − 3
2+ 1
=3n+1 − 1
2
Problem 20.8Use iteration to guess a formula for the following recusively defined sequenceand then use mathematical induction to prove the validity of your formula:w0 = 1, wn = 2n − wn−1, for all n ≥ 2.
Solution.Listing the first five terms of the sequence we find:
w0 =1
w1 =2− 1
w2 =22 − 2 + 1
w3 =23 − 22 + 2− 1
w4 =24 − 23 + 22 − 2 + 1.
148 RELATIONS AND FUNCTIONS
Our guess is wn =∑n
k=0(−1)k2n−k =2n+1(1−(− 1
2)n+1)
3. Next, we prove the
validity of this formula by mathematical induction.
Basis of induction: w0 = 1 =20+1(1−(− 1
2)0+1)
3.
Induction hypothesis: Suppose that wn =2n+1(1−(− 1
2)n+1)
3.
Induction step: We must show that wn+1 =2n+2(1−(− 1
2)n+2)
3. Indeed,
wn+1 =2n+1 − wn
=2n+1 −2n+1(1− (−1
2)n+1)
3
=2n+2(1− (−1
2)n+2)
3
Problem 20.9Determine whether the recursively defined sequence: a1 = 0 and an = 2an−1+n− 1 satisfies the explicit formula an = (n− 1)2, n ≥ 1.
Solution.If the given formula is the correct one then it must satisfy the mathematicalinduction argument.Basis of induction: a1 = 0(1− 1)2.Induction hypothesis: Suppose that an = (n− 1)2.Induction step: We must then have an+1 = n2. This implies 2an +n− 1 = n2
and by the induction hypothesis we have 2(n− 1)2 +n− 1 = n2. Simplifyingto obtain n2 − 3n + 1 = 0 and this equation has no integer solutions
Problem 20.10Which of the following are second-order homogeneous recurrence relationswith constant coefficients?a. an = 2an−1 − 5an−2.b. bn = nbn−1 + bn−2.c. cn = 3cn−1 · c2n−2.d. dn = 3dn−1 + dn−2.e. rn = rn−1 − rn−2 − 2.f. sn = 10sn−2.
Solution.a. Yes. A = 2 and B = −5.
20 RECURSION 149
b. No. A = n depends on n.c. No. Degree of cn−2 is 2.d. Yes. A = 3, B = 1.e. No because of the −2.f. Yes. A = 0, B = 10
Problem 20.11Let a0, a1, a2, · · · be the sequence defined by the explicit formula
an = C · 2n + D, n ≥ 0
where C and D are real numbers.a. Find C and D so that a0 = 1 and a1 = 3. What is a2 in this case?b. Find C and D so that a0 = 0 and a1 = 2. What is a2 in this case?
Solution.a. We have the following system{
C + D = 12C + D = 3.
Solving this system we find C = 2 and D = −1. Hence, an = 2n+1 − 1. Inparticular, a2 = 7.
b. We have the following system{C + D = 02C + D = 2.
Solving this system we find C = 2 and D = −2. Hence, an = 2n+1 − 2. Inparticular, a2 = 6
Problem 20.12Let a0, a1, a2, · · · be the sequence defined by the explicit formula
an = C · 2n + D, n ≥ 0
where C and D are real numbers. Show that for any choice of C and D,
an = 3an−1 − 2an−2, n ≥ 2.
150 RELATIONS AND FUNCTIONS
Solution.Indeed,
3an−1 − 2an−2 =3(C · 2n−1 + D)− 2(C · 2n−2 + D)
=3C · 2n−1 − C · 2n−1 + D
=2C · 2n−1 + D
=C · 2n + D = an
Problem 20.13Let a0, a1, a2, · · · be the sequence defined by the explicit formula{
a0 = 1, a1 = 2an = 2an−1 + 3an−2, n ≥ 2.
Find an explicit formula for the sequence.
Solution.The roots of the characteristic equation
t2 − 2t− 3 = 0
are t = −1 and t = 3. Thus,
an = C(−1)n + D3n
is a solution toan = 2an−1 + 3an−2.
Using the values of a0 and a1 we obtain the system{C + D = 1−C + 3D = 2.
Solving this system to obtain C = 14
and D = 34. Hence,
an =(−1)n
4+
3n+1
4
Problem 20.14Let a0, a1, a2, · · · be the sequence defined by the explicit formula{
a0 = 1, a1 = 4an = 2an−1 − an−2, n ≥ 2.
Find an explicit formula for the sequence.
20 RECURSION 151
Solution.The single root of the characteristic equation
t2 − 2t + 1 = 0
is t = 1. Thus,
an = C + Dn
is a solution to
an = 2an−1 − an−2.
Using the values of a0 and a1 we obtain the system{C = 1
C + D = 4.
Solving this system to obtain C = 1 and D = 3. Hence,
an = 3n + 1
Problem 20.15Show that the relation F : N→ Z given by the rule
F (n) =
1 if n = 1.
F (n2) if n is even
1− F (5n− 9) if n is odd and n > 1
does not define a function.
Solution.If we assume that F is a function then the number F (3) exists. But F (3) =1 + F (6) = 1 + F (3). This implies that 1 = 0 which is impossible. Hence, Fdoes not define a function
Problem 20.16Find a solution for the recurrence relation
a0 =1
an =an−1 + 2, n ≥ 1.
152 RELATIONS AND FUNCTIONS
Solution.Listing the first five terms of the sequence one finds
a0 =1
a1 =1 + 2
a2 =1 + 4
a3 =1 + 6
a4 =1 + 8
Hence, a guess is an = 2n + 1, n ≥ 0. It remains to show that this formula isvalid by using mathematical induction.Basis of induction: For n = 0, a0 = 1 = 2(0) + 1.Induction hypothesis: Suppose that an = 2n + 1.Induction step: We must show that an+1 = 2(n+ 1) + 1. By the definition ofan+1, we have an+1 = an + 2 = 2n + 1 + 2 = 2(n + 1) + 1
Problem 20.17Find a solution to the recurrence relation
a0 =0
an =an−1 + (n− 1), n ≥ 1.
Solution.Writing the first five terms of the sequence we find
a0 =0
a1 =0
a2 =0 + 1
a3 =0 + 1 + 2
a4 =0 + 1 + 2 + 3.
We guess that
an = 0 + 1 + 2 + · · ·+ (n− 1) =n(n− 1)
2.
We next show that the formula is valid by using induction on n ≥ 0.Basis of induction: a0 = 0 = 0(0−1)
2.
20 RECURSION 153
Induction hypothesis: Suppose that an = n(n−1)2
.
Induction step: We must show that an+1 = n(n+1)2
. Indeed,
an+1 =an + n
=n(n− 1)
2+ n
=n(n + 1)
2
Problem 20.18Find an explicit formula for the Fibonacci sequence
a0 =a1 = 1
an =an−1 + an−2.
Solution.The roots of the characteristic equation
t2 − t− 1 = 0
are t = 1−√5
2and t = 1+
√5
2. Thus,
an = C(1 +√
5
2)n + D(
1−√
5
2)n
is a solution toan = an−1 + an−2.
Using the values of a0 and a1 we obtain the system{C + D = 1
C(1+√5
2) + D(1−
√5
2) = 1.
Solving this system to obtain
C =1 +√
5
2√
5and D = −1−
√5
2√
5.
Hence,
an =1√5
(1 +√
5
2)n+1 − 1√
5(1−√
5
2)n+1
154 RELATIONS AND FUNCTIONS
Fundamentals of Counting
21 The Fundamental Principle of Counting
Problem 21.1If each of the 10 digits 0-9 is chosen at random, how many ways can youchoose the following numbers?(a) A two-digit code number, repeated digits permitted.(b) A three-digit identification card number, for which the first digit cannotbe a 0. Repeated digits permitted.(c) A four-digit bicycle lock number, where no digit can be used twice.(d) A five-digit zip code number, with the first digit not zero. Repeateddigits permitted.
Solution.(a) This is a decision with two steps. For the first step we have 10 choicesand for the second we have also 10 choices. By the Fundamental Principleof Counting there are 10 · 10 = 100 two-digit code numbers.(b) This is a decision with three steps. For the first step we have 9 choices,for the second we have 10 choices, and for the third we have 10 choices. Bythe Fundamental Principle of Counting there are 9 · 10 · 10 = 900 three-digitidentification card numbers.(c) This is a decision with four steps. For the first step we have 10 choices,for the second 9 choices, for the third 8 choices, and for fourth 7 choices. Bythe Fundamental Principle of Counting there are 10 ·9 ·8 ·7 = 5040 four-digitcode numbers.(d) This is a decision with five steps. For the first step we have 9 choices, forthe second 10 choices, for the third 10 choices, for the fourth 10 choices, andfor the fifth 10 choices. By the Fundamental Principle of Counting there are9 · 10 · 10 · 10 · 10 = 90, 000 five-digit zip codes
155
156 FUNDAMENTALS OF COUNTING
Problem 21.2(a) If eight cars are entered in a race and three finishing places are considered,how many finishing orders can they finish? Assume no ties.(b) If the top three cars are Buick, Honda, and BMW, in how many possibleorders can they finish?
Solution.(a) This is a decision with three steps. For the first finisher we have 8 choices,7 choices for the second and 6 choices for the third. By the FundamentalPrinciple of Counting there are 8 · 7 · 6 = 336 different first three finishers.(b) This is a decision with three steps. For the first finisher we have 3 choices,2 choices for the second and 1 choice for the third. By the FundamentalPrinciple of Counting there are 3 · 2 · 1 = 6 different arrangements
Problem 21.3You are taking 2 shirts(white and red) and 3 pairs of pants (black, blue, andgray) on a trip. How many different choices of outfits do you have?
Solution.This is a decision with two steps. For the choice of shirts there are 2 choicesand for the choice of pants there are 3 choices. By the Fundamental Principleof Counting there are 3 · 2 = 6 different choices of outfits
Problem 21.4A Poker club has 10 members. A president and a vice-president are to beselected. In how many ways can this be done if everyone is eligible?
Solution.This is a decision with two steps. For the choice of president we have 10possible choices, for the choice of the vice-president we have 9 choices. Bythe Fundamental Principle of Counting there are 10 · 9 = 90 different ways
Problem 21.5In a medical study, patients are classified according to whether they haveregular (RHB) or irregular heartbeat (IHB) and also according to whethertheir blood pressure is low (L), normal (N), or high (H). Use a tree diagramto represent the various outcomes that can occur.
21 THE FUNDAMENTAL PRINCIPLE OF COUNTING 157
Solution.
Problem 21.6If a travel agency offers special weekend trips to 12 different cities, by air,rail, bus, or sea; in how many different ways can such a trip be arranged?
Solution.The decision consists of two steps. The first step is the choice of the citywhere we have 12 choices. The second step is the mean of travel where wehave 4 choices. Hence, a trip can be arranged in 12× 4 = 48 ways
Problem 21.7If twenty different types of wine are entered in wine-tasting competition, inhow many different ways can the judges award a first prize and a secondprize?
Solution.For the first prize we have 20 choices and for the second we have 19 choices.By the Fundamental Principle of Counting we have 20 · 19 = 380 possiblechoices
Problem 21.8In how many ways can the 24 members of a faculty senate of a college choosea president, a vice-president, a secretary, and a treasurer?
158 FUNDAMENTALS OF COUNTING
Solution.For the president we have 24 choices, for the vice-president we have 23 choices,for the secretary we have 22 choices, and for the treasurer we have 21 choices.By the Fundamental Principle of Counting there are 24 ·23 ·22 ·21 = 255, 024possible choices
Problem 21.9Find the number of ways in which four of ten new novels can be ranked first,second, third, and fourth according to their figure sales for the first threemonths.
Solution.For the first ranking we have 10 choices, for the second we have 9 choices,for the third 8 choices, and for the fourth 7 choices. By the FundamentalPrinciple of Counting there are 10 · 9 · 8 · 7 = 5040 possible ways
Problem 21.10How many ways are there to seat 8 people, consisting of 4 couples, in a rowof seats (8 seats wide) if all couples are to get adjacent seats?
Solution.We can look at this problem as a task with 8 seats numbered 1 - 8. Forthe first seat, we have 8 possibilities. For the second seat, we have only 1possibility since each person must sit next to his/her spouse. For the thirdseat, there are 6 possibilities. For the fourth seat, 1 possibility, the fifth seat,4 possibilities, the sixth seat 1 possibility, the seventh seat 2 possibilities,and the eight seat 1 possibility. By the multiplication rule of counting, thereare 8 · 6 · 4 · 2 = 384 ways
Problem 21.11On an English test, a student must write two essays. For the first essay,the student must select from topics A, B, and C. For the second essay, thestudent must select from topics 1, 2, 3, and 4. How many different ways canthe student select the two essay topics?
Solution.This a task with 2 steps. The first step can be accomplished in 3 differentways and the second test can be accomplished in 4 different ways. Hence,there are 3 × 4 = 12 different ways the student can select the two essaytopics
21 THE FUNDAMENTAL PRINCIPLE OF COUNTING 159
Problem 21.12A civics club consists of 9 female Democrats, 5 male Democrats, 6 femaleRepublicans, and 7 male Republicans. How many ways can the club choose(a) a female Democrat and a male Republican to serve on the budget com-mittee?(b) a female Democrat or a male Republican to serve as chairperson?(c) a female or a Republican to serve as chairperson?
Solution.(a) Two tasks to be performed. The first task is to choose a female Democrat,in one of 9 ways, and the second task is to choose a male Republican, in oneof 7 ways. The number of ways of performing both these tasks is 9× 7 = 63.(b) Instead of performing both of the two tasks, the club is to perform onlyone or the other of them. There are 9 ways of selecting a female Democrat,and 7 ways of selecting a male Republican, but the club will carry out only oneof these two options. To find the number of ways of selecting one chairman,we put the 9 female Democrats together with the 7 male Republicans, toobtain 9 + 7 = 16 possibilities for chairperson. Thus there are 16 ways ofchoosing a chairperson meeting the specified conditions.(c) 15 + 13 - 6 = 22 possibilities
Problem 21.13To open your locker at the fitness center, you must enter five digits in orderfrom the set 0, 1, 2, · · · , 9. How many different keypad patterns are possibleif(a) any digits can be used in any position and repetition of digits is allowed?(b) the digit 0 cannot be used as the first digit, but otherwise any digit canbe used in any position and repetition is allowed?(c) any digits can be used in any position, but repetition is not allowed?
Solution.(a) A task with five steps each with 10 possibilities: 10× 10× 10× 10× 10 =105.(b) 9× 10× 10× 10× 10 = 90, 000.(c) 10× 9× 8× 7× 6 = 30, 240
Problem 21.14Professor Watson teaches an advanced cognitive sociology class of 10 stu-dents. She has a visually challenged student, Marie, who must sit in the
160 FUNDAMENTALS OF COUNTING
front row next to her tutor, who is also a member of the class. If there aresix chairs in the first row of her classroom, how many different ways canProfessor Watson assign students to sit in the first row?
Solution.The task consists of three steps: The first step is the number of ways Marieand her tutor can be assigned seats in the from row. In this case, there are5 ways. The second step is to decide where Marie and her tutor will sit inthese two seats. In this case, there are two possibilities. The third step is tofill the remaining four seats with the remaining 8 students. In this case thereare 8× 7× 6× 5 = 1, 680 possibilities. Hence, the task can be accomplishedin 5× 2× 1680 = 16, 800 different ways
Problem 21.15Mias Pizza advertises a special in which you can choose a thin crust, thickcrust, or cheese crust pizza with any combination of different toppings. Thead says that there are almost 200 different ways that you can order the pizza.What is the smallest number of toppings available?
Solution.This is a task with 2 steps. The first step is to choose the type of crust. Inthis case, there are 3 different possibilities. The second step is to choose thetoppings. Let’s say there are n possibilities. By the FCP, there are 3n = 200possibilities to choose a pizza. Solving for n, we find n = 200
3≈ 66.7. Thus,
the smallest number of toppings available is 66 toppings
Problem 21.16Telephone numbers in the United States have 10 digits. The first three arethe area code and the next seven are the local telephone number. How manydifferent telephone numbers are possible within each area code? (A telephonenumber cannot have 0 or 1 as its first or second digit.)
Solution.The answer is: 8× 8× 8× 10× 10× 10× 10× 10 = 6, 400, 000 numbers
Problem 21.17How many non-repeating odd three-digit counting numbers are there?
21 THE FUNDAMENTAL PRINCIPLE OF COUNTING 161
Solution.The task consists of three steps. For the third digit of the number one canassign one of the following: 1, 3, 5, 7, 9. For the first digit, the digit mustbe non-zero and different from the third digit. There are 8 choices. For thesecond digit, any digit can be used (including 0) except for the two non-zerodigits already used. There are 8 choices. By FPC, there are 5× 8× 8 = 320numbers
Problem 21.18A teacher is taking 13 pre-schoolers to the park. How many ways can thechildren line up, in a single line, to board the bus?
Solution.The 13 children can line up in a 13×12×· · ·×2×1 = 6, 227, 020, 800 ways
Problem 21.19A travel agent plans trips for tourists from Chicago to Miami. He gives themthree ways to get from town to town: airplane, bus, train. Once the touristsarrive, there are two ways to get to the hotel: hotel van or taxi. The cost ofeach type of transportation is given in the table below.
Transportation Type Cost ($)Airplane 350Bus 150Train 225Hotel Van 60Taxi 40
Draw a tree diagram to illustrate the possible choices for the tourists. De-termine the cost for each outcome.
Solution.The tree diagram is shown below
162 FUNDAMENTALS OF COUNTING
Problem 21.20Suppose that we are carrting out a quality control check in a particleboardmill and we have to select 3 sheets from the production line, 1 piece at atime. The mill produces either defective (D) or non-defective (N) boards.Draw a tree diagram showing all the outcomes.
Solution.The tree diagram is shown below
22 PERMUTATIONS 163
22 Permutations
Problem 22.1Find m and n so that mPn = 9!
6!
Solution.If m!
(m−n)! = 9!6!
then m = 9 and n = 3
Problem 22.2How many four-letter code words can be formed using a standard 26-letteralphabet(a) if repetition is allowed?(b) if repetition is not allowed?
Solution.(a) 26 · 26 · 26 · 26 = 456, 976(b) 26P4 = 26!
(26−4)! = 26 · 25 · 24 · 23 = 358, 800
Problem 22.3Certain automobile license plates consist of a sequence of three letters fol-lowed by three digits.(a) If letters can not be repeated but digits can, how many possible licenseplates are there?(b) If no letters and no digits are repeated, how many license plates arepossible?
Solution.(a) 26P3 · 10 · 10 · 10 = 15, 600, 000(b) 26P3 ·10 P3 = 15600 · 720 = 11, 232, 000
Problem 22.4A permutation lock has 40 numbers on it.(a) How many different three-number permtations can be made if the num-bers can be repeated?(b) How many different permutations are there if the three numbers aredifferent?
Solution.(a) 40 · 40 · 40 = 64, 000(b) 40P3 = 40!
(40−3)! = 40!37!
= 59, 280
164 FUNDAMENTALS OF COUNTING
Problem 22.5(a) 12 cabinet officials are to be seated in a row for a picture. How manydifferent seating arrangements are there?(b) Seven of the cabinet members are women and 5 are men. In how manydifferent ways can the 7 women be seated together on the left, and then the5 men together on the right?
Solution.(a) 12P12 = 12! = 479, 001, 600(b) 7P7 ·5 P5 = 7! · 5! = 5040 · 120 = 604, 800
Problem 22.6Using the digits 1, 3, 5, 7, and 9, with no repetitions of the digits, how many(a) one-digit numbers can be made?(b) two-digit numbers can be made?(c) three-digit numbers can be made?(d) four-digit numbers can be made?
Solution.(a) 5(b) 5P2 = 20(c) 5P3 = 60(d) 5P4 = 120
Problem 22.7There are five members of the Math Club. In how many ways can thepositions of a president, a secretary, and a treasurer, be chosen?
Solution.There are 5P3 = 60 different ways
Problem 22.8Find the number of ways of choosing three initials from the alphabet if noneof the letters can be repeated. Name initials such as MBF and BMF areconsidered different.
Solution.
26P3 = 15, 600
22 PERMUTATIONS 165
Problem 22.9(a) How many four-letter words can be made using the standard alphabet?(b) How many four-letter words can be made using the standard alphabet,where the letters are all different?(c) How many four-letter words have at least two letters the same?
Solution.(a) 264 = 456, 976.(b) 26P4 = 358, 800.(c) 456, 976− 358, 800 = 98, 176
Problem 22.10Twelve people need to be photographed, but there are only five chairs. (Therest of the people will be standing behind and their order does not matter.)How many ways can you sit the twelve people on the five chairs?
Solution.
12P5 = 95, 040
Problem 22.11An investor is going to invest $16,000 in 4 stocks chosen from a list of 12prepared by his broker. How many different investments are possible if $6,000is invested in one stock, $5,000 in another, $3,000 in the third, and $2,000 inthe fourth?
Solution.
12P4 = 11, 880
Problem 22.12Suppose certain account numbers are to consist of two letters followed byfour digits and then three more letters, where repetitions of letters or digitsare not allowed within any of the three groups, but the last group of lettersmay contain one or both of those used in the first group. How many suchaccounts are possible?
Solution.The answer is 26P2 ·10 P4 ·26 P3 = 51, 105, 600, 000
166 FUNDAMENTALS OF COUNTING
Problem 22.13A suitcase contains 6 distinct pairs of socks and 4 distinct pairs of pants. If atraveler randomly picks 2 pairs of socks and then 3 pairs of pants, how manyways can this be done?
Solution.The answer is 6P2 ·4 P3 = 720
Problem 22.14The number of permutations of n items, where n1 items are identical, n2
items are identical, n3 items are identical, and so on, is given by:
n!
n1!n2! · · ·.
In how many distinct ways can the letters of the word MISSISSIPPI bearranged?
Solution.The answer is 11!
4!4!2!= 34, 650
Problem 22.15How many different seven-digit phone numbers can be made from the digits1,1,1,3,3,5,5?
Solution.The answer is 7!
3!2!2!= 210
23 COMBINATIONS 167
23 Combinations
Problem 23.1Find m and n so that mCn = 13
Solution.If mCn = m!
n!(m−n)! = 13 then we can choose m = 13 and n = 1 or n = 12
Problem 23.2A club with 42 members has to select three representatives for a regionalmeeting. How many possible choices are there?
Solution.Since order is not of importance here, the number of different choices is
42C3 = 11480
Problem 23.3In a UN ceremony, 25 diplomats were introduced to each other. Supposethat the diplomats shook hands with each other exactly once. How manyhandshakes took place?
Solution.Since the handshake between persons A and B is the same as that betweenB and A, this is a problem of choosing combinations of 25 people two at atime. There are 25C2 = 300 different handshakes
Problem 23.4There are five members of the math club. In how many ways can the two-person Social Committee be chosen?
Solution.Since order is irrelevant, the different two-person committe is 5C2 = 10
Problem 23.5A medical research group plans to select 2 volunteers out of 8 for a drugexperiment. In how many ways can they choose the 2 volunteers?
Solution.There are 8C2 = 28 different ways
168 FUNDAMENTALS OF COUNTING
Problem 23.6A consumer group has 30 members. In how many ways can the group choose3 members to attend a national meeting?
Solution.There are 30C3 = 4060 different ways
Problem 23.7Which is usually greater the number of combinations of a set of objects orthe number of permutations?
Solution.Recall that mPn = m!
(m−n)! = n!mCn. Since n! ≥ 1, we can multiply both sidesby mCn to obtain mPn = n!mCn ≥ mCn
Problem 23.8Determine whether each problem requires a combination or a permutation:(a) There are 10 toppings available for your ice cream and you are allowed tochoose only three. How many possible 3-topping combinations can yo have?(b) Fifteen students participated in a spelling bee competition. The firstplace winner will receive $1,000, the second place $500, and the third place$250. In how many ways can the 3 winners be drawn?
Solution.(a) The order of how you select the toppings is irrelevant. Thus, this problemis a combination problem.(b) The order of the winners is important. Thus, the problem is a permuta-tion problem
Problem 23.9Use the binomial theorem and Pascal’s triangle to find the expansion of(a + b)7.
Solution.We have
(a + b)7 = a7 + 7a6b + 21a5b2 + 35a4b3 + 35a3b4 + 21a2b5 + 7ab6 + b7
Problem 23.10Find the 5th term in the expansion of (2a− 3b)7.
23 COMBINATIONS 169
Solution.The 5th term in the binomial theorem corresponds to k = 4. Thus, the answeris 7C4(2a)3(−3b)4 = 22, 680a3b4
Problem 23.11Does order matters for the following situations:(a) 7 digits selected for a phone number.(b) 3 member of the Math Faculty are selected to form a selection committeefor a Discrete Mathematics textbook.(c) Among all ATU Math Majors, 4 officers must be elected to be the Presi-dent, Vice-President, Treasurer, and Secretary of the Math Club.
Solution.(a) Order matters. (753-1835 is different from 753-8531).(b) Order doesn’t matter if each person has equal powers.(c) Order matters
Problem 23.12(a) Out of a class of 15 students 1 must be chosen to do office duty, 1 to beregister monitor and one to be a captain, how many ways can these roles behanded out?(b) Out of a class of 15 students 3 are needed to do a display, how manyways can they be chosen?
Solution.(a) 15P3 = 2, 730.(b) 15C3 = 455
Problem 23.13Find the constant term in the expansion
(2x2 − 1
x
)6.
Solution.By the Binomial Theore, the constant term occurs at 6C4(2x
2)2(1x
)4= 60
Problem 23.14A term in the expansion of (ma− 4)5 is −5760a2. What is the value of m?
Solution.We have 5C2(ma)2(−4)3 = −5760a2. Solving this equation for m, we findm = 3
170 FUNDAMENTALS OF COUNTING
Problem 23.15Find the value of k if the expansion (a− 2)3k−5 consists of 23 terms.
Solution.The Binomial Theorem expansion of (a + b)n consists of n + 1 terms. Thus,3k − 5 + 1 = 23. Solving this equation, we find k = 9
Problem 23.16In the expansion of (5a− 2b)9, find the coefficient of the term containing a5.
Solution.The term containing a5 is 9C5(5a)5(2b)4. The coefficient is 9C55
5 · 24 =6, 300, 000
Problem 23.17What is the third term in row 22 of Pascal’s triangle?
Solution.The term is 21C2
Problem 23.18In how many ways can a President, a Vice-President and a committee of 3can be selected from a group of 7 individuals?
Solution.This is a task with two steps: 7P2 ×5 C3 = 420
Problem 23.19When playing the lottery there are 6 different balls ranging between 0 and60 that can be chosen from. How many different possibilities are there whenpicking lottery numbers?
Solution.The answer is 61C6 = 55, 525, 372
Problem 23.20Suppose you have a group of 10 children consisting of 4 girls and 6 boys.(a) How many four-person teams can be chosen that consist of two girls andtwo boys?(b) How many four-person teams contain at least one girl?
Solution.(a) 4C2 ·6 C2 = 90.(b) 4C1 ·6 C3 +4 C2 ·6 C2 +4 C3 ·6 C1 +4 C4 = 195
Elements of Graph Theory
24 Graphs, Paths, and Circuits
Problem 24.1Find the vertices and edges of the following directed graph.
Solution.The vertices are
VG = {a, b, c, d}
and the edges are
EG = {(a, c), (a, d), (b, d), (b, c), (c, d)}
Problem 24.2Consider the following graph G
171
172 ELEMENTS OF GRAPH THEORY
(a) Find EG and VG.(b) List the isolated vertices.(c) List the loops.(d) List the parallel edges.(e) List the vertices adjacent to v3..(f) Find all edges incident on v4.
Solution.(a) We have
EG = {e1, e2, e3, e4, e5, e6}
and
VG = {v1, v2, v3, v4, v5, v6, v7}.
(b) There is only one isolated vertex, v5.(c) There is only one loop, e5.(d) {e2, e3}.(e) {v2, v4}.(f) {e1, e4, e5}.
Problem 24.3Which one of the following graphs is simple?
24 GRAPHS, PATHS, AND CIRCUITS 173
Solution.(a) G is not simple since it has a loop and parallel edges.(b) G is simple
Problem 24.4Draw K5.
Solution.
Problem 24.5Which of the following graph is bipartite?
174 ELEMENTS OF GRAPH THEORY
Solution.(a) Bipartite.(b) Any two sets of vertices of K3 will have one set with at least two vertices.Thus, according to the definition of bipartite graph, K3 is not bipartite
Problem 24.6Draw the complete bipartite graph K2,4.
Solution.
Problem 24.7What are the degrees of the vertices in the following graph
24 GRAPHS, PATHS, AND CIRCUITS 175
Solution.The graph G has deg(u) = 2, deg(v) = 3, deg(w) = 4 and deg(z) = 1
Problem 24.8The union of two graphs G1 = (V1, E1) and G2 = (V2, E2) is the graphG1 ∪G2 = (V1 ∪ V2, E1 ∪E2). The intersection of two graphs G1 = (V1, E1)and G2 = (V2, E2) is the graph G1 ∩G2 = (V1 ∩ V2, E1 ∩ E2).Find the union and the intersection of the graphs
176 ELEMENTS OF GRAPH THEORY
Solution.
Problem 24.9Graphs can be represented using matrices. The adjacency matrix of a graphG with n vertices is an n×n matrix AG such that each entry aij is the numberof edges connecting vi and vj. Thus, aij = 0 if there is no edge from vi to vj.(a) Draw a graph with the adjacency matrix
0 1 1 01 0 0 11 0 0 10 1 1 0
(b) Use an adjacency matrix to represent the graph
24 GRAPHS, PATHS, AND CIRCUITS 177
Solution.(a)
(b) 0 2 0 22 0 2 10 2 0 12 1 1 0
Problem 24.10A graph H = (VH , EH) is a subgraph of G = (VG, EG) if and only if VH ⊆ VG
and EH ⊆ EG.Find all nonempty subgraphs of the graph
178 ELEMENTS OF GRAPH THEORY
Solution.
Problem 24.11When (u, v) is an edge in a directed graph G then u is called the initialvertex and v is called the terminal vertex. In a directed graph, the in-degree of a vertex v, denoted by deg−(v), is the number of edges with v astheir terminal vertex. Similarly, the out-degree of v, denoted by deg+(v),is the number of edges with v as an initial vertex. Note that deg(v) =deg+(v) + deg−(v).Find the in-degree and out-degree of each of the vertices in the graph G withdirected edges.
24 GRAPHS, PATHS, AND CIRCUITS 179
Solution.
vertex in− degree out− degreev1 3 3v2 2 4v3 2 0v4 2 2v5 1 1
Problem 24.12Show that for a digraph G = (VG, EG) we have
|EG| =∑
v∈V (G)
deg−(v) =∑
v∈V (G)
deg+(v).
Solution.Each edge contributes 1 to the indegree of one vertex, so contributes 1 to thesum
∑v∈VG
deg−(v). Thus, the sum∑
v∈VGdeg−(v) is just the total number
of edges. Similarly for the outdegrees
Problem 24.13Another useful matrix representation of a graph is known as the incidencematrix. It is constructed as follows. We label the rows with the verticesand the columns with the edges. The entry for row v and column e is 1 if eis incident on v and 0 otherwise. If e is a loop at v we assign the value 2. Itis easy to see that the sum of entries of each column is 2 and that the sum
180 ELEMENTS OF GRAPH THEORY
of entries of a row gives the degree of the vertex corresponding to that row.Find the incidence matrix corresponding to the graph
Solution.
e1 e2 e3 e4 e5 e6v1 1 0 0 0 0 0v2 0 1 1 0 0 0v3 0 1 1 1 0 0v4 1 0 0 1 2 0v5 0 0 0 0 0 0v6 0 0 0 0 0 1v7 0 0 0 0 0 1
Problem 24.14If each vertex of an undirected graph has degree k then the graph is called aregular graph of degree k.How many edges are there in a graph with 10 vertices each of degree 6?
Solution.Since 2|EG| = 60, |EG| = 30. So the graph has 30 edges
Problem 24.15Find the vertices and edges of the directed graph shown below.
24 GRAPHS, PATHS, AND CIRCUITS 181
Solution.The vertices are
VG = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}
and the edges are
EG = {(0, 1), (0, 2), (0, 6), (2, 0), (2, 3), (3, 5), (5, 4), (6, 4), (6, 9), (7, 6), (8, 7), (9, 10), (9, 11), (11, 12)}
Problem 24.16Consider the following graph G = (VG, EG).
(a) List the isolated vertices.
182 ELEMENTS OF GRAPH THEORY
(b) List the loops.(c) List the parallel edges.(d) List the vertices adjacent to b.(e) Find all edges incident on b.
Solution.(a) e is the only isolated vertex.(b) e7 and e8.(c) {e1, e2} and {e5, e6}.(d) {a, c, d}.(e) {e3, e4, e6}
Problem 24.17Which one of the following graphs is simple?
Solution.(i) i is simple.(ii) has parallel edges and therefore is not simple.(iii) has a loop and therefore is not simple
Problem 24.18Draw the complete graph K6.
Solution.K6 is shown below
24 GRAPHS, PATHS, AND CIRCUITS 183
Problem 24.19Show that each of the following graphs is bipartite.
Solution.(i) V1 = {a, b} and V2 = {c, d, e, f}.(ii) V1 = {c, b, e, h} and V2 = {a, d, f, g}.(iii) V1 = {e, g, h, , i, j} and V2 = {a, b, c, d, f, k, l,m}Problem 24.20Graph the complete bipartite graphs K3,2 and K2,5.
Solution.The graphs are shown below
184 ELEMENTS OF GRAPH THEORY
Problem 24.21Find the dgree of each vertex of the graph below.
Solution.We have: deg(A) = 8, deg(B) = 3, deg(C) = 6, deg(D) = 1
25 PATHS AND CIRCUITS 185
25 Paths and Circuits
Problem 25.1Consider the graph shown below.
(a) Give an example of a path of length 4 connecting the vertices A andC.(b) Give an example of a simple path of length 4 connecting the vertices Aand B.(c) Give an example of a simple circuit of length 5 starting and ending at A.
Solution.(a) Ae1Be3De7Ee6C.(b) Ae2De7Ee6Ce4B.(c) Ae2De7Ee6Ce4Be1A
Problem 25.2Give an example of an acyclic graph with four vertices.
Solution.One such an example is shown below
186 ELEMENTS OF GRAPH THEORY
Problem 25.3Determine which graph is connected and which one is disconnected.
Solution.(I) is disconnected (II) is connected
Problem 25.4Show that the following graph has an Euler circuit.
25 PATHS AND CIRCUITS 187
Solution.Each vertex has an even degree. Hence, by Theorem 25.1, the graph has anEuler circuit
Problem 25.5Show that the following graph has no Hamiltonian path.
Solution.There is no path that visits every vertex of the graph exactly once
Problem 25.6Which of the graphs shown below are connected?
Solution.Both graphs are disconnected
Problem 25.7If a graph is disconnected then the various connected pieces of the grapgare called the connected components. Find the number of connected
188 ELEMENTS OF GRAPH THEORY
components of each of the given graphs.
Solution.(a) 3 connected components (b) 2 connected components
Problem 25.8Find the connected components of the graph shown below.
Solution.The connected components areshown below.
Problem 25.9Show that the graphs given below do not have an Euler circuit.
25 PATHS AND CIRCUITS 189
Solution.(a) Vertices A and D have odd degrees.(b) Vertices B and D have odd degrees
Problem 25.10Show that the graphs given below do not have an Euler path.
Solution.(a) deg(A) = 1, deg(B) = deg(D) = 3.(b) deg(A) = deg(D) = 1, deg(B) = 3
Problem 25.11Show that the graph given below has an Euler path.
190 ELEMENTS OF GRAPH THEORY
Solution.Only A and B are of odd degree
Problem 25.12Does the graph shown below have a Hamiltonian circuit?
Solution.Any circuit will have to cross D twice
Problem 25.13Does the graph shown below have a Hamiltonian circuit?
Solution.No
25 PATHS AND CIRCUITS 191
Problem 25.14Does the graph shown below have a Hamiltonian circuit?
Solution.Yes
Problem 25.15Given the graph below.
Determine which of the following sequences are paths, simple paths, cir-cuits, or simple circuits:(a) (i) v2e3v3e5v4e7v6(ii) e2e3e9e7e7e5e6(iii) v3v4v2v3(iv) v5v3v4v2v3v5.(b) Give an example of a path of length 4.
Solution.(a) (i) A simple path.(ii) Not a path because it has the repeated edge e9.(iii) A simple circuit.(iv) A non-simple circuit.(b) v2e3v3e5v4e9v3e6v5
192 ELEMENTS OF GRAPH THEORY
Problem 25.16Draw an acyclic graph with five vertices.
Solution.One such an example is shown below
Problem 25.17Determine which of the following graphs are connected?
Solution.Graph G1 is connected. Graph G2 is disconnected with three components.Graph G3 is disconnected with three components
Problem 25.18Consider the graph shown below.
25 PATHS AND CIRCUITS 193
(a) Is the path BBADCDEBC an Euler path?(b) Is the path CDCBBADEB an Euler path?(c) Is the path CDCBBADEBC an Euler circuit?(d) Is the path CDEBBADC an Euler circuit?
Solution.The answer is yes to all the four questions
Problem 25.19Show that the following graph has no Euler circuit and no Euler path.
Solution.The graph has more than 3 vertices of odd degree
Problem 25.20Show that the following graph has an Euler circuit.
194 ELEMENTS OF GRAPH THEORY
Solution.Each vertex has even degree
Problem 25.21Show that the following graph has an Euler path.
Solution.There are exactly two vertices of degree 3
Problem 25.22Find a Hamiltonian circuit and a Hamiltonian path in the graph
25 PATHS AND CIRCUITS 195
Solution.One such a Hamiltonian circuit is AFBCGDEA. An example of a Hamilto-nian path is AFBCGDE
196 ELEMENTS OF GRAPH THEORY
26 Trees
Problem 26.1Which of the following four graphs is a tree?
Solution.Graphs 1 and 3 satisfy the definition of a tree. Graph 2 has a circuit andGraph 4 is disconnected
Problem 26.2Find the number of edges in a tree with 58 vertices.
Solution.The number of edges is 57
Problem 26.3Can a graph with 41 vertices and 40 edges be a tree?
Solution.Yes provided the graph is connected
Problem 26.4Find the level of each vertex and the height of the following rooted tree.
26 TREES 197
Solution.The root is a.
vertex levelb 1c 2d 2e 3f 4g 3h 1i 2j 2k 2
The height of the tree is 4
Problem 26.5Consider the rooted tree
198 ELEMENTS OF GRAPH THEORY
(a) Find the parent of v6.(b) Find the ancestors of v10.(c) Find the children of v4.(d) Find the descendants of v1.(e) Find all the siblings.(f) Find the leaves.(g) Construct the subtree rooted at v1.
Solution.(a) v3.(b) {v0, v3, v5}.(c) {v7, v8, v9}.(d) {v4, v7, v8, v9}.(e) {v1, v2, v3}, {v5, v6}, {v7, v8, v9}.(f) {v2, v6, v7, v8, v9, v10.(g)
26 TREES 199
Problem 26.6A binary search tree is a binary tree T in which data are associated withthe vertices. The data are arranged so that, for each vertex v in T, each dataitem in the left subtree of v is less than the data item in v and each data itemin the right subtree of v is greater than the data item in v. Using numericalorder, form a binary search tree for a number in the set {1, 2, · · · , 15}.
Solution.
Given a number between 1 and 15, it is first compared with 8; if it is lessthan 8, proceed to key 4; if it greater than 8, proceed to key 12; if it is equalto 8 the search is over. One proceeds down the tree in this manner until thenumber is found
Problem 26.7Procedures for systematically visiting every vertex of a tree are called traver-sal algorithms. In the preorder traversal, the root r is listed first andthen the subtrees T1, T2, · · · , Tn are listed, from left to right, in order of theirroots. The preorder traversal begins by visiting r. It continues by travers-ing T1 in preorder, thenT2 in preorder, and so on, until Tn is traversed inpreorder. In which order does a preorder traversal visit the vertices in the
200 ELEMENTS OF GRAPH THEORY
following rooted tree?
Solution.Let Ts, Tv, and Tw be the trees rooted at s, v, and w respectively. Applyingthe preorder traversal algorithm we obtain the following listings:Tw : w, x, y, z.Tv : v, u, Tw or v, u, w, x, y, z.Ts : s, p, q.T : r, Tv, Ts or r, v, u, w, x, y, z, s, p, q
Problem 26.8A forest is a simple graph with no circuits. Which of the following graphsis a forest?
Solution.The first graph is a forest whereas the second is not
26 TREES 201
Problem 26.9What do spanning trees of a connected graph have in common?
Solution.They have the same number of edges
Problem 26.10Find three spanning trees of the graph below.
Solution.The three spanning trees are shown below
Problem 26.11Which of the following four graphs is a tree?
Solution.The first and the third are trees whereas the second and the third are not
Problem 26.12What is the number of edges in a tree with 49 vertices?
202 ELEMENTS OF GRAPH THEORY
Solution.By Theorem 26.1, the number of edges is 49-1 = 48 edges
Problem 26.13Prove that a tree with n vertices has at least two leaves.
Solution.Recall that a leaf in a tree is a vertex with degree 1. Suppose the contrary.Then at least n − 1 vertices have degree at least 2. Also, since the graphis connected, the last vertex has at least degree 1. Hence,
∑v∈VG
deg(v) ≥2(n − 1) + 1 = 2n − 1 and hence |EG| ≥ n − 1
2. Since |EG| is an integer,
|EG| ≥ n. This is impossible for a tree with n vertices
Problem 26.14Consider the rooted tree shown below.
(i) Find the parent of g.(ii) Find the ancestors of k.(iii) Find the children of c.(iv) Find the descendants of b.(v) Find an example of a siblings.(vi) Find the leaves.(vii) Construct the subtree rooted at c.
Solution.(i) c.(ii) a and d.(iii) g, h, i, j.
26 TREES 203
(iv) e and f.(v) {g, h, i, j}.(vi) {e, f, g, h, i, j, k}.(vii)
Problem 26.15Are the following binary trees different?
Solution.Yes. The first binary tree has a left child b whereas the second binary treehas a right child b
Problem 26.16Find a spanning tree of the following graph.
204 ELEMENTS OF GRAPH THEORY
Solution.One such a spanning tree is shown below
Problem 26.17The binary tree below gives an algorithm for choosing a restaurant. Eachinternal vertex asks a question. If we begin at the root, answer each ques-tion, and follow the appropriate edge, we will eventually arrive at a terminalvertex that chooses a restaurant. Such a tree is called a decision tree.
Construct a decision tree that sorts three given numbers a1, a2, a3 in as-cending order.
26 TREES 205
Solution.