McGILL UNIVERSITY FACULTY OF SCIENCE DEPARTMENT - The ...

23 downloads 292 Views 1MB Size Report
Oct 20, 2000 ... Notes Distributed to Students in Mathematics 189-240A (2000/2001) ...... [12] C. L. Liu, Elements of Discrete Mathematics, 2nd Edition.
McGILL UNIVERSITY FACULTY OF SCIENCE DEPARTMENT OF MATHEMATICS AND STATISTICS MATHEMATICS 189–240A DISCRETE STRUCTURES AND COMPUTING Notes Distributed to Students (Fall Term, 2000/2001) W. G. Brown September 19, 2000

Notes Distributed to Students in Mathematics 189-240A (2000/2001) (Items marked ‡ not distributed in hard copy)

Contents 1 General Information 1.1 Instructor, Tutors, and Times . 1.2 Calendar Description . . . . . . 1.3 Class Quiz . . . . . . . . . . . . 1.4 Term Test . . . . . . . . . . . . 1.5 Homework . . . . . . . . . . . . 1.6 Term Mark . . . . . . . . . . . 1.7 Calculators . . . . . . . . . . . 1.8 Final Grade . . . . . . . . . . . 1.9 Text-Book . . . . . . . . . . . . 1.10 Tutorials . . . . . . . . . . . . . 1.11 Homework Grader . . . . . . . 1.12 Supplementary Materials . . . 1.12.1 Printed Notes . . . . . . 1.12.2 Notes and Examinations from Previous Years . . 1.13 Examination information . . .

1 1 1 1 1 2 2 3 3 3 3 3 3 3

2 Timetable

5

3 Syllabus 3.1 Chapter 1. The Foundations: Logic, Sets, and Functions . . . 3.2 Chapter 2. The Fundamentals: Algorithms, the Integers, and Matrices . . . . . . . . . . . . . . . 3.3 Chapter 6. Relations (first part)

7

4 First Problem Assignment

9

5 Class Quiz

4 4

7

8 8

14

6 Solutions to Problems on the Class Quiz 17 7 Second Problem Assignment 8 References

21 901

i

A Problems on Term Tests of Previous Years ‡ 1001 A.1 1991 Term Test . . . . . . . . . 1001 A.1.1 First Version . . . . . . 1001 A.1.2 Second Version . . . . . 1002 A.2 1994 Term Test . . . . . . . . . 1003 A.2.1 First Version . . . . . . 1003 A.2.2 Second Version . . . . . 1003 A.3 1995 Term Test . . . . . . . . . 1004 A.3.1 First Version . . . . . . 1004 A.3.2 Second Version . . . . . 1004 A.3.3 Third Version . . . . . . 1005 A.3.4 Fourth Version . . . . . 1005 A.4 1996 Term Test . . . . . . . . . 1006 A.5 1997 Term Test . . . . . . . . . 1013 A.6 1998 Term Test . . . . . . . . . 1020 A.6.1 Problems on the counting of relations . . . . . 1020 A.6.2 Solution of linear homogeneous recurrences with constant coefficients . . 1022 A.6.3 Use of ordinary generating functions to count ordered additive partitions of integers . . . . . . . . 1024 A.6.4 Logic and induction . . 1027 A.6.5 Prove or disprove . . . . 1030 A.7 Solutions to Problems on the 1999 Class Tests . . . . . . . . . . . 1032 A.7.1 Proving or disproving the validity of a rule of inference . . . . . . . . . . . 1033 A.7.2 Injective and surjective functions . . . . . . . . 1035 A.7.3 Particular solutions of inhomogeneous recurrences 1037 A.7.4 Pigeonhole principle . . 1041 A.7.5 Permutations . . . . . . 1042 A.7.6 Ordered partitions of an integer . . . . . . . . . . 1045

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

ii

B Problems on 1995 — 1999 examiE Solutions to 1998 Assignment Probnations ‡ 1048 lems ‡ 1146 B.1 1995 Final Examination . . . . 1048 E.1 Solved Problems from the First B.2 1995 Supplemental/Deferred Ex1998 Problem Assignment . . . 1146 amination . . . . . . . . . . . . 1049 E.2 Solved Problems from the SecB.3 1996 Final Examination . . . . 1051 ond 1998 Problem Assignment 1152 B.4 1997 Final Examination . . . . 1052 E.3 Solved Problems from the Third B.5 1997 Supplemental/Deferred Ex1998 Problem Assignment . . . 1161 amination . . . . . . . . . . . . 1054 E.4 Solved Problems from the Fourth B.6 1998 Final Examination . . . . 1055 1998 Problem Assignment . . . 1172 B.7 1998 Supplemental/Deferred ExE.5 Solved Problems from the Fifth amination . . . . . . . . . . . . 1058 1998 Problem Assignment . . . 1179 B.8 1999 Final Examination . . . . 1059 F Solutions to 1999 Assignment ProbB.9 1999 Supplemental/Deferred Exlems ‡ 1183 amination . . . . . . . . . . . . 1061 F.1 First 1999 Problem Assignment, C Solutions to 1996 Assignment Probwith Solutions . . . . . . . . . . 1183 lems ‡ 1064 F.2 Second 1999 Problem Assignment, C.1 Solved Problems from the First with Solutions . . . . . . . . . . 1194 1996 Problem Assignment . . . 1064 F.3 Third 1999 Problem Assignment, C.2 Solved Problems from the Secwith Solutions . . . . . . . . . . 1203 ond 1996 Problem Assignment 1069 F.4 Fourth 1999 Problem Assignment, C.3 Solved Problems from the Third with Solutions . . . . . . . . . . 1211 1996 Problem Assignment . . . 1077 F.5 Fifth 1999 Problem Assignment, C.4 Solved Problems from the Fourth with Solutions . . . . . . . . . . 1224 1996 Problem Assignment . . . 1088 G Solved Combinatorial Problems‡1232 C.5 Solved Problems from the Fifth G.1 Counting words formed from a 1996 Problem Assignment . . . 1097 given population of letters, not D Solutions to 1997 Assignment Probnecessarily all different . . . . . 1232 lems ‡ 1104 G.2 Problems on inclusion-exclusion 1239 D.1 Solved Problems from the First G.3 A combinatorial identity . . . . 1241 1997 Problem Assignment . . . 1104 G.4 Lattice paths . . . . . . . . . . 1242 D.2 Solved Problems from the SecG.5 Partitions of labelled objects into ond 1997 Problem Assignment 1112 labelled boxes . . . . . . . . . . 1243 D.3 Solved Problems from the Third G.6 Circular permutations . . . . . 1245 G.7 Counting ordered partitions of 1997 Problem Assignment . . . 1121 D.4 Solved Problems from the Fourth a positive integer . . . . . . . . 1246 1997 Problem Assignment . . . 1129 G.8 Counting vertex-labelled graphs 1250 D.5 Solved Problems from the Fifth 1997 Problem Assignment . . . 1137

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1

1

General Information Distribution Date: Wednesday, September 6th, 2000 (all information is subject to change)

1.1

Instructor, Tutors, and Times

OFFICE: OFFICE HOURS (subject to change): OFFICE PHONE: E-MAIL: CLASSROOM: CLASS HOURS:

1.2

INSTRUCTOR Professor W. G. Brown BURN 1224 W 14:30→15:20; F 10:00→11:00 or by appointment 398–3836 BROWN @MATH.MCGILL.CA MAASS 112 MWF 15:30–16:30

TUTORS I. D´ech`ene BURN 1017 Th 114:00→16:00

L. Demb´el´e BURN 1029

DECHENE @MATH.MCGILL.CA ARTS W-120 W 16:30–18:00

DEMBELE @MATH.MCGILL.CA ENGMC 122 T 14:30–16:00

Calendar Description

(3 credits) (Corequisites 189-133 (or 189-121 or CEGEP 201-105) and 189222. For Major and Honours students in Computer Science only. Others only with the Instructor’s permission.) Abstractly defined mathematical structures. Mathematical induction. Sets, relations and functions. Combinatorics; graphs; recurrences; generating functions. Lattices, Boolean algebras.

1.3

Class Quiz

A quiz will be administered in class on Friday, September 15th, 2000. This quiz does not count in the computation of the term mark, and is intended as a diagnostic aid. It will be based on the material covered in the course during the first 4 lectures. Answers will be distributed, so that students may check their own performance. (Note that this is the last lecture before the end of the Course Change Period.)

1.4

Term Test

A term test will be administered during the regular class hour on Wednesday, October 25th, 2000. No provision is planned for a “make-up” test for a student absent during the test. Any change in this date will be announced in the lectures.

UPDATED TO September 19, 2000

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

2

In your instructor’s eyes the main purpose of the test is as a “dry run” for the final examination.1

1.5

Homework

There will be approximately 5 or 6 homework assignments. The material on these assignments forms an integral part of the course; it may happen that an assignment is concerned with material (from the textbook or self-contained in the assignment) which has not been explicitly discussed in the lectures. An assignment is not a test: it should be viewed as a learning experience, and as a preparation for reading the solutions, which will normally be circulated in print. The numerical grade recorded for the assignments is relatively insignificant; but students should be sure that they understand the problems and their solutions. It should not be assumed that every type of problem that a student will be expected to be able to solve will appear on an assignment; nor that all topics which appear on assignments are equally significant. In addition to completing the assignments, students are encouraged to attempt problems in the text-book, particularly low odd-numbered problems in each set of exercises, for which there will usually be answers in the text-book, and solutions in the solutions manual. While students are not discouraged from discussing assignment problems with their colleagues, the written solutions that are handed in should be each student’s own work.2 Submitted homework should be stapled with a cover page that contains your NAME, STUDENT NUMBER, the COURSE NUMBER, and the ASSIGNMENT NUMBER. Other pages should always include your student number. You can minimize the possibility that your assignment is lost or fragmented.

1.6

Term Mark

Graded out of 30, the TERM MARK will be the sum of the HOMEWORK GRADE (out of 10) and the TERM TEST GRADE (out of 20). 1

Notwithstanding the minimal contribution of the test grade to the student’s final grade (cf. §1.6 below), the test is to be considered an “examination” in the sense of the Handbook of Student Rights and Responsibilities (http://blizzard.cc.mcgill.ca/Secretariat/Students/index.html). 2 From the Handbook on Student Rights and Responsibilities: “No student shall, with intent to deceive, represent the work of another person as his or her own in any...assignment submitted in a course or program of study or represent as his or her own an entire essay or work of another, whether the material so represented constitutes a part or the entirety of the work submitted.”

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1.7

3

Calculators

The use of calculators, computers, notes, or other aids will not be permitted at the test or examination.

1.8

Final Grade

The final grade will be a letter grade, computed from the maximum of • the Examination Mark (out of 100); and • the sum of the Term Mark (out of 30) and 0.7 times the examination mark (out of 100).

1.9

Text-Book

The primary textbook for the course will be: Discrete Mathematics and its Applications, by K. H. Rosen, 4th Edition, (McGraw-Hill, Inc., 1999), ISBN 0-07-289905-0 [19]. An optional reference book is Student Solutions Guide for Discrete Mathematics and its Applications, by K. H. Rosen, 4th Edition, (McGraw-Hill, Inc., 1995), ISBN 0-07289906-9 [20]3 . This book contains, inter alia, solutions to odd-numbered exercises in the text-book.

1.10

Tutorials

There will be two optional weekly tutorials; the intention is that any student should attend one of these. However, classroom space permitting, students may attend both if they wish, although there could be considerable duplication.

1.11

Homework Grader

Some of the assignments may be graded by the tutors; others will be graded by the Homework Grader, who does not keep office hours. Questions concerning the grading of assignments should normally be brought to the tutor.

1.12

Supplementary Materials

1.12.1

Printed Notes

Printed notes will be distributed from time to time to supplement material in the textbook or lectures. Any such material should be treated as an integral part of the syllabus. 3

Do not confuse this Guide with the Guide for the 3rd edition [18].

Notes Distributed to Students in Mathematics 189-240A (2000/2001) 1.12.2

4

Notes and Examinations from Previous Years

These materials are not required, but are available to interested students at the following URL: http://www.math.mcgill.ca/brown/math240a.html Of particular interest may be the large numbers of worked problems. Solved problems from the assignments in the course during the last four years — the years when this and the previous edition of the present textbook was used — are collected into an appendix to the current year’s notes; these will probably not be distributed to the class, but will be available in the above location on the Web. It is hoped to mount these files in “pdf” format (· · · .pdf), which can be read by Adobe “Acrobat”. Some older files on the Website are presently in “PostScript” format, (· · · .ps), for which an appropriate viewer is required (e.g. ghostview). Some of these files are very long.

1.13

Examination information

1. “Will there be a supplemental examination in this course.” Yes. 2. “Will students with marks of D, F, or J have the option of doing additional work to upgrade their mark?” No. 3. “Will the final examination be machine scored?” No.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

2

5

Timetable Distribution Date: (Original version) Wednesday, September 6th, 2000 (All information is subject to change.)4 MONDAY

11



4

WEDNESDAY FRIDAY SEPTEMBER LABOUR DAY 6 §1.1 1 8 §1.2 Tutorials begin in the week of September 11th §1.3, §1.4 13 §1.4, §1.5; Prof. 15 CLASS QUIZ; Brown’s Friday office hour advanced to today.

9

16 23 30



2



25

Course changes must be completed by September 17 20 §1.6, §1.7(pp. 76– 22 §2.3 2 78) Deadline for withdrawal with fee refund = SeptemberP 24 §6.1 27 §3.1 29 §3.1 1 OCTOBER §3.2, §3.3 4 §4.1, §4.2 6 §4.1, §4.2 3 Verification Period (Graduating Students): October 10–13 THANKSGIVING 11 §4.3 13 §4.3 DAY Deadline for withdrawal (with W) from course via MARSP= Oct. 15 §4.3, §4.6 18 §4.6 20 X 2 §5.4,§5.1 4 25 CLASS TEST 27 §5.2 (tentative) §5.2, §5.4, N §1.6



18

Prof. Brown’s Office hour advanced to 13 Sept.

The next page will not be distributed until the syllabus has been revised.

Notation:

#

=

distribution of assignment #

P n

=

assignment #n due

R

=

Read Only

X

=

reserved for eXpansion or review

N

=

distributed notes



4

Section numbers refer to the text-book.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

6 13

§5.4, §5.5, N X

1 8 15

20 27

§6.6 §7.5

22 29

4

§8.1

6

WEDNESDAY NOVEMBER §5.2, §5.4, N §5.5 §6.2 (brief ), §6.3, §6.4 §7.1, §7.2, §7.3 §7.7 DECEMBER

FRIDAY 3 10 17

P §5.4, N 3 §5.6 5 P §6.4, §6.5 4

24

§7.4

1

§7.8



MONDAY

6

P 5

X

(This timetable could be subject to additional revisions.)

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

3

7

Syllabus Distribution Date: Wednesday, September 6th, 2000 This 0th version of the syllabus is subject to revision.

3.1

Chapter 1. The Foundations: Logic, Sets, and Functions

§ §1.1 §1.2 §1.3 §1.4 §1.5

Logic Propositional Equivalences Predicates and Quantifiers Sets Set Operations

§1.6

Functions

§1.7

Sequences and Summations

§1.8

The Growth of Functions

Section Name

Comments

Review of elementary set theory

Time 2 12 1 12

(Note that the author uses the term natural numbers for the nonnegative integers; i.e. he includes 0.)

While students will be expected to be familiar with the function concept from Calculus I, II (and are reminded that Calculus III is a corequisite of this course), emphasis will be placed on the special types of functions discussed — injective, surjective, bijective, etc. Students should have met/be meeting these concepts in their calculus and other courses. However, the optional material on Cardinality (pp. 76–78) will be discussed. This important material will be met in other courses. It forms part of the syllabus only to the extent to which it is discussed in the lectures, assignments, or printed notes.

1 12

1 2

0

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

3.2

Chapter 2. The Fundamentals: Algorithms, the Integers, and Matrices

§ §2.1 §2.2

Section Name Algorithms Complexity of Algorithms

§2.3

The Integers and Division

§2.4 §2.5

Integers and Algorithms Applications of Number Theory

§2.6

Matrices

3.3 § §6.1 §6.2

8

Comments Time These sections contain material that stu0 dents will meet elsewhere. It is recommended that students peruse this material, but it will not form part of the syllabus of this course. This material is also in the syllabus of 1 course 189-340B; it will be discussed briefly here to maintain the integrity of the present text-book. We will avoid the author’s use of the modulus as a unary function [19, Definition 8, §2.3]. As much of this material is in the sylε labus of course 189-340B, these concepts will be examination material only to the extent that they are applied in other sections of the syllabus. Most of this material will have been met 0 in pre- or corequesite courses in linear algebra. Algorithms for matrix operations may be met in computer science courses. Pages 157-159 may be studied in connection with Chapter 6.

Chapter 6. Relations (first part) Section Name Relations and Their Properties n-ary Relations and Their Applications

Comments

Time 1-ε

The database application will be discussed very briefly, as students will meet this in their computer science courses. Other mathematical examples should be supplied.

ε

(to be continued in §?? of these notes)

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

4

9

First Problem Assignment Distribution Date: Wednesday, September 6th, 2000 Solutions are to be submitted by Friday, September 29th, 2000 1. Determine whether each of the following is true or false, giving a precise explanation in each case. (a) 1 + 1 = 3 if and only if 2 + 2 = 3. (b) If it is raining, then it is raining. (c) If 2 + 1 = 3, then 2 = 3 − 1. 2. [THIS PROBLEM SHOULD BE OMITTED FROM THE ASSIGNMENT; THE ORIGINAL VERSION, CIRCULATED ON 6 SEPTEMBER, CONTAINED A MISPRINT.] (a) Suppose that ϕ is a compound proposition that is expressible in terms of primitive propositions p1 , p2 , ..., pn , using logical connectives, ¬, ∨, ∧, →, and ↔. Describe informally a procedure (algorithm) by which a truth table may be used to find a proposition ψ which is logically equivalent to ϕ, in which ψ uses only the connectives ¬, ∧ and ∨ (at most). (b) Illustrate your algorithm by finding ψ, where φ = (p → q) → ¬(r → p). 3. Write the following compound statements in symbols. Use the following letters to represent the statements: c d r w

: : : :

It It It It

is is is is

cold. dry. rainy. warm.

(a) It is neither cold nor dry. (b) It is rainy if it is not dry. (c) To be warm it is necessary that it be dry. (d) It is cold or dry, but not both. 4. Determine whether or not the two propositions are logically equivalent: p ∨ (q ∧ r),

UPDATED TO September 19, 2000

(p ∧ q) ∨ (p ∧ r) .

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

10

5. Determine whether the following proposition is a tautology: ((p → ¬q) ∧ q) → ¬p . 6. Write the contrapositive, converse, and inverse of the following statement: You sleep late if it is Saturday. (Inverse = converse of contrapositive.) 7. Suppose P (x, y) is the statement x + 2y = xy, where x and y are integers. What are the truth values of (a) P (0, 0) (b) ∀x∃yP (x, y) (c) ∀y∃xP (x, y) (d) ¬∀x∃y¬P (x, y) 8. Suppose the variable x represents students, y represents courses and T (x, y) means ”x is taking y”. Match each of the following symbolic statements with all its equivalent English statements in the second list: (a) ∃y∀xT (x, y) (b) ¬∃x∃yT (x, y) (c) ∀y∃xT (x, y) (d) ¬∀x∃yT (x, y) (e) ¬∀x∃y¬T (x, y) (f) ¬∀x¬∀y¬T (x, y) (g) ∀x∃y¬T (x, y) The English statements are (A) Every course is being taken by at least one student. (B) Some student is taking every course. (C) No student is taking all courses. (D) There is a course that all students are taking. (E) Every student is taking at least one course.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

11

(F) There is a course that no students are taking. (G) Some students are taking no courses. (H) No course is being taken by all students. (I) Some courses are being taken by no students. (J) No student is taking any course. 9. Suppose A = {a, b, c}. Determine the truth value of each of the following statements. Justify your answers. (a) {{a}} ⊆ P (A) (b) { } ⊆ P (A) (c) {a, c} ∈ A (d) (c, c) ∈ A × A 10. Suppose A = {a, b, c} and B = {b, {c}}. For each of the following statements, determine whether it is true or false. (a) |P (A × B)| = 64 (b) B ⊆ A (c) {a, b} ∈ A × A (d) {b, {c}} ∈ P (B) (e) {{{c}}} ⊆ P (B) 11. Determine, for each of the following sets A, whether it is the power set of some set B. If that is so, give B. (a) A = { , { }, {a}, {{a}}, {{{a}}}, { , a}, { , {a}}, { , {{a}}}, {a, {a}}, {a, {{a}}}, {{a}, {{a}}}, { , a, {a}}, { , a, {{a}}}, { , {a}, {{a}}}, {a, {a}, {{a}}}, { , a, {a}, {{a}}}} (b) A = { , {a}} (c) A = { , {a}, { , a}} (d) A = { , {a}, { }, {a, }} (e) A = { , {a, }} (f) A = { , {{ , a}}}

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

12

12. Prove or disprove the identity A ∩ B = A ∪ B using each of the following methods: (a) By using a “containment” proof or disproof. (Prove or disprove that the left side is a subset of the right, and that the right side is a subset of the left.) (b) By using a membership table (c) By proving that two propositions are logically equivalent or inequivalent. (d) By using a Venn diagram. 13. Suppose that A = {1, 2, 3, 4}, B = {a, b, c}, C = {2, 8, 10}, and g : A → B and f : B → C are functions defined by g = {(1, b), (2, a), (3, b), (4, a)}, f = {(a, 8), (b, 10), (c, 2)}. (a) Determine f ◦ g. (b) Determine f −1 . (Here, and in the following parts, we are not assuming that f −1 is a function, but are following the generalization introduced in [19, p. 68, following Exercise 27.], where f −1 denotes the set of preimages of points in the set S. Where S consists of but a single point, s, we may write f −1 (s) instead of f −1 ({s}); where f −1 (s) is a single point for every s in the codomain of f , we may interpret f −1 to be a function from the codomain of f to the domain of f .) (c) Determine f ◦ f −1 . (d) Explain why g −1 is not a function. (Use the interpretation discussed in #13b.) 14. Determine which of the following proposed definitions actually define a function. If the definition is defective, explain precisely what has gone wrong. √ (a) f : N → N, defined by f (n) = n. √ (b) h : R → R, defined by h(x) = x. 1 (c) F : R → R, where F (x) = . x−5  x + 2 if x ≥ 0 (d) φ : R → R, where φ(x) = x − 1 if x ≤ 4  x2 if x ≤ 2 (e) ψ : R → R, where ψ(x) = x − 1 if x ≥ 4   p (f) λ : Q → Q, where λ = q. q 15. None of the following statements is true for all sets. In each case give a counterexample to demonstrate this failure.

Notes Distributed to Students in Mathematics 189-240A (2000/2001) (a) A − (B − C) = (A − B) − C (b) (A − C) − (B − C) = A − B (c) A ∩ (B ∪ C) = (A ∪ B) ∩ (A ∪ C) (d) If A ∪ C = B ∪ C, then A = B. (e) If A ∩ C = B ∩ C, then A = B.

13

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

5

14

Class Quiz Distribution Date: 15 September, 2000 • This quiz is based on [19, §§1.1 – 1.4 and part of §1.5]. • No books, notes, calculators, or other aids may be used. • THIS QUIZ DOES NOT COUNT IN THE COMPUTATION OF YOUR TERM MARK! • All answers must be thoroughly justified. Unless you are instructed to the contrary, it is never sufficient to simply state a one-word answer. • For the purpose of assigning a numerical grade, the questions numbered with Arabic numberals (1, 2, 3,...) may be taken to be of equal value, although they are not equally difficult. • A sketch of solutions will be provided at the end of the hour. It is suggested that you exchange papers with another student, and each grade the other’s paper, referring to the sketch of solutions. 1. Determine whether each of the following is true or false, giving a precise explanation in each case. (a) If 1 < 0, then 3 = 4. (b) If 1 + 1 = 2 or (inclusive) 1 + 1 = 3, then 2 + 2 = 3 and 2 + 2 = 4. 2. Determine whether or not the following two propositions are logically equivalent: p → (¬q ∧ r),

¬p ∨ ¬(r → q) .

3. Determine whether the following proposition is a tautology: ((p → q) ∧ ¬p) → ¬q . 4. Write the contrapositive, converse, and inverse of the following statements: If you try hard, then you will win. (Inverse = converse of contrapositive.) 5. Suppose P (x, y) is the statement x + 2y = xy, where x and y are integers. What are the truth values of

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

15

(a) P (1, −1) (b) ∃yP (3, y) (c) ∃x∀yP (x, y) (d) ∃y∀xP (x, y) 6. Suppose the variable x represents students, y represents courses and T (x, y) means ”x is taking y”. Match each of the following symbolic statements with all its equivalent English statements in the second list: (a) ∃x∀yT (x, y) (b) ∀x∃yT (x, y) (c) ∃x∀y¬T (x, y) (d) ∃y∀x¬T (x, y) (e) ¬∃y∀xT (x, y) The English statements are (A) Every course is being taken by at least one student. (B) Some student is taking every course. (C) No student is taking all courses. (D) There is a course that all students are taking. (E) Every student is taking at least one course. (F) There is a course that no students are taking. (G) Some students are taking no courses. (H) No course is being taken by all students. (I) Some courses are being taken by no students. (J) No student is taking any course. 7. Suppose A = {a, b, c}. Determine the truth value of each of the following statements. (Because of time limitations no justification is requested.) (a) {b, c} ∈ P (A) (b)

⊆A

(c)

⊆A×A

(d) {a, b} ∈ A × A

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

16

8. Suppose A = {a, b, c} and B = {b, {c}}. For each of the following statements, determine whether it is true or false. (Because of time limitations no justification is requested.) (a) c ∈ A − B (b)

∈ P (B)

(c) {c} ⊆ B (d) {b, c} ∈ P (A) (e)

⊆A×A

9. Suppose D = {x, y} and E = {x, {x}}, where x 6= y. For each of the following statements, determine whether it is true or false. (Because of time limitations no justification is requested.) (a) x ⊆ E. (b)

∈ P (E).

(c) {x} ⊆ D − E. (d) |P (D)| = 4. 10. Find three subsets of {1, 2, 3, 4, 5, 6, 7, 8, 9} such that the intersection of any two has cardinality 2 and the intersection of all three has cardinality 1.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

6

17

Solutions to Problems on the Class Quiz which was administered on 15th September, 2000. Distribution Date: 15 September, 2000 1. Determine whether each of the following is true or false, giving a precise explanation in each case. (a) If 1 < 0, then 3 = 4. (b) If 1 + 1 = 2 or (inclusive) 1 + 1 = 3, then 2 + 2 = 3 and 2 + 2 = 4. Solution: (a) Here the premise, 1 < 0, is false; any conditional statement with a false premise must be true. (b) The premise is true, as it is the disjunction of two statements which are not both false. For the conditional to be true we require that the conjuction (2 + 2 = 3) ∧ (2 + 2 = 4) be true, i.e. that both of the conjuncts be true. But the first conjunct, 2 + 2 = 3, is false. Hence the conditional statement is false. 2. Determine whether or not the following two propositions are logically equivalent: p → (¬q ∧ r),

¬p ∨ ¬(r → q) .

Solution: This case could be proved using a truth table, where the columns corresponding to the two given formulæ would be seen to have identical entries. Another way of proving this equivalence would be as follows, using laws of logic and an equivalence proved in the textbook. ⇔ ⇔ ⇔ ⇔ ⇔

p → (¬q ∧ r) ¬p ∨ (¬q ∧ r) [19, Example 1.2.3, p. 16] ¬p ∨ (¬q ∧ ¬¬r) double negation law ¬p ∨ ¬(q ∨ ¬r) de Morgan law ¬p ∨ ¬(¬r ∨ q) commutativity of ∨ ¬p ∨ ¬(r → q) [19, Example 1.2.3, p. 16]

3. Determine whether the following proposition is a tautology: ((p → q) ∧ ¬p) → ¬q . Solution: By using a truth table, or otherwise, we can discover the interpretation (truth assignment) (p, q) = (F, T ) under which the given proposition is false.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

18

4. Write the contrapositive, converse, and inverse of the following statements: If you try hard, then you will win. (Inverse = converse of contrapositive.) Solution: Contrapositive: If you will not win, then you do not try hard. Converse: If you will win, then you try hard. Inverse: If you do not try hard, then you will not win. 5. Suppose P (x, y) is the statement x + 2y = xy, where x and y are integers. What are the truth values of (a) P (1, −1) (b) ∃yP (3, y) (c) ∃x∀yP (x, y) (d) ∃y∀xP (x, y) Solution: (a) 1 + 2(−1) = 1(−1) is True. (b) True. 3 + 2y = 3y ⇔ y = 3. (There is only one solution.) (c) False. If we attempt to solve the equation for y in terms of x, we find that x 2 y= =1+ , when x 6= 2. Thus, for every value of x distinct from x−2 x−2 2 there is at most one value of y that makes P (x, y) true; indeed, there will be exactly one value precisely when x is one of 0, 1, 3, 4, since it is necessary that x − 2 divide x — or, equivalently, that x − 2 be a divisor of 2. But, for x = 2, there exists no such value of y; that is, there is no solution to 2 + 2y = 2y. 2y (d) False. For y 6= 1 P (x, y) ⇔ x = . Thus no y other than possibly y = 1 y−1 could be such that ∀x P (x, y). But P (x, 1) ⇔ x + 2 = x, which is true for no x. 6. Suppose the variable x represents students, y represents courses and T (x, y) means ”x is taking y”. Match each of the following symbolic statements with all its equivalent English statements in the second list: (a) ∃x∀yT (x, y) UPDATED TO September 19, 2000

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

19

(b) ∀x∃yT (x, y) (c) ∃x∀y¬T (x, y) (d) ∃y∀x¬T (x, y) (e) ¬∃y∀xT (x, y) The English statements are (A) Every course is being taken by at least one student. (B) Some student is taking every course. (C) No student is taking all courses. (D) There is a course that all students are taking. (E) Every student is taking at least one course. (F) There is a course that no students are taking. (G) Some students are taking no courses. (H) No course is being taken by all students. (I) Some courses are being taken by no students. (J) No student is taking any course. Solution: aB bE cG dI dF eH 7. Suppose A = {a, b, c}. Determine the truth value of each of the following statements. (Because of time limitations no justification is requested.) (a) {b, c} ∈ P (A) (b)

⊆A

(c)

⊆A×A

(d) {a, b} ∈ A × A Solution: TTTF 8. Suppose A = {a, b, c} and B = {b, {c}}. For each of the following statements, determine whether it is true or false. (Because of time limitations no justification is requested.) (a) c ∈ A − B (b)

∈ P (B)

(c) {c} ⊆ B

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

20

(d) {b, c} ∈ P (A) (e)

⊆A×A

Solution: TTFTT 9. Suppose D = {x, y} and E = {x, {x}}, where x 6= y. For each of the following statements, determine whether it is true or false. (Because of time limitations no justification is requested.) (a) x ⊆ E. (b)

∈ P (E).

(c) {x} ⊆ D − E. (d) |P (D)| = 4. Solution: FTFT 10. Find three subsets of {1, 2, 3, 4, 5, 6, 7, 8, 9} such that the intersection of any two has cardinality 2 and the intersection of all three has cardinality 1. Solution: One example is {{1, 2, 3}, {2, 3, 4}, {1, 3, 4}}. We can determine whether this example is unique up to labelling. If we assume that subsets A and B intersect in elements 2 and 3 only, then A = {2, 3} ∪ D and B = {2, 3} ∪ E, where D and E are disjoint sets whose union is {1, 4, 5, 6, 7, 8, 9}. The 3rd subset must meet A ∩ B in one point in {2, 3}; without limiting generality, suppose it is 3. C will then contain just one point from D — say the point 1 — and just one point from E — say the point 4. But we could still take the remaining points — 5, 6, 7, 8, 9 — and partition them among the three sets without violating the intersection conditions. Thus the example given is far from unique, even if we disregard labelling considerations.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

7

21

Second Problem Assignment Distribution Date: Friday, September 22nd, 2000 Solutions are to be submitted on Friday, October 20th, 2000 1. Prove or disprove each of the following statements about integers. Proofs should be rigorous, referring to the textbook definition [19, Definition 2.3.1, p. 113]. To disprove a statement a counterexample should be provided. (In each case you should assume that all of the integer variables referred to have been universally quantified over the set of non-zero integers.)5 (a) If a|b and c|d, then (a + c)|(b + d). (b) If a|b and b|c, then a|c. (c) If a|c and b|c, then (a + b)|c. (d) If a|b and c|d, then (ac)|(b + d). (e) If a|b and b|a, then a|b. (f) If a|(b + c), then a|b and a|c. (g) If a|bc then a|b or a|c. (h) If a|b and b|c, then ab|c2 . 2. For each of the following binary relations, determine whether or not it has each of the following properties: • reflexivity • symmetry • antisymmetry • transitivity All negative statements should be justified by a counterexample. (a) The relation R1 on N, where aR1 b means a|b. (b) On the set {w, x, y, z}, the relation R2 = {(w, w), (w, x), (x, w), (x, x), (x, z), (y, y), (z, y), (z, z)}. (c) The relation R3 on Z, where aR3 b means |a − b| ≤ 1. 5

We are restricting to nonzero integers to avoid technical problems resulting from the fact that the textbook definition of a|b requires that a 6= 0. Some authors define the concept differently, and permit a = 0; of course, the only case that can then occur is 0|0; but the author of your textbook does not include this possibility in his definition of divisibility.

Notes Distributed to Students in Mathematics 189-240A (2000/2001) (d) (e) (f) (g) (h)

(i) (j) (k) (l) (m) (n)

22

The relation R4 on Z, where aR4 b means a2 = b2 . The relation R5 = (a, a), (b, b), (c, c), (a, b), (a, c), (c, b) on the set {a, b, c}. The relation R6 = {(x, x), (y, z), (z, y)} on the set A = {x, y, z}. The relation R7 on Z defined by aR7 b ⇔ a 6= b. The relation R8 on Z, where aR8 b means that the units digit of the decimal representation of a is equal to the units digit of the decimal representation of b. The relation R9 on N, where aR9 b means that the binary representation of a has the same number of digits as the binary representation of b. The relation R10 on the set of all subsets of {1, 2, 3, 4}, where SR10 T means S ⊆ T. The relation R11 on the set of all subsets of {1, 2, 3, 4}, where SR11 T means (S ⊆ T ) ∧ (S 6= T ). The relation R12 on the set of all people, where aR12 b means that a is younger than b. The relation R13 on the set {(a, b)|a ∈ Z, b ∈ Z}, where (a, b)R13 (c, d) means (a = c) ∨ (b = d). The relation R14 on R, where aR14 b means a − b ∈ Z.

3. Determine whether the following is a valid rule of inference: p → r q → r ¬(p ∨ q) ¬r )

4. Recall that the Rule of Inference called Modus Tollens infers from the truth of both propositions ¬q and p → q, the truth of the proposition ¬p. Use Mathematical Induction to prove the validity of the following Rule of Inference for all integers n > 1: p1 → p2 p2 → p3 ... ... ... (1) pn−1 → pn ¬pn ¬p1 )

You may need to use Modus Tollens at some stage(s) of your proof. [Note: The proposed Rule of Inference has been stated informally, using “. . .”. We could have avoided the “. . .” by recursively defining the conjunction of the implications.]

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

23

5. Read the solution to [19, Example 14, pp. 198-199]. Then use the same techniques to prove that every positive integer n ≥ 14 is expressible in the form n = 5a + 7b + 9c where a, b, c are non-negative integers. Give two proofs, one using the (“First”) Principle of Mathematical Induction, and the other using the Second Principle. [The solution to this problem can be expected to be longer than the solution in the cited example. You should expect to have to consider various cases.] 6. Suppose that a “word” is any string of letters of the (26-letter) English alphabet, with repeated letters allowed. Justify your answers to each of the following questions. (a) How many words are there? (b) How many 7-letter words end with the letter T? (c) How many 7-letter words begin with R and end with T? (d) How many 7-letter words begin with A or B? (e) How many 7-letter words have no vowels? [We consider the vowels to be A, E, I, O, U.] (f) How many 7-letter words have exactly one vowel? (g) How many 7-letter words have exactly two vowels, where the vowels are not side-by-side? [The 2 vowels may be the same letter.] (h) How many 7-letter words consist of an alternation of consonants and vowels, and begin with a consonent? You are not required to multiply out large integers that are expressed as a product. 7. Observe that the set S = {11, 17, 20, 22, 23, 24} has the property that all subsets of its elements have different sums. Use the Pigeonhole Principle to prove that there cannot exist a set of 7 (distinct) positive integers, none exceeding 24, with the property that all sums of its subsets are different. [Hints: (1) It suffices to consider subsets of cardinality not exceeding 4. (2) Students may wish to make use of the following fact which appears in [19, §4.3]: The number of r-element subsets n(n − 1) . . . (n − r + 1) of a set of n elements is .] r!

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

8

901

References [1] I. Anderson, Combinatorics of Finite Sets. Clarendon Press, (Oxford, 1987). ISBN 0-19-853367-5. [2] N. L. Biggs, E. K. Lloyd, R. J. Wilson, Graph Theory, 1736–1936. Clarendon Press, Oxford (1976). [3] J. A. Bondy and U. S. R. Murty, Graph Theory with Applications, Macmillan (London, 1976). ISBN 333-17791-6. [4] Lewis Carroll [Charles Lutwidge Dodgson]Through the Looking-Glass. [5] L. Euler, Solutio problematis ad geometriam situs pertinentis. Reprinted from Commentarii academiæ scientiarum Petropolitanæ 8 (1736), 1741, pp. 128–140. Printed as an appendix to [10]. [6] R. P. Grimaldi, Discrete and Combinatorial Mathematics, An Applied Introduction (Third Edition), Addison-Wesley Publishing Company (1994). ISBN 0–201–54983– 2. [7] G. Haggard, J. Schlipf, and S. Whitesides, Discrete Mathematical Structures for Computer Science, Preliminary edition. [8] F. Harary (editor), Proof Techniques in Graph Theory. Proceedings of the Second Ann Arbor Graph Theory Conference, February, 1968 . Academic Press, New York and London (1969). [9] D. E. Knuth, The Art of Computer Programming, Volume 1/Fundamental Algorithms. Addison-Wesley Publishing Company, Reading, Mass., Don Mills, Ontario, etc. (1968).

[10] D. K¨onig, Theorie der endlichen und unendlichen Graphen. Kombinatorische Topologie der Streckenkomplexe. (Theory of finite and infinite graphs. Combinatorial topology of 1-dimensional complexes.) Akademische Verlagsgesellschaft M. B. H., Leipzig (1936); Chelsea Publishing Company, New York (1950). A translation into English has been published by Birkh¨auser Verlag (1990), ISBN 0–8176–3389–8. Another reprint of the original version, published by Teubner Verlagsgesellschaft, Leipzig (1986), ISBN 3-211-95830-4, has Euler’s paper as an appendix (cf. [5]). [11] C. L. Liu, Introduction to Combinatorial Mathematics. McGraw-Hill Book Company, New York, etc. (1968). PSEAL Library, QA164 L58.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

902

[12] C. L. Liu, Elements of Discrete Mathematics, 2nd Edition. McGraw-Hill Book Company, New York, etc. (1985). ISBN 9009700938133–X. [13] L. Lov´asz, Combinatorial Problems and Exercises. North-Holland Publishing Company, Amsterdam, etc. (1979). ISBN 0–444–85219–0. [14] R. J. McEliece, R. B. Ash, C. Ash, Introduction to Discrete Mathematics Random House (New York, 1989). ISBN 0-394-35819-8. [15] J. W. Moon, Topics on Tournaments. Holt, Rinehart and Winston, New York, etc. (1968). [16] Moser, Leo Problem E 1062 . American Mathematical Monthly 60 (1953), pp. 262, 713–714. [17] K. H. Rosen Discrete Mathematics and its Applications, 3rd Edition, (McGrawHill, Inc., 1995), ISBN 0–07-853965-0. [18] K. H. Rosen Student Solutions Guide for Discrete Mathematics and its Applications, 3rd Edition, (McGraw-Hill, Inc., 1995), ISBN 0–07-853966-9. [19] K. H. Rosen Discrete Mathematics and its Applications, 4th Edition, (McGrawHill, Inc., 1999), ISBN 0–07-289905-0. [20] K. H. Rosen Student Solutions Guide for Discrete Mathematics and its Applications, 4th Edition, (McGraw-Hill, Inc., 1999), ISBN 0–07-289906-9. [21] K. H. Rosen, Elementary Number Theory and its Applications, Third Edition, (Addison Wesley, 1993), ISBN 0-201-57889-1. [22] J. Rotman, A First Course in Abstract Algebra, (Prentice Hall, 1996), ISBN 0-13311374-4. [23] W. Sierpi´ nski, Cardinal and Ordinal Numbers, Second Edition Revised . Polish Scientific Publishers (Warsaw, 1965). [24] W. A. Whitworth, Choice and Chance, (Hafner Purlishing Company, New York, 1965). (Enlarged reprint of the original edition, published in 1901) [25] P. Erd˝os, The Art of Counting, Selected Writings, edited by J. Spencer. MIT Press (Cambridge, 1973). ISBN 0-262-19116-4. [26] P. Erd˝os, Gy. Szekeres, A combinatorial problem in geometry, Compositio Math. 2 (1935), 463–470.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

A

1001

Problems on Term Tests of Previous Years

Students are cautioned not to make inferences about course content from the following tests, since both the syllabus and the text-books that were followed closely have changed. All tests were administered in a printed booklet into which all solutions were to be written.

A.1 A.1.1

1991 Term Test First Version

1. [5 MARKS EACH] Give an example of each of the following, if one exists. If none exists, prove that fact. (a) a non-empty binary relation R1 which is both symmetric and antisymmetric. (b) a partial ordering R2 on

such that R2 = R2−1

(c) an equivalence relation on {1, 2, 3, 4, 5, 6} whose equivalence classes are {1, 2}, {3}, {4, 5, 6} (d) a set which is not an element of its power set (e) a relation R3 on

such that |R3 | = 5 and |R3∗ | = 6

(f) a partial ordering R4 on a set S containing elements x, y such that x is minimal, y is minimum, and x 6= y (g) two non-isomorphic graphs with vertex set {a, b, c, d, e, f, g} and all degrees equal to 2 (h) two non-isomorphic graphs with vertex set {a, b, c, d, e} and all degrees equal to 3 2. [5 MARKS EACH] For each of the following assertions, either prove it, if it is true; or provide a counterexample, if it is false. (a) If f : A −→ A is onto then f ◦ f is onto. (b) If the edges of a complete graph with vertices {1, 2, 3, 4, 5} are coloured with colours red and blue, there will always exist either a red triangle, or a blue triangle, or both. (c) If a1 , a2 , ..., a5 are distinct integers, there must exist integers α, β, γ in {5, 4, 3, 2, 1} such that α < β < γ and aα > aβ > aγ . 3. [15 MARKS] Showing all your work, determine the number of solutions to the equation y1 + y2 + y3 + y4 = n with the properties that

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1002

(a) y1 , y2 , y3 , y4 are positive integers (b) y1 > 1, y2 > 2, y3 > 3, y4 > 4 4. [15 MARKS] Showing all your work, determine the number of ways of forming a 4-letter word from the letters of the word CHARACT ER. A.1.2

Second Version

1. [5 MARKS EACH] Give an example of each of the following, if one exists. If none exists, prove that fact. (a) two non-isomorphic graphs with vertex set {t, u, v, w, x, y, z} and all degrees equal to 2 (b) two non-isomorphic graphs with vertex set {t, u, v, w, x} and all degrees equal to 3 (c) a partial ordering R1 on

such that R1 = R1−1

(d) an equivalence relation on {a, b, c, d, e, f } whose equivalence classes are {a, b}, {c}, {d, e, f } (e) a set which is not an element of its power set (f) a relation R2 on

such that |R2 | = 4 and |R2∗ | = 4

(g) a partial ordering R3 on a set A containing distinct elements a and b such that a is minimum and b is minimal (h) a non-empty binary relation R3 which is both symmetric and antisymmetric. 2. [5 MARKS EACH] For each of the following assertions, either prove it, if it is true; or provide a counterexample, if it is false. (a) If the edges of a complete graph with vertices {c, d, e, f, g} are coloured with colours green and red , there will always exist either a green triangle, or a red triangle, or both. (b) If g : X −→ X is onto then g ◦ g is onto. (c) If n1 , n2 , ..., n5 are distinct integers, there must exist integers i, j, k in {5, 4, 3, 2, 1} such that i < j < k and ni < nj < nk 3. [15 MARKS] Showing all your work, determine the number of ways of forming a 4-letter word from the letters of the word HARRASSOR. 4. [15 MARKS] Showing all your work, determine the number of solutions to the equation x1 + x2 + x3 + x4 = n with the properties that

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1003

(a) x1 , x2 , x3 , x4 are positive integers (b) x1 > 1, x2 > 2, x3 > 3, x4 > 4.

A.2

1994 Term Test

A.2.1

First Version

1. [10 MARKS] Showing all your work , determine the number of permutations of the letters of the word DIGITAL in which at least one of the following conditions occurs: • D precedes G • G precedes T • T precedes L (Here precedes means “appears before”, but is not intended to imply that the two letters should necessarily be adjacent; adjacency is not excluded, however.) 2. [10 MARKS]Use a membership table — no other method will be acceptable — to prove that, for any subsets A, B, C of a universal set U, (A ∩ B) ∪ (A ∩ C) = (A ∩ B) ∪ (A ∩ C) 3. [10 MARKS] Give an example of the following, or prove that none exists: |A| = 5; u ∈ A; v ∈ A; u 6= v; g : A × A → A is an operation such that each of u and v is an identity for g. √ 4. [10 MARKS] Prove that 3 is irrational. A.2.2

Second Version

1. [10 MARKS] A quaternary sequence is one whose elements are each an element of the set {0, 1, 2, 3}. Let n, r be integers, n ≥ r. Explaining your reasoning, determine the number of quaternary sequences of length n which contain exactly r 1’s. 2. [10 MARKS] Using a truth table, or otherwise — but showing all your work — determine the truth values of p, q, r, s for which the following formula is true: [(p → q) ∧ [(q ∧ r) → s] ∧ r] → (p → r)

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1004

3. [10 MARKS] Give an example of the following, or prove that none exists: |B| = 4; x ∈ B; y ∈ B; x 6= y; f : B × B → B is an operation such that each of x and y is an identity for f . √ 4. [10 MARKS] Prove that 5 is irrational.

A.3 A.3.1

1995 Term Test First Version

1. [10 MARKS] Demonstrate your knowledge of the Principle of Induction by proving that 3n ≥ n + 2 for all integers n ≥ 1. (Only a fully documented induction proof is acceptable here. Show all your work, and do not use any other method to prove this theorem.) 2. Let f : X → Y and g : Y → Z be two given functions. (a) [2 MARKS] Define precisely what is meant by the composite function gf . (b) [8 MARKS] Showing all your work, prove that if f and g are both surjective, then gf is also surjective. 3. [10 MARKS] Showing all your work, determine whether or not it is possible to find a collection of subsets of 9 such that each one has exactly 4 members, and each member of 9 belongs to exactly 6 of the subsets. 4. [10 MARKS] Showing all your work, determine a formula in disjunctive normal form that is logically equivalent to the formula p ∧ (((¬r) ⇒ (((p ∨ q) ⇒ r) ⇒ (¬q)))) A.3.2

Second Version

1. Let g : A → B and f : B → C be two given functions. (a) [2 MARKS] Define precisely what is meant by the composite function f g. (b) [8 MARKS] Showing all your work, prove that if f and g are both injective, then gf is also injective. 2. [10 MARKS] Showing all your work, determine whether or not it is possible to find a collection of subsets of 9 such that each one has exactly 12 members, and each member of 9 belongs to exactly 10 of the subsets.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1005

3. [10 MARKS] Showing all your work, determine a formula in disjunctive normal form that is logically equivalent to the formula q ∧ (((¬s) ⇒ (((r ∨ q) ⇒ s) ⇒ (¬q)))) 4. [10 MARKS] Demonstrate your knowledge of the Principle of Induction by proving that 4n ≥ 2n + 2 for all integers n ≥ 1. (Only a fully documented induction proof is acceptable here. Show all your work, and do not use any other method to prove this theorem.) A.3.3

Third Version

1. [10 MARKS] Showing all your work, determine whether or not it is possible to find a collection of subsets of 9 such that each one has exactly 6 members, and each member of 9 belongs to exactly 3 of the subsets. 2. [10 MARKS] Demonstrate your knowledge of the Principle of Induction by proving that 2n ≥ 2n + 2 for all integers n ≥ 3. (Only a fully documented induction proof is acceptable here. Show all your work, and do not use any other method to prove this theorem.) 3. Let f : U → V and g : V → W be two given functions. (a) [2 MARKS] Define precisely what is meant by the composite function gf . (b) [8 MARKS] Showing all your work, construct an example to show that it is possible for f to be injective and g surjective, while gf is not injective. 4. [10 MARKS] Showing all your work, determine a formula in conjunctive normal form that is logically equivalent to the formula s ∧ (((¬t) ⇒ (((s ∨ q) ⇒ t) ⇒ (¬q)))) A.3.4

Fourth Version

1. [10 MARKS] Showing all your work, determine a formula in conjunctive normal form that is logically equivalent to the formula q ∧ (((¬r) ⇒ (((q ∨ p) ⇒ r) ⇒ (¬p)))) 2. [10 MARKS] Demonstrate your knowledge of the Principle of Induction by proving that 3n ≥ 2n + 5 for all integers n ≥ 2. (Only a fully documented induction proof is acceptable here. Show all your work, and do not use any other method to prove this theorem.)

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1006

3. Let f : W → X and g : X → Y be two given functions. (a) [2 MARKS] Define precisely what is meant by the composite function gf . (b) [8 MARKS] Showing all your work, construct an example to show that it is possible for f to be surjective, g to be injective, while gf is not surjective. 4. [10 MARKS] Showing all your work, determine whether or not it is possible to find a collection of subsets of 9 such that each one has exactly 10 members, and each member of 9 belongs to exactly 5 of the subsets.

A.4

1996 Term Test

There were four versions, each containing 3 questions worth 10 marks each, and 2 questions worth 5 marks each. The following are solutions to the problems on the various tests, or to variations of those problems: in some cases symbols and data were changed in superficial ways. A. [10 MARKS] Using any method discussed in the lectures, solve the recurrence bn+2 = −6bn+1 − 9bn (n ≥ 0), subject to the initial conditions b0 = 1 and b1 = 6. Solution: Using the characteristic equation: The characteristic polynomial is r2 + 6r + 9 = (r + 3)2 , so the characteristic roots are −3 (twice) (cf. [17, Example 5, p. 322]). Assuming a general solution of the form bn = (An + B)(−3)n , we impose the initial conditions, to obtain equations 1 = B 6 = (A + B)(−3) whose solution is A = −3, B = 1. Thus the solution to the recurrence which satisfies the initial conditions is an = (1 − 3n)(−3)n (n ≥ 0). ∞ P Using ordinary generating functions: Define b(t) = bn tn to be the ordin=0

nary generating function of the sequence {bn }n=0,1,... . Multiplying the recurrence by tn+2 and summing over the range t = 0, 1, ... yields ∞ X

bn+2 t

n+2

= −6t

n=0

∞ X

n+1

bn+1 t

2

− 9t

n=0

∞ X

bn t n

n=0

which reduces, after changes of variables of summation, to ∞ X k=2

k

bk t = −6t

∞ X `=1

`

2

b` t − 9t

∞ X n=0

bn t n ,

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1007

which can be rewritten in terms of the generating function as b(t) − b0 t0 − b1 t1 = −6t(b(t) − b0 t0 ) − 9t2 b(t) , which can be solved for b(t) to yield b0 + (b1 + 6b0 )t 1 + 6t + 9t2 1 + 12t = = (1 + 12t)(1 + 3t)−2 (1 + 3t)2  ∞  X m+2−1 = (1 + 12t) (−3)m tm 2 − 1 m=0

b(t) =

= =

∞ X

m m

(m + 1)(−3) t − 4

∞ X

m=0 ∞ X

∞ X

n=0

n=1

(m + 1)(−3)m+1 tm+1

m=0

(n + 1)(−3)n tn − 4

n(−3)n tn

∞ ∞ X X n n = (n + 1)(−3) t − 4 n(−3)n tn

=

n=0 ∞ X

n=0

(1 − 3n)(−3)n tn

n=0

so bn = (1 − 3n)(−3)n (n ≥ 0). B. [10 MARKS] Showing all your work, determine the number of solutions to the equation x1 + x2 + x3 + x4 = 12 in nonnegative integers x1 , x2 , x3 , x4 such that x1 ≥ 2, x2 ≤ 4, 1 ≤ x3 ≤ 4. Solution: Using inclusion-exclusion: It is convenient to change the variables so that they all range over an interval of non-negative integers whose left end-point is zero. This we achieve by defining y1 y2 y3 y4

= = = =

x1 − 2 x2 x3 − 1 x4

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1008

The equation transforms to y1 + y2 + y3 + y4 = 9

(2)

The constraints that must be satisfied simultaneously transform into 0≤ 0≤ 0≤ 0≤

y1 y2 ≤ 4 y3 ≤ 3 y4

(3) (4) (5) (6)

The number of solutions to (2) in non-negative integers, i.e. possibly failing to satisfy  either or both of the right inequalities of constraints (4) and (5), 9+3 is 3 . Those solutions which violate the right inequality of constraint (4) satisfy, after a change of variable (z1 , z2 , z3 , z4 ) = (y1 , y2 −5, y3 , y4 ), z1 +z2 +z3 + z4 = 4, with constraints 0 ≤ z1 ; 0 ≤ z2 ; 0 ≤ z3 ≤ 3; 0 ≤ z4 ; and their number is 5+3 . Those solutions which violate the right inequality of (5) satisfy, after 3 a change of variable (z1 , z2 , z3 , z4 ) = (y1 , y2 , y3 − 4, y4 ), z1 + z2 + z3 + z4 = 5, with constraints 0 ≤ z1 ; 0 ≤ z2 ≤ 4; 0 ≤ z3 ; 0 ≤ z4 ; their number is 4+3 . The 3 solutions which violate the right inequalities of both (4) and (5) satisfy, after a change of variable (z1 , z2 , z3 , z4 ) = (y1 , y2 −5, y3 −4, y4 ), z1 +z2 +z3 +z4 = 0, and there is just one such solution. Applying the Inclusion-Exclusion Principle, we find that of solutions to (2) satisfying the given constraints is  the  number  12 8 7 3 − 3 − 3 + 3 = 130. 3 Remember that the Principle of Inclusion-Exclusion serves to express the cardinality of a union in terms of the cardinalities of certain intersections. In typical applications the sets whose union we consider represent certain forbidden configurations. Here we transformed the problem so that the forbidden configurations corresponded to y2 ≥ 5 and y3 ≥ 4. Computing the number of points in the union allowed us, by complementation, to find the number of points in the total population not in that union, etc. If we wished to use this analysis for the problem as originally stated in terms of the xi , we would have had four prohibitions, say {(x1 , x2 , x3 , x4 )|x1 + x2 + x3 + x4 = 12; ∀i[xi ≥ 0]; x1 ≤ 1} {(x1 , x2 , x3 , x4 )|x1 + x2 + x3 + x4 = 12; ∀i[xi ≥ 0]; x2 ≥ 5} {(x1 , x2 , x3 , x4 )|x1 + x2 + x3 + x4 = 12; ∀i[xi ≥ 0]; x3 = 0} {(x1 , x2 , x3 , x4 )|x1 + x2 + x3 + x4 = 12; ∀i[xi ≥ 0]; x3 ≥ 5}   Then |A1 | = 12+2 + 11+2 , etc. This approach would be very tedious, as it 2 2 requires looking at 6 intersections of 2 sets and 4 intersections of 3 sets. A1 A2 A3 A4

= = = =

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1009

Using ordinary generating functions: (t2 + t3 + ...)(1 + t + ... + t4 )(t + t2 + ... + t4 )(1 + t + t2 + ...) t2 1 − t5 t (1 − t4 ) 1 = · · · 1−t 1−t 1−t 1−t t3 (1 − t4 − t5 + t9 ) = (1 − t)4  ∞  X m+3 m 3 7 8 12 = (t − t − t + t ) t 3 m=0 in which the coefficient of t12 is

12 3





8 3





7 3



+

3 3



, as before.

C. [10 MARKS] Use the Euclidean algorithm — no other method will be acceptable — to determine integers m and n such that gcd(341, 527) = 341m + 527n Solution: We apply the Eulidean algorithm: 527 341 186 155

= = = =

1 · 341 + 186 1 · 186 + 155 1 · 155 + 31 5 · 31 + 0

Hence gcd(341, 527) = 31 = 1 · 186 − 155 = 1 · 186 − 1 · (341 − 1 · 186) = (−1) · 341 + 2 · 186 = (−1) · 341 + 2(527 − 1 · 341) = 2 · 527 − 3 · 341 D. [5 MARKS] Showing all your work, determine the number of binary relations on the set {1, 2, ..., n} which are not symmetric. Solution: We shall count the symmetric relations first. Consider the n×n adjacency matrix. There is no restriction on the diagonal entries: there are n of these, and they may be chosen independently; by the Product Rule the number of possible main diagonals is 2n . The off-diagonal entries are restricted in pairs. For any symmetrically positioned pair, say in positions (i, j) and (j, i) (where i 6= j) there are only two possible

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1010

configurations of entries: either both entries are 0, or both entries are 1. Thus there are 2 choices for any such pair; and there are 12 (n2 − n) such pairs. It follows n2 −n

1

2

that the total number of symmetric relations is 2n · 2 2 = 2 2 (n +n) . The total 2 number of binary relations is 2n ; hence the number of binary relations that are 1 2 2 not symmetric is 2n − 2 2 (n +n) . E. [5 MARKS] Showing all your work, determine the number of binary relations on the set {1, 2, ..., n} which are antisymmetric. Solution: Antisymmetry constrains off-diagonal symmetric pairs of entries in the adjacency matrix to be anything except both 1: thus there are 3 acceptable values that the  pair corresponding to the three possible cases for i 6= j:   may take,   (i, j) ∈ R (i, j) ∈ /R (i, j) ∈ /R , , . Antisymmetry does not constrain (j, i) ∈ /R (j, i) ∈ R (j, i) ∈ /R in any way the main diagonal entries of the adjacency matrix: for any i (i, i) may or may not be present in an antisymmetric relation R. Thus there are 2 choices for each of the main diagonal entries, and 3 choices for each of the off-diagonal n2 −n symmetric pairs. The total number of antisymmetric relations is 2n 3 2 . F. [5 MARKS] Prove or disprove: Let f : A → B be injective, and g : B → C be surjective. Then g ◦ f is always surjective. Solution: The statement is false. Consider the following counterexample: A = {a}, B = {b, c} = C; f is given by f (a) = b; g = ιB , the identity function. Then f is evidently injective, and g is surjective; g ◦ f is the “constant” mapping on to b: no point of A is mapped on to c. G. [5 MARKS] Prove or disprove: Let f : A → B be injective, and g : B → C be surjective. Then g ◦ f is always injective. Solution: The statement is false. Consider the following counterexample: A = {a, b} = B, C = {c}; f = ιA , the identity function; g is the “constant” mapping on to c. For the composition to be injective it is necessary and sufficient that g ◦ f map a and b on to distinct points of C. But C possesses only one point. From this contradiction we conclude that the composition is not injective. H. [10 MARKS] The Fibonacci numbers are defined recursively by f0 = 0, f1 = 1, fn+2 = fn+1 + fn

(n ≥ 0) .

(7)

After observing that f2 = 1, prove the following property of these numbers by induction for all integers n ≥ 1. Only a proof by induction will be accepted. Do not

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1011

use or determine a formula for the Fibonacci numbers! n X

fi2 = fn · fn+1

(8)

i=1

Solution: Let P (n) denote statement (8). Basis Step: P (1) states that f12 = f1 · f2 . We know this to be true, since f2 = f1 + f0 = 1 + 0 = 1, so f12 = 12 = 1 = 1 · 1 = f1 · f2 . Induction Step: Suppose that P (n) is true. Then n+1 X

fi2

=

i=1

n X

fi2

+

2 fn+1

by definition of

i=1

= = = =

n+1 X i=1

2 fn+1

fn fn+1 + by the induction hypothesis fn+1 (fn + fn+1 ) fn+1 · fn+2 by (7) fn+1 · f(n+1)+1 ,

which is P (n + 1). It follows by the Principle of Induction that P (n) is true for all positive integers n. I. [10 MARKS] The Fibonacci numbers are defined recursively by f0 = 0, f1 = 1, fn+2 = fn+1 + fn

(n ≥ 0) .

(9)

After observing that f2 = 1, prove the following property of these numbers by induction for all integers n ≥ 1. Only a proof by induction will be accepted. Do not use or determine a formula for the Fibonacci numbers! n X

f2i−1 = f2n

(10)

i=1

Solution: Let Q(n) denote statement (10). Basis Step: Q(1) states that f1 = f2 . We know this to be true, since f2 = f1 + f0 = 1 + 0 = 1 = f1 .

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1012

Induction Step: Suppose that Q(n) is true. Then n+1 X

f2i−1 =

i=1

n X

f2i−1 + f2n+1

by definition of

i=1

n+1 X i=1

= f2n + f2n+1 by the induction hypothesis = f2n+2 by (9) = f2(n+1) , which is Q(n + 1). It follows by the Principle of Induction that Q(n) is true for all positive integers n. J. [5 MARKS] Let A = {1, 2, 3}. Determine all the equivalence relations R on A. For each of these list all ordered pairs in the relation R. (No other representation of the relation will be accepted.) Solution: We can classify these relations by finding the various possible partitions of A. There are exactly 5 equivalence relations. 3 equivalence classes: Here each of the points of A lies alone in an equivalence class. The equivalence classes are, therefore, {1} , {2} , {3} so R = {(1, 1), (2, 2), (3, 3)} . 2 equivalence classes: One class must have one point, and the other the remain ing 2 points. There are 3 = 31 ways of partitioning a set of 3 into 2 sets of these sizes. The class with one point gives rise to just one element of R; the class with 2 points gives rise to 4 points — two of the form (n, n), and two of the form (m, n), (n, m), where m 6= n. The three possible relations are {(1, 1), (2, 2), (3, 3), (2, 3), (3, 2)} {(2, 2), (3, 3), (1, 1), (3, 1), (1, 3)} {(3, 3), (1, 1), (2, 2), (1, 2), (2, 1)} 1 equivalence class: Here all points of A are in the same equivalence class, i.e. {1, 2, 3}. R must, therefore, contain all 9 of the ordered pairs in A × A. Consequently, R = {(1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3), (3, 1), (3, 2), (3, 3)}

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1013

K. [5 MARKS] Let B = {4, 5, 6}. Determine all the equivalence relations R on B. For each of these equivalence relations, draw the digraph. (No other representation of the relation will be accepted.) Solution: We can classify these relations by finding the various possible partitions of B. There are exactly 5 equivalence relations. 3 equivalence classes: Here each of the points of B lies alone in an equivalence class. The equivalence classes are, therefore, {4} ,

{5} ,

{6}

There is only one possible digraph: it has a loop at each of the vertices 4, 5, 6, and no other directed edges. 2 equivalence classes: One class must have one point, and the other the remain 3 ing 2 points. There are 3 = 1 ways of partitioning a set of 3 into 2 sets of these sizes. The class with 1 point gives rise to just one directed edge — a loop; the class with 2 points gives rise to 4 directed edges — two loops, and a pair of oppositely directed edges between the points. 1 equivalence class: Here all points of B are in the same equivalence class. The digraph of this relation has a loop at every vertex, and a pair of oppositely directed edges between each of the 32 pairs of distinct vertices.

A.5

1997 Term Test The test was administered on Wednesday, November 12th, 1997. Students were allowed 60 minutes on each of the following 4 versions: Version Marks Version Version Version Version

1 2 3 4

1 2 3 4 5 6 5 5 10 10 10 10 I VIII III IV VII XI II IX III IV VI X I VIII III IV VII XI II IX III IV VI X

50

Problem V. was not used on any version of the test. In some questions part marks were accorded for partial progress towards a solution. These were usually not “generous” unless the progress was substantial. Students are expected to budget part of their time to verifying the correctness of their solutions; errors

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1014

that could easily have been detected by verification6 procedures may have been taken more seriously than other errors. It is particularly important to implement verification procedures in problems where you invest a substantial amount of time, for sometimes an early error renders the rest of a solution useless. I. [5 MARKS] Prove or disprove: On the 4-element set A = {a, b, c, d} the following relation is symmetric: R = {(a, b), (b, c), (a, c), (a, a), (c, b), (c, a)} . Solution: FALSE, since (a, b) ∈ R but (b, a) ∈ / R. II. [5 MARKS] Prove or disprove: On the 4-element set B = {a, b, c, d} the following relation is transitive: S = {(a, b), (b, c), (a, c), (c, a), (c, b), (b, a), (c, c)} . Solution: FALSE: while (a, c) ∈ S and (c, a) ∈ S, (a, a) ∈ / S; for similar reasons, (b, b) must be, but is not present. The word transitive is used in other ways in other contexts. Some students attributed to the word meanings closer to those seen in other contexts. Mathematical terminology is not always well chosen, cf. §??. III. [10 MARKS] Using a truth table, or otherwise, determine whether or not the following argument is a valid rule of inference. p→r q→r (¬p ∧ ¬q) ∨ (¬q ∧ r) Solution: α := β := p q r ¬p ¬q p → r q → r ¬p ∧ ¬q ¬q ∧ r α ∨ β F F F T T T T T F T T T T T T F F T T T T F F F F F T F T F T T F F F F T T T F T F F F T T T F F F T T F T T T F T F T T F F F F T T F F F T T F F F T T T F F 6

For example, the solution found to the homogeneous linear recurrence in the last question could be substituted into the recurrence to check whether it did indeed satisfy the recurrence.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1015

Five lines of this table represent interpretations where both of the premisses are true: ll. ##1, 2, 4, 6, 8. In rows ##1, 2, 6 the conclusion is also true; but in rows ##4, 8 the conclusion is false. From these counterexamples we conclude that the argument is not universally true — i.e. that it is not a valid rule of inference. (It is not sufficient to compile the table and simply state a conclusion. You must indicate how you are using information from the table. If you had some insight into detecting the particular assignments of truth values which prove the claim invalid, you would not have needed the table at all.) IV. [10 MARKS] Using generating functions — no other method will be accepted for this problem — determine, for any integer n, the number of solutions in positive integers x1 , x2 to the inequality x1 + x2 ≤ n. Solution: Introduce a slack variable x3 = n−x1 −x2 , Then each solution to the given inequality corresponds to a solution to the equation x1 + x2 + x3 = n. These are enumerated by the ordinary generating function (t + t2 + t3 + ...)2 (1 + t + t2 + ...) = ∞ ∞   P P m+2 m+2 n n t2 (1 − t)3 = t = t . (The factor series begin with the term 2 2 m=0

n=2

t1 because the summands x1 and x2 were to be positive.) Hence the number of  n solutions for n is 2 ; as the coefficients of powers of t lower than the 2nd are 0, there are no solutions when n ≤ 1. The purpose of this problem was to test the use of generating functions. We can verify the correctness of this solution by solving in another way. Define yi = xi − 1 (i = 1, 2); y3 = x3 ; and count the number of solutions of the transformed equation, y1 + y2 + y3 = n − 2, in non-negative integers. These are equinumerous with the binary strings  of length (n − 2) + 2 with 2 1’s and n − 2 0’s, whose number is evidently n2 . Note that there are 0 solutions when n ≤ 1. V. [10 MARKS] Using generating functions — no other method will be accepted for this problem — determine, for any integer n, the number of nonnegative integer solutions to the equation x1 + x2 = n, where x1 is required to be even. Solution: The enumerators for x1 and x2 will be, respectively, 1+t2 +t4 +...+t2m +... and 1 + t + t2 + ... + t` + ..., so the generating function for the numbers sought ∞  2 m P m+1 1+t is (1 − t2 )−1 (1 − t)−1 = (1−t (t ) . The coefficient of t2m is 2 )2 = (1 + t) 1 m=0

m + 1, so there are m + 1 solutions to x1 + x2 = 2m; the coefficient of t2m+1 is m + 1, so there are m + 1 solutions to x1 + x2 = 2m + 1, in both cases x1 must be even. To verify this solution replace x1 by 2y1 , and consider the equation x2 = n − 2y. When n = 2m, we are solving x2 = 2(m − y1 ) in non-negative integers: for each of

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1016

the m + 1 values y1 = 0, 1, ..., m we have an admissible value for x2 , and only for these. When n = 2m + 1, we are solving x2 = 1 + 2(m − y1 ). Again, each of the m + 1 values y1 = 0, 1, ..., m yields an admissible value for x2 . We could combine the two solutions into a single statement: the number of solutions to x1 + x2 = n in non-negative integers, where x1 is even, is d n+1 e. 2 VI. [10 MARKS] Using the Principle of Inclusion-Exclusion — no other method will be accepted for this problem — determine the number of strings x1 x2 x3 x4 of length 4 that can be formed from the digits 0, 1, ..., 9 if no digit appears exactly 2 times in the string. Except for this type of restriction, any numbers of repetitions are permitted. Solution: The set of all strings, Ω, contains, by the Product Rule, 104 = 10, 000 elements. Define the subset Ai to consist of all strings that contain exactly 2 i’s (i = 0, 1, ..., 9). Then |Ai | = 42 92 , since there are 42 ways of selecting the locations for the prohibited i’s, after the placing of which there are exactly 9 ways of choosing the digits in each of the other 4 − 2 = 2 locations. For distinct i and  4 j, |Ai ∩ Aj | = 2 , the number of ways of choosing the locations for the i’s — after which the j’s must be placed in the remaining two locations. By the Principle of Inclusion-Exclusion, the total number of strings is       10 4 2 10 4 4 9 + = 10, 000 − 4860 + 270 = 5410 , 10 − 1 2 2 2   10 where 10 counts the number of prohibited subsets, and counts the number 1 2 of pairs of prohibited subsets. Although it was required that students solve this problem using the Principle of Inclusion-Exclusion, we present, for verification purposes, a solution using exponential generating functions. The enumerator for each of the 10 possible digits is x3 x4 xn x2 1 + x + 0x2 + + + ... + ... = ex − 3! 4! n! 2 Raising to the 10th power yields, by the binomial theorem,  10 x2 45 x e − = e10x − 5x2 e9x + x4 e8x − ... 2 4  4  10 92 45 = ... + −5· + x4 + ... 4! 2! 4 As the coefficient of x4 is 5410 , the number of words is 5410, confirming the result 4! obtained using Inclusion-Exclusion.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1017

VII. [10 MARKS] Using the Principle of Inclusion-Exclusion — no other method will be accepted for this problem — determine the number of strings y1 y2 y3 y4 y5 y6 of length 6 that can be formed from the digits 0, 1, ..., 9 if no digit appears exactly 3 times in the string. Except for this type of restriction, any numbers of repetitions are permitted. Solution: The set of all strings, Ω, contains, by the Product Rule, 106 = 1, 000, 000 elements. Define the subset Ai to consist of all strings that contain exactly 3 i’s (i = 0, 1, ..., 9). Then |Ai | = 63 93 , since there are 63 ways of selecting the locations for the prohibited i’s, after the placing of which there are exactly 9 ways of choosing the digits in each of the other 6 − 3 = 3 locations. For distinct i and  j, |Ai ∩ Aj | = 63 , the number of ways of choosing the locations for the i’s — after which the j’s must be placed in the remaining three locations. By the Principle of Inclusion-Exclusion, the total number of strings is       10 6 3 10 6 6 9 + = 1, 000, 000 − 145, 800 + 900 = 855, 100 , 10 − 1 3 2 3   10 counts the number where 10 counts the number of prohibited subsets, and 2 1 of pairs of prohibited subsets. Although it was required that students solve this problem using the Principle of Inclusion-Exclusion, we present, for verification purposes, a solution using exponential generating functions. The enumerator for each of the 10 possible digits is x2 x4 xn x3 1+x+ + 0x3 + + ... + ... = ex − 2! 4! n! 6 Raising to the 10th power yields, by the binomial theorem,  10 x3 10 90 x e − = e10x − x3 e9x + x6 e8x − ... 6 6 72  6  10 5 93 5 = ... + − · + x6 + ... 6! 3 3! 4 As the coefficient of x4 is 855100 , the number of words is 855,100, confirming the 6! result obtained using Inclusion-Exclusion. VIII. [5 MARKS] Using an incidence matrix, give an example of a graph on 4 vertices which is isomorphic to its complement, or prove that none can exist. Solution: (cf. [17, Exercise 7.3.50]) The path of length 3 is such an example. Its incidence matrix [17, p. 453] depends on the ordering of the vertices; it also requires a labelling of the edges. An adjacency matrix [17, p. 451] requires only a labelling

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1018

of the vertices. Had only an adjacency matrix been requested, one possible ordering would give the matrix   0 1 0 0  1 0 1 0     0 1 0 1 . 0 0 1 0 However, it is an incidence matrix that is required here. If we retain the ordering of the vertices used in the preceding adjacency matrix, and label the edges so that e1 = 12, e2 = 23, e3 = 34, then the incidence matrix would be   1 0 0  1 1 0     0 1 1 . 0 0 1 Had the graph in question not existed, there would have been an ambiguity in the question. It is not clear from the wording whether a non-existence proof would have to “use” an incidence matrix. Since the graph does exist, this ambiguity is irrelevant. IX. [5 MARKS] Using an incidence matrix, give an example of a graph on 5 vertices which is isomorphic to its complement, or prove that none can exist. Solution: (cf. [17, Example 7.3.51]) The pentagon is such an example. Its incidence matrix [17, p. 453] depends on the ordering of the vertices; it also requires a labelling of the edges. An adjacency matrix [17, p. 451] requires only a labelling of the vertices. Had only an adjacency matrix been requested, one possible ordering would give the matrix   0 1 0 0 1  1 0 1 0 0     0 1 0 1 0 .    0 0 1 0 1  1 0 0 1 0 However, it is an incidence matrix that is required here. If we retain the ordering of the vertices used in the preceding adjacency matrix, and label the edges so that e1 = 12, e2 = 23, e3 = 34, e4 = 45, e5 = 51, then the incidence matrix would be   1 0 0 0 1  1 1 0 0 0     0 1 1 0 0 .    0 0 1 1 0  0 0 0 1 1

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1019

Had the graph in question not existed, there would have been an ambiguity in the question. It is not clear from the wording whether a non-existence proof would have to “use” an incidence matrix. Since the graph does exist, this ambiguity is irrelevant. X. [10 MARKS] Solve the recurrence 4an+2 − 12an+1 + 9an = 0 subject to the initial conditions a0 = 4, a1 = −2, and determine the value of a60 . (The value of a60 should be expressed without Σ’s or ...’s, using not more than one + or − sign.) Solution: The characteristic equation, 4r2 − 12r + 9 = 0, has a solution r = 23 , 32 ,  n of multiplicity 2. Hence the general solution is an = (α + βn) 32 . Imposing the initial conditions yields two equations, α = 4   3 (α + β) = −2 2 from which we determine that β = − 16 . It follows that the particular solution is 3    n 3 16n an = 4 − 3 2 Thus a60 = −316

 3 60 . 2

XI. [10 MARKS] Solve the recurrence 25bn+2 + 10bn+1 + bn = 0 subject to the initial conditions b0 = −3, b1 = 12 , and determine the value of b80 . (The value of b80 should be expressed without Σ’s or ...’s, using not more than one + or − sign.) Solution: The characteristic equation, 25r2 +10r+1 = 0, has a solution r = − 51 , − 15 ,  n of multiplicity 2. Hence the general solution is bn = (α + βn) − 51 . Imposing the initial conditions yields two equations, α = −3   1 1 (α + β) − = 5 2 from which we determine that β = 12 . It follows that the particular solution is  n bn = −3 + (−5)−n 2 Thus b80 = 37 · 5−80 .

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

A.6

1020

1998 Term Test

There were four versions of this test. Each problem on each test was scored out of a maximum of 8. The selections of problems were as follows: Versions I, V II, VI III, VII IV, VIII

1 2 3 5

6 7 8 9

10 11 13 12

14 17 15 16

21 18 19 20

Problem 4 was not used on any version of the test. A.6.1

Problems on the counting of relations

1. Explaining your reasoning, determine the number of binary relations on the set {1, 2, ..., n} which are symmetric but not reflexive.  Solution: Represent each relation by a zero-one matrix M . There are n2 offn diagonal pairs of entries that must be filled alike: these pairs can be filled in 2( 2 ) ways. The diagonal entries may be filled in any way save one — they cannot all be 1, as then the relation would be reflexive; thus the diagonal entries may be filled in 2n − 1 ways. By the product rule, the number of symmetric relations that are n n+1 n not reflexive is the product, 2( 2 ) · (2n − 1) = 2( 2 ) − 2( 2 ) . 2. Explaining your reasoning, determine the number of binary relations on the set {1, 2, ..., n} which are both antisymmetric and reflexive.  Solution: Represent each relation by a zero-one matrix M . There are n2 offdiagonal pairs of entries that may not both contain a 1: these pairs can be filled n in (2 · 2 − 1)( 2 ) ways. The diagonal entries may be filled in only one way each — they must all be 1 for the relation to be reflexive. Accordingly, the number of n antisymmetric relations that are also reflexive is 3( 2 ) . 3. Explaining your reasoning, determine the number of binary relations on the set {1, 2, ..., n} which are not both symmetric and reflexive. Solution: Represent each relation by a zero-one matrix M . The total number of 2 binary relations on the given set is 2n , since there are precisely n2 cells in the matrix, and each may be filled in 2 ways, independently of the others. We shall subtract from this number the number of relations which are both symmetric and reflexive.

Notes Distributed to Students in Mathematics 189-240A (2000/2001) For these, there are

1021

n 2



off-diagonal pairs of entries that must be filled alike: these n ( pairs can be filled in 2 2 ) ways. The diagonal entries may be filled in only 1 way — each must be a 1. Hence the number of binary relations that are not both n 2 symmetric and reflexive is 2n − 2( 2 ) . 4. Explaining your reasoning, determine the number of binary relations on the set {1, 2, ..., n} which are neither antisymmetric nor symmetric. Solution: Represent each relation by a zero-one matrix M . We apply Inclusion2 Exclusion. The total number of relations is 2n , as there are precisely n2 cells in the matrix, which may be filled independently. From this we subtract • the number of relations which are antisymmetric: the off-diagonal symmetrically located pairs may be filled in 22 −1 ways each, since one of the 4 possible cases — placing 1 in both locations — is forbidden; the diagonal entries may be filled without any restriction. The number of these antisymmetric relations n is therefore, by the Product Rule, 3( 2 ) · 2n . • the number of relations which are symmetric: the off-diagonal symmetrically located pairs may each be filled in 2 ways — either both are 0 or both are 1. Again, the diagonal entries are unrestricted. The number of these symmetric n relations is therefore, again by the Product Rule, 2( 2 ) · 2n . Finally we must add the number of relations subtracted twice: those that are both symmetric and antisymmetric. In these the symmetrically located off-diagonal entries may only be filled with 0’s, so there is freedom only in the filling of the diagonal entries, which may be chosen arbitrarily. The number is therefore 2n . By Inclusion-Exclusion, the number of relations that are neither antisymmetric nor symmetric is  n  n n n 2 2 2n − 3 ( 2 ) · 2 n − 2 ( 2 ) · 2 n + 2 n = 2 n − 2n 3( 2 ) + 2 ( 2 ) − 1 5. Explaining your reasoning, determine the number of binary relations on the set {1, 2, ..., n} which are functions from the set {1, 2, ..., n} to itself, but are not derangements. Solution: Represent each relation by a zero-one matrix M . The functions have exactly one 1 in each row of the matrix; there are n ways of filling each row — in all, nn functions. The number of derangements is, by Inclusion-Exclusion,   1 1 r 1 n 1 n! 1 − + + ... + (−1) + ... + (−1) 1! 2! r! n!

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1022

so the number of functions which are not derangements is   1 1 n r 1 n 1 n − n! 1 − + + ... + (−1) + ... + (−1) 1! 2! r! n! A.6.2 Solution of linear homogeneous recurrences with constant coefficients For problems of this type the generating function approach is usually more difficult. We will give a sketch of a generating function solution only in the two cases were a student attempted one: neither student was successful. 6. Using any method, solve the following recurrence subject to the stated initial conditions: 4an+2 + 12an+1 + 5an = 0 (n ≥ 0) a0 = 2 a1 = −7 Solution: The auxiliary polynomial is 4r2 + 12r + 5, whose roots are − 52 and − 12 . n n The general solution is of the form an = A − 52 + B − 12 . Imposing the initial conditions yields linear equations 2 = A+B 5 1 −7 = − A − B 2 2 whose solution is A = 3, B = −1, so the particular solution which satisfies the n initial conditions is an = (3 · (−5)n − 1) − 12 . 7. Using any method, solve the following recurrence subject to the stated initial conditions: bn+2 − 14bn+1 + 49bn = 0 (n ≥ 0) b0 = 4 b1 = 21 Solution: The auxiliary polynomial is r2 − 14r + 49 = (r − 7)2 . As this has a root 7 of multiplicity 2, the general solution is of the form bn = (C + Dn)7n . Imposing the initial conditions yields linear equations 4 = C +0 21 = (C + D)7

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1023

whose solution is C = 4, D = −1, so the particular solution which satisfies the initial conditions is bn = (4 − n)7n . 8. Using any method, solve the following recurrence subject to the stated initial conditions: 9un + 9un−1 − 4un−2 = 0 (n ≥ 2) u0 = −1 u1 = 3 Solution: The auxiliary polynomial is 9r2 + 9r − 4, whose roots are 31 and − 43 .   n n The general solution is of the form un = E 13 + F − 43 . Imposing the initial conditions yields linear equations −1 = E + F 1 4 3 = E− F 3 3 whose solution is E = 1, F = −2, so the particular solution which satisfies the n initial conditions is un = (1 − 2(−4)n ) · 13 . Solution Using Generating Functions: Multiply the recurrence by xn and sum over all valid values, i.e. from n = 2 to ∞. If we define the generating function u(x) = ∞ P , we obtain, using the initial conditions, that n=0

9(u(x) − (−1) − 3x) + 9x(u(x) − (−1)) − 4x2 u(x) = 0 , −9+18x which reduces to u(x) = 9+9x−4x 2 . Factorizing the denominator, and expanding by partial fractions, we obtain u(x) = 1−11 x − 1+24 x , whose MacLaurin expansion can 3 3 be found by combining the two geometric series expansions.

9. Using any method, solve the following recurrence subject to the stated initial conditions: 4gn − 12gn−1 + 9gn−2 = 0 (n ≥ 2) g0 = −2 g1 = 3 2 Solution: The auxiliary polynomial is 4r2 −12r+9 = (2r−3)2 = 4 r − 32 . As this n has a root 32 of multiplicity 2, the general solution is of the form gn = (G+Hn) 32 .

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1024

Imposing the initial conditions yields linear equations −2 = G + 0 3 = (G + H)

3 2

whose solution is G = −2, H = 4, so the particular solution which satisfies the n initial conditions is gn = (−2 + 4n) 32 . Solution Using Generating Functions: Analogously to the solution to the preceding ∞ P problem, we can show that the generating function g(x) = gn xn satisfies an n=0

equation (4 − 12x + 9x2 )g(x) = −8 + 36x, from which we can show that −2 + 9x 1 − 3x + 94 x2 −2 + 9x = 2 1 − 32 x

g(x) =

and we know the expansions of all negative powers (1 − y)−r . A.6.3 Use of ordinary generating functions to count ordered additive partitions of integers 10. Using ordinary generating functions — no other method will be accepted — determine the number of solutions of the equation x1 + x 2 + x3 = n in ordered triples (x1 , x2 , x3 ) of integers, subject to the conditions 1 ≤ x1 2 ≤ x2 3 ≤ x3 that must all be satisfied. Solution: The number of solutions will be the coefficient of tn in the expansion of (t + t2 + t3 + ...)(t2 + t3 + t4 + ...)(t3 + t4 + t5 + ...) t3 t t2 = · · 1−t 1−t 1−t

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1025

= t6 · (1 − t)−3  ∞  X m+2 m 6 t = t · 2 m=0  ∞  X m + 2 m+6 = t 2 m=0  ∞  X n−4 n = t 2 n=6 i.e.

n−4 2

 .

11. Using ordinary generating functions — no other method will be accepted — determine the number of solutions of the equation y1 + y2 + y3 = m in ordered triples (y1 , y2 , y3 ) of integers, subject to the conditions 0 ≤ y1 3 ≤ y2 4 ≤ y3 that must all be satisfied. Solution: The number of solutions will be the coefficient of tn in the expansion of

= = = = = i.e.

m−5 2



.

(1 + t + t2 + ...)(t3 + t4 + t5 + ...)(t4 + t5 + t6 + ...) 1 t3 t4 · · 1−t 1−t 1−t t7 · (1 − t)−3  ∞  X n+2 n 7 t · t 2 n=0  ∞  X n + 2 n+7 t 2 n=0  ∞  X m−5 m t 2 m=7

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1026

12. Using ordinary generating functions — no other method will be accepted — determine the number of solutions of the equation z1 + z2 + z3 + z4 = n in ordered triples (z1 , z2 , z3 ) of integers, subject to the conditions 1 1 1 1

≤ ≤ ≤ ≤

z1 z2 z3 z4

that must all be satisfied. Solution: The number of solutions will be the coefficient of tn in the expansion of

= = = = i.e.

n−1 3

(t + t2 + t3 + ...)4  4 t = t4 (1 − t)−4 1−t  ∞  X m+3 m 4 t · t 3 m=0  ∞  X m + 3 m+4 t 3 m=0  ∞  X n−1 n t 3 n=4

 .

13. Using ordinary generating functions — no other method will be accepted — determine the number of solutions of the equation w1 + w2 + w3 = n (n ≥ 3) in ordered triples (w1 , w2 , w3 ) of integers, subject to the conditions 0 ≤ w1 0 ≤ w2 0 ≤ w3 ≤ 2 that must all be satisfied.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1027

Solution: The number of solutions will be the coefficient of tn in the expansion of

= = = = =

(1 + t + t2 + t3 + ...)(1 + t1 + t2 + t3 + ...)(1 + t + t2 ) 1 1 1 − t3 · · 1−t 1−t 1−t (1 − t3 ) · (1 − t)−3  ∞  X m+2 m 3 (1 − t ) · t 2 m=0   ∞  ∞  X m + 2 m X m + 2 m+3 t − t 2 2 m=0 m=0   ∞  ∞  X m+2 m X n−1 n t − t 2 2 m=0 n=3

For n ≥ 3 the coefficient of tn is the difference     n+2 n−1 − = 3n . 2 2 Alternatively, one could proceed as follows: (1 + t + t2 + t3 + ...)(1 + t1 + t2 + t3 + ...)(1 + t + t2 ) = 1 + t + t2 (1 − t)−2   ∞  ∞   ∞  X m+1 m X n n X n−1 n = t + t + t 1 1 1 m=0 n=1 n=2 =

∞ X

3ntn

n=0

A.6.4

Logic and induction

(The form of an induction proof is important. Students should read their textbook or notes to see models of such proofs. Among other common defects was the following: when you wish to prove, for example, that. as in the first problem below, the proposition we have called P (1) is true, you need to prove that the is equal to the sum, in this case instance of the claimed formula, in this case 3·1·2 3 P1 i=1 i(i + 1). Your proof could consist of evaluating the two expressions, and observing that they are equal; or it could consist of a sequence of equations like 1 X i=1

i(i + 1) = 1 · 2 = 2 =

(1 + 2)1(1 + 1) . 3

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1028

But it is very poor form to end your proof of this base case with a tautology like 2 = 2. Such a tautology never contributes anything to a proof, and suggests that you have misunderstood the logic.) 14. Prove by induction — no other method will be accepted — that n X

i(i + 1) =

i=1

(n + 2)n(n + 1) . 3

(11)

Solution: Denote proposition (11) by P (n). Base Case: By direct computation we find that 1 X

i(i + 1) = 1(1 + 1)

i=1

= 2=

(1 + 2)1(2) 3

establishing the truth of P (1). Induction Step: Assume that P (N ) is known to be true. Then N +1 X i=1

i(i + 1) =

N X

i(i + 1) + (N + 1)(N + 2) by definition of

X

i=1

(N + 2)N (N + 1) = + (N + 1)(N + 2) 3 by induction hypothesis (N + 3)(N + 1)(N + 2) (N + 1 + 2)(N + 1)(N + 1 + 1) = = 3 3 which is P (N + 1). It follows by the (First) Principle of Induction that P (n) is true for all n ≥ 1. 15. Prove by induction — no other method will be accepted — that m X j=1

j(j + 2) =

(2m + 7)m(m + 1) . 6

Solution: Denote proposition (12) by P (n).

(12)

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1029

Base Case: By direct computation we find that 1 X

j(j + 2) = 1(1 + 2)

j=1

= 3=

(2 + 7)1(2) 6

establishing the truth of P (1). Induction Step: Assume that P (N ) is known to be true. Then N +1 X

j(j + 2) =

j=1

N X

j(j + 2) + (N + 1)(N + 3) by definition of

X

j=1

(2N + 7)N (N + 1) + (N + 1)(N + 3) 6 by induction hypothesis (2 · N + 1 + 7)(N + 1)(N + 1 + 1) = 6 =

which is P (N + 1). It follows by the (First) Principle of Induction that P (n) is true for all n ≥ 1. 16. Use a truth table to determine whether or not the following argument is valid: a→b (b → c) → a a∨c a∧b )

Solution: (Many students misunderstood the significance of the validity of the argument. What must be shown is that, whenever the three premises are true, the conclusion is true. We need not prove the converse, although many students believed that this was the meaning of validity. Nor must we prove that the conclusion and the conjunction of the three hypothesis are logically equivalent. In the present case the last two alternatives happen to be true, but these are not what

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1030

the problem asked to be proved.) a 0 0 0 0 1 1 1 1

b 0 0 1 1 0 0 1 1

c 0 1 0 1 0 1 0 1

a → b b → c (b → c) → a a ∨ c 1 1 0 0 1 1 0 1 1 0 1 0 1 1 0 1 0 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1

a∧b 0 0 0 0 0 0 1 1

In the table, the only lines in which the three premises are all true are lines ##7, 8; in both of these cases the conclusion a ∧ b is also true. Thus the argument is valid. 17. Use a truth table to determine whether or not the following argument is valid: u∨v w ∨ (¬u) (w → v) → u v∧u )

Solution: u 0 0 0 0 1 1 1 1

v 0 0 1 1 0 0 1 1

w 0 1 0 1 0 1 0 1

¬u u ∨ v w ∨ ¬u w → v (w → v) → u v ∧ u 1 0 1 1 0 0 1 0 1 0 1 0 1 1 1 1 0 0 1 1 1 1 0 0 0 1 0 1 1 0 0 1 1 0 1 0 0 1 0 1 1 1 0 1 1 1 1 1

In the table, the only lines in which the three premises are all true are lines ##6, 8; in line #6 the conclusion v ∧ u isfalse. From this failure, we assert that the argument is invalid. A.6.5

Prove or disprove

(In problems of this type no marks were given if the incorrect choice was made: one cannot partially prove a statement which is false, or partially disprove a true statement.)

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1031

18. If the following statement is true, prove it; if it is false, provide a counterexample: On the set R of real numbers, the relation R defined by (x, y) ∈ R ⇔ x 6= y is an equivalence relation. Solution: This relation is not transitive. For example, 1 6= 2 and 2 6= 1, but it is not true that 1 6= 1. From this one instance of the failure of transitivity, we may assert that the relation is not transitive, hence it is not an equivalence relation. Ever more simply, we observe that this relation cannot be reflexive — indeed, it is irreflexive and R is non-empty. Hence again R cannot be an equivalence relation. 19. If the following statement is true, prove it; if it is false, provide a counterexample: On the set Z of all integers, the relation S defined by (a, b) ∈ S ⇔ a|b is a partial ordering. Solution: This relation was defined on all integers, positive and negative. Since −1 | 1 and 1 | −1, we would require, for antisymmetry, that −1 = 1. That is not the case, so the relation is not intransitive, hence it is not a partial order. (Had we confined ourselves to the positive integers, the relation would then have been a partial order.) 20. If the following statement is true, prove it; if it is false, provide a counterexample: The number of surjections from a set A = {a, b, c, d} of four elements to a set B = {e, f, g} of three elements is 34 − 3 · 24 + 3 = 36 Solution: The set Ω of all functions from A to B contains 34 elements. If we denote respectively by U1 , U2 , U3 the subsets of functions which do not assume the values e, f , g, then each of these subsets contains 24 functions, and there are 3 such sets. The intersections of the 32 = 3 pairs of these sets each contains exactly 14 = 1 function; and the intersection of all three of these sets contains no functions. Accordingly, by the Inclusion-Exclusion Principle, the number of surjections is the alternating sum 34 − 3 · 24 + 3 · 1 − 0 = 36, as claimed.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1032

Another Solution: One of the points of A will be the image of two points, and the others will be the  image of one point each. Choose the point which is the image of two points in 31 ways, and multiply by thenumber of ways in which the two points mapped on to it may be chosen, i.e. by 42 . This leaves two points, each of which is the image of one of the remaining points of the domain, and the assignment may be made in 2! ways. In all we have    3 4 2! = 36 1 2 surjections. At least one other correct solution was proposed by a student. 21. If the following statement is true, prove it; if it is false, provide a counterexample: Among any set of 101 integers between 1 and 200 there must be two distinct integers — call them m and n — such that (m + 1)|(n + 1). Solution: We know by [17, Example 8, p. 246] that there must exist at least one pair of distinct integers a and b in the set of 101 integers such that a|b. This result is so similar to the question, and had been discussed in the lectures, that it was expected to be the starting point in solving the problem. The claim would be true provided we could interpret m + 1 as a and n + 1 as b. Since b will be at least 2, there is no harm in defining n = b − 1. However, it could happen that we cannot define m = a − 1: that could occur if a − 1 is not in the set, for example, if a is the smallest member of the set. One such example is in the set {100, 101, 102, ..., 200}. For any distinct integers m and n In this set, n+1 200 + 1 201 ≤ ≤ < 2, m+1 m+1 100 + 1 so (m + 1) (n + 1). So, from this particular counterexample, we see that the statement is not universally true: i.e. the claim is false.

A.7

Solutions to Problems on the 1999 Class Tests

The test was administered on Wednesday, November 10th, 1999, in four versions. Students were allowed about 45 minutes for each of the versions. Each examination had six questions, each marked out of 10.

Notes Distributed to Students in Mathematics 189-240A (2000/2001) 1 Version Version 1 Version 2 Version 3 Version 4

2

3

4

A E I F V N W K S L H D

5

1033

6

M Q U R B J C O G X T P

Students are reminded that the instructions clearly stated that “you must indicate any continuation clearly on the page where the question is printed.” Since the examination may be graded question by question over the whole class (i.e. the grader may first grade question 3 for all the students, then go on to question 5 for all the students, etc.) the grader may not know that you have continued a solution on some other page unless you specifically indicate where he should look. So you should write a clear message like “Continued on continuation page...” or “ Continued on the back of this page...” or “Continued facing page 3...”. In many cases students received full marks even though answers were not reduced to simplest terms. For purposes of the final examination, let it now be understood that solutions should be in “simplest form” wherever the reduction involves integers or fractions that involve integers that are three decimal digits or less. Thus,   you will be expected 5 10 to replace 3 by 10, but you will not be expected to evaluate 4 . Where the reduction requires little energy, you should carry it out in case the reduced final answer may look wrong, and may indicate an earlier error. A.7.1

Proving or disproving the validity of a rule of inference

Some students did not understand what was meant by a Rule of Inference. In such a rule we claim that the truth of hypotheses φ1 , φ2 , ..., φm implies the truth of a conclusion ψ. In these problems there were two hypotheses: one needed to look only at those rows of the truth table in which both hypotheses were true, and to verify that the conclusion was true in every such line; equivalently, one had to prove that the proposition φ1 ∧ φ2 → ψ was true. This is not the same as proving that the propositions φ1 ∧ φ2 and ψ have exactly the same truth values for all values of the elementary variables, as, in the cases where φ1 ∧ φ2 is false, the implication φ1 ∧ φ2 → ψ will be true even if ψ is false. A Using a truth table — no other method will be accepted — prove or disprove the p→q ¬q . You are expected to indicate validity of the following rule of inference: ¬p unambiguously precisely which information in the truth table is being used to prove or disprove the validity. )

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1034

Solution: In the truth table p F F T T

q F T F T

¬q ¬p p → q T T T F T T T F F F F T

We need only look at those rows in which both hypotheses, p → q and ¬q are true; here the two hypotheses are true only in the first row. In that row we observe that the conclusion, ¬p is also true. That is all that is required to prove validity of the rule of inference. (Had there existed a row in the truth table in which the hypotheses were all true but the conclusion was false, we would have deduced that the proposed rule of inference was invalid.) B Using a truth table — no other method will be accepted — prove or disprove the ¬p → ¬q q validity of the following rule of inference: . You are expected to indicate p unambiguously precisely which information in the truth table is being used to prove or disprove the validity. )

Solution: In the truth table p F F T T

q F T F T

¬p ¬q ¬p → ¬q T T T T F F F T T F F T

We need only look at those rows in which both hypotheses, ¬p → ¬q and q are true; here the two hypotheses are true only in the fourth row. In that row we observe that the conclusion, p is also true. That is all that is required to prove or disprove the validity of the rule of inference. (Had there existed a row in the truth table in which the hypotheses were all true but the conclusion was false, we would have deduced that the proposed rule of inference was invalid.) C Using a truth table — no other method will be accepted — prove or disprove the ¬r validity of the following rule of inference: q → r . You are expected to indicate ¬q unambiguously precisely which information in the truth table is being used to prove or disprove the validity. )

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1035

Solution: In the truth table q F F T T

r F T F T

¬r ¬q q → r T T T F T T T F F F F T

We need only look at those rows in which both hypotheses, q → r and ¬r are true; here the two hypotheses are true only in the first row. In that row we observe that the conclusion, ¬q is also true. That is all that is required to prove or disprove the validity of the rule of inference. (Had there existed a row in the truth table in which the hypotheses were all true but the conclusion was false, we would have deduced that the proposed rule of inference was invalid.) D Using a truth table — no other method will be accepted — prove or disprove the s validity of the following rule of inference: ¬p → ¬s . You are expected to indicate p unambiguously precisely which information in the truth table is being used to prove or disprove the validity. )

Solution: In the truth table p F F T T

s F T F T

¬p ¬s ¬p → ¬s T T T T F F F T T F F T

We need only look at those rows in which both hypotheses, ¬p → ¬s and s are true; here the two hypotheses are true only in the fourth row. In that row we observe that the conclusion, p is also true. That is all that is resuired to prove validity of the rule of inference. (Had there existed a row in the truth table in which the hypotheses were all true but the conclusion was false, we would have deduced that the proposed rule of inference was invalid.) A.7.2

Injective and surjective functions

Some students inferred from the composition statements given in the following problems that the functions were mutual inverses. The definition of inverses requires two statements equating a composition to an identity; one such statement

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1036

does not imply that the functions are inverses; (students should be able to manufacture a counterexample to show that the given composition does not imply that the functions are mutual inverses). Any “proof” based on such reasoning was defective. Where a problem of this type appears difficult, a first attack would be to experiment with “small” examples. This could lead both to a generalization which would yield a proof, if the statement is true; or to a simple counterexample, if the statement is false. In the four problems following, two involved true statements, and two false. One might have expected students who had done some experimentation to have succeeded in finding counterexamples, as the examples we have presented are small; but the opposite was the case — on all the papers where the statement was false, only one student was able to produce a counterexample (and his was not the “smallest”.) More students were successful in the problems where the statement was true. E Let f : B → A and g : A → B be any functions, and suppose that f ◦ g = ιA , the identity function on A. Prove or disprove: f must be surjective. Solution: The statement is true. For any x ∈ A, x = ιA (x) definition of ιA = (f ◦ g)(x) = f (g(x)) Thus x is the image of the point g(x) in B under the function f . F Let f : B → A and g : A → B be any functions, and suppose that f ◦ g = ιA , the identity function on A. Prove or disprove: f must be injective. Solution: The statement is false. Here is a small counterexample. Let A = {1}, B = {2, 3}. here is only one possible function f : B → A, given by x 7→ 1 (x = 2, 3). Let us define g to be the function 1 7→ 2. Then f ◦ g is the only possible function from B to B, mapping 1 on to 1. But f is not injective, since two distinct points have the same image. G Let f : B → A and g : A → B be any functions, and suppose that f ◦ g = ιA , the identity function on A. Prove or disprove: g must be surjective. Solution: The statement is false. Here is a small counterexample. Let A = {1}, B = {2, 3}. here is only one possible function f : B → A, given by x 7→ 1 (x = 2, 3). Let us define g to be the function 1 7→ 2. Then f ◦ g is the only possible function from B to B, mapping 1 on to 1. But g is not surjective, since no point is mapped on to 3.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1037

H Let f : B → A and g : A → B be any functions, and suppose that f ◦ g = ιA , the identity function on A. Prove or disprove: g must be injective. Solution: The statement is true. For all a1 , a2 ∈ A, g(a1 ) = g(a1 ) ⇒ f (g(a1 )) = f (g(a1 )) ⇒ (f ◦ g)(a1 ) = (f ◦ g)(a1 ) definition of f ◦ g ⇒ a1 = a1 since ∀x[(f ◦ g)(x) = x] is true A.7.3

Particular solutions of inhomogeneous recurrences

The general theory of inhomogeneous recurrences provides a form for a particular solution, involving “undetermined coefficients”. These coefficients are determined, for example, by substituting the form into the recurrence and either comparing coefficients of like powers of the variable, or by assigning “convenient” values to the variable: in either case, or in a combination of these methods, equations may be obtained that can be solved for the coefficients. Many students failed to complete the solution by determining the coefficients. Where this substitution leads to a system of solutions which admit no simultaneous solution, that is an indication that an error has been made earlier in the form assumed for the particular solution. I Showing all your work, determine a sequence a0 , a1 , ..., an , ... (i.e. a “particular” solution) which satisfies the inhomogeneous recurrence an+2 − 4an+1 + 3an = n · 2n

(n = 0, 1, ...)

(13)

You are expected to solve this problem “systematically”: that is, your solution should demonstrate that you could solve any problem of this type, where the function to the right of the equal sign is any product of the form polynomial × exponential. Solution: The “characteristic” polynomial is x2 − 4x + 3, whose roots are 1 and 3. As 2 is not one of these roots, we know by [19, Theorem 6, p. 328], that there is a solution of the form an = (An + B)2n

(n = 0, 1, 2, ...) ,

(14)

where A and B are constants to be determined. Substituting (14) in (13), we obtain (A(n + 2) + B) · 2n+2 − 4(A(n + 1) + B)2n+1 + 3(An + B)2n = n · 2n (n = 0, 1, ...), which implies that 4(A(n + 2) + B) − 8(A(n + 1) + B) + 3(An + B) = n (n = 0, 1, ...) .

(15)

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1038

Equating coefficients of like powers of n yields equations which can be solved to show that A = −1, B = 0. This information could also be obtained by giving n “convenient” values in (15), and solving the resulting equations. For example, when n = 0, we obtain −B = 0; and, when n = −1, we obtain A − B = −1.7 Thus one “particular” solution is an = −n2n .8 The recurrence can be solved in general using generating functions, but this is technically much more difficult than the preceding method. We define A(t) = ∞ P an tn to be the generating function for the solution. Multiplying (13) by tn+2 n=0

and summing as t = 0, 1, ..., we obtain ∞ X

an+2 t

n+2

− 4t

n=0



∞ X



an+1 t

n+1

2

+ 3t

n=0

am tm − 4t

m=2



∞ X

∞ X

am tm + 3t2

m=1 0

∞ X

an t = t

2

∞ X

n=0 ∞ X

0





n(2t)n

n=0

an t n = t 2

n=0 1

n

∞ X

n(2t)n

n=0 2

A(t) − a0 t − a1 t − 4t A(t) − a0 t + 3t A(t)   ∞ X 1 d n 3 d 2 ((2t) ) = t =t ·t dt dt 1 − 2t n=0  1 − 4t + 3t2 A(t) = a0 + (a1 − 4a0 )t +

⇒ A(t) =

2t3 (1 − 2t)2

a0 + (a1 − 4a0 )t 2t3 + (1 − 3t)(1 − t) (1 − 3t)(1 − t)(1 − 2t)2

The following partial fraction expansions and MacLaurin expansions can be obtained in the usual ways: 3 1 1 2 = − 2 (1 − 3t)(1 − t) 1 − 3t 1 − t ∞ ∞ 3X n n 1X n = 3 t − t 2 n=0 2 n=0

2t3 1 1 1 1 = − − + 2 2 (1 − 3t)(1 − t)(1 − 2t) 1 − 3t 1 − t (1 − 2t) 1 − 2t ∞ X = (3n − 1 − (n + 1)2n + 2n ) tn n=0 7

The values taken for n need not be non-negative integers — any real value will do! 8 This is not the only possible “particular” solution. Since the general solution of the associated homogeneous recurrence is ahomog = C · 3n + D · 1n , i.e. ahomog = C · 3n + D, all particular solutions n n homog n n have the form an = C · 3 + D − n2 , where C and D are any real numbers.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

=

∞ X

1039

(3n − 1 − n · 2n ) tn

n=0

so the general solution is  ∞ 1 m m X m ·3 − ·1 t + (3 − 1 − m · 2m ) tm A(t) = (a0 + (a1 − 4a0 )t) 2 2 m=0 m=0    ∞ ∞  X 3 X 1 m m 3 m 1 m m+1 m = a0 ·3 − ·1 t + (a1 − 4a0 ) ·3 − ·1 t 2 2 2 2 m=0 m=0 ∞  X 3

+ = a0

∞ X

m=0 ∞ X n=0 ∞ X

+ =

(3m − 1 − m · 2m ) tm 3 n 1 ·3 − 2 2

a0



n

t + (a1 − 4a0 )

∞  X 1 n=1

1 ·3 − 2 2 n



tn

(3n − 1 − n · 2n ) tn

n=0   ∞ X n=0

m

3 n 1 ·3 − 2 2



 + (a1 − 4a0 )

1 n 1 ·3 − 2 2



 + (3 − 1 − n · 2 ) tn n

n

from which we conclude that an =

a1 − a0 + 2 n 3a0 − a1 − 2 · 3 − n · 2n + 2 2

J Showing all your work, determine a sequence a0 , a1 , ..., an , ... (i.e. a “particular” solution) which satisfies the inhomogeneous recurrence an+2 + 3an+1 − 4an = n − 1 (n = 0, 1, ...)

(16)

You are expected to solve this problem “systematically”: that is, your solution should demonstrate that you could solve any problem of this type, where the function to the right of the equal sign is any product of the form polynomial × exponential. Solution: The “characteristic” polynomial is x2 + 3x − 4, whose roots are 1 and −4. As n − 1 = (n − 1) · 1n , and 1 is one of these roots, we know by [19, Theorem 6, p. 328], that there is a solution of the form an = n(An + B)1n = An2 + Bn (n = 0, 1, 2, ...) ,

(17)

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1040

where A and B are constants to be determined. Substituting (17) in (16), we obtain (A(n + 2)2 + B(n + 2)) + 3(A(n + 1)2 + B(n + 1)) − 4(An2 + Bn) = n − 1 (n = 0, 1, ...). Equating coefficients of like powers of n yields equations as follows: 0 = 0 10A = 1 7A + 5B = −1 which we may solve, to obtain A = 2 an = 5n 50−17 .

1 , 10

B = − 17 . Hence one particular solution is 50

K Showing all your work, determine a sequence a0 , a1 , ..., an , ... (i.e. a “particular” solution) which satisfies the inhomogeneous recurrence an+2 + 2an+1 + an = 6n − 3 (n = 0, 1, ...)

(18)

You are expected to solve this problem “systematically”: that is, your solution should demonstrate that you could solve any problem of this type, where the function to the right of the equal sign is any product of the form polynomial × exponential. Solution: The “characteristic” polynomial is x2 +2x+1, whose roots are −1 (twice). As 6n − 3 = (6n − 3) · 1n , and 1 is not one of these roots, we know by [19, Theorem 6, p. 328], that there is a solution of the form an = (An + B)1n

(n = 0, 1, 2, ...) ,

(19)

where A and B are constants to be determined. Substituting (19) in (18), we obtain (A(n + 2) + B) + 2(A(n + 1) + B) + 1(An + B) = 6n − 3 (n = 0, 1, ...). Equating coefficients of like powers of n yields equations as follows: 4A = 6 4A + 4B = −3 which we may solve, to obtain A = 23 , B = − 94 . Hence one particular solution is an = 34 (2n − 3). L Showing all your work, determine a sequence a0 , a1 , ..., an , ... (i.e. a “particular” solution) which satisfies the inhomogeneous recurrence an+2 + 6an+1 + 9an = n · 3n

(n = 0, 1, ...)

(20)

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1041

You are expected to solve this problem “systematically”: that is, your solution should demonstrate that you could solve any problem of this type, where the function to the right of the equal sign is any product of the form polynomial × exponential. Solution: The “characteristic” polynomial is x2 +6x+9, whose roots are −3 (twice). As 3 is not one of these roots, we know by [19, Theorem 6, p. 328], that there is a solution of the form an = (An + B)3n

(n = 0, 1, 2, ...) ,

(21)

where A and B are constants to be determined. Substituting (20) in (21), we obtain (A(n + 2) + B)3n+2 + 6(A(n + 1) + B)3n+1 + 9(An + B)3n = n · 3n (n = 0, 1, ...), which simplifies to 9A(4n + 4) + 36B = n (n = 0, 1, 2, ...).. Equating coefficients of like powers of n yields equations as follows: 36A = 1 4A + 4B = 0 which we may solve, to obtain A = an = n−1 · 3n . 4 A.7.4

1 , 36

1 B = − 36 . Hence one particular solution is

Pigeonhole principle

M Prove or disprove: Among any 1000 distinct integers chosen from the set {n : (n ∈ N) ∧ (1 ≤ n ≤ 2000)} there must exist one integer that divides one of the others. Solution: The statement is false. As a counterexample take the set {1001, 1002, ..., 2000}. Here the ratio of any elements of this set to any smaller element is 2000 ≤ 1001 < 2. N Prove or disprove: Among any 800 distinct integers chosen from the set {n : (n ∈ N) ∧ (1 ≤ n ≤ 1600)} at least two must be consecutive. Solution: The statement is false. One counterexample is the set {1, 3, 5, ..., 1599}, which has 800 members, no two of which are consecutive. O Prove or disprove: Among any 610 distinct integers chosen from the set A = {n : (n ∈ N) ∧ (1 ≤ n ≤ 1200)} at least two must be consecutive. Solution: The statement is true. Consider the 600 sets of the form {2m+1, 2m+2} (m = 0, 1, ..., 599). The union of these sets is the set A, so each of the 610 integers chosen is contained in one of these subsets; as the number of integers selected

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1042

exceeds the number of subsets, one subset contains at least two of the selected integers. But each subset consists of a consecutive pair. Where students applied the Pigeonhole Principle they were expected to be precise about the “pigeonholes”, and what determined whether a point was placed in such a pigeonhole. It was not sufficient to observe, for example, that the integer d 1200 e = 2. 610 P Assume that “friendship” is a symmetric irreflexive relation: i.e. if x is a friend of y, then y is a friend of x; and no person is consided a friend of herself. Prove or disprove: In any group of five persons there will always exist either three persons, each of which is a friend of the other two; or three persons, each of which is not a friend of the other two. Solution: The statement is false. If the persons are labelled 1, 2, 3, 4, 5, then a counterexample can occur when the only friendships are 1 and 2, 2 and 3, 3 and 4, 4 and 5, 5 and 1. Here there are exactly 5 non-friendships, and they also do not yield a “monochromatic triangle”. (The terminology refers to a representation of the relation as a colouring of the edges of a complete graph on five vertices: friendships  yields a pentagon with one colour, non-friendship is given by the remaining 52 −5 = 5 edges, bearing the other colour.) The preceding is, except for the labelling of the persons, the only counterexample. Had there been six persons, rather than 5, the claim would have been true, as a simple case of Ramsey’s Theorem [19, Example 4.2.10], or of the theorem of P. Erd˝os and Gy. Szekeres [26], [25, p. 18]. A.7.5

Permutations

Q Showing all your work, determine the number of 4-letter words that can be formed from the letters of the word BANANAS. You are expected to solve this problem “systematically”: that is, your solution should demonstrate that you could solve any problem of this type, for any given collection of letters. You will not receive any marks if you simply list the words. Solution: The given population has 3 letters of one type (A), 2 letters of a second type (N), and 1 each of two other letters (B, S). We shall subdivide the set of 4letter words according to the multiplicities of the letters chosen, classified according to partitions of 4 into sums of positive integers. 4 = 4: This case cannot occur, as none of the letters is available in 4 copies.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1043

 4 = 3 + 1: We can choose a letter of multiplicity 3 in 11 = 1 way, and the letter of multiplicity 1 in 4−1 = 3 ways. Each of these 3 choices can be arranged 1 4! in 3!1! = 4 ways. Thus there are 3 × 4 = 12 words of this type. 4 = 2 + 2: We can choose two letters of multiplicity 2 from  two possible letters 2 which are available in multiplicities of at least 2 in 2 = 1 way. The chosen 4! letters can be arranged in 2!2! = 6 ways. There are 1 × 6 = 6 words of this type.  4 = 2 + 1 + 1: We can choose theletter having multiplicity 2 in 21 = 2 ways, and the other two letters in 4−1 = 3 ways. The chosen letters may be arranged 2 4! in 2!1!1! = 12 ways. The number of these words is 2 × 3 × 12 = 72. 4 = 1 + 1 + 1 + 1: There are only 4 kinds of letters available, so they may be chosen in 44 = 1 way. They may be arranged in 4! = 24 ways. The number of words is therefore 12 + 6 + 72 + 24 = 114. R Showing all your work, determine the number of 4-letter words that can be formed from the letters of the word MEMENTO. You are expected to solve this problem “systematically”: that is, your solution should demonstrate that you could solve any problem of this type, for any given collection of letters. You will not receive any marks if you simply list the words. Solution: The given population has 2 letters of two types (E, M), and 1 each of three other letters (N, O, T). We shall subdivide the set of 4-letter words according to the multiplicities of the letters chosen, classified according to partitions of 4 into sums of positive integers. 4 = 4: This case cannot occur, as none of the letters is available in 4 copies. 4 = 3 + 1: This case also cannot occur, as no letter is available in multiplicity 3. 4 = 2 + 2: We can choose two letters of multiplicity 2 from  two possible letters 2 which are available in multiplicities of at least 2 in 2 = 1 way. The chosen 4! letters can be arranged in 2!2! = 6 ways. There are 1 × 6 = 6 words of this type.  4 = 2 + 1 + 1: We can choose theletter having multiplicity 2 in 21 = 2 ways, and the other two letters in 5−1 = 6 ways. The chosen letters may be arranged 2 4! in 2!1!1! = 12 ways. The number of these words is 2 × 6 × 12 = 144. 4 = 1 + 1 + 1 + 1: There are 5 kinds of letters available, so 4 distinct letters may  be chosen in 54 = 5 ways. They may be arranged in 4! = 24 ways. Thus there are 120 such words. The number of words is therefore 6 + 144 + 120 = 270.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1044

S Showing all your work, determine the number of 4-letter words that can be formed from the letters A, A, B, B, C, C, D (in at most the given multiplicities). You are expected to solve this problem “systematically”: that is, your solution should demonstrate that you could solve any problem of this type, for any given collection of letters. You will not receive any marks if you simply list the words. Solution: The given population has 2 letters of each of three types (A, B, C), and 1 of another type (D). We shall subdivide the set of 4-letter words according to the multiplicities of the letters chosen, classified according to partitions of 4 into sums of positive integers. 4 = 4: This case cannot occur, as none of the letters is available in 4 copies. 4 = 3 + 1: This case also cannot occur, as no letter is available in multiplicity 3. 4 = 2 + 2: We can choose two letters of multiplicity 2 from  two possible letters 3 which are available in multiplicities of at least 2 in 2 = 3 ways. The chosen 4! letters can be arranged in 2!2! = 6 ways. There are 3 × 6 = 18 words of this type.  4 = 2 + 1 + 1: We can choose theletter having multiplicity 2 in 31 = 3 ways, and the other two letters in 4−1 = 3 ways. The chosen letters may be arranged 2 4! in 2!1!1! = 12 ways. The number of these words is 3 × 3 × 12 = 108. 4 = 1 + 1 + 1 + 1: There are 4 kinds of letters available, so 4 distinct letters may  4 be chosen in 4 = 1 way. They may be arranged in 4! = 24 ways. Thus there are 24 such words. The number of words is therefore 18 + 108 + 24 = 150. T Showing all your work, determine the number of 5-letter words that can be formed from the letters A, A, A, B, B, B, C, C, C (in at most the given multiplicities). You are expected to solve this problem “systematically”: that is, your solution should demonstrate that you could solve any problem of this type, for any given collection of letters. You will not receive any marks if you simply list the words. Solution: We shall subdivide the set of 5-letter words according to the multiplicities of the letters chosen, classified according to partitions of 5 into sums of positive integers. 5 = 5: This case cannot occur, as none of the letters is available in 5 copies. 5 = 4 + 1: This case also cannot occur, as no letter is available in multiplicity 4.  3 5 = 3 + 2: We can choose the letters of multiplicity 3 from {A,B,C} in ways; 1  2 the letter of multiplicity two can then be chosen in 1 ways. The chosen

Notes Distributed to Students in Mathematics 189-240A (2000/2001) letters can be arranged in this type.

5! 3!2!

1045

= 10 ways. There are 3 × 2 × 10 = 60 words of

 5 = 3 + 1 + 1: We can choose theletter having multiplicity 3 in 31 = 3 ways, and the other two letters in 3−1 = 1 way. The chosen letters may be arranged 2 5! in 3!1!1! = 20 ways. The number of these words is 3 × 1 × 20 = 60.  3 5 = 2 + 2 + 1: Choose the letters of multiplicity 2 in = 3 ways, and the letter 2  3−2 5! of multiplicity 1 in 1 = 1 way. The letters may be arranged in 2!2!1! = 30 ways. Thus there are 3 × 1 × 30 = 90 such words. 5 = 2 + 1 + 1 + 1: This case cannot occur, as there don’t exist as many as four different kinds of letters. 5 = 1 + 1 + 1 + 1 + 1: This case also cannot occur: there are only three different kinds of letters. The number of words is therefore 60 + 60 + 90 = 210. A.7.6

Ordered partitions of an integer

Students were asked to solve the following problems using generating functions. You should also know how to solve them by counting certain binary words. Thus you have a way of verifying your answer; you could also have verified small cases by actually counting the solutions and comparing their number with the number you had computed. In such situations errors in a solution are considered more serious, as your verification should have indicated the presence of an error, and lead you to recheck your calculuations. U Using t as the “indeterminate” (=variable), and showing your work, determine the ordinary generating function for the number, bn , of solutions of the equation x1 + x2 + x3 = n, where x1 , x2 , x3 are integers satisfying the conditions x1 ≥ 1, x2 ≥ 0, x3 ≥ 3. Determine the value of bn by finding the MacLaurin expansion of this generating function. You are expected to solve this problem using the methods indicated; no marks will be awarded for other types of solutions. t Solution: The “enumerator” for x1 is t1 + t2 + t3 + ... = 1−t ; the “enumerator” 1 0 1 2 for x2 is t + t + t + ... = 1−t ; the enumerator for x3 is t3 + t4 + t5 + ... = ∞ P t3 . The generating function for the number of solutions bn tn is the product, 1−t t 1−t

·

1 1−t

·

t3 1−t

=

t4 (1−t)3

= t4

∞ P m=0

m+2 2



tm =

∞ P n=4

n=0

n−2 2



tn , so bn =

n−2 2



.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1046

V Using y as the “indeterminate” (=variable), and showing your work, determine the ordinary generating function for the number, cn , of solutions of the equation x1 + x2 + x3 ≤ n, where x1 , x2 , x3 are integers satisfying the conditions x1 ≥ 0, x2 ≥ 0, x3 ≥ 0. Determine the value of cn by finding the MacLaurin expansion of this generating function. You are expected to solve this problem using the methods indicated; no marks will be awarded for other types of solutions. Solution: (Many students failed to observe that the indeterminate to be used in the generating function had been prescribed.) To convert the problem from the solution of an inequality to that of an equation we introduce a “slack” variable x4 = n − x1 − x2 − x3 , and require that x4 ≥ 0. The “enumerator” for x1 is 1 1 y 0 + y 1 + y 2 + ... = 1−y ; the “enumerator” for x2 is y 0 + y 1 + y 2 + ... = 1−y ; 1 2 the enumerator for x3 is 1 + y + y + ... = 1−y ; the “enumerator” for x4 is also ∞ P 1 . The generating function for the number of solutions cn y n is the product, 1−y n=0  4 P ∞   n+3 n n+3 1 = y , so cn = 3 . 1−y 3 n=0

W Using t as the “indeterminate” (=variable), and showing your work, determine the ordinary generating function for the number, bn , of solutions of the equation y1 + y2 + y3 = n, where y1 , y2 , y3 are integers satisfying the conditions y1 ≥ 3, y2 ≥ 2, y3 ≥ 1. Determine the value of bn by finding the MacLaurin expansion of this generating function. You are expected to solve this problem using the methods indicated; no marks will be awarded for other types of solutions. 3

t Solution: The “enumerator” for y1 is t3 + t4 + t5 + ... = 1−t ; the “enumerator” for y2 2 t t 2 3 4 2 3 is t +t +t +... = 1−t ; the enumerator for y3 is t+t +t +... = 1−t . The generating ∞ P t2 t t6 t3 function for the number of solutions bn tn is the product, 1−t · 1−t · 1−t = (1−t) 3 =

t6

∞ P m=0

m+2 2



tm =

∞ P n=6

n=0

n−4 2



tn , so bn =

n−4 2



.

X Using y as the “indeterminate” (=variable), and showing your work, determine the ordinary generating function for the number, cn , of solutions of the equation y1 + y2 + y3 ≤ n, where y1 , y2 , y3 are integers satisfying the conditions y1 ≥ 0, y2 ≥ 0, y3 ≥ 0. Determine the value of cn by finding the MacLaurin expansion of this generating function. You are expected to solve this problem using the methods indicated; no marks will be awarded for other types of solutions. Solution: (Many students failed to observe that the indeterminate to be used in the generating function had been prescribed.) To convert the problem from the solution of an inequality to that of an equation we introduce a “slack” variable

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1047

y4 = n − y1 − y2 − y3 , and require that y4 ≥ 0. The “enumerator” for y1 is 1 1 y 0 + y 1 + y 2 + ... = 1−y ; the “enumerator” for y2 is y 0 + y 1 + y 2 + ... = 1−y ; 1 2 the enumerator for y3 is 1 + y + y + ... = 1−y ; the “enumerator” for y4 is also ∞ P 1 . The generating function for the number of solutions cn y n is the product, 1−y n=0  4 P ∞   n+3 n n+3 1 = y , so cn = 3 . 1−y 3 n=0

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

B

1048

Problems on 1995 — 1999 examinations These examinations were printed in a book, size 8 12 inches × 14 inches, with adequate space for students’ solutions to be written. They are being circulated for information purposes only. Students should be aware that there are changes in syllabus and/or textbook from year to year.

B.1

1995 Final Examination

1. Let α, β, γ be the permutations of notation are α = (1237)(49)(58)(6) ,

9

whose representations in (disjoint) cycle

β = (135)(246)(789) ,

γ = (1273)(59)(46)(8) .

(a) [10 MARKS] Showing all your work, determine disjoint cycle representations for each of the following permutations: αβ, βα, α2 , β 2 , α−1 , β −1 . (b) [5 MARKS] Determine a permutation σ ∈ S9 such that σασ −1 = γ. Express σ in disjoint cycle notation. 2. You are to show that the set S = {((¬p) ∨ (¬q) ∨ r), ((¬p) ∨ (¬q) ∨ s), ((¬r) ∨ (¬s) ∨ r)} logically implies the formula (¬(p ∧ q)). Use only the method requested; in each case no other method will be accepted. (a) [6 MARKS] Prove the logical implication using a truth table. (b) [9 MARKS] Provide a resolution proof. 3. (a) [1 MARKS] Give a precise definition for S(m, k), the Stirling number of the second kind . (b) [2 MARKS] Prove that, for all m ≥ 1, S(m, m) = 1

and

S(m, 1) = 1 .

(c) [2 MARKS] State, without proof, an identity which relates S(m + 1, k) to certain values S(m, r), (r = 1, 2, ..., k). (d) [10 MARKS] Use the results you have stated and/or proved above in a careful m + 1 for all m ≥ 2. Only an induction induction proof that S(m + 1, m) = m −1 proof will be accepted.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1049

4. (a) [5 MARKS] Showing all your work, use the Euclidean algorithm — no other method is acceptable here — to determine the greatest common divisor of the integers 243 and 198. (b) [5 MARKS] Using your computations above, determine two integers, x and y, such that gcd(243, 198) = 243x + 198y. 243 (c) [5 MARKS] Let m = . From your computations above, detergcd(243, 198) 198 mine an inverse for in m . gcd(243, 198) 5. (a) [5 MARKS] Prove or disprove: If f : A → B and g : B → C are any functions, and the composite gf is surjective, then f must be surjective. (b) [5 MARKS] Prove or disprove: Let k be a fixed integer, (k ≥ 5), and let a relation ∼ be defined on the set × by (x, y) ∼ (u, v) iff (x ≡ u (mod k)) ∨ (y ≡ v (mod k)) Then ∼ is an equivalence relation. 6. (a) [5 MARKS] Using the Sieve Principle(no other method will be accepted) 1 2 3 determine the number of permtations in S3 with the property a b c that (a 6= 1) ∧ (b 6= 2) ∧ (c 6= 3). (b) [5 MARKS] Showing all your work, determine all positive integers n with the property that φ(n) is odd, where φ is the Euler (totient) function. (You may assume the formula for φ derived in the textbook and lectures.)

B.2

1995 Supplemental/Deferred Examination (Note: Do not draw conclusion about the possible similarities of Final and Supplemental/Deferred Examinations; they can be very different, or very similar.)

1. The symbols x1 , x2 , ..., xm , y1 , y2 , ..., yn , z1 , z2 , ..., z` are all distinct. In each of the following problems you are to show all your work. (a) [3 MARKS] Determine the number of ways of arranging the m+n+` symbols in a row, so that x1 , x2 , ..., xm occupy m consecutive positions, in some order. (b) [7 MARKS] Determine the number of ways of arranging the m+n+` symbols in a row so that x1 , x2 , ..., xm do not occupy m consecutive positions, in any order, in the row; and neither do y1 , y2 , ..., yn occupy n consecutive positions,

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1050

in any order, in the row; and neither do z1 , z2 , ..., z` occupy ` consecutive positions, in any order, in the row. (c) [5 MARKS] If we require that xi appear somewhere to the left of xi+1 (i = 1, 2, ..., m − 1) — i.e., that x1 , x2 , ..., xm appear in the “natural” order (although there may be other symbols between them), what is the number of arrangements of the m + n + ` symbols? 2. Let α, β, γ be the permutations of notation are α = (12374)(958)(6) ,

9

whose representations in (disjoint) cycle

β = (127)(594)(683) ,

γ = (135)(24678)(9) .

(a) [10 MARKS] Showing all your work, determine disjoint cycle representations for each of the following permutations: αβ

,

βα ,

α2

,

β2

,

α−1

,

β −1

.

(b) [5 MARKS] Determine a permutation σ ∈ S9 such that σασ −1 = γ. Express σ in disjoint cycle notation. 3. [7 MARKS] Showing all your work, determine whether the following is a valid rule of inference: (p ⇒ r) ⇒ (q ⇒ r) (r ⇒ q) ∧ ((¬r) ∨ q) (¬(p ∨ r)) ∨ r r 4. [8 MARKS] Write a formula which “says” that the relation ∼, written a ∼ b, is an equivalence relation on a set S. 5. [10 MARKS] Prove that among 5 points in a square of side 1 there must exist two 1 that are not more than √ units apart. 2 6. [10 MARKS] Suppose that a sequence an (n = 0, 1, ...) is defined recursively by a0 = 1, a1 = 7, an+2 = 4an+1 − 4an (n ≥ 0). Prove by induction — no other method of proof will be accepted — that an = (5n + 2)2n−1 for all n ≥ 0. 7. (a) [5 MARKS] Prove or disprove: If f : A → B and g : B → C are any functions, and the composite gf is injective, then f must be injective. (b) [5 MARKS] Prove or disprove: if a relation ∼ is both symmetric and transitive, then ∼ must be reflexive.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

B.3

1051

1996 Final Examination

1. (a) [7 MARKS] Let f : A → B be a function. Show carefully that, if f is an injection, and S and T are subsets of A, f (S ∩ T ) = f (S) ∩ f (T ) .

(22)

(b) [3 MARKS] Show that (22) need not hold if f is not an injection. 2. [10 MARKS] A simple undirected graph G = (V, E) (i.e., an undirected graph G = (V, E) without loops or multiple edges) has the property that its chromatic number is 3; but that, after any edge is removed, the resulting graph has chromatic number 2. Showing all your work, determine all graphs G with this property. 3. [10 MARKS] An examination has 5 problems, on each of which a student can obtain a grade between 0 and 3 inclusive. Using generating functions — no other method will be accepted here — determine the number of different ways in which a student can obtain a grade of 9. 4. [10 MARKS] Using any method studied in this course, solve the recurrence an+1 = 2an + 3an−1 , (n ≥ 1), subject to initial conditions a0 = 1, a1 = 7. 5. (a) [5 MARKS] Determine the number of different strings that can be formed from all the letters of the word PEPPERCORN. (b) [5 MARKS] Determine the number of different strings that can be formed from all the letters of the word PEPPERCORN where the letters C and N cannot be side by side (in either order), and where O cannot appear immediately to the left of N. (c) [5 MARKS] Determine the number of different strings that can be formed from all the letters of the word PEPPERCORN where no two P’s can appear side by side. 6. (a) [5 MARKS] Prove or disprove: If (P, R) and (Q, S) are posets with |P | = |Q| = 4, and if |R| = |S|, then there exists a bijection f : P → Q such that h i ∀p1 ∈ P ∀p2 ∈ P [((p1 , p2 ) ∈ R) ⇔ ((f (p1 ), f (p2 )) ∈ S)] (b) [5 MARKS] Prove or disprove: On the set {1, 2, 3} there is no equivalence relation R for which |R| = 6 . 7. (a) [5 MARKS] Prove or disprove: There exist at least 2 non-isomorphic graphs on 8 vertices whose degrees are 2, 2, 2, 2, 3, 3, 3, 3.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1052

(b) [5 MARKS] Prove or disprove: There exist at least 2 non-isomorphic trees on 10 vertices whose degrees are 1, 1, 1, 1, 1, 2, 3, 3, 3, 4. 8. (a) [7 MARKS] Show that, if 5 distinct integers are selected from the set {1, 2, 3, 4, 5, 6, 7, 8} , then there must be a pair of these integers whose sum is equal to 9. (b) [3 MARKS] Show that the preceding statement fails if only 4 distinct integers are selected from the set. 9. (a) [5 MARKS] Let p be a positive prime integer. Describe in detail an algorithm by which one can find, for each integer a which is not divisible by p, integers b and c such that ab + pc = 1 . (b) [5 MARKS] Show that 127 is prime by dividing it by certain positive integers less than 12. Explain why your method works. (c) [5 MARKS] Use the method you have described in (a) to determine, for the integer 15, an integer ` such that 15 ` ≡ 0

B.4

(mod 127) .

1997 Final Examination

1. [10 MARKS] Using any method, but showing all your work, determine the number of solutions (x1 , x2 , x3 ) to the inequality x1 + x2 + x3 ≤ n where x1 , x2 , x3 are integers such that 2 ≤ x1 ≤ 8 3 ≤ x2 0 ≤ x3 ≤ 6 2. (a) [5 MARKS] Using any method, but showing all your work, solve the recurrence −an + 4an−1 − 4an−2 = 0 subject to the initial conditions a0 = 1, a1 = 3.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1053

(b) [5 MARKS] Prove carefully, by induction — no other method will be accepted — that  n X 1 n=0 ai = . 4an−1 n > 0 i=0

3. [5 MARKS] Prove or disprove: For any positive integers m and n the graph Km,n contains a Hamilton path. 4. [5 MARKS] Prove or disprove: If functions f : A → B and g : B → C are surjective, then g ◦ f is surjective. 5. Prove or disprove: The number of total orders that can be defined on a set of n elements (n ≥ 2) is 2n n!. 6. [5 MARKS] Prove or disprove: A connected simple undirected graph with e edges and v vertices such that v ≥ 3 and e ≤ 3v − 6 is planar. 7. [5 MARKS] Prove or disprove: A simple undirected graph with 9 vertices whose respective degrees are 4, 4, 4, 4, 4, 3, 3, 2, 2 must have an Euler path. 8. [5 MARKS] Prove or disprove: For any propositional function P (x, y), (∀y∃xP (x, y)) ⇒ (∃x∀yP (x, y))

V

by

iff ((U ⊆ V ) ∨ (V ⊆ U ))

Showing all your work, determine whether or not

Q

Q

U

Q

9. [10 MARKS] Let A be a set. Define on the set P (A) a relation

is a partial order.

10. [10 MARKS] Give an example of a graph G — different from K4 — with both the following properties, or prove that no such graph exists: (a) The chromatic number of G is 4. (b) The graphs obtained by deleting any one edge of G are all 3-colourable. If you are presenting an example, you are expected to prove that it has the properties you claim. 11. You are to count, in two ways, the number of 3-letter words that can be formed from the letters of the words ALMA MATER: (a) [5 MARKS] Using generating functions.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1054

(b) [5 MARKS] Without using generating functions. (The intention is that each letter may be used at most the number of times it appears in the words ALMA MATER; i.e. you may use A at most three times, L at most once twice, etc. The space between the two words is to be ignored.) 12. [10 MARKS] Determine whether or not the following is a valid argument: p→q p→r t→p t→r r→s t→s t→p p→t

)

(Hint: While you may be able to attack this problem with a truth table, there may be easier ways.) 13. [10 MARKS] For n = 1, 2, 3, 4, 5 determine the numbers of trees on n vertices a1 , a2 , ..., an . Sketch one tree from each equivalence class under isomorphism, and determine — showing your work — the number of trees in each equivalence class.

B.5

1997 Supplemental/Deferred Examination

1. [10 MARKS] Prove that the following argument is invalid. p↔q q→r r ∨ (¬s) (¬s) → q s

(23) (24) (25) (26) (27)

)

2. (a) [6 MARKS] Give examples of two simple graphs, one with 4 vertices, and the other with 5 vertices, such that each of them is isomorphic to its complement. (b) [4 MARKS] Prove that there is no graph G with exactly 99 vertices such that G is isomorphic to its complement.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1055

3. [10 MARKS] An examination has 4 problems, on each of which a student can obtain a grade between 0 and 4 inclusive. Using generating functions — no other method will be accepted here — determine the number of different ways in which a student can obtain a grade of 10. 4. [10 MARKS] Using any method studied in this course, solve the recurrence 9an−1 = −6an − an+1 , (n ≥ 1), subject to initial conditions a0 = 1, a1 = −3. 5. (a) [5 MARKS] Determine the number of different strings that can be formed from all 12 of the letters of the words FREEZING RAIN. (b) [5 MARKS] Determine the number of different strings that can be formed from all 12 of the letters of the words FREEZING RAIN where the letters F and G cannot be side by side (in either order), and where A cannot appear immediately to the left of G. (c) [5 MARKS] Determine the number of different strings that can be formed from all the letters of the words FREEZING RAIN where no two R’s can appear side by side. 6. (a) [5 MARKS] Prove or disprove: If S is a reflexive relation on a set A, then S 2 ⊆ S. (b) [5 MARKS] Prove or disprove: On a set B with |B| = 4 there is no equivalence relation R for which |R| = 6 . 7. (a) [5 MARKS] Prove or disprove: Every bipartite connected graph has a Hamilton path. (b) [5 MARKS] Prove or disprove: Every bipartite connected graph has an Euler path. 8. (a) [5 MARKS] Prove or disprove: If functions f : A → B and g : B → C are injective, then g ◦ f is injective. (b) [5 MARKS] Prove or disprove: The number of antisymmetric relations on a set A which are not reflexive is n 3( 2 ) × (2n − 1) .

B.6

1998 Final Examination

1. For a binary relation R on a set A, you are to consider the possibility that there exists a relation R0 such that R ⊆ R0 , where R0 is to have certain specified properties. In each of the following separate cases either prove that, for any R, a relation R0 must always exist; or prove by a counterexample that it may happen that no such R0 exists.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1056

(a) [3 MARKS] R0 is reflexive. (b) [3 MARKS] R0 is symmetric. (c) [3 MARKS] R0 is a partial ordering. 2. [9 MARKS] Your are to solve this problem only by using exponential generating functions – no other method will be accepted. You have a supply of 4 kinds of letters from which n-letter words are to be formed, with the following restrictions: • There are 2 A’s, and you may use any number of them. • There are 3 B’s and you must use only an odd number of them. • There are 4 C’s, and you must use only an positive, even number of them. • There is 1 D, and you may use it if you wish. Determine the exponential generating function for the number, an , of words that can be formed; and compute the value of a5 . 3. (a) [4 MARKS] Find an example to prove that the statement ∀x[A(x) ∨ B(x)] → [(∀xA(x)) ∨ (∀yB(y))] is not always true. (b) [5 MARKS] The following argument claims to prove the preceding implication. Determine precisely where the argument is defective, and verify your claim with the counterexample you presented in the preceding part of this question. ∀x[A(x) ∨ B(x)] ⇔ ⇔ ⇒ ⇔ ⇔

¬(∃x[¬(A(x) ∨ B(x))]) ¬(∃x[(¬A(x)) ∧ (¬B(x))]) ¬((∃x[¬A(x)]) ∧ (∃x[¬B(x)])) (¬(∃x[¬A(x)])) ∨ (¬(∃x[¬B(x)])) (∀xA(x)) ∨ (∀yB(y))

4. [9 MARKS] Showing all your work, determine, for any integer n, a formula for the number of solutions (x1 , x2 , x3 , x4 ) to the inequality x 1 + x2 + x3 + x4 ≤ n in non-negative integers which satisfy all of the following constraints simultaneously: • x1 ≤ 5

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1057

• x2 > 4 • x3 + x4 6= 3 (It is not necessary to simplify the formula.) 5. Suppose that f : A → B is any injective function, and g : B → C is any surjective function. Prove or disprove each of the following statements: (a) [3 MARKS] g ◦ f must be surjective. (b) [3 MARKS] g ◦ f must be injective. (c) [3 MARKS] The relation R defined as follows on B is an equivalence relation: ∀b1 ∈ B ∀b2 ∈ B[(b1 , b2 ) ∈ R ⇔ g(b1 ) = g(b2 )] 6. (a) [5 MARKS] Using any method you have learned in this course, determine a formula for an , the general term in a sequence {an } which satisfies the recurrence 2an+2 = 3an+1 − an (n ≥ 0) (28) subject to the initial conditions a0 = 3 a1 = 11

(29) (30)

(b) [4 MARKS] Using mathematical induction on n, verify carefully that the sequence you have found is indeed the unique solution to (28) subject to the given initial conditions. 7. (a) [2 MARKS] State Euler’s formula for maps on the plane or sphere (or for graphs embedded in the plane or on the sphere). (b) [7 MARKS] Apply Euler’s formula to prove that the complete bipartite graph K3,3 cannot be embedded in the plane or on the sphere. 8. (a) [5 MARKS] Prove or disprove: every tournament on 8 or more vertices contains a directed Hamilton circuit. (b) [4 MARKS] Prove or disprove: every tournament on 8 or more vertices contains a directed Euler path.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

B.7

1058

1998 Supplemental/Deferred Examination

1. You are to consider binary relations R on a finite set A, where |A| = n. Showing all your work, determine the number of such relations such that (a) [3 MARKS] R is reflexive. (b) [3 MARKS] R is symmetric and not reflexive. (c) [3 MARKS] R is antisymmetric. 2. [9 MARKS] Your are to solve this problem only by using exponential generating functions – no other method will be accepted. You have a supply of three kinds of letters from which n-letter words are to be formed, with the following restrictions: • There are 3 A’s, and you may use any number of them. • There are 4 B’s, and you must use only a positive, odd number of them. • There are 4 C’s, and you must use only a positive, even number of them. Determine the exponential generating function for the number, an , of words that can be formed; and compute the value of a6 . 3. [9 MARKS] Determine whether or not the following argument is valid: (¬p) ∨ q (p → q) → r ((¬q) → (¬p)) → (q ∨ (¬r)) (¬q) ∨ ¬(s → t) s ∧ (¬t) )

4. [9 MARKS] Showing all your work, determine, for any positive integer n, a formula for the number of solutions (x1 , x2 , x3 , x4 ) to the inequality x1 + x 2 + x3 + x4 < n in positive integers which simultaneously satisfy all of the following constraints simultaneously: • x1 > 5 • x2 ≤ 4 • x2 + x3 + x4 6= 5 (It is not necessary to simplify the formula.)

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1059

5. Suppose that f : A → B is any surjective function, and g : B → C is any injective function. Prove or disprove each of the following statements: (a) [5 MARKS] g ◦ f must be injective. (b) [4 MARKS] g ◦ f must be surjective. 6. (a) [5 MARKS] Using any method you have learned in this course, determine a formula for an , the general term in a sequence {an } which satisfies the recurrence 3an+2 = −2an+1 + an (n ≥ 0) (31) subject to the initial conditions a0 = 6 a1 = 6

(32) (33)

(b) [4 MARKS] Using mathematical induction on n, verify carefully that the sequence you have found satisfies the recurrence bn = bn+1 + 5bn+2 + 3bn+3

(n ≥ 0) .

7. (a) [2 MARKS] State Euler’s formula for maps on the plane or sphere (or for graphs embedded in the plane or on the sphere). (b) [4 MARKS] Apply Euler’s formula to prove that the complete graph K5 cannot be embedded in the plane or sphere. (c) [3 MARKS] Apply Kuratowski’s theorem — no other method will be accepted — to prove that any tree can be embedded in the plane or sphere. 8. (a) [5 MARKS] Prove or disprove: For every integer n ≥ 2, the n-cube Qn contains a Hamilton circuit. (b) [4 MARKS] Prove or disprove: For every integer n ≥ 2, the n-cube Qn contains an Euler circuit.

B.8

1999 Final Examination

1. [10 MARKS] Using any method studied in this course, and showing all of your work, determine whether or not the following is a valid rule of inference: ¬p → q ¬q p → (r ∧ s) r∨s )

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1060

2. (a) [2 MARKS] Define what is meant by an equivalence relation on a set. (b) [3 MARKS] Showing all your work, determine, for any positive integer n, exactly how many (binary) relations there are on the set {1, 2, ..., n}. (c) [6 MARKS] Showing all your work, determine exactly how many equivalence relations there are on the 4-element set S = {a, b, c, d}. (d) [3 MARKS] Showing all your work, determine exactly how many total orderings there are on the 4-element set S defined above. 3. [4 MARKS] Prove or disprove: Among any 101 integers in the set {n|101 ≤ n ≤ 300}, there must exist two integers a and b such that a|b. 4. [10 MARKS] Prove by induction, or disprove by providing a counterexample: For all integers N ≥ 2, N  X n2 − n − n=2

1 2 n −n

 =

N3 − N 1 − 3 N

5. [12 MARKS] Your are to solve this problem only by using exponential generating functions – no other method will be accepted. You have a supply of 3 kinds of letters from which n-letter words are to be formed, with no restrictions: you may use each of the 3 letters any non-negative number of times in any word. Determine the exponential generating function for the number, an , of words that can be formed; and use this to determine an in “closed form” (without using any summation signs). 6. [12 MARKS] Showing all your work, determine, for any integer n, a formula for the number of solutions (x1 , x2 , x3 , x4 ) to the inequality x 1 + x2 + x3 + x4 ≤ n in non-negative integers which satisfy all of the following constraints simultaneously: • 3 ≤ x1 ≤ 6 • x2 > 2 • x3 > 4 • 0 ≤ x4 ≤ 3 Verify that your formula is correct for n ≤ 5. (It is not necessary to simplify the formula.)

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1061

7. [12 MARKS] Showing all your work, determine the value of an , the general term in a sequence {an } which satisfies the recurrence 2an+2 − 3an+1 + an = 21−n

(n ≥ 0)

(34)

subject to the initial conditions a0 = 0 a1 = 0

(35) (36)

8. [12 MARKS] The Petersen graph has vertex-set V = {a, b, c, d, e, v, w, x, y, z} , and edge-set E = {ab, bc, cd, de, ea, av, bw, cx, dy, ez, vx, xz, zw, wy, yv} . Use the Euler polyhedron formula (not the Kuratowski Theorem) to prove that the Petersen graph is not planar. (You may assume that it is known that the Peterson graph has no circuits of lengths 3 or 4.) 9. (a) [2 MARKS] For trees on more than 1 vertex the number of vertices of degree 1 is bounded below. State the best bound. (b) [6 MARKS] Proceeding systematically, develop a list of trees on n vertices, where n = 1, 2, ..., 6. (c) [6 MARKS] For each of the trees listed in (b), determine the number of ways of labelling the vertices with distinct labels 1, 2, ..., n. Explain your reasoning in every case.

B.9

1999 Supplemental/Deferred Examination

1. [10 MARKS] Using any method studied in this course, and showing all of your work, determine whether or not the following is a valid rule of inference: ¬p → q ¬q p → (r ∨ s) r∧s )

2. Let S = {a, b, c, d} be a 4-element set.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1062

(a) [2 MARKS] Define what is meant by an partial ordering on S. (b) [3 MARKS] Showing all your work, determine exactly how many reflexive relations there are on the set S. (c) [6 MARKS] Showing all your work, determine exactly all the partial orderings of the set S that contain exactly 5 ordered pairs of elements of S. (d) [3 MARKS] Showing all your work, determine exactly how many total orderings of the set S are not symmetric. 3. [8 MARKS] Prove or disprove: Among any 501 integers n with the property that 1 ≤ n ≤ 1000 there must exist two integers a and b such that a = b − 1. 4. [10 MARKS] If the following statement is true, prove it by induction; if it is false, provide a counterexample: For all positive integers N , N X

n(n − 1)(n − 2)(n − 3) =

n=1

(N + 1)N (N − 1)(N − 2)(N − 3) 5

5. [12 MARKS] You have a supply of 3 kinds of letters from which n-letter words are to be formed, where you may use each of the 3 letters any positive number of times in any word. Determine the exponential generating function for the number, an , of words that can be formed; and use this to determine an in “closed form” (without using any summation signs). 6. [12 MARKS] You are to solve this problem only by using generating functions — no other type of solution will be accepted. Showing all your work, determine, for any integer n, a formula for the number of solutions (x1 , x2 , x3 , x4 ) to the inequality y1 + y2 + y3 + y4 ≤ n in non-negative integers which satisfy all of the following constraints simultaneously: • 3 ≤ y1 ≤ 7 • y2 > 2 • y3 > 4 • 0 ≤ y4 ≤ 4 Verify that your formula is correct for n ≤ 5. (It is not necessary to simplify the formula.)

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1063

7. [12 MARKS] Showing all your work, determine one particular sequence {an } which satisfies the recurrence an+2 − 2an+1 + an = n2 2−n

(n ≥ 0)

(37)

8. [12 MARKS] The Petersen graph has vertex-set V = {a, b, c, d, e, v, w, x, y, z} , and edge-set E = {ab, bc, cd, de, ea, av, bw, cx, dy, ez, vx, xz, zw, wy, yv} . Use the Kuratowski Theorem — no other method will be accepted —to prove that the Petersen graph is not planar.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

C

1064

Solutions to 1996 Assignment Problems

C.1

Solved Problems from the First 1996 Problem Assignment

1. (a) [17, Supplementary Exercise 2, p. 93] Find the truth table of the compound proposition (p ∨ q) → (p ∧ ¬r). (b) Is the given proposition a tautology or a contradiction? Explain. Solution: p T T T T F F F F

(a)

q T T F F T T F F

Truth table for (p ∨ q) → (p ∧ ¬r) r p ∨ q ¬r p ∧ ¬r (p ∨ q) → (p ∧ ¬r) T T F F F F T T T T T T F F F F T T T T T T F F F F T T F F T F F F T F F T F T

(b) A tautology has truth value T under all interpretations; a contradiction has truth value F under all interpretations. The given proposition attains both truth values, so it is neither a tautology nor a contradiction. 2. [17, Exercise 1.2.16] Show that p → q and ¬q → ¬p are logically equivalent. Solution: This problem can be solved directly using a truth table:

p T T F F

q T F T T

Truth table for p → q and ¬q → ¬p p → q ¬p ¬q ¬q → ¬p (p → q) ↔ (¬q → ¬p) T F F T T F F T F T T T F T T T T F T T

The equivalence of the two given propositions follows from the last column; or, equivalently, from the identity of corresponding truth values in columns ##3 and 6: if this latter observation is made, then the 7th column is redundant. Alternatively, we may analyse the two given propositions as follows. p → q is true for all assignments of truth values to p and q, except (p, q) := (T, F ). If we negate both sides of this assignment we find that it is equivalent to (¬p, ¬q) := (¬T, ¬F ) =

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1065

(F, T ), which is precisely the interpretation under which the contrapositive ¬q → ¬p is false. 3. [17, Exercise 1.2.24] Find a compound proposition involving the propositions p, q, and r that is true when p and q are true and r is false, but is false otherwise. (Hint: Use a conjunction of each proposition or its negation.) Solution: There are 2 × 2 × 2 = 8 possible conjunctions of the type mentioned in the hint. Of these 8, only 1 has the desired behavior, namely p ∧ q ∧ (¬r). This (compound) proposition has the desired set of truth values. This is not the only solution to the problem, however. There are infinitely many other propositions logically equivalent to this one, for example, (p ∧ q ∧ (¬r)) ∨ (p ∧ (¬p)), (p ∨ q ∨ r) ∧ (p ∨ q ∨ ¬r) ∧ (¬p ∨ q ∨ r) ∧ (¬p ∨ q ∨ ¬r) ∧ (p ∨ ¬q ∨ r) ∧ (p ∨ ¬q ∨ ¬r) ∧ (¬p ∨ ¬q ∨ ¬r).9 4. (a) [17, Supplementary Exercise 10, p. 94] If ∀y∃xP (x, y) is true, does it necessarily follow that ∃x∀yP (x, y) is true? If the answer is YES, prove it! If NO, give a specific counterexample.10 (b) If ∃x∀yP (x, y) is true, does it necessarily follow that ∀y∃xP (x, y) is true? If the answer is YES, prove it! If NO, give a specific counterexample. Solution: (a) The claim is false. For example, let P (x, y) be the statement x > y, where the universe is R. As there is no largest real number, there exists, for every y, a number x which is larger. However, there is no real number x which is greater than all real numbers y. (b) In this case the claim is correct. Suppose x0 is such that ∀yP (x0 , y) is true. For any specific y it follows from the truth of P (x0 , y) that ∃xP (x, y) is true. As y ranges over all propositions, this entails that ∀y∃xP (x, y) is true. 5. (cf. [17, Exercise 1.4.22]) Determine conditions on sets A and B that characterize when A × B = B × A. Solution: First assume that A × B = B × A. Then, for any points a ∈ A, b ∈ B, (a, b) ∈ A × B = B × A, all of whose ordered pair members have their first element in B and their second in A. It follows that a ∈ B and b ∈ A. As a and b were completely general, we have proved that A ⊆ B and that B ⊆ A, hence that A = B. Thus, if both A and B are non-empty, A × B = B × A implies that A = B. 9 10

The first solution we gave is in disjunctive normal form; the last is in conjunctive normal form. A counterexample is an example used to prove that a statement is false.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1066

However, if either of A or B is empty, then the preceding argument breaks down, as the Cartesian products are also empty. More precisely, if, say, A is empty, then there do not exist any ordered pairs of the form (a, b) with a ∈ A and b ∈ B, since the condition a ∈ A is a contradiction; similarly if B is empty. So, if just one of A and B is empty, the two Cartesian products are equal, even though the sets are unequal. We have shown that if A × B = B × A and neither A nor B is empty, then A = B. Conversely, if A = B, then A × B = A × A = B × B = B × A. 6. (cf. [17, Exercise 1.5.20]) Consider the following predicates (statements) about three sets: A∪C = B∪C A∩C = B∩C

(38) (39)

Prove or disprove each of the following statements. (a) ∀A∀B(∃C(38) → A = B) (b) ∀A∀B(∃C(39) → A = B) (c) ∀A∀B(∀C(38) → A = B) (d) ∀A∀B(∀C(39) → A = B) Solution: Both with binary connectives and with quantifiers there are often situations where the interpretation of a statement can be ambiguous. In the case of quantifiers the usual convention is that the quantifier applies to the shortest possible formula. Thus, for example, in part 6a, the formula shown means ∀A(∀B((∃C(38)) → (A = B))), not ∀A(∀B(∃C((38) → (A = B)))). (a) The statement is false: we give a counterexample, with specific choices of A and B. Let A = {1, 2}, B = {1}, C = {2}. Then A ∪ C = {1, 2} = B ∪ C, but A 6= B. (b) The statement is false: we give a counterexample, with specific choices of A and B. Simply take, for any distinct sets A and B, a set C consisting of some point which is neither in A nor in B. Then A ∩ C = = B ∩ C, but A 6= B.11 11

We observe that, notwithstanding the two preceding results, ∀A∀B(∃C((38) ∧ (39)) → A = B)) is true. We can express A ∪ C and B ∪ C as disjoint unions as follows; A∪C B∪C

= (A ∩ C) ∪ (A − C) ∪ (C − A) = (B ∩ C) ∪ (B − C) ∪ (C − B)

If these sets are equal, and if A ∩ C = B ∩ C, it follows that (A − C) ∪ (C − A) = (B − C) ∪ (C − B)

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1067

(c) For given A and B assume that (38) holds for all choices of C. In particular, let C consist of a single point {c} lying outside of the union A ∪ B. Then any point x of A is in A ∪ C = B ∪ C; but x ∈ / C; hence x ∈ B; as x ranges over all points of A, this implies that A ⊆ B. Similarly we may prove that B ⊆ A. It follows that A = B. An even simpler counterexample can be constructed by taking C = . (d) For given A and B, let C consist of any point x ∈ A. Then (39) ensures that {x} = A ∩ C = B ∩ {x}, so x ∈ B; as x ranges over all points of A, this implies that A ⊆ B. Similarly, taking x ∈ B, we may conclude that B ⊆ A. We conclude that A = B. An even simpler counterexample can be constructed by taking C = A ∪ B. 7. Equality of Functions. We say that two functions f : A → B, g : C → D are equal and write f = g if all of the following conditions are satisfied: F1. A = C, i.e. the domains are the same; F2. B = D, i.e. the codomains are the same; and F3. ∀a ∈ A(f (a) = g(a)), i.e. the functions have precisely the same action. Composition of Functions. Let f : A → B and g : B → C be any functions. The function g ◦ f : A → C is defined by the action a 7→ g(f (a)), i.e. by (g ◦ f )(a) = g(f (a)) for all a ∈ A. (This is essentially [17, Definition 1.10, p. 66], except we emphasize that it is not sufficient to specify the action of a function: both its domain and its codomain must be unambiguously specified, as well.) Invertible Functions. If f : A → B is a bijection, then [17, p. 67] f ◦ f −1 = ιB f −1 ◦ f = ιA

and

(40) (41)

(a) Show that, for any function f : A → B, f ◦ ιA = f and ιB ◦ f = f . (This serves as a second justification of the use of the word identity.) (b) Show that, for any functions f : A → B, ` : B → C, m : C → D, (m ◦ `) ◦ f = m ◦ (` ◦ f ). (This is the property of associativity of function composition.) (c) Show that a function f : A → B cannot have 2 different inverses. (Hint: Show that if g : B → A and h : B → A are such that f ◦ g = f ◦ h = ιB and g ◦ f = h ◦ f = ιA , then g = h.) from which it may be shown that A − C = B − C and C − A = C − B. Then A = (A ∩ C) ∪ (A − C) = (B ∩ C) ∪ (B − C) = B.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1068

Solution: (a) Since the identity functions are ιA : A → A and ιB : B → B, the compositions f ◦ ιA and ιB ◦ f both have domain A and codomain B. Thus, to prove the desired equality, it suffices to show that the two compositions both have the same action as f on any point in A. (f ◦ ιA )(a) = = (ιB ◦ f )(a) = =

f (ιA (a)) f (a) by ιB (f (a)) f (a) by

by definition of ◦ definition of ιA ; and by definition of ◦ definition of ιB

for any a ∈ A, proving that f ◦ ιA = f = ιB ◦ f . The difficulty in this problem, if there is one, is in recognizing that the properties you are being asked to prove appear obvious because of the suggestive notation we are using. Just because we denote something by a symbol suggesting that it behaves like an “identity”, or use that word in describing it, does not imply that the property actually holds. (b) As in the preceding part, the first step is to show that, by virtue of the definition of composition of functions, the double compositions both have domain A and codomain C. Then, having shown that the domains and codomains both coincide, all that remains to prove is that the two compositions have precisely the same action on all points of A. Since f : A → B and ` : B → C, the composition is ` ◦ f : A → C; since m has domain C and codomain D, m ◦ (` ◦ f ) has domain A and codomain C; in a similar way the same result can be proved for (m ◦ `) ◦ f . For every a ∈ A (m ◦ (` ◦ f ))(a) = = = =

m((` ◦ f )(a))) by definition of m ◦ · · · m(`(f (a))) by definition of ` ◦ f (m ◦ `)(f (a)) by definition of m ◦ ` ((m ◦ `) ◦ f )(a) by definition of · · · ◦ f ;

hence m ◦ (` ◦ f ) = (m ◦ `) ◦ f . (c) g = g ◦ ιB by part (a) = g ◦ (f ◦ h) by the hypothesis that h is an inverse = (g ◦ f ) ◦ h by associativity, proved above

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1069

= ιA ◦ h by the hypothesis that g is an inverse = h by part (a) 8. ([17, Exercise 1.8.20(a)]) Let T denote the set of integers that are not divisible by 3. Show carefully that T is countable. Solution: We are interested in the set ..., −11, −10, −8, −7, −5, −4, −2, −1, 1, 2, 4, 5, 7, 8, 10, 11, ... We have to prove the existence of a bijection between T and N. There are infinitely many ways of doing this, since the order of the natural numbers does not have to be considered; however, one wants a relatively simple enumeration so that countability is easily demonstrated. Had the set under consideration been only the non-negative integers not divisible by 3 — i.e. T ∩ N — we could simply have enumerated the members in increasing order, by a bijection f defined by  3n + 1 i = 0 f (2n + i) = . One enumeration in the present, more complicated 3n +  2 i=1 3n + 1 i = 0    −3n − 1 i = 1 case, is f (4n + i) = . 3n + 2 i = 2    −3n − 2 i = 3 As mentioned, there are infinitely many other possible enumerations. The systematic way in which we have, in effect, merged two countable sets into one, could be rewritten to give a solution to the following problem in the textbook: [17, Exercise 1.7.*24] Show that the union of two countable sets is countable.

C.2

Solved Problems from the Second 1996 Problem Assignment

1. (cf. [17, Exercise 6.1.28]) Suppose that R and S are reflexive relations on a set A. Prove or disprove each of the following statements: (a) R ∪ S is reflexive (b) R − S is symmetric (c) R ⊕ S is irreflexive Solution:

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1070

(a) TRUE. By hypothesis the set {(a, a)|a ∈ A} is contained in both R and S. Hence it is contained in their union. (Indeed, it is even contained in their intersection, which is, in turn, contained in the union.) (b) FALSE; we construct a counterexample. Let S be the smallest possible reflexive relation — i.e. just the “diagonal” elements {(a, a)|a ∈ A}. Let R be a reflextive relation which is not symmetric; for example, R could consists of the diagonal together with some element (a, b), where a 6= b and (b, a) ∈ / R. Then R − S will contain only the element (a, b) and will not be symmetric, since the element (b, a) is not present. (c) TRUE. R ⊕ S is the so-called symmetric difference (sometimes denoted by R∆S). Since the diagonal elements are present in both R and S, none is present in R ⊕ S. This is precisely the definition of irreflexivity [17, p. 365]. 2. (a) [17, Exercise 6.1.22] List all relations on the set {0, 1}. (b) (cf. [17, Exercise 6.1.24]) Which of the relations listed above are i. ii. iii. iv. v. vi.

reflexive? irreflexive? symmetric? antisymmetric? transitive? asymmetric?12

Solution: (a) In tabular form, the 24 = 16 relations are 12 Mathematicians usually try to choose terminology which is suggestive of the precise meaning intended. Occasionally this practice fails — either because of the choice of a word whose “normal” meaning is different from what is intended, or through the choice of an ambiguous word. One such case is the word asymmetric: a relation R is asymmetric iff ∀a∀b((a, b) ∈ R → (b, a) ∈ / R) is true [17, preceding Exercise 6.1.10]. Since the word symmetric entails a property that holds for all pairs of points, one might have expected that the absence of symmetry would coincide with the negation of the symmetry property. That is, a relation R on A fails to be symmetric if ¬(∀a∀b((a, b) ∈ R → (b, a) ∈ R)) is true, i.e. if ∃a∃b(¬((a, b) ∈ R → (b, a) ∈ R)) is true, i.e. if ∃a∃b(((a, b) ∈ R) ∧ ((b, a) ∈ / R)). Thus symmetry fails if at least one pair lacks its reversal. Note that asymmetry does not necessarily entail the absence of symmetry!

Notes Distributed to Students in Mathematics 189-240A (2000/2001) 0 0 0 1 0

1 0 0

0 0 0 1 0

1 0 1

0 0 0 1 1

1 0 0

0 0 0 1 0

1 1 0

0 0 0 1 0

1 1 1

0 0 0 1 1

0 0 1 1 0

1 0 0

0 0 1 1 0

1 0 1

0 0 1 1 0

1 1 0

0 0 1 1 0

1 1 1

1071

0 1

0 0 1

1 0 1

1 1 0

0 1

0 0 1

1 1 1

0 0 1 1 1

1 0 0

0 1

0 1 1

1 0 1

0 0 1 1 1

1 1 0

0 1

0 1 1

1 1 1

The relations can be represented by the 4-digit binary word obtained by reading the entries in locations (0, 0), (0, 1), (1, 0), (1, 1), i.e. by ordering the 4 locations “lexicographically”. i. Reflexive: The reflexive relations have a 1 in the diagonal entries in the table: 1001, 1011, 1101, 1111 ii. Irreflexive: A relation is defined to be irreflexive if no element is related to itself [17, p. 365]. Thus the tables for these relations have zeroes in the main diagonal: 0000, 0010, 0100, 0110 iii. Symmetric: The tables for symmetric relations are symmetric in the sense in which this word is used for matrices — i.e. the matrix has reflective symmetry in the main diagonal. There is no restriction on the main diagonal itself: only the pairs (1, 0) and (0, 1) must either both be present or neither be present. The symmetric relations are 0000, 0001, 1000, 1001, 0110, 0111, 1110, 1111. iv. Antisymmetric: For antisymmetric relations also there is no restriction on the diagonal entries of the table. Symmetrically located off-diagonal entries (in the present case there is only one such pair) must be different. Thus, in the present case, every relation which is not symmetric is antisymmetric. This is not true in general: on a set with more than 2 points there are relations which are neither symmetric nor antisymmetric; for 0 1 2 0 0 1 1 . example 1 1 0 0 2 0 0 0

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1072

v. Transitive: While the preceding properties are easily described in matrix terms, the property of transitivity is relatively “difficult” to determine from the matrix. In this case the digraph notation is preferable. We have to check all possible sequences of ordered pairs (a, b), (b, c) in the relation. Most of the relations prove to be transitive. Those that are not transitive are 0110, 0111, 1110. In each case the failure of transitivity occurs because under transitivity, whenever we have directed edges (a, b) and (b, a) in the digraph, then we must also have both (a, a), and (b, b). Again, this case of only 2 points is somewhat “degenerate” in that there are no instances of 3 distinct points under which transitivity could hold in its greatest generality. vi. Asymmetric: While, as seen above, there are 16-8=8 relations that are not symmetric, not all of these are asymmetric. Asymmetric relations must have zero diagonal. There are 3 asymmetric relations: 0010, 0100, 0000, of which the last is both symmetric and asymmetric. 3. (a) Consider the ternary (3-ary) relation on R defined by ∀x∀y∀z((x, y, z) ∈ R ⇔ x2 + y 2 = z 2 ) . Describe the projections P1,2 , P1,3 , P1,2,3 , P3 of R. (b) Suppose that we have, for some set A, a function f : A × A → A. We can represent this function as a ternary relation on A — i.e. as a subset of A×A×A; for example, we could use the “graph” {(x, y, f (x, y))|x ∈ A, y ∈ A}; when A = R this is the familiar graph of z = f (x, y). Explain why the ternary relation studied in part (3a) could not have been obtained in this way from a real function of 2 variables. (c) Let S be a binary relation on a given set A. Show that the projection P1,3 of the join J1 (S, S) ([17, Definition 6.2.3]) is the same as S 2 ([17, Definition 6.1.7]).13 Solution: (a) P1,2 maps R on to the set of all points (x, y) ∈ R2 such that there exists a z for which x2 + y 2 = z 2 , i.e. on to all points in the xy-plane. P1,3 maps R on to the set of points (x, z) in the xz-plane for which z 2 −x2 ≥ 0, equivalently, |z| ≥ |x|. This region consists of all points in the union of the two quarter-planes bounded by the lines z = ±x containing the z-axis. 13

Proving that a relation S1 from B to C is equal to a relation S2 from D to E is similar to proving functions equal. You must show that A = C, that B = D, and that the relations are precisely the same sets of points.

UPDATED TO September 19, 2000

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1073

P1,2,3 maps R on to R. P3 maps R on to the entire z-axis. (b) The surface x2 + y 2 = z 2 is not the graph of a function z = z(x, y), since, for all points P on the xy-plane except the origin there will be more than one point on the line through P parallel to the z-axis. For example, (3, 4, 5) and (3, 4, −5) both are contained in R. (c) J1 (S, S) consists of all (a, b, c) such that (a, b) ∈ S and (b, c) ∈ S. The action of P1,3 on this relation yields the composite of S and S, which was defined to be S 2 . 4. (a) The Sieve of Eratosthenes is an algorithm based on [17, Theorem 2.3.3] for determining all positive primes not exceeding an integer n. One first writes down the positive integers 2, 3, 4, 5, ..., n. In the first pass one deletes from the list all multiples of 2, except 2 itself. Then one observes that the successor of 2 in the list is 3, and deletes from the list all multiples of 3 except 3 itself. The successor of 3 is 5, since 4 was deleted earlier as a multiple of 2. The list is now scanned for multiples of 5 and all except 5 itself are omitted. Next 7, etc. Use the Sieve of Eratosthenes to determine all positive primes not exceeding 50. By√virtue of [17, Theorem 2.3.3], we need not divide by any prime exceeding 50 = 7.07... (b) (cf. [17, Example 2.6, p. 114]) Showing all your work, determine the prime factorization of 10014. (cf. [17, Example 2.3.6]). Solution: (a) We have determined the first √ 4 members of the list above. Since 7 is the largest prime not exceeding 50 we know that all surviving members of the list which exceed 7 must be prime. The list of primes less than 50 is therefore 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47 (b) We begin by dividing succesive primes into 10014. As evidently 2|10014, we have 10014 = 21 · 5007. As 5007 is evidently not divisible by 2, we proceed to test divisibility by the next prime, 3: 5007 = 3 · 1669, and 3 1669, 1669 is divisible only by primes exceeding 3. Unless it is prime, 1669 will be divisible by one or √ more of 5, 7, 11, ..., where the largest prime considered does not exceed 1669 = 40.85... The primes required were determined in the preceding part, using the Sieve or Eratosthenes. We find that none of the primes 2, 3, 5, ..., 37 divides 1669. Hence 1669 is prime, and the prime decomposition of 5007 is 21 31 16691 .

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1074

5. ([17, Exercise 2.3.30]) If the product of two integers m, n is 27 38 52 711 , and their greatest common divisor is 23 34 5, determine their least common multiple. Solution: As the product of the two integers has been given, each can involve only the primes 2, 3, 5, 7 in its prime decomposition. Suppose m = 2a 3b 5c 7d and n = 2e 3f 5g 7h . Then we have the following information about the exponents: a+e=7 b+f =8 c+g =2 d + h = 11

min{a, e} = 3 min{b, f } = 4 min{c, d} = 1 min{d, h} = 0

Given the sum of two integers, and their minimum, their maximum will be the other of the two. The maxima form the exponents of the primes in the least commn mon multiple. Alternatively, the least common multiple is the quotient lcm(m,n) = 7−3 8−4 2−1 11−0 4 4 1 11 2 3 5 7 =2 3 5 7 . 6. In [17, Exercise 2.3.19; Solution p. S-17] it is shown that 2n − 1 is prime only if n is prime. Such an integer, when prime is called a Mersenne prime. Your task is to consider a similarly defined sequence, the Fermat primes — defined to be those primes of the form 2n + 1. You should be familiar with the identity  x2m+1 + 1 = (x + 1) x2m − x2m−1 + ... − x + 1 ; (42) the simplest non-trivial instance is x3 + 1 = (x + 1)(x2 − x + 1). Use this identity with x an appropriate odd power of 2 to show that 2n + 1 is prime only if n has no odd factors other than ±1 — i.e. only if n is a power of 2. (Note: As with the m Mersenne sequence, not every integer of the form 22 + 1 is prime.) Solution: Factorize n into a product of powers of primes [17, Fundamental Theorem of Arithmetic, p. 113]; suppose that n is not a power of 2 — i.e. that n has an odd n factor 2m + 1 exceeding 1; let d = 2m+1 . Then, setting x = 2d in equation (42), we have the factorization  2n + 1 = (2d + 1) 22md − 2(2m−1)d + ... − 2d + 1 . The first factor, 2d + 1, is evidently greater than 1. The second factor may be expressed as a sum (22md − 2(2m−1)d ) + (2(2m−2)d − 2(2m−3)d ) + ... + (22d − 2d ) + 1 in which each of the summands preceding the last is greater than 1; as m ≥ 1 the total is surely greater than 1; thus we have shown that 2n + 1 is composite. We conclude that, if 2n + 1 is prime, n cannot have an odd factor exceeding 1, i.e. n must be a power of 2.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1075

7. [17, Exercise 2.4.8(d)] Showing all your work, convert the following integer from binary notation to decimal notation, then from decimal notation to hexadecimal notation — in that order: 11111 00000 11111. Solution: (11111 00000 11111)2 = (20 + 21 + 22 + 23 + 24 ) + 0 + (210 + 211 + 212 + 213 + 214 ) = (20 + 21 + 22 + 23 + 24 )(1 + 0 + 210 ) = 31(1 + 0 + 1024) = 31775. Now converting to hexadecimal notation, we apply the division algorithm repeatedly: 31775 1985 124 7

= = = =

16 · 1985 + 15 16 · 124 + 1 16 · 7 + 12 16 · 0 + 7

Hence (31775)10 = 15 + 1 · 16 + 12 · 162 + 7 · 163 = (7C1F )16 . We can verify this last computation by observing that (0111 1100 0001 1111)2 = (7C1F )16 . (This grouping of the binary digits in 4’s is the essence of the solution to [17, Exercise 2.4.10].) 8. [17, Exercise 2.4.14] It can be shown that every integer admits a representation in the form ek 3k + ek−1 3k−1 + ... + e1 31 + e0 30 , where ej = −1, 0, or 1 for j = 0, 1, ..., k. Expansions of this type are called balanced ternary expansions. In a systematic way which could be generalized into an algorithm, find the balanced ternary expansion of 79. Solution: Students were not supplied with an algorithm for determining the balanced ternary expansion. So a reasonable starting place would be the (unbalanced) ternary expansion: 79 26 8 2

= = = =

3 · 26 + 1 3·8+2 3·2+2 3·0+2

from which we conclude that 79 = 1 + 2 · 31 + 2 · 32 + 2 · 33 . Now we progressively eliminate coefficients 2, by replacing them by 3 − 1, working down from the highest powers. We begin with the term 2 · 33 = (3 − 1)33 = −1 · 33 + 1 · 34 ; hence 79 = 1 + 2 · 31 + 2 · 32 − 33 + 34 . Next 2 · 32 = (3 − 1) · 32 = −32 + 33 , so 79 = 1 + 2 · 31 − 32 + 34 .

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1076

But 2 · 31 = (3 − 1)31 = −31 + 32 , so 79 = 1 − 31 + 34 . The decomposition can be obtained more directly by modifying the applications of the division algorithm: instead of repeatedly dividing by 3 and taking the smallest positive remainder, take the remainder of smallest absolute value in every case — i.e. always take a remainder of 0 or ±1: 79 26 9 3 1

3 · 26 + 1 3·9−1 3·3+0 3·1+0 3·0+1

= = = = =

from which we conclude that 79 = 1 · 30 − 1 · 31 + 0 · 32 + 0 · 33 + 1 · 34 . This decomposition has the following interesting application. Suppose you are supplied with a set of balances and with weights in the magnitudes 1, 3, 9, 27, ... These weights suffice to weigh an object of integer weight: the negative signs signify weights to be placed in the same pan as the object; the positive signs signify weights to be placed in the opposite pan. (Of course it is possible to weigh an object with integer weight if we have weights 1, 2, 4, 8, 16, ...; the weights — all placed in the opposite pan to the object — will correspond to the non-zero digits in the binary expansion of the weight.) 9. (a) [17, Exercise 2.4.2(e)] Use the Euclidean algorithm to find gcd(1529,14038). (b) Use the results of your computations to express gcd(1529,14038) as an integer linear combination of 1529 and 14028. Solution: (a) 14038 1529 277 144 133 11

= = = = = =

1529 · 9 + 277 277 · 5 + 144 144 · 1 + 133 133 · 1 + 11 11 · 12 + 1 11 · 1 + 0

From these computations we can conclude that gcd(1529,14038)=1.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1077

(b) Working upwards through the preceding computations we have 1 = = = = =

133 · 1 − 11 · 12 = 133 · 1 − (144 − 133 · 1) · 12 144 · (−12) + 133 · 13 = 144 · (−12) + (277 − 144 · 1) · 13 277 · 13 + 144 · (−25) = 277 · 13 + (1529 − 277 · 5) · (−25) 1529 · (−25) + 277 · 138 = 1529 · (−25) + (14038 − 1529 · 9) · 138 14038 · 138 + 1529 · (−1267)

This is not the only possible decomposition. It can be shown that all possible decompositions are of the form 1 = 14038 · (138 + 1529t) + 1529 · (−1267 − 14038t) where t is any integer (positive, 0, or negative).

C.3

Solved Problems from the Third 1996 Problem Assignment

1. Dots. In practice mathematicians often indicate the presence of a proof by induction by writing down the first few instances of the statement to be proved, then writing a few dots (. . .), then the general case, with an indication of how an induction proof could be completed. Mathematicians also use the “. . .” notation to indicate a sequence which is defined recursively; where the terms are separated by commas, they are simply being listed (as in 1, 2, . . ., n, . . .). Where they are connected by plus signs, a sum is intended; for example, in 1+3+5+. . .+(2n−1), the n P notation is just an abbreviation for the finite sum normally denoted by (2i − 1), i=1

which is defined recursively by

1 P i=1

(2i − 1) = 1,

n+1 P i=1

(2i − 1) =

n P

(2i − 1) + (2n + 1);

i=1

where the sum is infinite there may be questions of convergence involved, but we are not likely to consider such questions in this course. In [17, §3.2] both uses of “. . .” may appear. Your assignment in this problem is to examine each use of “. . .” in [17, §3.2], explaining whether dots are being used to indicate an induction proof, or to describe a sequence or series that could be defined recursively. For example, the first use of “. . .” appears in [17, p. 186, l. 2], in the sequence 1, 2, 3, . . ., n. Here the dots connect the first terms of a sequence (the positive natural numbers) with the general term n. Everything we have said concerning terms connected by plus signs applies equally well to any associative binary operation. Thus, one might write, informally, 1 · 2 ·

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1078

3 · . . . · n to mean n!; one could also use dots to connect logical propositions where either the conjunction or disjunction is intended, as, for example, in [P (1) ∧ P (2) ∧ · · · ∧ P (n)] → P (n + 1) . Solution: (a) [17, p. 187, Example 2] (3 times): Each of the uses here is as an “abbreviation” n P for a sum of the form (2i − 1). i=1

(b) [17, p. 189, Example 4]: The author writes n = k, k + 1, k + 2, . . . to refer to the set {n|n ∈ N ∩ (n ≥ k)}; later he writes n = 0, 1, 2, . . . where he means N. (c) [17, p. 189, Example 5]: Here there are 3 instances where dots are used to indicate the sum of a geometric progression, which could be rigorously defined inductively, even if we did not possess a compact formula for the sum of the progression. Every one of these uses could be replaced by a sum using the Σ n+1 P i 2 , which notation. So we could represent 1 + 2 + 22 + . . . + 2n + 2n+1 by i=0

can be defined recursively as a function of n. (d) [17, p. 189, last 2 paragraphs]: Here there are several instances where dots are used to describe infinite sequences. In these cases the sum is not of interest; indeed, unless the common ratio of these geometric series is less than 1 in modulus, there will be no sum. (e) [17, p. 190, Example 6] (4 times): These uses are all to indicate the sum of a (finite) geometric progression. (f) [17, p. 191, Example 7]: In k = 1, 2, 3, . . . the dots are used to indicate the sequence of positive natural numbers in their usual order. In the remaining uses except the sum in [17, p. 191, 3 lines from bottom of page], the dots are used in the description of a finite sum that could have been defined recursively. The usage 3 lines from the bottom is to indicate the harmonic series, which does not converge. (g) [17, p. 192, Example 9]: There are 2 instances where dots are used to describe the sequence of positive integers (n = 1, 2, 3, . . .). There are four instances where dots are used to indicate the sum of the first n or n + 1 terms of this sequence. These sums could be defined inductively without dots. (h) [17, p. 196, 2nd Principle of Mathematical Induction]: The proposition [P (1)∧ P (2) ∧ · · · ∧ P (n)] → P (n + 1) could have been written without dots. Define a sequence of statements Q(n) inductively as follows: Q(1) = P (1). If Q(r)

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1079

has been defined, then Q(r + 1) is defined to be the statement Q(r) ∧ P (r + 1) (r ≥ 1). (i) [17, p. 198 Remark]: Some of the uses are to represent sequences that are not being summed. There are two statements where the use is as described in connection with the theorem above — to describe a conjunction of a finite number of logical propositions. 2. [17, Exercise 3.2.16] Use mathematical induction to prove that n X i=1

1 i(i + 1)(i + 2) = n(n + 1)(n + 2)(n + 3) . 4

(43)

Solution: Denote equation (43) by P (n). BASIS STEP. P (1) states that 1 · 2 · 3 = 1 · 2 · 3 · 4/4, which is evidently true. INDUCTIVE STEP. Assume that P (n) is true. Then n+1 X

=

i=1 n X

i(i + 1)(i + 2) i(i + 1)(i + 2) + (n + 1)(n + 2)(n + 3) by definition of

n+1 P

i=1

1 = n(n + 1)(n + 2)(n + 3) + (n + 1)(n + 2)(n + 3) by P (n) 4 (n + 1)(n + 2)(n + 3)(n + 4) = , 4 which is P (n + 1). Truth of P (n) for all positive n follows by Mathematical Induction. 3. [17, Supplementary Exercise 36, p. 228] A set is well ordered if every nonempty subset of this set has a least element. Determine which of the following sets S is well ordered. (a) the set of integers (b) the set of integers greater than −100 (c) the set of positive rationals (d) the set of positive rationals with denominator less than 100

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1080

Solution: (a) FALSE. While some nonempty subsets do indeed have a least element, there exist subsets that do not, for example, the set Z itself. This set has no least element; for, if x were a least element, it would have to be no greater than x − 1, which is also in Z. From this contradiction we conclude that there exists no least element for Z (more precisely, for the structure (Z, ≤).) Hence this poset is not well ordered. (b) TRUE. Every nonempty set of integers from this set has a least element which will not be less than −100. This is because we are working with integers; the set of rational numbers greater than −100 is not well ordered. For example, the subset consisting of all real numbers strictly greater than −100 — i.e. the set14 {x ∈ Q|x > −100} with the usual order of the real numbers — has no minimum element; for, if one were to claim that some real number a in the set were the minimum, then a−100 would be a smaller number in the set; from 2 this contradiction one concludes that this set has no least element. (c) Reasoning as at the end of the preceding part, suppose that a is the smallest positive rational number. Then a is expressible as a ratio cb of positive integers. But now the rational number 2cb is smaller than a and is still positive; so a is not the smallest positive rational number. From this contradiction we conclude that the hypothesized existence of a is false: there exists no smallest positive rational. As we have exhibited a non-empty subset with no least element, we have shown that the positive rationals are not well ordered (under the usual ordering of the real numbers). 1 (d) In any subset of S the elements are never closer together than 100 2 (since the difference between two ratios that both have denominators less than 100 is greater than a rational whose numerator is a non-zero integer, and whose denominator is less than 992 ). Thus, if a subset T ⊆ S is given we have an algorithm to determine its minimum element: succesively examine each interval [10−4 n, 10−4 (n + 1)) for n = 0, 1, ... — there will never be more than one member of T in such an interval; stop when the examination yields an element of T . If T 6= , this algorithm must terminate.

4. [17, Exercise 3.2.18] Prove that 1 + 14 + 19 + · · · + n12 < 2 − n1 whenever n is a positive integer exceeding 1. Solution: This is an example of an important activity in mathematical analysis, the estimation of a quantity whose exact value may be difficult to determine. In such situations we often do not require the “best” value, but merely a bound for 14

Q denotes the set of rational numbers.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1081

P 1 π2 the value. For example, it is known that ∞ i=1 i2 = 6 = 1.64493.... which gives a better bound than the one you are asked to prove, as soon as n ≥ 3. P Let P (n) denote the statement ni=1 i12 < 2 − n1 . P (2) states that 54 < 2 − 12 which is evidently true. Suppose that P (n) has been proved. Then n+1 n n+1 X X X 1 1 1 = + by recursive definition of 2 2 2 i i (n + 1) i=1 i=1   1 1 < 2− + by induction hypothesis n (n + 1)2     1 1 1 1 = 2− − + ≤2− − + Why? (n + 1)2 n n(n + 1) n 1 n = = n(n + 1) n+1

5. In the propositional calculus, the set W F F of well formed formulæ is defined recursively as follows: • BASE CASES: – F ∈ W F F and T ∈ W F F – every propositional variable belongs to W F F ; • RECURSIVE STEP: if u and v are in W F F , then so also are each of (¬u), (u ∨ v), (u ∧ v), (u → v), (u ↔ v). [17, Example 3.3.9] (cf. [17, Exercise 3.3.24]) Show that any element of W F F contains equal numbers of left and right parentheses. Hint. Eventually we will have a general procedure that could be applied here. For the present, we have only the two types of induction, both of which require a statement P (n), where n ranges over the positive integers. Thus, in order to solve this problem with tools available to you at present, you will have to recast the statement into one of the form P (n) — that is, that depends on some positive integer variable. There are several ways in which this could be done. For example, you could take n to be the number of logical connectives in the formula. These are the operators ¬, ∨, ∧, →, ↔. The formulæ are strings of symbols from the alphabet {T, F} ∪ {all propositional variables} ∪ {¬, ∨, ∧, →, ↔, (, )} (Another approach would be to build the induction on the length of the formula — i.e. the total number of characters in the string, counting variables, connectives, and parentheses.) Solution: Define P (n) to be the statement:

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1082

All well formed formulæ having exactly n connectives contain equal numbers of left and right parentheses. BASIS STEP. The formulæ whose membership derives from the RECURSIVE STEP all contain at least one connective. The others are precisely the BASE CASES, none of which contains any parentheses. Hence the numbers of parentheses are equal (each to 0) when the number of connectives is 0; i.e. P (0) is true. INDUCTIVE STEP: Suppose that P (n) has been proved for all n ∈ N, and consider P (n + 1). Any well formed formula with n + 1 connectives is constructed by the RECURSIVE STEP either (a) from a well formed formula u, by negation, to form (¬u); or (b) from two well formed formulæ u, v, as (u ∗ v) where ∗ is one of the binary connectives ∧, ∨, →, ↔. But, if the numbers of left and right parentheses in u are equal (to some integer m), then the numbers in (¬u) will also be equal (to m + 1). And, if the numbers of left and right parentheses of u are both equal to m, and those of v are both equal to `, then the numbers in (u ∗ v) will both be equal to ` + m + 1. This proves that P (n) → P (n + 1) is always true (n = 0, 1, ...). 6. [17, Exercise 4.1.18] Determine the numbers of positive integers between 1000 and 9999 inclusive having each of the following properties. (Note that in the range we have chosen there will be no “leading zeroes”.) (a) Integers divisible by 9. (b) Even integers. (c) Integers in which all digits are distinct. (d) Integers which are not divisible by 3. (e) Integers which are divisible by 5 or 7 (or both). (f) Integers which are not divisible by either 5 or 7. (g) Integers which are divisible by 5 but not by 7. (h) Integers which are divisible by both 5 and 7. Solution: (a) Integers divisible by 9. The first such integer will be 9 × d 1000 e = 1008; 9 the last is 9 × b 9999 c = 9999 The number of multiples of 9 in this interval is 9 1111 − 112 + 1 = 1000.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1083

(b) Even integers. Exactly half of the integers in the range are even; their number is 9000 = 4500. 2 (c) Integers in which all digits are distinct. We have to choose 4-digit sequences of distinct integers in which the first digit is not a zero. The first digit may be chosen in 9 ways. Following that, the second may be chosen independently of the first, from the residual population of 9 digits (excluding the first digit chosen). The third digit is then chosen in 10 − 2 = 8 ways; then the fourth in 10 − 3 = 7 ways. In all, by the Product Rule, the total number of these integers is 9 × 9 × 8 × 7 = 4536. (d) Integers which are not divisible by 3. The integers which are divisible by 3 are equally spaced, 3 units apart; starting at the largest, 9999 and descending to the smallest, 3×d 1000 e = 1002. Their number is 9999−1002 +1 = 3000. Hence 3 3 the number of integers which are not disible by 3 number 9000 − 3000 = 6000. (e) Integers which are divisible by 5 or 7 (or both). We apply the InclusionExclusion Principle, to be studied formally in [17, §§5.4]. Let A1 and A2 respectlvely denote the sets of integers in the given range that are divisible by 5 and by 7. Then |A1 | = 9000 = 1800; |A2 | = b 9999 c−b 999 c = 1428−142 = 1286. 5 7 7 By part (6h), |A1 ∩ A2 | = 257. |A1 ∪ A2 | = |A1 | + |A2 | − |A1 ∩ A2 | = 1800 + 1286 − 257 = 2829. (f) Integers which are not divisible by either 5 or 7. This is the complement of the preceding case; the number of such integers is 9000 − 2829 = 6171. (g) Integers which are divisible by 5 but not by 7. The number of integers divisible by 5 is 1800. From this set we delete those divisible by both 5 and 7, numbering (by the next part) 257, leaving a balance of 1543. (h) Integers which are divisible by both 5 and 7. The number of multiples of 35 not exceeding 999 is b 999 c = 28; the number of such multiples not 35 9999 exceeding 9999 is b 35 c = 285; hence the number of multiples of 35 in the desired range is 285 − 28 = 257. 7. You are given a set A = {a1 , a2 , a3 , a4 , a5 } containing 5 elements, and a set B = {b1 , b2 , b3 } containing 3 elements. Showing all of your work, determine each of the following: (a) The number of functions f : A → B. (b) The number of bijections f : A → A. (c) The number of injections f : A → B.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1084

(d) The number of injections f : B → A. (e) The number of surjections f : A → B. Solution: (a) The number of functions f : A → B. For each point of A there are |B| choices of image. Since the action of f on any point is not affected by its action on any other point, the Product Rule is applicable. The total number of such functions is, therefore, |B||A| = 35 = 243. (b) The number of bijections f : A → A. Map a1 in |A| ways, a2 in |A| − 1 ways, etc. The Product Rule applies, yielding the number |A|! = 5! = 120 such permutations in all. (c) The number of injections f : A → B. Since |B| is smaller than |A| there can be no injection of A into B. Accordingly, the number of such functions is 0.  |A| (d) The number of injections f : B → A. Select the image points in |B| =  5 = 10 ways. Then map the elements of B in |B|! ways. In all the number 3 of functions is P (5, 3) = 60. (e) The number of surjections f : A → B. The total number of functions from B to A is |B||A| = 35 = 243. Denote by Si those functions for which bi is not in the image (i = 1, 2, 3). Then |Si | = 25 = 32 (i = 1, 2, 3). |S1 ∩ S2 | = 15 = 1, etc. |S1 ∩ S2 ∩ S3 | = | | = 0. By the Inclusion-Exclusion Principle, the total number of mappings which are not surjective is 3 · 25 − 3 · 1 + 1 · 0 = 93; hence the number of surjective mappings is 243 − 93 = 150. We can enumerate these in other ways. For example, we could examine the possible distributions of 5 points among 3 image points. The possible partitions of 5 into 3 positive parts are: 5 = 2 + 2 + 1 and 5 = 3 + 1 + 1. In the case of 2 + 2 + 1 we can select the point of B which is to be theimage of 1 point in 31 = 3 ways, and the point of A to be mapped to it in 51 = 5 ways. Then we can select  the points of A to be mapped on to one of the remaining 2 points of B in 42 = 6 ways; there is no choice for the action on the remaining points. Applying the Product Rule we find that the total number of surjective mappings associated with this partition to be 3 × 5 × 6 = 90. Inthe case of partition 3 + 1 + 1, choose the point of B toreceive 3 points in 3 = 3 ways, and the points to be mapped on to it in 53 = 10 ways. Then 1 the remaining 2 points of B are assigned one to each of the remaining 2 points of B, in 2! = 2 ways. In all, the number of such mappings is 3 × 10 × 2 = 60. Summing the numbers of surjections associated with the two partitions yields 90 + 60 = 150, as computed earlier.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1085

(What we have computed here is 3! times the Stirling number of the Second Kind S(5, 3) = 25. This Stirling number is the number of ways of partitioning a set of 5 distinguishable objects into 3 unlabelled sets, each of which is to contain a positive number of elements. The factor 3! by which we have multiplied the Stirling number is to render the sets distinguishable.) 8. (a) [17, Exercise 3.3.30] Give a recursive definition of the set of bit strings that are palindromes15 over some alphabet A. (b) Determine a formula for the number of palindromes of length n over the alphabet {0, 1}. Solution: (a) (There will be other ways of generating this set recursively.) Define a sequence of sets Sn by i. S0 = . ii. S1 = A. iii. Sn+2 = {apa|(a ∈ A) ∧ (p ∈ Sn )} (n ≥ 0) Then the set of palindromes is ∪∞ i=0 Si . A similar definition, which does not partition the set of palindromes into those of various lengths, is i’. and all elements of A are palindromes. ii’. If p is a palindrome, and if a ∈ A, then apa is a palindrome. A palindrome of even length n = 2m can be obtained by concatenating any binary word of length m with its “inverse” (i.e. reversal); and, conversely, any word constructed in this way is a palindrome. The number of such words n+1 is 2m = 2 2 . A palindrome of odd length n = 2m + 1 can be obtained by inserting either a 0 or a 1 into the centre of a palindrome of length 2m; and n+1 conversely. The number of such words is therefore 2 · 2m = 2m+1 = 2d 2 e . 9. [17, Exercise 4.3.28] How many bit strings contain exactly five 0’s and 14 1’s, if every 0 must be immediately followed by 2 successive 1’s Solution: Every 0 appears as the first members of a subsequence 011. Our words can be viewed as words in the alphabet {011, 1}. Any permutation of repeated copies of these primitive words can be analyzied to determine uniquely the numbers of the two subwords used. In the present case we are permuting 5 copies of 011  and (5 + 14) − 15 = 4 copies of 1. The number of permutations is 5+4 = 126. 5 15

A palindrome is a string that is not changed under reversal, for example, the word “radar”; another palindrome, supposedly recited by Napoleon is ABLE WAS I ERE I SAW ELBA.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1086

10. [17, Exercise 4.2.12] (a) Show that if seven integers are selected from the first ten positive integers, there must be at least two pairs of these integers with sum 11. (b) Is the conclusion in part (a) true if six integers are selected instead of seven? Explain. Solution: (a) Partition the set {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} = {1, 10} ∪ {2, 9} ∪ {3, 8} ∪ {4, 7} ∪ {5, 6} Let xi denote the number of points selected from the pair {i, 11 − i} (i = 1, 2, 3, 4, 5). Then x 1 + x2 + x3 + x4 + x5 = 7 (44) The claim is that at least 2 of these xi which are ≥ 2. Let us consider the alternatives: Just one x is ≥ 2: As the maximum value of each xi is also 2, in this case there would remain 7−2 = 5 to be partitioned amoung the remaining four subsets; by the Pigeonhole Principle, at least one subset would contribute more than 1. No x is ≥ 2: This would imply that xi ≤ 1 for all i, contradicting the Pigeonhole Principle. i

i

We conclude that the claim is correct. (b) The preceding result is “best possible” in the sense that a selection of six integers might not have the property claimed: select 2 points from one of the pairs, and 1 from each of the others. 11. (cf. [17, Exercise 4.6.16]) In each of the following cases determine the number of solutions to the equation x1 + x2 + x3 + x4 + x5 + x6 = 29 in nonnegative integers such that (a) xi > 1 (i = 1, 2, 3, 4, 5, 6)16 . (b) xi ≥ i (i = 1, 2, 3, 4, 6); x5 > 5. 16

This part has been changed from the version in the textbook.

(45)

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1087

(c) x1 ≤ 5. (d) x1 < 8, x2 > 8. Solution: Problems of this type, involving ordered partitions into non-negative integers, can be represented by binary integers. Represent part xi by a string of xi 1’s; follow each of these strings — except the last — by a 0, serving as a separator. Conversely, any binary integer in 29 1’s and 5 0’s can be interpreted as a partition. (a) x > 1 (i = 1, 2, 3, 4, 5, 6): We shall change the variables to convert this problem to one which can be represented by binary strings, where the only restrictions are the numbers of 0’s and 1’s. Define yi = xi − 2 (i = 1, 2, 3, 4, 5, 6). Equation (45) transforms to i

y1 + y2 + y3 + y4 + y5 + y6 = 17, . The number of binary words with 17 1’s and 5 0’s is

17+5 5



= 26 334.

(b) x ≥ i (i = 1, 2, 3, 4, 6); x5 > 5: We shall change the variables. Define yi = xi − i (i = 1, 2, 3, 4, 6); y5 = x5 − 6. Then equation (45) is equivalent to i

y1 + y2 + y3 + y4 + y5 + y6 = 7 , to be solved in non-negative integers. The number of binary words in 7 + 5  7+5 1’s and 5 0’s is 5 = 792. (c) x1 ≤ 5: Changing the variables by yi = xi (i = 1, 2, 3, 4, 6); y5 = x5 − 6 we can count the number of solutions to the preceding part that violate the present conditions. The new equation is y1 + y2 + y3 + y4 + y5 + y6 = 23 ,  and the number of non-negative solutions is 28 = 98 280. Hence the num5   29+5 28 ber of solutions satisfying the present condition is 5 − 5 = 278 256 − 98 280 = 179 976. (d) x1 < 8, x2 > 8: By the methods used above, the number of solutions to equation (45) satisfying x2 ≥ 9 is the number of non-negative solutions to y1 + y2 + y3 + y4 + y5 + y6 = 20 ,  25

i.e. 5 = 53 130. From these we wish to exclude the solutions corresponding to x1 ≥ 8, now y1 ≥ 8. We change the variable again: z1 = y1 − 8, zi = y1 (i = 2, 3, 4, 5, 6). The resulting equation is z1 + z2 + z3 + z4 + z5 + z6 = 12 .  The number of inadmissible solutions is 12+5 = 6 188. Subtracting yields 5 the number of admissible solutions, 53 130 − 6 188 = 46 942.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1088

12. [17, Exercise 4.6.28] Determine how many different strings can be made from all the letters in AARDVARK, subject to the condition that the three A’s must be consecutive. Solution: We count the number of permutations of 6 objects: one string AAA; two strings R, R; and three other single letters, D, V, K. Had the R’s been distinguishable, the number would have been 6!. Here, as the R’s are alike, the total number of arrangements is 6! = 360. 2!

C.4

Solved Problems from the Fourth 1996 Problem Assignment Note: Students had been advised that ‘There is no need to evaluate “large” binomial coefficients, unless knowing their values can help you verify your work.’

1. Showing all your work, determine the total17 coefficient of z 7 in the expansion of (x − 2yz + 3z 2 )11 . Solution: Using the Multinomial Theorem [17, Exercise 4.6.49]: The coefficient will 11! be the sum of all possible terms of type xn1 (−2y)n2 3n3 where n1 +n2 + n1 !n2 !n3 ! n3 = 11 and n2 + 2n3 = 7. Since 0 ≤ n2 = 7 − 2n3 , we see that the following are the only possible non-negative integer solutions of these equations: (n1 , n2 , n3 ) ∈ {(4, 7, 0), (5, 5, 1), (6, 3, 2), (7, 1, 3)} . Hence the total coefficient of z 7 is 11! 11! (−2)7 30 x4 y 7 + (−2)5 31 x5 y 5 4!7!0! 5!5!1! 11! 11! + (−2)3 32 x6 y 2 + (−2)1 33 x7 y 1 6!3!2! 7!1!3! = −42240x4 y 7 − 266112x5 y 5 − 332640x6 y 2 − 71280x7 y 1 . Using the Binomial Theorem several times: (x + z(−2y + 3z))11 17

By total we mean the polynomial in x and y which, when multiplied by z 7 , contains all terms of the form (constant)xi y j z 7 ; had we suppressed the word total some readers might have assumed we were interested only in the term (constant)z 7 in the expansion — whose coefficient is evidently 0.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1089

    11 4 11 5 7 7 = x (−2y + 3z) z + x (−2y + 3z)6 z 6 7 6     11 6 11 7 5 5 + x (−2y + 3z) z + x (−2y + 3z)4 z 4 + irrelevant terms 5 4         11 5 6 11 4 7 = x (−2)7 y 7 z 7 + x (−2y)5 3zz 6 7 0 6 1         11 7 4 11 6 5 x (−2y)3 (3z)2 z 5 + x (−2y)1 (3z)3 z 4 + · · · + 2 4 3 5 2. Use exponential generating functions to determine, for any n, the number of ternary words of length n having an even number of 0’s, an odd number of 1’s, and an ∞ P x2n+1 unrestricted number of 2’s. [Hint: ex − e−x = 2 . A similar relation holds (2n+1)! n=0

for the sum of even powers.] x

−x

x

−x

Solution: The enumerators for 0’s, 1’s, and 2’s respectively are e +e , e −e . ex . 2 2 Multiplying these three factors yields the exponential generating function for the x −x x −x numbers under consideration in this problem: e +e · e −e · ex = 14 (e3x − e−x ) = 2 2 ∞ P 3n −(−1)n 1 . Hence the number of ternary words sought is n! times the preceding 4 n! n=0

nth degree coefficient, or

1 4

(3n − (−1)n ).

3. The proprietor of a book shop wishes to arrange 15 different books on five shelves for a window display. In how many ways can she arrange them so that each shelf has at least one, but no more than four books? Solution: [6, Exercise 8.1.7] We can think of this problem as having two phases: • selecting the locations for books — i.e. determining the number of books to be placed on each shelf; and • determining the number of ways of placing the 15 distinct books in the determined locations. The second phase will always be independent of the first: there are 15! ways of placing the 15 books. Thus we need only solve the first phase and multiply by 15! — by the Product Rule. The first phase of the problem is equivalent to solving the equation x1 + x2 + x3 + x4 + x5 = 15 in non-negative integers xi subject to constraints 1 ≤ xi ≤ 4 (i = 1, ..., 5).

(46)

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1090

Using Generating Functions The ordinary generating function for the admissible values of xi is t1 + t2 + t3 + t4 . We seek the coefficient of t15 in the expansion of (t + t2 + t3 + t4 )5 = t5 (1 − t4 )5 (1 − t)−5 , i.e. the coefficient of t10 in the expansion of  ∞  X n+4 n 4 5 −5 4 8 (1 − t ) (1 − t) = (1 − 5t + 10t − ...) · t 4 n=0 = (1 − 5t4 + 10t8 − ...)         6 2 10 6 14 10 · 1 + ... + t + ... + t + ... + t + ... 4 4 4       14 10 6 = ... + −5 + 10 t10 + ... 4 4 4 Hence the number of arrangements of distinct books is       14 10 6 −5 + 10 · 15! 4 4 4 Using the Principle of Inclusion-Exclusion We shall adopt a point of view suggested by the preceding solution. We will take as our underlying population the set S consisting of all integer solutions of (46) such that xi ≥ 1 (i = 1, 2, ..., 5). Then we will define Ci to be the subset of S such that xi ≥ 5 (i = 1, 2, ..., 5). We shall determine the cardinalities of various intersections of sets from the one-to-one correspondence between the integer solutions to x1 + x2 + ... + xk = n subject to xi ≥ 0

(i = 1, 2, ..., k)

and the binary words in n 0’s and k − 1 1’s, which serve as separators. That number is the number of ways of selecting k − 1 separators  positions for the n+k−1 n+k−1 in the (n + k − 1)-digit word, i.e. k−1 or, equivalently, . n To determine |S|, we make a change of variables yi = xi − 1 (i = 1, 2, ..., 5): the number of non-negative integer solutions to y1 + y2 + y3 + y4 + y5 + 5 = 15  10+4 is 4 . The number of solutions to (46) subject to 5 ≤ x1 , 1 ≤ xi (i = 2, 3, 4, 5) is, after a change of variables y1 = x1 − 5, yi = xi − 1 (i = 2, 3, 4, 5), the number of non-negative integer solutions to y1 + y2 + y3 + y4 + y5 + 9 = 15, namely  6+4 = |C1 |. The same value holds for |Ci | (i = 2, 3, 4, 5). 4

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1091

For the intersection of two of the sets of forbidden partitions, consider, for example, C1 ∩ C2 , the cardinality will be the number of integer solutions to (46) subject to 5 ≤ x1 , 5 ≤ x2 , 1 ≤ xi (i = 3, 4, 5); after the change of variables y1 = x1 − 5, y2 = x2 − 5, yi = xi − 1 (i = 3, 4, 5), this will be the number of non-negative integer solutions to y1 + y2 + y3 + y4 + y5 + 13 = 15,  2+4 namely 4 = |C1 ∩ C2 |. The same value holds for all 52 intersections of pairs of the sets Ci (i = 1, 2, 3, 4, 5). All intersections of more than two of these sets will be empty, since they entail preassigning more books than we have available to place. Accordingly, the Principle of Inclusion-Exclusion yields the number of solutions to be the same alternating sum determined before. Another solution using Inclusion-Exclusion We give here a second solution using Inclusion-Exclusion. This solution has no redeeming features; it is presented only to show that there are often several different points of view that will lead to the same numerical solution. This particular point of view leads to very tedious computations. We define S to be the set of all non-negative integer solutions to (46). Let Ci be the subset of solutions for which xi = 0 (i = 1, 2, ..., 5), and let Di be the subset of solutions for which xi ≥ 5 (i = 1, 2, ..., 5). There cannot be any non-empty intersections with more than 3 of the Dj ; the intersection of Di 5 Q Ci = . with Ci is always empty (i = 1, 2, 3, 4, 5); and the intersection i=1

Then |S| = |Ci | = |Ci1 ∩ Ci2 | = |Ci1 ∩ Ci2 ∩ Ci3 | = |Ci1 ∩ Ci2 ∩ Ci3 ∩ Ci4 | = |Dj | = |Dj ∩ Ci | =

  15 + 4 4   15 + 3 3   15 + 2 2   15 + 1 = 16 1   15 + 0 =1 0   10 + 4 4   10 + 3 3

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

|Dj ∩ Ci1 ∩ Ci2 | = |Dj ∩ Ci1 ∩ Ci2 ∩ Ci3 | = |Dj ∩ Ci1 ∩ Ci2 ∩ Ci3 ∩ Ci4 | = |Dj1 ∩ Dj2 | = |Dj1 ∩ Dj2 ∩ Ci | = |Dj1 ∩ Dj2 ∩ Ci1 ∩ Ci2 | = |Dj1 ∩ Dj2 ∩ Ci1 ∩ Ci2 ∩ Ci3 | = |Dj1 ∩ Dj2 ∩ Dj3 | = |Dj1 ∩ Dj2 ∩ Dj3 ∩ Ci | = |Dj1 ∩ Dj2 ∩ Dj3 ∩ Ci1 ∩ Ci2 | =

1092

  10 + 2 2   10 + 1 = 11 1   10 + 0 =1 0   5+4 4   5+3 3   5+2 2   5+1 =6 1   4 4   3 3   2 2

We apply the Principle of Inclusion-Exclusion. The total number of arrangements is 15! times         19 5 18 5 14 − + 4 1 3 1 4           5 17 5 4 13 5 9 + + + 2 2 1 1 3 2 4               5 16 5 3 12 5 3 8 5 4 − + + + 3 1 2 1 2 2 1 3 3 4                5 4 3 5 3 7 5 2 11 5 15 + + + + 2 2 2 3 1 1 4 0 1 3 3        5 5 6 5 − + + 4 3 1 2 This alternating sum can be shown to have the same value as that obtained in the previous solution.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1093

4. [17, Exercise 5.2.12] Find the solution to an = 2an−1 + an−2 − 2an−3 for n = 3, 4, 5, . . ., with initial conditions a0 = 3, a1 = 6, a2 = 0. Solution: The characteristic polynomial of this equation is x3 − 2x2 − x + 2, i.e. (x + 1)(x − 1)(x − 2), so the roots are −1, 1, 2, each of multiplicity 1. The general solution is an = A(−1)n + B1n + C2n . Imposing the three initial conditions yields the 3 equations A+B+C = 3 −A + B + 2C = 6 A + B + 4C = 0 having solution (A, B, C) = (−2, 6, −1), so the particular solution to the given recurrence satisfying the stated initial conditions is an = −2(−1)n + 6 − 2n . 5. Let |A| = n. Showing all your work, determine the numbers of relations in A × A (i.e. binary relations on A) which have each of the following properties: (a) symmetry (b) reflexivity (c) symmetry and reflexivity (d) antisymmetry, and are not reflexive (e) (for n = 4 only) reflexivity and symmetry and transitivity (f) no restriction at all (i.e. count all relations) Solution: We will solve this problem, where convenient, by referring to the matrix representation. (a) A relation is symmetric iff it adjacency matrix is symmetric. Pair off the corresponding off-diagonal entries in an n × n-matrix. A relation is symmetric iff both members of each of these n2 pairs are related, or both are not related. We also may include or exclude each of the n diagonal  entries. The n n+1 total number of inclusions and exclusions is n + 2 = 2 . These are all n+1 independent, so, by the Product Rule, the number of relations is 2( 2 ) . (b) Reflexivity corresponds to the presence of 1’s throughout the main diagonal of the adjacency matrix. All other entries are unconstrained, so the total 2 number of relations is 2n −n . (c) For symmetry and reflexivity both, the diagonal entries are now determined, and the off-diagonal entries are determined in pairs — either both are present, n or neither. The total number of relations, again by the Product Rule, is 2( 2 ) . UPDATED TO September 19, 2000

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1094

(d) Antisymmetry is independent of reflexivity. The off-diagonal entries, considered in symmetrically located pairs, must be either both 0, or just one 1 and n the other 0. There are thus 3 choices for each of these pairs, or 3( 2 ) choices in all. For each of these choices the main diagonal of the matrix may be anything except all 0’s: there are thus 2n − 1 choices for the main diagonal. By the product rule, the total number of antisymmetric but non-reflexive relations is n 3( 2 ) (2n − 1). (e) The three stated properties define an equivalence relation. We know that the equivalence classes partition the set A; and that, conversely, any partition of A gives rise to an equivalence relation. Thus we need only count the partitions (cf. [17, Exercise 6.5.43]). 4 = 4. There is only one way to partition A into one subset. The number of relations is 1.  4 = 3 + 1. We can partition A into a 3-subset and a 1-subset in 43 = 4 ways.  4 = 2 + 2. This case requires some thought. There are 42 = 6 ways to choose a subset of 2 elements from among the 4 elements of A. But this counts each partition twice: any 2 points can appear as members of the subset “selected”, or as members of the subset “discarded”; indeed, the multiplicity of the count is 2! = 2; dividing by 2 yields 3 distinct partitions of A into two subsets, each having 2 members.  4 = 2 + 1 + 1. Select the subset with 2 members in 42 = 6 ways; then the remaining 2 points must each be treated the same way. The total number of partitions is 6. 4 = 1 + 1 + 1 + 1. All points are treated the same; the total number of partitions is 1. In all we have 1 + 4 + 3 + 6 + 1 = 15 distinct partitions of A, hence 15 distinct equivalence relations. 2

(f) This is simply the number of n × n 0 − 1-matrices, i.e. 2n . 6. [17, Exercise 6.3.8] Let R1 and R2 be relations on a set matrices    0 1 0 0 MR1 =  1 1 1  and MR2 =  0 1 0 0 1

A, represented by the  1 0 1 1 . 1 1

Showing all your work, determine the matrices representing each of the following relations: (a) R1 ∪ R2 .

Notes Distributed to Students in Mathematics 189-240A (2000/2001) (b) (c) (d) (e) (f)

1095

R1 ∩ R2 . R1 ◦ R2 . R2 ∪ R1 . R1 ◦ R1 . R1 ⊕ R2 .

Solution: (a) The entry in any specific location is found by taking the maximum of the   0 1 0 entries in that position in the given matrices. Hence MR1 ∪R2 =  1 1 1  . 1 1 1 (b) Analogously to the previous case, e take the  minimaof corresponding entries 0 1 0 in the two matrices, to obtain MR1 ∩R2 =  0 1 1  . 1 0 0   1 1 1 (c) MR1 ◦R2 =  1 1 1  . 1 1 1 (d) same as part (a) (e) R1 ⊕ R2 . An entry is 1 iffthe entriesin that position in the two given matrices 0 0 0  are different. MR1 ⊕R2 = 1 0 0  . 0 1 1 7. (a) [17, Exercise 6.5.10] Let R be the relation on the set of ordered pairs of positive integers such that ((a, b), (c, d)) ∈ R iff ad = bc. Show that R is an equivalence relation. (b) For the relation induced by R on the set of pairs (a, b) where 1 ≤ a ≤ 3 and 1 ≤ b ≤ 3, sketch the directed graph. Solution: (a) Reflexivity. For any ordered pair (a, b), since ab = ba, ((a, b), (a, b)) ∈ R. Symmetry. ∀a∀b∀c∀d ((a, b), (c, d)) ∈ R ⇔ ad = bc by definition of R ⇔ cb = da by commutativity of integer multiplication ⇔ ((c, d), (a, b)) ∈ R by definition of R

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1096

Transitivity. Suppose that ((a, b), (c, d)) ∈ R and ((c, d), (e, f )) ∈ R. Then ad = bc, cf = de. Hence adf = bcf = bde, so af = be, implying that ((a, b), (e, f )) ∈ R. (b) The digraph has 9 points, at each of which there is a loop. In addition, the points (1, 1), (2, 2), (3, 3) are mutually adjacent by pairs of directed edges — as these three points constitute one equivalence class. There are no other related pairs. 8. [17, Exercise 6.6.28] (a) Show that there is exactly one greatest element of a poset, if such an element exists. (b) Show that there is exactly one least element of a poset, if such an element exists. Solution: (a) For the poset (S, ), suppose that both x and y are greatest elements. Then ∀a[a  x]

and

∀b[b  y]

(47)

Specializing a := y and b := x in (47) yields y  x and x  y; by the antisymmetry of , these statements imply x = y. (b) The “dual” of the preceding result. 9. (cf. [17, Exercise 6.6.32]) Determine which of the following posets are lattices. (a) {1, 3, 6, 9, 12}, where the order relation is divisibility (b) {1, 3, 6, 9, 12}, where the order relation is the usual ordering ≤ of the real numbers (c) {1, 5, 25, 125}, where the order relation is divisibility (d) (Z, ≥) (e) (P (S), ⊇). where P (S) is the power set of a set S. Solution: (a) This is not a lattice, since lcm(6, 9) is not present. (b) This is a totally ordered set with 4 elements, hence a lattice (cf. [17, Exercise 6.6.38]). (c) as the preceding case (d) again, a totally ordered set (e) This is a lattice, cf. [17, Example 6.6.23].

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

C.5

1097

Solved Problems from the Fifth 1996 Problem Assignment

1. [17, Exercise 7.2.*36, p. 449] Using the calculus or otherwise show that, if G = (V, E) is a bipartite simple graph with |V | vertices and |E| edges, then |E| ≤ 14 |V |2 . Solution: Since G is bipartite, we may assume that V = V1 ∪V2 , where V1 ∩V2 = , and every edge joins a vertex of V1 with a vertex of V2 . Hence the maximum number of edges is |V1 | · |V2 | = |V1 |(|V | − |V1 |). The problem reduces to determining the maximum value of the function f (x) = x(|V | − x) as x ranges over the integers between 0 and |V |, inclusive. We broaden the domain to permit x to be any real number. Then  2 1 2 1 1 f (x) = |V | − x − |V | ≤ |V |2 . 4 2 4 This could also have been solved using the calculus. Since f 0 (x) = |V | − 2x, and f ” (x) = −2 < 0, f attains a maximum at x = 12 |V |; as f 12 |V | = 14 |V |2 , the number of edges in a bipartite graph on |V | vertices cannot exceed 14 |V |2 . j 2k [With greater care we could show that the maximum number of edges is |V4| .] 2. (a) [17, Exercise 7.3.28] Showing all your work, determine the value of the sum of the entries in any row of the adjacency matrix of an undirected graph. (b) [17, Exercise 7.3.28] Showing all your work, determine the value of the sum of the entries in any row of the adjacency matrix of a directed graph. (c) [17, Exercise 7.3.30] Showing all your work, determine the value of the sum of the entries in a row of the incidence matrix of an undirected graph. (d) Showing all your work, determine the value of the trace 18 of the square of the adjacency matrix of an undirected graph. Solution: (a) The entries in the ith row of the adjacency matrix represent the numbers of edges connecting the ith vertex to each vertex. The sum is the valency or degree of the ith vertex. If there are loops at the ith vertex, each of them contributes 2 to the degree. (b) The sum of the entries in the ith row will be the out-degree of the ith vertex. (c) Each 1 in the ith row of the incidence matrix represents incidence of the ith vertex with one edge; hence the sum of the entries is the degree of that vertex. Here again, each loop at the ith vertex contributes 2 to the degree. 18

trace = sum of the entries in the main diagonal

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1098

(d) By [17, Theorem 7.4.1, p. 468], the entry in position (i, i) of the square of the adjacency matrix gives the number of paths of length 2 originating and terminating at vertex i. Where the graph is simple — i.e. has neither loops nor multiple edges — then each path of length 2 from i to i corresponds to an edge at i, which is traversed in both directions; and conversely. Thus, in such a case, the sum of the diagonal entries is just the sum of the degrees in the graph, i.e. twice the number of edges in the graph. Where the graph has multiple edges and/or loops, the entry in position (i, i) of the square of the adjacency matrix is the sum of the squares of the numbers of edges joining i to each of the vertices (including the square of the number of loops at i). Then the trace is the sum of these sums, i.e. the sum of the squares of all entries in the adjacency matrix. 3. [17, Exercise 7.7.12] Suppose that a connected planar graph has 30 edges. If a planar representation of this graph divides the plane into 20 regions, determine how many vertices this graph has. Solution: Let v be the number of vertices. By Euler’s formula [17, Theorem 7.7.1, p. 502], v − 30 + 20 = 2, hence v = 12. (One graph with this property is the graph formed by the vertices and edges of the icosahedron — the regular “Platonic” solid having 20 triangular faces, 5 meeting at each of the 12 vertices.) 4. [17, Exercise 7.7.28] Show that K3,3 has 2 as its thickness.19 Solution: First we observe [17, Example 7.7.6, p. 505]20 that K3,3 is not planar; hence the thickness is at least 2. If K3,3 = ({1, 2, 3, 4, 5, 6}, {(i, j)|1 ≤ i ≤ 3; 4 ≤ j ≤ 6}), then the graph can be decomposed into G1 = ({1, 2, 3, 4, 5, 6}, {(i, j)|1 ≤ i ≤ 3; 4 ≤ j ≤ 5}) G2 = ({1, 2, 3, 4, 5, 6}, {(1, 6), (2, 6), (3, 6)}) The first of these graphs is surely planar, since it consists of three paths of length 2 all joining vertex 4 to vertex 5; the second graph consists of some isolated vertices (whose presence does not affect planarity) and a star consisting of vertex 6 joined to each of vertices 1, 2, 3. 19

[17, p. 509] The thickness of a simple graph G is the smallest number of planar subgraphs of G that have G as their union. 20 The “proof” given in [17, Example 7.7.3, pp. 500–501], is not rigorous.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1099

5. [17, Supplementary Exercise *46, p. 527] Showing all your work, determine the independence number 21 of each of the following graphs: (a) Kn (b) Cn (c) Qn (d) Km,n Solution: (a) As every pair of vertices are adjacent, no more than 1 vertex may be in any independent set. The independence number is 1. (b) No 2 adjacent verticesinthe cycle may be chosen; hence the indepence number of Cn cannot exceed n2 . When n is even, this is indeed attained: the graph is bipartite. When n is odd, here again the number is attained: just omit one vertex and alternately choose half of the others. (c) The vertices of Qn are [17, p. 441] the binary strings of length n; two vertices are adjacent if they differ in exactly one bit position. One independent set consists of all vertices whose number of 1’s is even: this contains exactly half of the 2n vertices. We prove by induction on n that this set attains the maximum cardinality for all independent sets of vertices. Basis Step. Q1 = K2 , which has, by a preceding part, independence number equal to 1 = 21−1 . Inductive Step. An independent set will induce (by intersection) an independent set in any subgraph. Take as subgraphs of Qn+1 two copies of Qn spanned respectively by the vertices with final coordinate 0, and the vertices with final coordinate 1. By the induction hypothesis neither of these independent sets can have more than 2n−1 vertices, hence their union cannot contain more than 2 × 2n−1 = 2(n+1)−1 vertices, as claimed. (d) We cannot choose vertices from both “colour classes” of the bipartite graph. Hence the independence number cannot exceed max{m, n}. But all the vertices in one or other of these classes are independent, so this maximum is surely attained as the independence number. 6. (a) Determine, in a systematic way, all undirected graphs with vertex-set {1, 2, 3}. These graphs may not have loops (edges whose ends coincide), nor multiple edges. 21 22

independence number = maximum number of vertices in an independent 22 set of vertices [17, p. 527] independent set of vertices = a set of vertices in which no two are adjacent

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1100

(b) Isomorphism of graphs is an equivalence relation. For graphs on 3 vertices, determine all equivalence classes under this equivalence relation. Again, graphs may have neither loops nor multiple edges. (c) Determine, all digraphs having the vertex set {1, 2, 3}. Your digraphs must have no loops, nor may two vertices be connected by directed edges in both directions. (d) Determine all equivalence classes of digraphs having 3 vertices. Solution: (a) While these graphs could be represented in various ways, we shall use adjacency matrices for the purpose. (Incidence matrices would not be ideal, since in these the edges as well as the vertices are labelled. We would require some routine to avoid counting the same graph twice because of a permutation of the columns.) The only entries that can be non-zero are the off-diagonal ones; and these must be 0 or 1 in symmetric pairs. There are thus 3 such pairs — corresponding to the possible edges {1, 2}, {1, 3}, {2, 3}. Each of these edges may be present or absent, independently of the others. By the Product Rule there will be 23 = 8 graphs on these labelled vertices. We could represent each by the 3-digit binary word from positions (1, 2), (1, 3), (2, 3) in the adjacency matrix. We list the adjacency matrices in that order below:         0 0 0 0 1 0 0 0 1 0 1 1  0 0 0   1 0 0   0 0 0   1 0 0   0 0 0   0 0 0   1 0 0   1 0 0  0 0 0 0 1 0 0 0 1 0 1 1  0 0 1   1 0 1   0 0 1   1 0 1  0 1 0 0 1 0 1 1 0 1 1 0 (b) There is just one graph above having 3 edges, namely, the graph having structure K3 . There are 3 isomorphic graphs having 2 edges; all have the structure of a path of length 2. There are 3 isomorphic graphs having 1 edge and an isolated vertex; these are the complements of the paths of length 2. Finally, there is just one graph with 0 edges: having 3 isolated vertices. (c) These digraphs could be determined by analysis of the adjacency matrices, as we did above for undirected graphs. There would be, for each of the symmetric pairs of entries off the main diagonal, precisely 3 (i.e. 22 − 1) possible values — all except the presence of edges in both directions. Hence the total number of such digraphs is 33 = 27. We describe them in terms of the isomorphism classes enumerated below.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1101

The cyclic triangle23 may be labelled in (3 − 1)! = 2! = 2 ways. The vertices of a transitive triangle24 may be labelled in 3! ways — the number of ways of selecting the ends of the path of length 2. There are thus 8 digraphs on 3 vertices having three edges. The consistently oriented path of length 2 may also be oriented in 3! ways. The digraph consisting of 2 edges directed into a single vertex may be oriented in 3 ways; likewise the digraph with 3 edges directed outward from a single vertex. There are thus 6 + 3 + 3 = 12 digraphs on 2 edges. For digraphs with just one edge there are 3! ways of orienting: choose the isolated vertex in 3 ways; then orient the edge joining the other vertices in 2! ways: 6 digraphs in all. Finally, the digraph with no edges is unique. Summming, we have 8 + 12 + 6 + 1 = 27 digraphs, as predicted. (d) The undirected graphs on 3 vertices may be directed as follows. The complete graph, K3 , may be oriented in just 2 ways: either all edges are consistently oriented — giving a cyclic triangle; or the direction reverses once — giving a transitive triangle.25 The path of length 2 may be oriented in 3 ways: as a consistently oriented path of length 2; as a pair of directed edges both directed into one vertex; and as a pair of directed edges both directed out from one vertex. There is only one way in which a graph on one edge may be oriented. There is also only one way in which a graph with 0 edges may be oriented. In all we have 2 + 3 + 1 + 1 = 7 equivalence classes of digraphs. 7. [17, Exercises 7.5.36, 7.3.54] Determine for which values of n the following graphs have i. an Euler circuit ii. a Hamilton circuit iii. a colouring of the vertices in m colours 23 The orientation of a triangle in which all directed edges are “consistently” oriented, so that there is a directed circuit of length 3. 24 Any orientation of K3 in which there is no directed circuit; so named because there will be always be a directed path of length 2, and a third edge directed from the initial vertex of this path to its terminal vertex, as suggested by the property of transitivity of a binary relation. 25 These digraphs which are orientations of a complete graph are called tournaments, after round robin tournaments where each player in a 2-person game plays every other player, and a directed edge can be used to record the result of the match.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1102

(a) Kn (b) Cn (c) Wn (d) Qn Solution: (a)

i. Kn is a connected regular graph. It has an Euler circuit iff the common valency is even, i.e. iff n − 1 is even i.e. iff n is odd. ii. Every permutation of the vertices gives rise to a Hamilton circuit of Kn . iii. If m < n, the Pigeonhole Principle would ensure that two adjacent vertices had the same colour. Hence m ≥ n, For such values of n there will always exist an m-colouring: just be sure never to use a colour on more than one vertex.

(b)

i. Cn is an Euler circuit ii. Cn is a Hamilton circuit. iii. If m ≤ 1 there can be no colouring, since the presence of edges entails having at least 2 colours. Cn will have an m-colouring iff n is even. When m ≥ 3 there always exists an m-colouring, (as we don’t have to use all the colours available to us).

(c)

i. For Wn to have an Euler circuit, all vertices must have even degree — in particular the “hub” of the wheel, whose valency is n. Thus it is necessary for the existence of an Euler circuit that n be even. This, however, is not sufficient, as all vertices along the “rim” of the wheel have valency 3. Thus no wheel is Eulerian. ii. An obvious Hamilton circuit in a wheel is obtained from a circuit around the rim by deleting one rim edge and detouring through the hub. iii. The wheel Wn consists of a single vertex — the hub — adjacent to all vertices of a circuit Cn . The hub must, therefore, have a colour different from all the rim vertices. There can be no colourings of a wheel with fewer than 3 colours; and 3 colours suffice only when n is even. When n is odd, 4 colours are required, and suffice. i. Qn has valency n. There cannot exist an Euler circuit unless n is even. Then, since Qn is connected, there will always exist an Euler circuit. ii. The existence of a Hamilton circuit can be proved by induction (cf. [17, Exercise 7.5.*57, pp. 487, S–56].

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1103

iii. Qn is bipartite: no two vertices whose weight 26 is even are adjacent; likewise odd. Hence an m colouring exists when m ≥ 2n for all n. No colourings exist for m < 2.

26

number of coordinates equal to 1

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

D D.1

1104

Solutions to 1997 Assignment Problems Solved Problems from the First 1997 Problem Assignment

In all of the following problems, unless you are instructed otherwise, you are expected to show your work and to prove every statement. 1. (a) [17, Exercise 1.2.24] Find a compound proposition involving the propositions p, q, and r that is true when p and q are true and r is false — the three conditions being satisfied simultaneously — but is false otherwise. (Hint: Use a conjunction of each proposition or its negation. [There are, however, other ways to attack this problem.]) (b) [17, Exercise 1.2.26] Suppose that a truth table in propositional variables pi (i = 1, 2, ..., n) is specified; thus the table has 2n rows. Show that a compound proposition with this truth table can be formed by taking the disjunction of conjunctions of the variables or their negations, with one conjunction included for each combination of values for which the compound proposition is true. The resulting compound proposition is said to be in disjunctive normal form. (c) Express in disjunctive normal form: φ = (¬p → r) → (q ↔ p). (d) Find a conjunction of disjunctions that is logically equivalent to the proposition φ defined above. (Hint: First apply the preceding method to ¬φ.) Solution: Many students may have found the second part of this problem difficult. That should not be surprising, since you were being asked to “discover” a theorem, based on some minimal evidence in the first part. The purpose of the problem was to expose those who ultimately solved the problem to the euphoria of solution, and the others to the frustration of failure. These are normal events in the learning of mathematics. These problems were intended as a learning experience, not as a test!

(a) The proposition is logically equivalent to p ∧ q ∧ ¬r. (b) The rows of the truth table correspond to the 2n possible combinations of truth values. We can express φ as a disjunction of propositions, each of which is associated with one row of the table for which φ is true, in the sense that it is true precisely when the elementary variables have the values shown in that row. The proposition associated with a row in which pi is true will have a conjuncted factor pi ; and, where pi is false, the conjuncted factor will be ¬pi . Thus the conjunction of these literals is true precisely when the elementary propositions have the values of that row, and in no other case.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1105

(c) We set up a truth table: p T T T T F F F F

q T T F F T T F F

r T F T F T F T F

¬p ¬p → r q ↔ p (¬p → r) → (q ↔ p) F T T T F T T T F T F F F T F F T T F F T F F T T T T T T F T T

Rows ##1, 2, 6, 7, 8 of the table are the only ones where the proposition is true: we associate with each a conjunction of “literals”, and form the disjunction: (p ∧ q ∧ r) ∨ (p ∧ q ∧ (¬r)) ∨ ((¬p) ∧ (¬q) ∧ r) (48) ∨((¬p) ∧ q ∧ (¬r)) ∨ ((¬p) ∧ (¬q) ∧ (¬r)) . (d) You are being asked to find an equivalent proposition in conjunctive normal form. One way to proceed is to apply the previous procedure to ¬φ; then negate and apply the De Morgan and Double Negation Laws: what was a disjunction of conjunctions will become a conjunction of disjunctions. The truth table for ¬φ will have 3 rows in which ¬φ is true, corresponding to rows ##3, 4, 5 in the preceding table. This leads to the following expression for ¬φ: (p ∧ (¬q) ∧ r) ∨ (¬p ∧ q ∧ r) ∨ (p ∧ ¬q ∧ ¬r). Forming its complement yields (¬p ∨ q ∨ ¬r) ∧ (p ∨ ¬q ∨ ¬r) ∧ (¬p ∨ q ∨ r) , (49) which is logically equivalent to φ, and in the desired form. Note that, since r ∧ (¬r) is logically equivalent to F (sometimes called one of the Complementation Laws), ((p ∨ ¬q) ∨ r) ∧ ((p ∨ ¬q) ∨ (¬r)) is logically equivalent to (p ∨ ¬q) ∨ F (by a Distributive Law), which is, in turn, logically equivalent to p ∨ ¬q, by an Identity Law. Thus an equivalent proposition to (49) is (p ∨ ¬q) ∧ (¬p ∨ q ∨ r) also in conjunctive normal form. 2. (a) [17, Supplementary Exercise 8, p. 94] Let P (x, y) be a propositional function. Show that the implication (∃x∀yP (x, y)) → (∀y∃xP (x, y)) is a tautology.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1106

(b) [17, Supplementary Exercise 10, p. 94] If ∀y∃xP (x, y) is true, does it necessarily follow that ∃x∀yP (x, y) is true? Solution: (a) As a hypothesis, assume that ∃x∀yP (x, y) is true. That asserts the existence of some x0 such that ∀yP (x0 , y) is true. Hence, for any y, there does indeed exist an x (namely x0 ) such that P (x, y); i.e. ∀y∃xP (x, y). (b) We are asked to investigate the converse of the preceding implication. The hypothesis that for every y there should exist an x does not guarantee that it is the same x for the various y’s. Here is a counterexample to the alleged implication: In the universe of all real numbers, define P (x, y) to mean x < y. Then the hypothesis states that for every real number y there exists a smaller number x. We cannot conclude, however, that there exists a real number x which is smaller than all real numbers. (For one thing, x could not be smaller than x.) 3. A function f : → is said to have limit27 A as the variable approaches infinity (written lim f (x) = A) if, for every positive real number h, there exists a real x→∞

number N such that x > N ⇒ |f (x) − A| < h. Use the universal and/or existential quantifiers, i.e. ∀ and ∃, to write symbolically the statement The function f (x) has no limit as x → ∞. Take as universe for the quantifiers the set

.

Solution: The definition translates to ¬(∃A(∀h((h > 0) → (∃N (∀x((x > N ) → (|f (x) − A| < h))))))) . Other equivalent statements are possible; for example, the →’s can be replaced by equivalent formulations, also ¬ can be “pushed inside”. ∀A(¬(∀h((h > 0) → (∃N (∀x((x > N ) → (|f (x) − A| < h))))))) ; ∀A(∃h(¬((h > 0) → (∃N (∀x((x > N ) → (|f (x) − A| < h))))))) . 4. (a) [17, Exercise 1.4.18] Determine all possible ordered pairs of sets (A, B) such that A × B = . 27

Remember, Calculus III is a corequisite for 189-240.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1107

(b) Determine all possible ordered triples of sets (A, B, C) such that (A × B) ∪ (B × C) ∪ (C × A) =

.

(50)

Solution: (a) The statement A × B = asserts that there can exist no a ∈ A, b ∈ B such that there is an ordered pair (a, b). But any element a ∈ A may be associated with any element b ∈ B to yield such an ordered pair. Thus, if the cartesian product is empty, it must be impossible to find both an element of A and an element of B — i.e. at least one of A and B must be empty. And, as observed in [17, Exercise 1.4.19], this condition is also sufficient for the cartesian product to be empty. The answer is therefore Either A =

and B is any set, or A is any set and B =

.

(b) For a union to be empty each of the sets in the union must be empty. Hence, by the preceding part, the given condition implies that at least one of A, B is empty and at least one of B, C is empty and at least one of C, A is empty. It is thus certainly necessary that at least one of A, B, C should be empty. This, however, would not be enough. For example, if A = and B 6= 6= C, the second condition above would not be satisfied. If follows that at at least two of A, B, C must be empty. This condition, which we have proved to be necessary, would also be sufficient to make all three unions empty, hence to satisfy (50). 5. (cf. [17, Exercises 1.5.11, 1.5.12]) Show that if A, B, C are sets, then A∪B∪C = A∩B∩C (A − B) − C ⊆ A − C A ⊕ (B ⊕ C) = (A ⊕ B) ⊕ C

(51) (52) (53)

(The symmetric difference [17, p. 56] A ⊕ B of sets A and B is defined to consist of those elements in either A or B, but not in both.) (a) by showing, as required, that one side is contained in the other; and (b) by using a membership table. While a proof using a membership table is staightforward, the type of proof envisioned in part (a) is technically more difficult, and you may not have the “machinery” to prove every step rigorously, so you will be permitted to rely on intuitive statements here. Should you wish to prove it rigorously without a membership

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1108

table, you may find it necessary to use, in the course of part of your solution, the “Rule of Inference” p ∧ q ⇒ p [17, Simplification Rule, Table 1, p. 170]. Solution: (a) (51) Each of the following implications is, in fact, reversible. Thus, while we are proving A∪B∪C ⊆A∩B∩C we can obtain as a corollary to this proof the inclusion A∪B∪C ⊇A∩B∩C Alternatively, we could combine the two proofs by replacing each ⇒ by ⇔ in the following proof. x∈A∪B∪C ¬(x ∈ A ∪ B ∪ C) definition of complementation ¬((x ∈ A) ∨ (x ∈ B) ∨ (x ∈ C)) definition of ∪ (¬(x ∈ A)) ∧ (¬(x ∈ B)) ∧ (¬(x ∈ C)) de Morgan Laws (x ∈ A) ∧ (x ∈ B) ∧ (x ∈ C) definition of complementation x∈A∩B∩C definition of intersection

⇒ ⇒ ⇒ ⇒ ⇒

Hence A ∪ B ∪ C ⊆ A ∩ B ∩ C. (52)

⇒ ⇒ ⇒ ⇒

x ∈ (A − B) − C (x ∈ (A − B)) ∧ (¬(x ∈ C)) definition of (A-B)-C ((x ∈ A) ∧ (¬(x ∈ B))) ∧ (¬(x ∈ C)) definition of A-B (x ∈ A) ∧ (¬(x ∈ B)) ∧ ¬(x ∈ C)) associativity of ∧ (x ∈ A) ∧ (¬(x ∈ C)) ∧ ¬(x ∈ B)) commutativity of ∧

(54) (55) (56) (57) (58)

At this stage in the proof we would like to replace ¬(x ∈ C)) ∧ ¬(x ∈ B) by ¬(x ∈ C). If that can be justified, we will have the desired conclusion. But how can we justify this transformation? We do know that (¬(x ∈ C)) ∧ (¬(x ∈ B))) ⇒ (¬(x ∈ C)) ;

(59)

this is an instance of the so-called Rule of (Conjunctive) Simplification 28 . To make our proof rigorous we have to apply this Rule of (Conjunctive) 28

p ∧ q ⇒ p, i.e.

p∧q . p

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1109

Simplification more carefully. We begin with statement (58) and first apply the associativity of ∩: ((x ∈ A) ∧ ¬(x ∈ C)) ∧ ¬(x ∈ B)

(60)

and then apply the Rule of (Conjunctive) Simplification to conclude that (x ∈ A) ∧ (¬(x ∈ C)) which, by definition of −, is equivalent to x ∈ A−C. Thus (A−B)−C ⊆ A − C. (53) For any sets R, S, R⊕S = = = = = =

(R ∪ S) − (R ∩ S) definition of ⊕ (R ∪ S) ∩ R ∩ S [17, Exercise 1.5.13] (61) (R ∪ S) ∩ (R ∪ S) de Morgan Laws (R ∩ R) ∪ (R ∩ S) ∪ (S ∩ R) ∪ (S ∩ S) by distributivity ∪ (R ∩ S) ∪ (R ∩ S) ∪ (R ∩ S) ∪ (R ∩ S) (62)

Applying the foregoing twice we have A ⊕ (B ⊕ C) = (A ∩ B ⊕ C) ∪ (A ∩ (B ⊕ C))

(63) (64)

= (A ∩ (B ∩ C) ∪ (B ∩ C)) ∪ (A ∩ ((B ∩ C) ∪ (B ∩ C)))

(65)

(A ∩ (B ∩ C) ∩ (B ∩ C)) ∪ (A ∩ ((B ∪ C) ∪ (B ∩ C))) (66) (A ∩ (B ∪ C) ∩ (B ∪ C)) ∪ (A ∩ ((B ∪ C) ∪ (B ∩ C))) (67) (A ∩ (B ∪ C) ∩ (B ∪ C)) ∪ ((A ∩ (B ∩ C) ∪ (A ∩ B ∩ C)) (68) (A ∩ ((B ∩ B) ∪ (C ∩ B) ∪ (B ∩ C) ∩ (C ∩ C))) ∪(A ∩ (B ∩ C) ∪ (A ∩ B ∩ C)) (69) = (A ∩ ( ∪ (C ∩ B) ∪ (B ∩ C) ∪ )) ∪(A ∩ (B ∩ C) ∪ (A ∩ B ∩ C)) (70) = (A ∩ ((C ∩ B) ∪ (B ∩ C))) ∪ (A ∩ (B ∩ C) ∪ (A ∩ B ∩ C)) (71) = (A ∩ C ∩ B) ∪ (A ∩ B ∩ C) ∪ (A ∩ B ∩ C) ∪ (A ∩ B ∩ C) (72) = = = =

Thus we see that the set is expressed as the union of the 4 disjoint sets in which an element can be a member of precisely an odd number of A, B, C. By the symmetry of this expression, we can expect to obtain precisely

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1110

the same list if we begin with C ⊕ (A ⊕ B), which, but for a change in order, is the right side of the alleged set equation. But the change of order can be seen to be irrelevant from (62) and the symmetry of ∩ and ∪. This proves both set inclusions A ⊕ (B ⊕ C) ⊆ (A ⊕ B) ⊕ C A ⊕ (B ⊕ C) ⊇ (A ⊕ B) ⊕ C (b) (51) A F F F F T T T T

B F F T T F F T T

C F T F T F T F T

A T T T T F F F F

B T T F F T T F F

C T F T F T F T F

A∪B∪C A∪B∪C A∩B∩C F T T T F F T F F T F F T F F T F F T F F T F F

As the last two columns are identical, A ∪ B ∪ C and A ∩ B ∩ C have identical memberships. (52) A B C A − B (A − B) − C A − C F F F F F F F F T F F F F T F F F F F F F F T T T T T T F F T F F T F T F F T T T F F F F T T T As there is a T in the last column whenever there is a T in the preceding column, the desired inclusion must hold.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1111

(53) A F F F F T T T T

B F F T T F F T T

C F T F T F T F T

B ⊕ C A ⊕ (B ⊕ C) A ⊕ B (A ⊕ B) ⊕ C F F F F T T F T T T T T F F T F F T T T T F T F T F F F F T F T

As columns ##5, 7 are identical, the desired identity must hold. 6. [17, Exercise 1.6.17] If g : A → B and f : B → C are given functions such that f and f ◦ g are injective, does it follow that g is injective? If your answer is YES, then prove it; if it is NO, give an example to prove that the statement is not always true. Solution: The statement is TRUE. g(x) = g(y) ⇒ f (g(x)) = f (g(y)) ⇒ (f ◦ g)(x) = (f ◦ g)(y) by definition of composition f ◦ g ⇒ x=y since f ◦ g is injectuve Since the preceding implication is true for all x and for all y, g is injective (cf. [17, Definition 5, p. 61]). Note that the hypothesis that f be injective is not required! 7. Let f : B → C be any function from B to C. Prove or disprove the following properties of the identity functions [17, p. 64]. (a) ιC ◦ f = f = f ◦ ιB (b) The only function h : B → B with the property that f = f ◦h for all functions f : B → C is ιB . [Note: To prove that functions λ : U → V , µ : W → X are equal (written simply λ = µ) you must show • that the domains are the same, i.e. U = W ; • that the codomains are the same, i.e. V = X; and • that the actions of the functions are the same, i.e. (∀x ∈ U )(λ(x) = µ(x)).] Solution:

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1112

(a) By definition, the composition f ◦ g of functions g : A → B and f : B → C has domain A and codomain C. Thus all three of f , ιC ◦ f , and f ◦ ιB have domain B and codomain C; to prove the three functions are equal we must demonstrate that they all act the same on a general point x ∈ B. (ιC ◦ f )(x) = = = =

ιC (f (x)) f (x) f (ιB (x)) (f ◦ ιB )(x)

definition of composition definition of ιC definition of ιB definition of composition

(73) (74) (75) (76)

proving that the three functions act identically on any x ∈ B. (b) The statement ((∀f : B → C)(f ◦ h = f )) ⇒ (h = ιB )

(77)

need not be true. For example, suppose that B = {a, b}, C = {c}. Then there is only one possible function f : B → C, and f = f ◦ ιB = f ◦ h is just the “constant” mapping on to c; this is true even if h is the function given by f (a) = b, h(b) = a, which is certainly not the identity function. The preceding is all that was expected of students at this stage. However, we can characterize precisely when (77) is true. Suppose that for some function f it is possible to find a function g : C → B such that f ◦ g = ιC , g ◦ f = ιB . Then it can be shown easily that h = ιB . It can be shown that such a g exists precisely when f is injective. So the question reduces to determining whether, for given sets B and C, there exists an injective function f : B → C. This can be seen to occur precisely when |B| ≤ |C|.

D.2

Solved Problems from the Second 1997 Problem Assignment

1. [The contents of [17, §§2.3, 2.4] form a part of the syllabus of the successor course to 189-240A, namely 189-340B. For the purposes of this course you need to be familiar with some of the concepts in these sections, only to the extent that they are applied in subsequent sections. While some parts of [17, §§2.3, 2.4] will be discussed briefly in the lectures, this relatively easy exercise is intended to be solved after reading [17, §2.3] on your own. It is not expected that your solutions should be elegant or short; please do not use a calculator or computer.] (a) [17, Exercise 2.3.14] For each of the positive integers n ≤ 12 determine all positive integer divisors; based on this information, list the positive integers n ≤ 12 which are relatively prime to 12.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1113

(b) [17, Exercise 2.3.12] Determine the number of zeros at the end of the decimal representation of the integer 100!. (c) (cf. [17, Exercise 2.3.28]) Determine all integers n that are congruent to 4 modulo 12; i.e. the set of all solutions to the congruence n≡4

(mod 12)

(d) [17, Exercise 2.3.32] Show that if a, b, c, d, m are integers such that m ≥ 2 a ≡ b (mod m) c ≡ d (mod m) ,

(78) (79) (80)

a − c ≡ b − d (mod m) .

(81)

then Solution: (a) We can, by repeated attempted division, determine all the positive prime factors of 1, 2, ..., 12; these can then be combined to determine all the positive divisors. n prime factorization positive factors 1 1 1 2 21 1, 21 3 31 1, 31 4 22 1, 21 , 22 1 5 5 1, 5 1 1 6 23 1, 21 , 31 , 21 31 1 7 7 1, 71 8 23 1, 21 , 22 , 23 9 32 1, 31 , 32 1 1 10 25 1, 21 , 51 , 21 51 11 111 1, 111 12 22 3 1 1, 21 , 22 , 31 , 21 31 , 22 31 By comparing the lists of divisors of n with those of 12, or otherwise, we can see that the integers relatively prime to 12 are 1,5, 7, 11. (b) The number of zeros at the end of a decimal representation of an integer n is equal to the maximum integer m such that 10m divides n. If n = 2r 3s 5t ..., m = min{r, t}. The exponents r and t will be respectively the sums of the exponents of 2 and 5 in the prime decompositions of 1, 2, ..., 100. In this list

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1114

the multiples of 5 are 5, 10, 15, 20, ..., 95, 100; of these 25, 50, 75, 100 each contribute 2 factors, and the others contribute 1, so that the exponent of 5 in 100! is precisely t = 20 + 4 = 24. For divisibility by 2 there are 50 even integers, each contributing at least 1 factor 2; 25 integers are divisible by 4, 12 by 8, 6 by 16, 3 by 32, and 1 by 64: in general the number of integers between 1 and k divisible by ` is b k` c. Thus the exponent of 2 in 100! is r = 50 + 25 + 12 + 6 + 3 + 1 = 97. The maximum power of 10 dividing 100! is therefore min{97, 24} = 24. (Note that it was not necessary to determine the value of r; it would have been sufficient to observe that r ≥ t.) (c) We wish to determine the integers n such that 12 divides n − 4, i.e. such that there exists an integer k such that n − 4 = 12k, or n = 12k + 4. This is the characterization sought. The set is infinite, since any integer k yields an integer congruent to 4 modulo 12. (d) By [17, Definition 9, p. 119], (79) ⇒ ∃k(a − b = mk) (80) ⇒ ∃`(c − d = m`) Hence m(k − `) = (a − b) − (c − d) = (a − c) − (b − d) implying (81). 2. (a) Prove that the following argument is valid by using the logical equivalence of an implication and its contrapositive, known logical equivalences from [17, Table 1.2.5, p. 17], and the rules of inference in these notes, §??.??, page ??. p → (q → r) p∨s t→q ¬s ¬r → ¬t

(82) (83) (84) (85) (86)

)

(b) This argument could also be proved using a truth table. Give such a proof. You may be able to reduce the number of truth values needed in this table through some analysis of the specific statements in the argument. Solution:

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1115

(a) Following is one possible proof; there will certainly be others. p → (q → r) p∨s t→q ¬s p q→r t→r ¬r → ¬t

Premiss Premiss Premiss Premiss (88), (90), Disjunctive Syllogism (87), (91), Modus Ponens (89), (92), Hypothetical Syllogism contrapositive of (93)

(87) (88) (89) (90) (91) (92) (93) (94)

)

(b) Since there are 5 primitive logical variables, the truth table needs 25 lines. We don’t need the whole table, however: only those lines in which all four of the hypotheses are true. To determine precisely the number of lines of the table where all hypotheses are true may be complicated; however, any one of these hypotheses restricts the number of lines. For example, ¬s is true in only half of the lines — i.e. 16; t → q is true in precisely three-quarters of the lines, i.e. 24; p ∨ s also is true in precisely three-quarters of the lines: so one choice may be better than another. Another approach would be to consider the consequence, viz. ¬r → ¬t. This could be false only in one-quarter of the lines, namely, where ¬r is true (i.e. r is false) and ¬t is false (i.e. t is true); so only 8 lines are required in this table, for the 23 possible truth values of the other three propositional variables. Moreover, ¬s is to be true, so s is false: this means we can investigate this argument with a mere 4 lines: p F F T T

q r = F s = T t = T q → r p → (q → r) t → q p ∨ s F T T F F T F T T F F T T F T T F F T T

In none of the rows are all of the hypotheses true: and these rows are the only ones where the consequence could fail to be true; hence the argument is established. (In effect this is a proof by contradiction.) 3. Prove that the following argument is invalid. p↔q q→r

(95) (96)

Notes Distributed to Students in Mathematics 189-240A (2000/2001) r ∨ (¬s) (¬s) → q s

1116 (97) (98) (99)

)

Solution: One must prove the existence of an assignment of truth values under which the four hypotheses are true, but the alleged consequence is false. One way of doing this would be to exhibit an explicit counter example. Such an example could be found by completing a truth table. However, as there are 4 variables, such an example could require the completing of 24 = 16 rows in a truth table. Following is an ad hoc attack which leads to the determination of all counterexamples. In any counterexample all five statements (95), (96), (97), (98), and the negation of (99) (i.e. ¬s) must be true. From (98), q is true. From (96), r is true. From (95), p has the same truth value as q, so p is true. Finally, we observe that these truth values are consistent with the truth of (97). We have thus shown that there is just one assignment of truth values which is a counterexample; as this number of counterexamples is positive, the original argument is not valid. 4. You are presented below with all steps in an argument, but without the justifications for the various steps. You are to supply valid justifications. The object is to prove the validity of the following argument. u→r Premiss (r ∧ s) → (p ∨ t) etc. q → (u ∧ s) ¬t q p

(100) (101) (102) (103) (104) (105)

)

You are to supply justifications for each of the steps in the following. (The ordering of the premisses (= hypotheses) is not relevant, and has been altered from the order in which they were originally stated.) q q → (u ∧ s) u∧s u

(106) (107) (108) (109)

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1117

u→r r s r∧s (r ∧ s) → (p ∨ t) p∨t ¬t p

(110) (111) (112) (113) (114) (115) (116) (117)

)

Solution: (cf. [6, Example 2.34, p. 92]) q q → (u ∧ s) u∧s u u→r r s r∧s (r ∧ s) → (p ∨ t) p∨t ¬t p

Premiss Premiss Modus Ponens applied to (118), (119) Conjunctive Simplification of (120) Premiss Modus Ponens applied to (121), (122) Simplification of (120) Conjunction of (123), (124) Premiss Modus Ponens applied to (125), (126) Premiss Disjunctive Syllogism applied to (127), (128)

)

5. Prove by induction on N for integers N > 1 that

N P i=1

i N

. Ni−1 = −1

N +1 . 3

(118) (119) (120) (121) (122) (123) (124) (125) (126) (127) (128) (129)

[Note: The

intention is that you should not convert this problem into an equivalent problem: prove it in its present form by induction.] Solution: Basis Step. When N = 2 2 X i i−1 1 1−1 2 2−1 . = . + . 2 2−1 2 2−1 2 2−1 i=1

= 0+1=1 2+1 = 3

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1118

as claimed. Inductive Step. Suppose that

N P i=1

N +1 X

=

i=1 N X i=1

i N

. Ni−1 = −1

N +1 . 3

Then

i i−1 . N + 1 (N + 1) − 1 i i−1 N + 1 (N + 1) − 1 . + . N + 1 (N + 1) − 1 N + 1 (N + 1) − 1 N

N −1X i i−1 N = . . +1 N + 1 N i=1 N N − 1   N −1 N +1 N = . + 1 by induction hypothesis N +1 N 3 N +2 (N + 1) + 1 N −1 N +1 = . +1= = , N +1 3 3 3 completing the induction step. 6. You are asked to solve the following problem using the Second Principle of Mathematical Induction. For any integer n ≥ 35 there exist nonnegative integers x and y such that n = 5x + 9y . (130) [Hint: Consider two cases in the induction step: (a) n is a multiple of 5. (b) n is not a multiple of 5. Use the fact that 9 = 2 · 5 − 1.] Solution: [14, Problem 1.5.21, pp 37, A-5]. Basis Step. Evidently 35 = 5 · 7 + 9 · 0. Thus (130) is true for n = 35, x = 7, y = 0. Induction Step. Now assume that the statement is true for all integers n ≤ N , where N is some integer ≥ 35. (a) To say that N is a multiple of 5 is equivalent to stating that there is some integer x such that N = x · 5; since N ≥ 35, x ≥ 35 = 7. But then 5 N +1 = x·5+1 = (x − 7)5 + 4 · 9

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1119

is a decomposition of N +1 of the desired type. (Note that the hypothesis N ≥ 35 ensures that x − 7 ≥ 0, as required. Note also that we have not needed the full induction hypothesis in this subcase: divisibility by 5 is a stronger condition than (130).) (b) Assume that N = 5x + 9y, where 5 does not divide N . This implies that y is a non-negative integer greater than 0, i.e. that y ≥ 1. Then N + 1 = 5x + 9y + 1 = (5x + 9y) + (2 · 5 − 1 · 9) = 5(x + 2) + 9(y − 1), which has the desired form since y ≥ 1. 7. Let f : → be any function which is “infinitely differentiable”: i.e. not only 0 does f exist, but, the derivative of f 0 (denoted by f 00 ) exists, and its derivative f 000 , etc. We can define the r-times-iterated derivative f (r) recursively by f (1) = f 0 f (r+1) = f r ≥ 1.

(131)  (r) 0

(132) (133)

Prove by the Second Principle of Mathematical Induction that, for all positive integers r and s, (s) f (r+s) = f (r) (134) Although you are not being asked to do so here, this definition can be extended by defining f (0) = f . Then it can be shown that (134) holds even when either or both of r and s are zero. [Hint: Define n = r + s, and prove by induction on n. The basis step will be when n = 2, since neither r nor s can be less than 1. The statement that is to be proved may appear to be “obvious”. Students should analyze just what has been defined and precisely what is to be proved. Do not assume any properties of integration. While the mathematical result is “trivial”, the procedure to be followed is a very common one that is often applied in non-trivial situations. The purpose is to provide an exercise in careful use of induction.] Solution: While students were asked to use the “Second” Principle, the following proof uses the “First” Principle. Since the induction hypothesis of the Second Principle implies the induction hypothesis of the First, the proof we give can be interpreted as being an instance of the Second Principle as well. Basis step (n=2). There is only one feasible set of values of r and s for which r + s = 2, namely r = s = 1. Then (1) f (1+1) = f (1)

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1120

by (132), which is precisely what is to be proved in (134) in this case. Induction step. Now assume that (134) has been proved for all r and s when r + s = N ≥ 2. The rest of this proof could be proved with the same symbols r and s, but we will introduce two new symbols to help clarify the reasoning. Let t and u be any two positive integers such that t + u = N + 1. Case 1. Suppose that u = 1. Then f (t)

(u)

=

f (t)

= f

0

(t+1)

by (131) by (132)

which is precisely what (134) says when r = t and s = u = 1. Case 2. Suppose that u > 1. Then f (t)

(u)

(u−1+1) f (t)  (u−1) 0 (u−1) = f (t) by (132) applied to the function f (t) 0 = f (t+u−1) by induction hypothesis =

= f (t+u−1+1) = f (t+u)

by (132) applied to the function f (t+u−1)

q.e.d.29 , proving (134) when r = t and s = u > 1. This completes the proof of the induction step. The temporary change of symbols from r and s to t and u made it easier to describe how the induction hypothesis was being applied. Since (134) is quantified ∀r∀s, we may replace the symbols r and s everywhere by any symbols that are convenient. (This problem could also be solved in another way, using “Double” Induction. We could first prove (134) — in the case s = 1 — by the First Principle (of “Simple” Induction). That would be the Base Case of the “outermost” induction. Then, assuming that (134) has been proved for s ≤ S, and for all r, we could prove — by the First Princple — the case s = S + 1 for all r. This is the induction step for the outermost induction. We could then conclude the truth for all r and s. The method we have proposed, using r + s = n as the variable, is superior, in that it reduces the number of applications of induction from 2 to 1.) 29

quad erat demonstrandum = what was to be proved. Nowadays mathematicians often replace this Latin clause by the symbol . 

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

D.3

1121

Solved Problems from the Third 1997 Problem Assignment Distribution Date: Friday, November 7th, 1997 Solutions were to be submitted by Monday, October 27th, 1997 n

1. [17, Exercise 4.1.*48, p. 243] Use the product rule to show that there are 22 different truth tables for propositions in n variables. Illustrate by showing — in a single truth table — the truth values of all possible propositions in 1 variable. (The 0 statement is true even for 0 variables: there are precisely 2 = 21 = 22 constant functions — namely T and F . These are not the only propositions in 0 variables; but every function of 0 variables will be logically equivalent to one of them — i.e. every such function is either a tautology or a contradiction.) [Hint: A proposition in n variables is a function from the Cartesian product of n propositional variables — call them p1 , p2 , ..., pn — to the set {T, F }.] Solution: There are, by the product rule, exactly 2n ways of assigning truth values to the n variables p1 , p2 , ..., pn ; i.e. there are 2n points in the domain of the function defined by any such proposition, a function acting on the n − tuples (p1 , p2 , ..., pn ) and taking its values in the set {T, F }; the action of the function is presented in a truth table with 2n rows. For each of these 2n assignments of truth values there are two choices for the value taken by the proposition; and these choices are n independent. In all there are 22 different truth tables. n

[Note that we are not claiming that there are only 22 distinct propositions. Every proposition will be logically equivalent to infinitely many others; all of these will correspond to one possible column of a truth table.] The table for one variable is p F T

φ00 φ01 φ10 φ11 F F T T F T F T

(We have chosen to name the types of propositions according to the values in their respective columns, taking 0 to represent F and 1 to represent T .) Examples of φ00 are the constant function F , p ∧ (¬p), ((¬p) ∨ p) → (p ↔ (¬p)). 2. (cf. [17, Exercise 4.2.26]) A computer network consists of n computers (n ≥ 2). Each computer is directly connected with at least one of the other computers. Show that there are at least two computers in the network that are directly connected with the same number of other computers.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1122

Solution: Denote the computers by C1 , C2 , ..., Cn . Call the number of computers connected to Ci the degree of Ci , and denoted it by deg(Ci ). Then the degree function maps the n computers to a set with n − 1 values, 1, 2, ..., n − 1. By the Pigeonhole Principle at least one of these values is realized at least twice. 3. (cf. [17, Exercise 4.3.24]) Determine how many strings of n lowercase letters from the English alphabet contain (a) the letter a. (b) the letters a and b. (c) the letters a and b in consecutive positions with a preceding b, with all letters of the string distinct. (d) the letters a and b, where a is somewhere to the left of b in the string, with all letters distinct. Solution: (a) The total number of strings, without restriction, is 26n . We subtract from this number the number of strings constructed from the alphabet {b, c, ..., z}, i.e. 25n , leaving a balance of 26n − 25n . (b) We first count the strings which do not contain both a and b. Those containing no a number 25n ; the same is the number of strings containing no b. We can add these two numbers, but the sum will count the strings containing neither a nor b — whose number is 24n — twice; hence the number of strings which contain both a and b is 26n − 2 · 25n + 24n . (c) Consider the 2-letter string ab as one object, to be permuted with n − 2 other objects, all distinct. The n − 2 other objects may be chosen from the set 24 of 24 letters {c, d, ..., z}; the number of choices is n−2 . We then permute n objects: these n − 2 letters and the 2-letter object ab. The number of such permutations is (n − 1)!. By the product rule, the number of strings is  (n−1)24! 24 (n − 1)! n−2 = (26−n)! (d) The total number of n-letter words containing a and b, in which all letters  24 are distinct, is n! × n−2 : we apply the product rule after selecting the n − 2 letters distinct from a and b. Since there is no essential difference between the objects a and b, half of these strings have a to the left of b. Another approach. The number of words of length n − 2 containing neither 24! a nor b is P (24, n − 2) = (26−n)! . Add the letter b, placing it in any one of 25

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1123

positions. If it be placed between letters in positions i, i+1 (i = 0, 1, ..., n−2)30 then a can be placed in i + 1 ways to the left of b; by the product rule there are (i + 1)P (24, n − 2) strings of this type. By the sum rule, the total number n  P of strings is (i + 1)P (24, n − 2) = n2 P (24, n − 2). From this expression i=0

we can now see a shorter approach: every word of the type we wish to count may be decomposed into an (n − 2)-letter word obtained by suppressing the a and b, and two distinct position numbers for a and b — chosen from 1, 2, ..., n. Conversely, if we choose two positions, and place a in the left one, and b in the right, we may then place an (n − 2)-letter word into the remaining places. 4. [17, Exercise 4.6.20] Determine the number of solutions in non-negative integers to the inequality x1 + x2 + x3 ≤ 11. [Hint: Introduce an auxiliary “slack” variable x4 , such that x1 + x4 + x3 + x4 = 11.] Solution: Corresponding to each solution to x1 + x2 + x3 ≤ 11

(135)

we define x4 = 11 − x1 − x2 − x3 . Thus x4 ≥ 0. Conversely, for every solution x1 , x2 , x3 , x4 ) to the equation x1 + x2 + x3 + x4 = 11

(136)

the ordered triple (x1 , x2 , x3 ) is a solution to inequality (135). Thus we have a bijection between solutions to the inequality and solution to the equation. The number of solutions to the equation is the number of (11 + 3)-letter “words” in 11 0’s and 3 1’s: the 1’s can be viewed as separating 11 objects into 3 + 1 strings. This number is 11+3 = 364. 3 This problem can also be solved using ordinary generating functions. Each of x1 , x2 , x3 is enumerated by 1 + x + x2 + x3 + ... = (1 − x)−1 . Multiplication by 1 + x + x2 + ... + x11 sums the coefficients of x up to the 11th power. The coefficient −4 of x11 in the expansion of (1 − x)−3 · (1 − x12 )(1 − x11 )−1 = (1 − x)−4 − x12 (1 − x)  11+3 11 −4 is the same as the coefficient of x in the expansion of (1 − x) , i.e. 3 as before. 5. Determine the number of 4-letter words that can be formed from the letters of the word ASSOCIATIVITY. Solution: The maximum multiplicities of letters available are as follows: 30

When i = 0 this is intended to mean placing b at the beginning of the word; when i = n − 2, this is intended to mean placing b at the very end of the word.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1124

3 copies: I 2 copies: A, S, T 1 copy: C, O, V, Y We present two, quite different, methods for solving this problem. Students were expected to provide one solution. For examination purposes students will be expected to be able to use either method, although the actual computations in the second method shown are more difficult than might be expected on an examination. (a) From first principles: By the sum rule we can count separately the words having a given partition of multiplicities, and add. The partitions of 4 into unordered positive integer parts are 4 = 4, 4 = 3 + 1, 4 = 2 + 2, 4 = 2 + 1 + 1, 4 = 1 + 1 + 1 + 1. Of these, the partition 4 = 4 is not applicable, as no letter is available in 4 copies. The others are all achievable.  4 = 3 + 1. The letter of multiplicity 3 can be chosen in 11 = 1 way (as it is uniquely I. The letter of multiplicity 1 may be chosen in 8−1 = 7 1 ways. In all, the letters of the 4-letter word of this type will be chosen 4! in 1 × 7 = 7 ways; and then arranged in 3!1! = 4 ways. Thus the total number of words of this type is 7 × 4 = 28. 4 = 2 + 2. Choose the two letters of multiplicity 2 from the population of 4 letters (A, I, S, T) available with this or greater multiplicity, in 42 = 6 4! = 6 ways. Thus there are 6 × 6 = 36 words with ways; and arrange in 2!2! this partition.  4 4 = 2 + 1 + 1. Choose the letter which is to contribute 2 copies in = 4 1  8−1 ways; then choose the 2 other letters in 2 = 21 ways. Order the 4! letters in 2!1!1! = 12. The total number of words of this type is thus 4 × 21 × 12 = 1008.  4 = 1 + 1 + 1 + 1. Choose the 4 letters in 84 = 70 ways, and order in 4! = 24 ways. The number of words is 1680. The total number of words will be 28 + 36 + 1008 + 1680 = 2752. (b) Using exponential generating functions: The exponential generating function is  1  3 x 2 x3 x2 1+x+ + 1+x+ (1 + x)4 2! 3! 2!   2 3 1 x x = 1+x+ + 2! 3!   9 2 9 4 3 × 1 + 3x + x + 4x + x + ... 2 4

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1125

 × 1 + 4x + 6x2 + 4x3 + x4 421 3 344 4 = 1 + 8x + 30x2 + x + x + ... 6 3 where · · · represents terms in powers of x higher than the 4th. Hence 4! times the coefficient of x4 is 2752; this will be the number of 4-letter words from the given population of letters. 6. (a) Consider the set {0, 1}n of strings of length n in the alphabet {0, 1}. Among those strings we wish to select a subset S with the property that no string x ∈ S can be transformed into a string y ∈ S by changing not more than 2t of its bits. Prove that the number of elements of S is not more than 2n  n 0

+

 n 1

+

n 2



+ ... +

.

n t

[Hint: Think of any element x ∈ S as being the centre of a “sphere of radius t”, consisting of those words that can be obtained from x by changing 0 bits, 1 bit, ..., t bits. These spheres cannot overlap in {0, 1}n , as an overlap point would indicate a method for changing one centre into another in at most t + t steps.] (b) Show that it is possible to attain this bound in the case that n = 3 and t = 1 (c) Show that it is not possible to attain this bound in the case n = 4, t = 1. Solution:  (a) The centre of the sphere is the word x itself — and is counted by n0 = 1. The number of words obtainable by changing precisely r digits is nr . We sum over the range r = 0, 1, ..., t. Since the spheres cannot overlap, and the total number of words in {0, 1}n is 2n , we have the inequality |S|

t   X n r=0

r

≤ 2n .

(b) The bound is that no such “code” could have more than such example is S = {000, 111}.

23 1+3 4

= 2 words. One

2 (c) The bound is that no such “code” could have more than 1+4 words, hence no 16 more than b 5 c = 3 words. Suppose that we have such a code, whose words are a1 a2 a3 a4 , b1 b2 b3 b4 and c1 c2 c3 c4 . Suppose first that two of these words, say a1 a2 a3 a4 and b1 b2 b3 b4 , differ in all 4 digits. Then the 3rd word will differ from a1 a2 a3 a4 in at least 3 digits — so it will be the same as b1 b2 b3 b4 in those

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1126

3 digits, a contradiction. Hence no two of he words differ in 4 digits: so every pair differ in exactly 3 digits. Suppose, without limiting generality, that a1 6= b1 , a2 6= b2 , a3 6= b3 and a4 = b4 . Then c1 c2 c3 c4 must differ from each of a1 a2 a3 a4 , b1 b2 b3 b4 in at least 2 of the first 3 digits: but that is impossible. The case n = 7 corresponds to the “perfect single-error correcting code” called the Hamming code of length 7, containing exactly 16 binary words of length 7. This set has the property that a single bit change (“error”) in one code word cannot be confused with a bit change from another word: so the error can be unambiguously “corrected”. 7. (a) Using generating functions, determine for each non-negative integer n the number vn of n-letter words in the alphabet {0, 1, 2, 3} in which the number of 0’s is even and the number of 1’s is odd — the 2 conditions to hold simultaneously. There are to be no restrictions on the numbers of 2’s or the number of 3’s. (b) Using generating functions, determine for each non-negative integer n the number wn of selections with repetitions of n objects from the alphabet {0, 1, 2, 3} in which the number of 0’s is even and the number of 1’s is odd — the 2 conditions to hold simultaneously. There are to be no restrictions on the numbers of 2’s or the number of 3’s. 1 1+2x+x2 [Hint: (1−x) 2 = (1−x2 )2 .] Solution: (a) We use exponential generating functions. The enumerator for the symbol 0, ∞ P x2n which is selected an even number of times, is , which is equal to the (2n)! n=0

MacLaurin expansion of 21 (ex + e−x ). (This series is, in fact, the expansion of cosh x; however, we shall not assume students to be familiar with the hyperbolic functions.) Similarly, the enumerator for the symbol 1, which is selected ∞ P x2n+1 an odd number of times, is , which is equal to the MacLaurin expan(2n+1)! n=0

sion of 12 (ex − e−x ). (This series is the expansion of sinh x.) The remaining two symbols are enumerated each by ex . The generating function for the number of words is therefore  1 x  1 x e + e−x · e − e−x · ex · ex 2 2  1 2x = e − e−2x · e2x 4

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1127



 1 X 4n n 1 4x = e −1 = x 4 4 n=1 n! from which it follows that vn = 4n−1 (n ≥ 1); v0 = 0. (b) We use ordinary generating functions. The enumerator for 0 is 1 + x2 + x4 + x6 + ... + x2n + ... 1 = ; 1 − x2 the enumerator for 1 is x + x3 + x5 + x7 + ... + x2n+1 + ... x = . 1 − x2 The enumerators for 2 and 3 are each 1 + x + x2 + x3 + ... + xn + ... 1 = 1−x Hence the ordinary generating function for selections of this type of length n is 1 x 1 1 · · · 2 2 1−x 1−x 1−x 1−x x = 2 (1 − x )2 (1 − x)2 We need to find the MacLaurin expansion of this rational function. One way to do this — much longer than needed — would be to factorize the denominator and expand the function into partial fractions: x x)2 (1

(1 + − x)4 1 1 1 1 1 1 = · + · + · 2 16 (1 + x) 8 1 + x 4 (1 − x)4 1 1 3 1 1 1 + · + · + · 3 2 4 (1 − x) 16 (1 − x) 8 1−x A simpler method is to multiply numerator and denominator by a polynomial factor which will convert the denominator into a power of a binomial; which

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1128

function is relatively easy to expand: x x2 )2 (1

(1 − − x)2 x(1 + x)2 = (1 − x2 )4 1 = (x(1 + x)2 ) · (1 − x2 )4  ∞  X n n+3 2 3 = (x + 2x + x ) · x2 3 n=0     ∞ ∞  ∞  X X X n + 3 2n n + 3 2n n + 3 2n 2 3 = x· x + 2x · x +x · x 3 3 3 n=0 n=0 n=0    ∞  ∞  ∞  X X X n + 3 2n+1 n + 3 2n+2 n + 3 2n+3 = x +2 x + x 3 3 3 n=0 n=0 n=0 We will transform the sums through changes of variables: in the second sum define m = n + 1, in order to develop a formula for the coefficient of even powers of x; in the third sum define n0 = n + 1 in order to eventually combine the first and third sums, which both yield odd powers of x. The result is x x2 )2 (1

= = = =

=

(1 − − x)2     ∞ ∞  ∞  X X n + 3 2n+1 m + 2 2m X n0 + 2 2n0 +1 x +2 x + x 3 3 3 n=0 m=1 n0 =1    ∞  ∞  ∞  X X n + 3 2n+1 m + 2 2m X n + 2 2n+1 x +2 x + x 3 3 3 n=0 m=1 n=1     ∞  ∞  X X n+3 n+2 m + 2 2m 2n+1 + x +2 x 3 3 3 n=0 m=1  ∞  X (n + 3)(n + 2)(n + 1) (n + 2)(n + 1)n + x2n+1 6 6 n=0   ∞ X m+2 +2 x2m 3 m=1  ∞ ∞  X X (n + 2)(n + 1)(2n + 3) 2n+1 n + 2 2m x +2 x 6 3 n=0 m=1

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1129

from which we conclude that (n + 2)(n + 1)(2n + 3) w2n+1 = for n ≥ 0 6 (n + 2)(n + 1)n w2n = for n ≥ 0 3

D.4

Solved Problems from the Fourth 1997 Problem Assignment

1. Consider the recurrence an+4 − 18an+2 + 81an = 0 ,

(137)

subject to the initial conditions: a0 a1 a2 a3

= 6 = 18 = −54 = 0

(138)

(a) Solve the recurrence for n ≥ 0 using the methods of [17, §5.2]. (b) Solve the recurrence for n ≥ 0 using ordinary generating functions. (c) Transform the recurrence into recurrences involving sequences {bn }n=0,1,2,... and {cn }n=0,1,2,... , by defining ( if n is even bn an = c 2 b n c if n is odd 2

Then solve these recurrences for n ≥ 0 using the methods of [17, §5.2]. Solution: (a) The characteristic equation of the homogeneous recurrence is r4 − 18r2 + 81 = 0, which is equivalent to (r2 − 9)2 = 0, and, in turn, to (r − 3)2 (r + 3)2 = 0. The characteristic roots, 3 and −3, each have multiplicity 2. The general solution is, therefore, of the form an = (A + Bn)(−3)n + (C + Dn)3n . Imposing initial conditions (138) yields the system of linear equations A+C −3A − 3B + 3C + 3D 9A + 18B + 9C + 18D −27A − 81B + 27C + 81D

= 6 = 18 = −54 = 0

(139)

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1130

 having a unique solution, (A, B, C, D) = − 32 , − 32 , 15 , − 29 . Hence the partic2 ular solution to (137) satisfying the given initial conditions is   15 − 9n n 3 n 3 . (140) an = − (1 + n)(−3) + 2 2 P∞ n (b) Denote the ordinary generating function n=0 an t by A(t). Multiplying n+4 (137) by t and summing for n ≥ 0 yields ∞ X



n=0 ∞ X

(an+4 − 18an+2 + 81an ) tn+4 = 0 an+4 t

n+4

− 18

n=0



∞ X m=4

∞ X

an+2 t

n+4

+ 81

n=0

am tm − 18t2

∞ X `=2

a` t` + 81t4

∞ X

an tn+4 = 0

n=0 ∞ X

an tn = 0

n=0

changing to new variables m = n + 4, ` = n + 2 ∞ ∞ ∞ X X X n 2 n 4 ⇔ an t − 18t an t + 81t an tn = 0 n=4

n=2

n=0

renaming the bound variables m and ` both to be n ⇔ A(t) − a0 − a1 t − a2 t2 − a3 t3 −18t2 A(t) + 18t2 (a0 + a1 t) +81t4 A(t) = 0  ⇔ 1 − 18t2 + 81t4 A(t) = a0 + a1 t + (a2 − 18a0 )t2 + (a3 − 18a1 )t3 = 6 + 18t − 162t2 − 324t3 from the initial data 1 + 3t − 27t2 − 54t3 6 + 18t − 162t2 − 324t3 = 6 · ⇔ A(t) = 1 − 18t2 + 81t4 (1 − 9t2 )2 To determine the MacLaurin expansion of the last given ratio we could appeal to the method of partial fractions. As the denominator factorizes into (1 − 3t)2 (1 + 3t)2 , and the degree of the numerator is less than the degree of the denominator, we know that there exist constants U, V, W, X such that 6(1 + 3t − 27t2 − 54t3 ) (1 − 9t2 )2 U V W X = + + + 2 2 (1 − 3t) 1 − 3t (1 + 3t) 1 + 3t

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1131

Taking both sides to a common denominator yields the identity 6(1 + 3t − 27t2 − 54t3 ) = U (1 + 3t)2 + V (1 − 3t)(1 + 3t)2 +W (1 − 3t)2 + X(1 − 3t)2 (1 + 3t)(141) At this point students should know two methods of determining the constants: either by comparing coefficients of corresponding powers of t; or by assigning “convenient” values to t; and these methods may be combined. Two “convenient” values of t are ± 31 , since these cause most of the terms of (141) to vanish. We thus obtain U = − 92 , and W = − 32 . We need two more equations to determine the remaining constants. One or other of the methods mentioned yields V = 12 and X = 0, from which we find the partial fraction decomposition to be 9 1 12 3 1 A(t) = − · + − · 2 2 (1 − 3t) 1 − 3t 2 (1 + 3t)2 This may be expanded as follows: 1 12 3 1 9 A(t) = − · + − · 2 (1 − 3t)2 1 − 3t 2 (1 + 3t)2   ∞  ∞ ∞  X 9X n+1 3X n+1 n n = − (3t) + 12 (3t) − (−3t)n 2 n=0 1 2 1 n=0 n=0 ∞ ∞ ∞ X 9X 3X n n n n = − (n + 1)3 t + 12 3 t − (n + 1)(−3)n tn 2 n=0 2 n=0 n=0 ∞

= −

3X ((n + 1)(−3)n + (3n − 5)3n ) tn 2 n=0

We could avoid the use of partial fractions by rewriting in the form 6 (1 − 27t2 ) 18t (1 − 18t2 ) + (1 − 9t2 )2 (1 − 9t2 )2   ∞  ∞  X X k+1 k+1 2 2 k 2 = 6 1 − 27t (9t ) + 18t 1 − 18t (9t2 )k 1 1 k=0 k=0

A(t) =

∞ ∞ X X k 2k 2 = 6 (k + 1)9 t − 162t (k + 1)9k t2k k=0

+18t

k=0 ∞ X

k 2k

(k + 1)9 t

k=0

∞ X − 324t (k + 1)9k t2k 3

k=0

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1132

∞ ∞ X X k 2k = 6 (k + 1)9 t − 162 (k + 1)9k t2k+2 k=0

+18

k=0 ∞ X

k 2k+1

(k + 1)9 t

∞ X − 324 (k + 1)9k t2k+3

k=0

k=0

∞ ∞ X X = 6 (k + 1)9k t2k − 18 ` 9` t2` k=0

`=1 ∞ ∞ X X k 2k+1 +18 (k + 1)9 t − 36 ` 9` t2`+1 k=0

`=1

∞ ∞ X X k 2k = 6 (k + 1)9 t − 18 ` 9` t2` k=0

`=0

+18

∞ X

∞ X

k=0

`=0

(k + 1)9k t2k+1 − 36

` 9` t2`+1

∞ ∞ X X k 2k k 9k t2k (k + 1)9 t − 18 = 6 k=0

k=0

∞ ∞ X X k 2k+1 k 9k t2k+1 (k + 1)9 t − 36 +18 `=0

k=0

extending 2 summations to include zero terms ∞ ∞ X X 2k 2k 18k · 32k t2k 6(k + 1)3 t − = k=0

k=0

+

∞ X

2k+1 2k+1

6(k + 1)3

t

k=0

=

∞ X k=0

6(1 − 2k)32k t2k +



∞ X

12k · 32k+1 t2k+1

k=0 ∞ X

(9 − 3(2k + 1))32k+1 t2k+1

k=0

from which we may read off the values  6(1 − n)3n if n is even an = (9 − 3n)3n if n is odd

(142)

which agree with the values given by equation (140). (c) When n = 2m, (137) becomes a2m+4 −18a2m+2 +81a2m = 0, which is equivalent to bm+2 − 18bm+1 + 81bm = 0 (143)

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1133

and is subject to two of the original four initial conditions, viz. b0 = 6 b1 = −54 When n = 2m + 1, (137) becomes a2m+5 − 18a2m+3 + 81a2m+1 = 0, which is equivalent to cm+2 − 18cm+1 + 81cm = 0 (144) and is subject to two of the original four initial conditions, viz. c0 = 18 c1 = 0 Thus both of the new sequences satisfy the same recurrence dm+2 − 18dm+1 + 81dm = 0

(145)

but with different initial conditions. The general solution of (143) is of the form bm = (K + Lm)9m , while the general solution of (144) is of the form cm = (M + N m)9m . Imposing the initial conditions, we obtain K (K + L)9 M (M + N )9

= = = =

6 −54 18 0

whose solution is (K, L, M, N ) = (6, −12, 18, −18); hence bm = (6 − 12m)9m cm = (18 − 18m)9m from which, by appropriate substitutions, we can recover (142). 2. In a certain course the 2n students (always an even number) are divided up into n pairs of “partners”. It is desired to seat the students around a round table for a test, with the restriction that no student sits beside her/his partner.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1134

(a) Using the Principle of Inclusion-Exclusion — no other method will be accepted for this part of the problem — determine a formula for the number an of admissible seatings of 2n students. (b) Verify the correctness of your formula when n = 1, 2, 3 by some other method. Solution: (a) For (i = 1, 2, ..., n) denote by Ai the number of seatings of the 2n students which violate the restrictions because the students in the ith pair are sitting side-by-side. Then with an exception in the case n = 1, for r distinct pairs, (1 ≤ r ≤ n), |Ai1 ∩ Ai2 ∩ . . . ∩ Air | is equal to 2r times the number of circular arrangements of (2n − 2r) + r objects — of which r are 2-person pairs; i.e. is equal to 2r (2n − r − 1)!. As there are nr ways of selecting r pairs, the Principle of Inclusion-Exclusion gives     1 n 2 n (2n − 2)! + 2 (2n − 3)! an = (2n − 1)! − 2 1 2   r n +(−2) (2n − r − 1)! + ... + (−2)n (n − 1)! (146) r When n = 1 the preceding reasoning breaks down: the 2-person object that we wish to arrange in A1 there has only one ordering; in that case we have to replace (146) by   1 a1 = (2 · 1 − 1)! − (2 · 1 − 2)! (147) 1 (b) Our preceding calculations give a1 = 0, a2 = 2, a3 = 32. n = 1: It is not possible to seat members of only one pair without them being side-by-side. n = 2: Each of the pairs must separate the other. Once one pair has been seated in opposite seats there are two ways to place the members of the other pair in the two separating seats. n = 3: Let the pairs be {a1 , a2 }, {b1 , b2 }, {c1 , c2 }. Without limiting generality, let’s place pair {a1 , a2 } first. Case 1 — a1 and a2 are in opposite seats: In this case there are two seats to be filled in each of the residual portions of the table. Each of the seats in one portion must be filled with one member of each of the remaining pairs — giving 2 × 2 choices, and 2 arrangements of the selected members. In the other residual portion there are two remaining persons to be placed — in either of 2 orders, independent

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1135

of the previous count. In all we have (2×2×2)×2 = 16 arrangements of this type. Case 2 — a1 and a2 are in non-opposite seats: There are two ways in which this can happen — depending upon whether the residual portion to the left of a1 has 1 or 3 spaces. The portion having just one seat can be filled in 4 ways — just choose any of the 4 unseated students. Then the partner of that student must be placed in the middle of the 3-student string, in order to separate the members of the other pair. After that the other pair can be placed in either of 2 orders. In all we have 4 × 2 = 8 seatings for either of the 2 ways — i.e. 16 in all. The preceding computations applied the Product Rule. Now, by the Sum Rule, we have 16 + 16 = 32 seatings, as computed using our formula. 3. (cf. [17, Exercise 6.5.36]) Determine all equivalence relations on the 4-element set S = {a, b, c, d}. For each of these determine the number of ordered pairs in the relation. Solution: By [17, Theorem 6.5.2, p. 399], there exists a one-to-one correspondence between equivalence relations on S and partitions of S (into mutually disjoint non-empty subsets). We will enumerate the partitions instead of the equivalence relations. We consider the various partitions of 4 into positive integer parts. 4 = 4: There is just one way to partition S into one part — namely S = S. The corresponding relation is the “complete” relation, containing all 42 = 16 ordered pairs. 4 = 3 + 1: We can partition S into parts of cardinalities 1 and 3 by selecting one point — in 41 = 4 ways. Each of the corresponding relations contains 32 + 12 = 10 ordered pairs. 4 = 2 + 2: The number of ways of dividing 4 elementsinto two distinguishable i.e. labelled parts, each containing 2 elements, is 42 = 6. If, however, we are concerned only with the partition, and the parts are not labelled, then the number of partitions is 2!6 = 3 since there are 2! ways in which a partition into unlabelled parts could be labelled to produce 6 ordered partitions. The number of ordered pairs is 22 + 22 = 8.  4 = 2 + 1 + 1: Select the points for the part of size 2 in 42 = 6 ways. The total number of ordered pairs is 22 + 12 + 12 = 6. 4 = 1 + 1 + 1 + 1: There is just one relation of this type: it has 12 +12 +12 +12 = 4 ordered pairs.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1136

In all we have found 1 + 4 + 3 + 6 + 1 = 15 distinct equivalence relations on a set of 4 points. 4. Prove of disprove each of the following statements. To disprove, where applicable, one explicit counterexample is sufficient. But a proof, where applicable, must be totally general: you must not specialize the problem in any way. (a) [17, Supplementary Exercises 6.8, p. 423] If R is a symmetric relation on a set A, then the complementary31 relation R is also symmetric. (b) (cf. [17, Supplementary Exercises 6.5, p. 423]) If R is a reflexive relation on a set A, then R ⊇ R2 . (c) If R is a transitive relation on a set A, then R2 is also transitive. (d) If R and S are total orders on a set A, then R ◦ S is also a total order. (e) The number of symmetric relations on A which are neither reflexive nor irn reflexive32 is 2( 2 ) · (2n − 2). Solution: (a) We give a proof by contradiction that ∀(a, b) ∈ A × A[(a, b) ∈ R ⇒ (b, a) ∈ R] (a, b) ∈ R (b, a) ∈ /R (b, a) ∈ R (a, b) ∈ R (a, b) ∈ /R F

Premiss Premiss (149), definition of R (150), symmetry of R (151), definition of R (148), (152), ∀p[p ∧ ¬p ⇔ F ][17, Table 6, p. 18]

(148) (149) (150) (151) (152) (153)

)

This proof is valid ∀a, b ∈ A. Hence R is symmetric. (b) Define A = {a, b, c}, and let R be the reflexive relation {(a, a), (b, b), (c, c), (a, b), (b, c)} . Then R is not transitive. However R2 contains, in addition to R, the element (a, c). Thus R R2 . This counterexample disproves the claim. (Students should try to convince themselves that this is the “smallest” counterexample.) 31 32

[17, p. 365] For a relation R on a set A, R = {(a, b) ∈ A × A : (a, b) ∈ / R}. [17, p. 365] A relation on a set A is irreflexive if ∀a ∈ A[(a, a) ∈ / R].

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1137

(c) If R is transitive, then R2 ⊆ R (cf. [17, Theorem 6.1.1, p. 364]). (a, b) ∈ R2 ⇒ (a, b) ∈ R (b, c) ∈ R2 ⇒ (b, c) ∈ R These statements imply, by definition of R2 , that (a, c) ∈ R2 , As the preceding argument is valid ∀a, b, c ∈ A, R2 is transitive. (d) This statement is false. Consider, for example, the total orderings R = {(a, a), (b, b), (a, b)} and S = R−1 = {(a, a), (b, b), (b, a)} on the 2-element set {a, b}. R ◦ S = {(a, a), (b, b), (a, b), (b, a)}. This relation is not antisymmetric, so it is not a partial order. (Try to convince yourself that there cannot be a counterexample with fewer points — i.e. that this is the “best possible” counterexample.) (e) To not be reflexive a relation cannot have loops at every point of its digraph; to not be irreflexive if cannot lack a loop at every point of its digraph. Thus the relations we are considering have between 1 and n − 1 points which are related to themselves. The number of ways of selecting these self-related points is 2n − 2. The relations are to be symmetric. For any pair of distinct points a, b, we must select either both ordered pairs (a, b), (b, a), or neither n of them. This can be done in 2( 2 ) ways, independent of the selection of the points which are related to themselves. By the Product Rule, the number of n relations is 2( 2 ) · (2n − 2), as claimed.

D.5

Solved Problems from the Fifth 1997 Problem Assignment This version of the solutions, in preliminary form and awaiting proofreading is posted for the benefit of students preparing for the examination. Caveat lector!33 There could be misprints and/or errors!

1. Isomorphism of undirected graphs is an equivalence relation ([17, Exercise 7.3.45]). (You should be able to prove this, but are not being asked to do so at this time.) Determine the isomorphism classes of undirected graphs with 4 vertices. That is, determine the various possible structures that a graph G = ({a, b, c, d}, E) on 4 vertices can have. For each of the structures, give an incidence matrix for one particular labelling of the vertices, which you should show in a sketch (cf. [17, Exercises 7.3.54(c), 7.3.55]). Solution: (We shall not show the sketches which were requested.) It is convenient to list the isomorphism classes according to the numbers of edges; (all the graphs 33

Let the reader beware.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1138

have  exactly four vertices). The mimimum is, of course, zero; the maximum is 4 = 6. 2 (a) 0  edges. 0 0 0  0 0 0   0 0 0 0 0 0

There  is only one graph with 0 edges. Its incidence matrix is 0 0  . 0  0

(b) 1  is only one graph with 1 edge. One incidence matrix is  edge. There 0 1 0 0  1 0 0 0     0 0 0 0 . 0 0 0 0 (c) 2 edges. There are two possible graphs with 2 edges. i. The graph({a, b, c, d}, {ab,  cd}) has two disjoint edges. One incidence 0 1 0 0  1 0 0 0   matrix is   0 0 0 1 . 0 0 1 0 ii. The graph ({a, b, c, d}, {ab, ac}) has two edges that are not disjoint, i.e. that are incident   with a common vertex. One incidence matrix is 0 1 1 0  1 0 0 0     1 0 0 0 . 0 0 0 0 (d) 3 edges. We can list the subgraphs formed by three edges in the order of the maximum degree of a vertex. The maximum degree in K4 is 3; were the maximum degree ≤ 1, the total number of edges would be at most 12 × 4 × 1 = 2 < 3. i. Maximum degree = 3. This graphhas the structure of ({a, b, c, d},  0 1 1 1  1 0 0 0   {ab, ac, ad}). One incidence matrix is   1 0 0 0 . 1 0 0 0 ii. Maximum degree = 2. There are two possible cases: A. The graph is a tree. This graph has the structure of ({a, b, c, d}, {ab, bc, cd}), a “path of length 3”. One incidence matrix is

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1139



 0 1 0 0  1 0 1 0     0 1 0 1 . 0 0 1 0 B. The graph has a circuit. This graph has the structure of ({a, b, c, d}, {ab, triangle and an isolated vertex. One incidence matrix is  bc, ca}), a  0 1 1 0  1 0 1 0     1 1 0 0 . 0 0 0 0 (e) 4 edges. These graphs are the complements of the graphs with 6 − 4 = 2 edges, so there  areprecisely 2 ofthem. Possible incidence matrices are 0 0 1 1 0 0 0 1  0 0 1 1   0 0 1 1       1 1 0 0  and  0 1 0 1  . 1 1 0 0 1 1 1 0 (f) 5 edges. This graph is the complement of the   unique graph with 6 − 5 = 1 0 0 1 1  0 0 1 1   edge. One incidence matrix is   1 1 0 1 . 1 1 1 0 (g) 6 edges. This graph is the complement of the graph  0  1 has the structure of K4 . Its incidence matrix is   1 1

with 0 edges;  that is, it 1 1 1 0 1 1  . 1 0 1  1 1 0

2. (a) The vertices of the 3-dimensional cube with vertices at the 23 points of 3 whose coordinates are all ±1 can be viewed as representing a graph whose edges are given by the line segments which join these vertices parallel to the coordinate axes (e.g. x = 1, y = −1, −1 ≤ z ≤ 1). i. Show that this graph — often denoted by Q3 — is bipartite, and can be obtained from K4,4 by erasing 4 independent edges — i.e. 4 edges such that no two of them are incident with the same vertex. ii. Project this graph on to the plane z = 0 from the point A(0, 0, 2). That is, replace each vertex P of the graph by the intersection with the plane z = 0 of the line through A and P . The line segment joining any two vertices is projected in the same way. Sketch the graph, and explain why the 3-cube is planar .

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1140

(b) Now generalize the 3-cube to a 4-cube, whose vertices are all ordered 4-tuples with each coordinate equal to ±1, 24 = 16 vertices in all; join two vertices if they differ in just one coordinate. For this graph i. Show that the graph is regular, and determine the degree. ii. Define a vertex to be red if an odd number of its coordinates are negative, and blue if the number of minuses is even; i.e. define the colour based on the parity 34 of the number of minus signs in the coordinates of a vertex. Show that the 4-cube — often denoted by Q4 — is bipartite. iii. [Difficult] Show that the 4-cube may be viewed as obtained from a K8,8 by erasing from it a 4-cube; that is, that K8,8 may be viewed as the union of 2 edge-disjoint copies of a 4-cube. Hence argue that K16 may be viewed as the edge-disjoint union of 2 4cubes and 2 K8 ’s. Solution: (a)

34

i. Each of the 23 vertices is adjacent to the 3 vertices that can be obtained from it by reversing the sign of one of its 3 coordinates. Call a point red if an odd number of its coordinates are negative, and blue if an even number of its coordinates are negative. Then the only edges in this graph connect red points to blue points. There are exactly 4 points with even coordinates, and 4 with odd, so the graph is bipartite, with red points connected only to blue points. As each point is connected to all but one of the points in the opposite colour class, the graph has the desired property. (We call the 4 edges deleted from the K4,4 a 1-factor .) ii. The line joining (a, b, 1) to (0, 0, 2) has direction numbers (−a, −b, 1), and parametric equations x = −at, y = −bt, z = 2 + t. This line meets the plane z = 0 in the point with parameter value t = −2, i.e. in the point (2a, 2b, 0). Similarly, the line joining (a, b, −1) to (0, 0, 2) has direction numbers (−a, −b, 3), equations x = −au, y = −bu, z = 2 + 3u, and meets the xy-plane in the point with parameter value u = − 32 , i.e. in the  point 2a , 2b , 0 . The edges joining vertices in the plane z = 1 project 3 3 into a square, as do the edges joining the vertices in the plane z = −1. The edges passing between vertices in the two planes project on to edges with slopes ±1 in the xy-plane; for example, the images of (1, 1, 1) and (1, 1, −1) — i.e. (2, 2, 0) and 23 , 23 , 0 — are joined by a line segment with slope 1. The graph in the plane which is produced by projection has no crossing edges. Thus the original graph was planar , since it is has a planar representation.

evenness or oddness

Notes Distributed to Students in Mathematics 189-240A (2000/2001) (b)

1141

i. Let’s consider, with greater generality, the n-cube, whose vertices are strings of 1’s and −1’s of length n, with two strings being adjacent iff they differ in precisely one location. Then each vertex is adjacent to precisely n other vertices. As this degree is constant, the graph is regular . ii. Since any vertex adjacent to a given vertex has either one more minus or one less, all edges connect vertices bearing different colours. Thus the graph is bipartite. iii. Pairs of vertices of opposite colours which are not adjacent must be precisely those which differ by an odd number of minus different from the odd number 1, i.e. vertices whose coordinates differ in precisely 3 places. To see that this graph — the complement of the 4-cube in K8,8 — also has the structure of a 4-cube, we need only relabel each red vertex (a, b, c, d) by the new symbol [−a, −b, −c, −d]. In this new graph the red vertices are connected to points whose labels differ in exactly 1 place, so the graph is isomorphic to a 4-cube. Thus K8,8 is the edge-disjoint union of 2 copies of the 4-cube. We may complete the K8,8 to form a K8+8 i.e. a K16 , by joining all the red vertices — to form a K8 — and, similarly, joining all the blue vertices — to form a second, disjoint, copy of K8 .

3. Show that, if A is the adjacency matrix of a graph with n vertices, then the trace 35 of A3 is equal to 6 times the number of K3 ’s in G. Verify this for the graph G = ({a, b, c, d, e}, {ab, bc, ca, de}). [Hint: Use [17, Theorem 7.4.2, p. 468].] Solution: By the theorem, the number of paths of length 3 from vertex v to itself will be the main diagonal entry in the vth row of the adjacency matrix. If we sum the main diagonal entries we have the total number of paths of length 3, counted according to their starting vertex and according to the order in which the vertices are traversed. For any K3 there are three vertices that can serve as the initial vertex for the path, and two directions in which the vertices may be traversed; hence each K3 gives rise to 3 × 2 closed paths; to find the number of K3 ’s we must divide the total number of closed paths of length 3 by 6. For the given graph G,with the verticeslabelled in the  order a, b, c, d, e,  the ad0 1 1 0 0 2 1 1 0 0  1 0 1 0 0   1 2 1 0 0      2  . Then A =  1 1 2 0 0  , and 1 1 0 0 0 jacency matrix is A =       0 0 0 0 1   0 0 0 1 0  0 0 0 1 0 0 0 0 0 1 35

The trace of a square matrix is the sum of the main diagonal entries.

Notes Distributed to Students in Mathematics 189-240A (2000/2001) 

2  3  A3 =   3  0 0 number of

1142

 3 3 0 0 2 3 0 0   3 2 0 0   . The trace is 2 + 2 + 2 + 0 + 0 = 6, precisely 6 times the 0 0 0 1  0 0 1 0 K3 ’s — there is only one, with vertices a, b, c.

4. (a) Prove that a bipartite graph cannot have a Hamilton path unless the numbers of vertices in the two classes differ by at most one. (b) [3, Exercise 4.2.2] “A mouse eats her way through a 3 × 3 × 3 cube of cheese by tunnelling through all of the 27 1 × 1 × 1 subcubes. If she starts at one corner, and always moves on to an uneaten subcube through a flat 1×1 side36 , can she finish at the centre of the cube?” Set up a graph whose vertices are located at the centres of the 1×1×1 subcubes, and use the theory of bipartite graphs to resolve this question. (c) Does the graph of the preceding part have an Euler path or an Euler circuit? Explain. Solution: (a) The only possible paths in a bipartite graph oscillate between vertices of one colour and vertices of the other colour, since all edges have one end of each colour. Hence non-self-intersecting paths connecting vertices of the same colour will have one more vertex of that colour than those of the other colour; non-self-intersecting paths connecting vertices of different colours will have the same numbers of vertices of the two colours. (b) The degrees of the vertices of the graph are: 3, for each of the 8 corners; 4 for the mid-points of each of the 12 sides, 5 for the mid-points of the 6 faces, and 6 for the centre of the cube. One can colour the 8 + 6 + 1 vertices of degrees 3, 5, 6 in one colour – say red — and no two of them will be adjacent; the other 12 vertices may be coloured blue. We seek a Hamilton path that begins at one of the red vertices, and ends at a red vertex. Paths must oscillate between vertices which are red and those which are blue. Thus a path with two red ends must have precisely one more red vertex than blue vertices; but 15 − 12 6= 1. (c) The graph has 8 + 6 = 14 vertices of odd degree, and 12 + 1 vertices of even degree. Since the number of odd-degree vertices is positive, there cannot be an Euler circuit; since the number exceeds 2, there cannot be an Euler path. 36

never through an edge or through a vertex

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1143

5. (a) [17, Exercise 7.7.24, p. 508] Show that K3,3 has 1 as its crossing number37 . (b) [17, Exercise 7.7.28, p. 509] Show that K3,3 has 2 as its thickness38 . (c) Determine the thickness of K4,4 . Solution: (a) By Kuratowski’s theorem [17, Theorem 7.7.2, p. 506] the deletion of one edge from a K3,3 renders it planar. Can we conclude that the crossing number of K3,3 is therefore 1? Not without more careful reasoning: it is plausible that any embedding of the K3,3 with an edge removed is such that the restoration of the edge would require more than one crossing. That this is not the case is most easily shown by a sketch. (Since we cannot produce figures easily with the software in which these notes are written, we describe a way of sketching the graph. Take the vertices of one class to be (2, 2), (−2, −2), (−1, 1), and the vertices of the other class to be (2, −2), (−2, 2), (−1, −1), and join the vertices of each class to those of the other class by line segments. Then the only crossing is of the edges (−1, −1)(2, 2) and (−1, 1)(2, −2), which occurs at the origin.) (b) As K3,3 is not planar, its thickness cannot be less than 2. But the graph obtained by deleting one edge — any one edge — from K3,3 is planar; and the deleted edge itself, with 4 isolated vertices, constitutes another planar subgraph. Thus the thickness of K3,3 is exactly 2. (c) We have seen earlier in this assignment that the deletion of 4 “independent” edges from K4,4 yields the graph Q3 , which is planar. These 4 independent edges together constitute one planar graph. Thus the thickness of K4,4 cannot exceed 2. But, as K4,4 contains K3,3 as a subgraph, and is therefore nonplanar, its thickness cannot be less than 2; hence the thickness is exactly 2. 6. (a) [17, Exercise 7.8.14] Show that a simple graph that has a circuit with an odd number of vertices in it cannot be coloured using two colours. (b) The graph Wn has n + 1 vertices; it consists of a circuit Cn of n vertices (the “rim” of the wheel), to each of which is connected the (n + 1)th vertex — the “hub” of the wheel. (cf. [17, Exercise 7.8.13]) Show that, for n ≡ 1 (mod 2), Wn has the property that χ(Wn ) = 4; but that the deletion of any 37

[17, p. 508] The crossing number of a simple graph is the minimum number of crossings that can occur in a planar representation of this graph, where no three arcs representing edges can cross at the same point. 38 [17, p. 509] The thickness of a simple graph G is the smallest number of planar subgraphs of G that have G as their union.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1144

edge renders the graph 3-colourable, indeed 3-chromatic (i.e. such that χ = 3). Discuss the case when n ≡ 0 (mod 2). Solution: (a) This is a simple consequence of [17, Example 7.8.4, p. 514], wherein it is shown that χ(Cn ) = 3 when n ≡ 1 (mod 2). If a graph contains other vertices and/or edges than Cn , it surely cannot be coloured in fewer colours than are required for the Cn . (b) When n is odd, the rim of a wheel Wn , being an odd circuit, requires, and can be coloured in 3 colours. The hub, being connected to all vertices of the rim, must bear a different colour from all of them, so Wn ≥ 4; moreover, any colouring of the rim in 3 colours extends to a 4-colouring of Wn by adding one more colour; hence χ(Wn ) ≤ 4. We have proved that χ(Wn ) = 4 when n is odd. The deletion of an edge from the hub to the rim creates an opportunity to use the same colour at the ends of the previous edge, and then to colour the remainder of the rim in an alternation of 2 other colours; thus 3 colours suffice. The deletion of an edge from the rim permits the colouring of the rim in an alternation of 2 colours, which extends to a 3-colouring by using another colour for the hub. Thus, in either case, 3 colours suffice for colouring the graph obtained by deleting one edge. We call a graph with this property (edge)-critical 4-chromatic.39 7. A tournament is a directed graph in which there is exactly one directed edge between any two distinct vertices (cf. [17, p. 526]). (a) [17, Supplementary Exercise 32, p. 526] Determine the number of distinct tournaments that can be constructed on the vertex set {1, 2, ..., n}. (You are not being asked to count isomorphism classses of tournaments, which is a much more difficult problem. Thus, for example, there are 2 distinct tournaments when n = 2.) P 40 (b) Show deg− (i) + deg+ (i) = n − 1 for all i, and that ni=1 deg− (i) =  Pn that n + i=1 deg (i) = 2 . (c) Show that n X i=1 39

n 2 X 2 deg+ (i) = deg− (i) i=1

The prefix edge- is often omitted. An analogous concept — vertex-critical involves the deletion of a vertex and all its incident edges; we will not study that concept in this course. 40 We are using the notation of [17, Definition 7.2.4, p. 439].

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1145

Show by a counterexample that this property need not hold for digraphs that are not tournaments. Solution:  (a) There are n2 pairs of vertices. Each of these unordered pairs must be assigned one of the two possible orders. Hence the number of tournaments is exactly n 2( 2 ) . (b) Every vertex is connected with each of the other n − 1 vertices by an edge; it matters not which direction is assigned to the edge, it is still counted precisely once in the sum deg− (i) + deg+ (i).  Each of the n2 directed edges contributes exactly 1 to the sum of in-degrees, and exactly 1 to the sum of out-degrees. Hence the two sums are equal,  and n each is equal to the total number of unordered pairs of vertices, viz. 2 . (c) That this property may fail for digraphs that are not tournaments may be seen from the counterexample ({1, 2, 3}, {(1, 2), (1, 3)}), in which the sum of the squares of the out-degrees is 22 + 02 + 02 = 4, while the sum of the squares of the in-degrees is 02 + 12 + 12 = 2 6= 4. n X

n X 2 2 deg (i) = n − 1 − deg+ (i) −

i=1

i=1 n  X 2  (n − 1)2 − 2(n − 1) deg+ (i) + deg+ (i) = i=1 n n n X X X 2 + 2 deg+ (i) = (n − 1) − 2(n − 1) deg (i) + i=1

i=1

i=1

  X n 2 n 2 = n(n − 1) − 2(n − 1) + deg+ (i) 2 i=1 2

2

= n(n − 1) − n(n − 1) +

n X

2 deg+ (i)

i=1

deg+ (i)

2 

=

n X i=1

When n ≡ 0 (mod 2), the rim of the wheel can be coloured in 2 colours, and the hub requires an additional colour — so the wheel is 3-colourable, and, indeed, 3-chromatic. However, the deletion of any edge does not reduce the number of colours required, except for W2 , which is 2-colourable.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

E

1146

Solutions to 1998 Assignment Problems

E.1

Solved Problems from the First 1998 Problem Assignment

1. For the four logical variables p, q, r, s, determine a proposition f which is true precisely when any two of these four are true and the other two are false: that is, f is true when p and q are true and r and s are false, when p and r are true and q and s are false, etc.; and is false in all other cases. (a) Express f as a disjunction of conjunctions, each of which conjunctions is of the form a ∧ b ∧ c ∧ d, where a is either p or ¬p, b is either q or ¬q, c is either r or ¬r, and d is either s or ¬s. (b) Express f as a conjunction of disjunctions, each of which disjunctions is of the form a ∨ b ∨ c ∨ d, where a is either p or ¬p, b is either q or ¬q, c is either r or ¬r, and d is either s or ¬s. Solution: (a) In the definition given f is expressed as a disjunction of the form u∨v ∨...∨w, where u, v, ..., w are all the conjunctions of the logical variables or their negations in which eactly two negations appear. There are precisely 6 ways in which 2 of the 4 variables can be negated. This can  be seen by “brute force” at this stage, but will be seen eventually to be 42 = 6. The disjunction of these 6 terms is true precisely when at least one of the terms is true; and, any one of the terms is true precisely when two of the variables are true and two are false. Thus f is given by (p ∧ q ∧ ((¬r) ∧ (¬s)) ∨ (p ∧ r ∧ (¬q) ∧ (¬s)) ∨ (p ∧ s ∧ (¬q) ∧ (¬r)) ∨ (q ∧ r ∧ (¬p) ∧ (¬s)) ∨ (q ∧ s ∧ (¬p) ∧ (¬r)) ∨ (r ∧ s ∧ (¬p) ∧ (¬q)) in which neither the order of the conjuncts in the conjunctions, nor the order of the 6 terms is significant. This formula for f is said to be in disjunctive normal form. (b) There are 24 = 16 conjunctions that may be formed by the 4 variables and/or their negations. Of these, exactly 10 involve some number other than 2 negations. Forming the disunction of these conjunctions, we have the formula p∧q∧r∧s ∨

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1147

(¬p ∧ q ∧ r ∧ s) ∨ (p ∧ ¬q ∧ r ∧ s) ∨ (p ∧ q ∧ ¬r ∧ s) ∨ (p ∧ q ∧ r ∧ ¬s) ∨ (p ∧ ¬q ∧ ¬r ∧ ¬s) ∨ (¬p ∧ q ∧ ¬r ∧ ¬s) ∨ (¬p ∧ ¬q ∧ r ∧ ¬s) ∨ (¬p ∧ ¬q ∧ ¬r ∧ s) ∨ ¬p ∧ ¬q ∧ ¬r ∧ ¬s that is true precisely when f is false. Its negation will be logically equivalent to f and will be, by the de Morgan laws, a conjunction of disjunctive clauses of the form sought. Thus f has the form p∨q∨r∨s ∧ (¬p ∨ q ∨ r ∨ s) ∧ (p ∨ ¬q ∨ r ∨ s) ∧ (p ∨ q ∨ ¬r ∨ s) ∧ (p ∨ q ∨ r ∨ ¬s) ∧ (p ∨ ¬q ∨ ¬r ∨ ¬s) ∧ (¬p ∨ q ∨ ¬r ∨ ¬s) ∧ (¬p ∨ ¬q ∨ r ∨ ¬s) ∧ (¬p ∨ ¬q ∨ ¬r ∨ s) ∧ ¬p ∨ ¬q ∨ ¬r ∨ ¬s This formula for f is said to be in conjunctive normal form. 2. Showing all your work, determine all propositions which are logically equivalent to their own negation. Solution: For two propositions to be logically equivalent, they must always have the same truth value. But any proposition has the opposite truth value from its negation. Thus no proposition can be logically equivalent to its negation. That is, the set {f : f ⇔ (¬f )} is empty. 3. (a) (cf. [17, Ex. 1.2.11, p. 20]) Using a truth table, prove the absorption laws: (p ∨ (p ∧ q)) ⇔ p and (p ∧ (p ∨ q)) ⇔ p. (b) Using a truth table, determine whether the following argument is valid: p∨q q→r p→m ¬m r ∧ (p ∨ q)

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1148

(c) Using a truth table or otherwise, determine whether the following proposition is a tautology, a contradiction, or neither: ((p ∨ q) ∧ (q → r) ∧ (p → m) ∧ (¬m)) ↔ (r ∧ (p ∨ q)) Solution: (a) (A proof not using truth tables is given in [18, p. 7].) p F F T T

q F T F T

p ∧ q p ∨ q p ∨ (p ∧ q) p ∧ (p ∨ q) F F F F F T F F F T T T T T T T

Since the last two columns always have precisely the same entry as the first column, the two formulæ which head them are both logically equivalent to p. (If we had more space we could have included two additional columns, respectively headed by (p ∨ (p ∧ q)) ↔ p and (p ∧ (p ∨ q)) ↔ p, and then proved that each of these formulæ is a tautology by showing that all entries in each of these columns would be T .) (b) p F F F F F F F F T T T T T T T T

q F F F F T T T T F F F F T T T T

r m ¬m p ∨ q q → r p → m r ∧ (p ∨ q) F F T F T T F F T F F T T F T F T F T T F T T F F T T F F F T T F T F F T F T F T F T F T T T T T T T F T T T T F F T T T F F F T F T T T F T F T T T F T T T F T T T T F F T T F F F F T F T F T F T F T T T F T T T F T T T T

In this truth table there is only one line — the 7th — in which all the premises are true. This is the only line of the table that is needed for this part of the

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1149

problem: the validity of the argument follows from the presence of a T in that line in the last column. The validity of this argument could have been proved in other ways. For example, we could argue that ¬m is true only if m is false. Then the premise p → m could be true only if p is false. Then the first premise, p ∨ q could be true only if q is true; and finally, the premise q → r could be true only if r is true. In this way we have determined the unique row of the truth table that represents the one assignment of truth values under which all the premises are true. It remains only to test the conclusion and to observe that it is indeed true under that particular interpretation. (c) In the preceding part of the problem we have, using a truth table, proved that ((p ∨ q) ∧ (q → r) ∧ (p → m) ∧ (¬m)) → (r ∧ (p ∨ q)) is a tautology. However, there are five other rows of the table in which the entry in the last column is a T even though the entries for the four premises are not all true. Any one of those five rows — for example row 16 — shows that ((p ∨ q) ∧ (q → r) ∧ (p → m) ∧ (¬m)) ← (r ∧ (p ∨ q)) is not always true. Hence the given proposition is not always true, i.e. is not a tautology. Row 7 shows that the given proposition is not a contradiction, either. 4. Give an example to show that, where P (x, y) is any propositional function, the equivalence (∀y)(∃x)P (x, y) ↔ (∃y)(∀x)P (y, x) (154) is not a tautology. Solution: (cf. [17, Example 1.3.17, pp. 29-30]) In [17, Exercise 8, p. 94] the implication ← is proved. We shall produce a counterexample to the implication →. Such an implication can fail only where (∀y)(∃x)P (x, y) is true while (∃y)(∀x)P (y, x) is false. Suppose that the universe consists of all positive integers, and that P (x, y) means that x > y. For every integer y there certainly exists an integer which is larger — for example, y + 1 is such an integer. However, there exists no integer y which is greater than all integers x; for, in particular, the statement P (y, y) fails for all integers. Thus the implication (154) may fail to hold. 5. Prove the following results, for any nonempty sets A, B, C. (a) A × B = C × C ⇔ A = B = C.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1150

(b) [More difficult!] (A × B) ∪ (B × A) = C × C ⇔ A = B = C. (c) Show that neither of the preceding conclusions is valid when not all of the sets are non-empty. Solution: (a) If A = B = C then, evidently, A × B = C × C. It remains only to prove A × B = C × C ⇒ A = B = C.

(155)

We assume A × B = C × C, i.e. A×B ⊆C ×C C ×C ⊆A×B

(156) (157)

Let a ∈ A and b ∈ B. Then, by virtue of (156), (a, b) ∈ C × C, so a ∈ C and b ∈ C; thus we have shown that A ⊆ C and B ⊆ C. Conversely, suppose c ∈ C. Then, by virtue of (157), (c, c) ∈ A × B, so c ∈ A and c ∈ B; here we have shown that C ⊆ A and C ⊆ B. The two pairs of inclusions imply that A = C and B = C, . 

(b) (cf. [23, Exercise 7, p. 23]) Here again we wish to prove four inclusions: A⊆C B⊆C C⊆A C⊆B

(158) (159) (160) (161)

(A × B) ∪ (B × A) ⊆ C × C (A × B) ∪ (B × A) ⊇ C × C

(162) (163)

from the hypotheses

If (a, b) is any point in A × B, then, by virtue of (162), (a, b) ∈ C × C, so a ∈ C and b ∈ C; this proves (158) and (159) respectively. Suppose there exists b ∈ B − A. Then, as the point (b, b) is in C × C, by virtue of (159), we may apply (163): (b, b) ∈ A × B or (b, b) ∈ B × A. But each of these alternatives implies that b ∈ A, which is contrary to hypothesis. From this contradiction we conclude that b ∈ B − A, equivalently, that B ⊆ A.

(164)

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1151

Similarly we may prove that A⊆B,

(165)

A=B.

(166)

so But now (163) implies A×A⊇C ×C and we may conclude A = C by virtue of the preceding problem. (c) But the conclusions are not valid when, for example, A and C are empty and B is non-empty. In such a case the products A × B, B × A, and C × C are all empty; but B 6= C and B 6= A. 6. Suppose that a set A has precisely n > 0 elements, and let B be a set consisting of subsets of A with the property that no two of the members of B are disjoint. Prove that B cannot contain more than 2n−1 elements. Show also that this result is “best possible”, i.e. that the bound of 2n−1 cannot be improved. [Hint: Is it possible for B to contain a set and its complement?] Solution: (cf. [1, Theorem 1.1.1]) Were there a pair C, C of complementary sets in B, then the condition of non-disjointness would be violated. The power set n P(A) may be partitioned into 22 sets, each consisting of two complementary sets: B cannot contain more than one member of each of these pairs, hence it cannot contain more than 2n−1 elements. The following example shows that 2n−1 is best possible: fix one element a0 ∈ A, and define B to consist of all subsets containing a0 . What happens when n = 0? [While the theorem is “best possible” in one sense, it can be strengthened. It is possible to show that, if |B| < 2n−1 , it is possible to adjoin new sets to B until the resulting collection has precisely 2n−1 elements.] 7. [17, Problem 1.6.16] If f : B → C and f ◦ g : A → C are injective, does it follow that g : A → B is injective? Justify your answer. Solution: g(a1 ) = g(a2 ) ⇒ f (g(a1 )) = f (g(a2 )) ⇔ (f ◦ g)(a1 ) = (f ◦ g)(a2 ) by definition of ◦ ⇒ a1 = a2 Thus g is injective. Note that, for this proof, we did not require the hypothesis that f should be injective!

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

E.2

1152

Solved Problems from the Second 1998 Problem Assignment

1. The contents of [17, §§2.3 – 2.5] form part of the syllabus of course 189-340B. For the purposes of the present course students should become minimally familiar with the concepts of §§2.3–2.4 by reading [17, pp. 111–120; 126–130] and solving the relevant simple problems below. The concepts will be discussed in this course only to the extent that they are required. (a) The parity of an integer describes its evenness or oddness: n is even if it is divisible by 2, and odd if it is not even. Evidently even integers n are expressible in the form n = 2t, while odd integers are expressible in the form n = 2t + 1. Show that the product of two consecutive integers, i.e. a product of the form n(n + 1) is always even. (b) (cf. [17, Exercise 3.2.22] Show that, for any integer n, the product n(n+1)(n+ 2) is always divisible by 3!. Solution: The solutions given below are not intended to be elegant — just correct. We will write much more than is necessary in a correct proof in order to show the pitfalls in various approaches to the problems. (a)

i. Proof by cases: If n = 2t, then n(n + 1) = 2t(2t + 1) = 2(t2 + t) ≡ 0

(mod 2)

If n = 2t + 1, then n(n + 1) = (2t + 1)(2t + 2) = 2(2t2 + 3t + 1) ≡ 0

(mod 2)

So, whatever the parity of n, the product n(n + 1) is always even. ii. A combinatorial proof, valid for positive n: The number of pairs of elements may be chosen from a set of n + 1 distinct elements is  that (n+1)n n+1 = . As this number must be an integer, and as the de2 2 nominator of the last mentioned fraction is 2, the numerator must be even. (b)

i. Proof by cases: There are various possible approaches. We will begin with the most na¨ıve one. Any integer n is expressible in the form 6t + u, where the least positive remainder u is one of 0, 1, 2, 3, 4, 5. The product n(n + 1)(n + 2) is then equal to (6n + u)(6n + u + 1)(6n + u + 2) which is congruent modulo 6 to u(u + 1)(u + 2). We wish to prove that this

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1153

last product is a multiple of 6. The most na¨ıve way is to consider the six possible values of u: u u(u + 1)(u + 2) 0 0·1·2=0=6·0 1 1·2·3=6=6·1 2 2 · 3 · 4 = 24 = 6 · 4 3 3 · 4 · 5 = 60 = 6 · 10 4 4 · 5 · 6 = 120 = 6 · 20 5 5 · 6 · 7 = 210 = 6 · 35 This totally unsophisticated proof is mathematically correct, but not very interesting. ii. Proof by induction: An inductive proof could be based on the 6 cases considered above, (cf. [17, Example 3.4], where a weaker result is proved). Take n = 0 as the base case. Then, observe that (n + 1)[(n + 1) + 1][(n + 2) + 1] = n(n + 1)(n + 2) + 3(n + 1)(n + 2) . We know from the preceding problem that (n + 1)(n + 2) is even, so 3(n + 1)(n + 2) is a multiple of 3 · 2 = 6. The induction hypothesis that n(n + 1)(n + 2) is also divisible by 6 will imply that the sum n(n + 1)(n + 2) + 3(n + 1)(n + 2) is also divisible by 6. This proof, however, applies only to non-negative n, and the claim was that the n(n + 1)(n + 2) ≡ 0 (mod 6) for any integer 6. We can extend the result we have just proved by observing that, if n < 0, it is of the form n = −m, where m > 0; then n(n + 1)(n + 2) = (−m)(−m + 1)(−m + 2) = −(m − 2)((m − 2) + 1)((m − 2) + 2), which we know to be divisible by 6 provided m − 2 ≥ 0, i.e. provided m ≥ 2. So we still have one case that has not been proved: m = 1 — i.e. n = −1. But then n(n + 1)(n + 2) = −1(0)1 = 0 = 0 · 6. iii. Combinatorial proof, for n ≥ 3: Analogously to the preceding problem, we could consider the number of 3-subsets of a set of n + 2 elements. This number is known to be n3 = (n+2)(n+1)n ; as the value is an integer, 3! the numerator in the last mentioned fraction must be divisible by the denominator, which is 3! = 6. This proof could now be extended to n ≤ 2 by the methods used in the preceding proof. iv. By virtue of the preceding problem, n(n + 1) is divisible by 2. If we can show that n(n + 1)(n + 2) is also divislble by 3, we can conclude — by

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1154

virtue of the fact that 2 and 3 are relatively prime41 — that n(n+1)(n+2) is divisible by 2 · 3 = 6. We can assume that n = 3v + w, where w is 0 or 1 or 2, and observe that n(n + 1)(n + 2) ≡ w(w + 1)(w + 2) (mod 3). When w = 0, 1, 2 the values of this product are, respectively, 0, 6, 24, all multiples of 3. Indeed, from the fact that these values are all multiples of 6 we see that we could have shortened the first proof we gave by looking only at the remainders of n modulo 3 — it was not necessary to consider remainders modulo 6. So the observation we made above that the product was divisible by 2, and that 2 and 3 are relatively prime, was true, but totally unnecessary. 2. (cf. [17, Exercise 2.3.20]) By using, where possible, what you know about factorizations of the polynomial xn − y n , and/or [17, Theorem 2.3, p. 114], determine whether each of the following integers is prime. (a) 29 − 1 (b) 3165 − 711 (c) 27 − 1. Solution: (a) We know that x9 − 1 is (x − 1) (x8 + x7 + x6 + x5 + x4 + x3 + x2 + x1 + x0 ), which is not particularly interesting if x = 2, since the first factor is 2 − 1 = 1. However, taking x = z 3 , and n = 3, we have x9 − 1 = z 3 − 1 = (x3 − 1) ((x3 )2 + x3 + 1), which yields, when x = 2, 29 − 1 = (8 − 1)(64 + 8 + 1) = 7 · 73 , which is evidently composite. (b) The numbers here are very large, so the problem is not easy to approach “by brute force”. However, again we observe a factorization 3165 − 711 11 = 315 − 711  = 315 − 7   10 9 8 2 1 × 315 + 315 7 + 315 72 + ... + 315 78 + 315 79 + 710 41

But this na¨ıve reasoning would not work if we wished to prove, for example, that n(n+1)(n+2)(n+3) is divisible by 24: we need the fact that 2 and 3 are relatively prime.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1155

which is the product of a large integer, 315 − 7 = 14, 348, 900 and another much larger integer, and so is composite. (The fact that these integers are large is not relevant: what is important is that neither is ±1.) This problem could, however, have been attacked in a much simpler way. Since both 3 and 7 are odd, their powers are all odd, and hence the difference of two powers would be even. As it is evident that this difference is neither +2 nor −2, it is surely composite. (c) In this case there is no useful factorization. √ 27 − 1 = 127. If it is not prime, it will have to have a factor between 2 and 127, which is less than 12 [17, Theorem 2.3, p. 114]. Thus, if 127 is composite, it must be divisible by one of the primes in this range, i.e. one or more of 2, 3, 5, 7, 11. It is easy to verify that none of these primes divides 127. 3. (a) In another assignment we have considered the argument p∨q q→r p→m ¬m r ∧ (p ∨ q)

)

which was proved (§E.1, Problem 3#3b) to be valid through the use of a truth table. You are now asked to prove the validity of the same argument by using • the logical equivalence of an implication and its contrapositive • known logical equivalences from [17, Table 1.2.5, p. 17 and Table 1.2.6, p. 18] • the rules of inference in these notes ?? You are expected to follow the style of proof shown in these notes in ??, numbering the lines in your proof, and carefully accounting for every line, beginning with the premisses and ending with the conclusion. There will be many different correct derivations. You must not appeal to the earlier proof which involved a truth table. This proof should not be a proof by contradiction. (b) Now solve the same problem using a proof by contradiction. Solution: (a) p∨q

premiss

(167)

Notes Distributed to Students in Mathematics 189-240A (2000/2001) q→r p→m ¬m ¬p q r r ∧ (p ∨ q)

premiss premiss premiss modus tollens from (170), (169) disjunctive syllogism from (167), (171) modus ponens from (172), (168) conjunction of (173) and (167)

1156 (168) (169) (170) (171) (172) (173) (174)

)

(b) While one could create a totally new proof, we will adapt a proof by negation from the preceding proof. We begin by adjoining to the premises the negation of the original conclusion. p∨q q→r p→m ¬m ¬(r ∧ (p ∨ q)) ¬p q r r ∧ (p ∨ q) (r ∧ (p ∨ q)) ∧ (¬(r ∧ (p ∨ q))) F

premiss (175) premiss (176) premiss (177) premiss (178) new premiss (179) modus tollens from (178), (177) (180) disjunctive syllogism from (175), (180) (181) modus ponens from (181), (176) (182) conjunction of (182) and (175) (183) Rule of Conjunction (184) [17, Table 1.2.6] (185)

)

Since the negation of r ∧ (p ∨ q), when adjoined to the other premisses, yields a contradiction, the other premisses imply r ∧ (p ∨ q). 4. You are given below the skeleton of a derivation of d ∨ c from a ∨ b and b → d and a → c. You are to supply the missing justifications. a∨b b→d a→c ¬(¬a) ∨ b ¬a → b ¬a → d ¬d → a

Premiss Premiss Premiss By Law of Double Negation

(186) (187) (188) (189) (190) (191) (192)

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1157

¬d → c d∨c

(193) (194)

)

Solution: a∨b b→d a→c ¬a → b ¬a → d ¬d → a ¬d → c d∨c

Premiss Premiss Premiss [17, Table 1.2.6] By hypothetical syllogism from (198), (196) contrapositive of (199) By hypothetical syllogism from (200), (197) [17, Table 1.2.6]

(195) (196) (197) (198) (199) (200) (201) (202)

)

5. Let pi (i = 1, 2, ...) be an infinite set of proposition letters. Define the formulæ n V pi recursively for all n ≥ 0 as follows: i=1



0 V

pi is defined to be T.

i=1

• If

n V

pi has been defined, then

n+1 V

 pi is defined to be

(a) Show that, according to this definition,

 pi ∧ pn+1 .

i=1

i=1

i=1

n V

1 V

pi ⇔ p1 .

i=1 2 V

pi ⇔ p1 ∧ p2 n  n W V (c) Define, for any integer n ≥ 0, pi to be the formula ¬ ¬pi . Prove that

(b) Show that, according to this definition,

i=1

i=1

i. ii.

0 W

i=1

pi ⇔ F. n  W pi ⇔ pi ∨ pn+1 .

i=1 n+1 W i=1

i=1

(d) Prove that, for all n ≥ 0, n ^ i=1

! pi

∨ pn+1 ⇔

n ^ i=1

(pi ∨ pn+1 )

Notes Distributed to Students in Mathematics 189-240A (2000/2001) Solution: (a) 1 ^

0 ^

pi ⇔

i=1

! pi

∧ p1

i=1

⇔ T ∧ p1 by base case ⇔ p1 ∧ T by commutativity of ∧ ⇔ p1 by Domination Law (b) 2 ^

1 ^

pi ⇔

i=1

! ∧ p2 by recursive definition

pi

i=1

⇔ p1 ∧ p2 (c)

by preceding proof

i. 0 _

pi

i=1

⇔ ¬

0 ^

! ¬pi

i=1

⇔ ¬T ⇔ F ii. For n ≥ 0, n+1 _

pi

i=1

⇔ ¬ ⇔ ¬ ⇔ ¬

n+1 ^

! ¬pi

i=1 n ^

!

i=1 n ^

!

¬pi

i=1

¬pi

∧ ¬pn+1 ∨ ¬ (¬pn+1 )

by De Morgan Law

1158

Notes Distributed to Students in Mathematics 189-240A (2000/2001) n ^

⇔ ¬

1159

! ¬pi

∨ pn+1

by Double Negation

i=1 n _



! ∨ pn+1

pi

by definition of

i=1

n _ i=1

(d) Our proof is by induction on n. Case n = 0: !

0 ^

pi

∨ p1 ⇔ T ∨ p1

by definition

i=1

⇔ T by Domination Law 0 ^ ⇔ (pi ∨ p1 ) by definition for n = 0 i=1

Cases n ≥ 1: Now assume that the equivalence has been proved for n = n0 , where n0 ≥ 0. We wish to prove the case n = n0 + 1. ! n^ 0 +1 pi ∨ pn0 +2 ⇔ ⇔

i=1 n0 ^ i=1 n0 ^

!

! ∧ pn0 +1

pi ! pi

∨ pn0 +2

by definition of

^

! ∨ pn0 +2

∧ (pn0 +1 ∨ pn0 +2 )

i=1

⇔ ⇔

n0 ^

by distributivity of ∧ over ∨ ! (pi ∨ pn0 +2 )

i=1 n^ 0 +1

∧ (pn0 +1 ∨ pn0 +2 )

by induction hypothesis

! (pi ∨ pn0 +2 )

by definition of

^

i=1 

V (Note that two applications of the definition of are used above, over different sequences of formulæ.) This completes the proof of the induction step. 6. Suppose that a sequence {an }n=0,1,2,... of integers is defined recursively by a0 = 1

(203)

Notes Distributed to Students in Mathematics 189-240A (2000/2001) a1 = 0 an = (−3)n − 6an−1 − 9an−2

1160 (204) (205)

(n ≥ 2)

Prove, using the “Second Principle of Mathematical Induction”, that   1 n (∀n) an = (n − 1)(n − 2)(−3) . 2

(206)

Solution: Base Case: Since, by one of the given “initial conditions”, a0 = 1 = 12 (0 − 1)(0 − 2)(−3)0 , (206) is true for n = 0. Induction Step: Suppose it has been proved that (206) is true for all n ≤ n0 , where n0 ≥ 0. We will show that the claim holds for n = n0 + 1. Subcase n0 = 0: By the second of the given initial conditions, a1 = 0 = (1−1)(1−2) (−3)1 , as required, when n0 = 0. 2 Subcase n0 ≥ 2: Only now are we able to provide a “general” argument, since only for n0 + 1 ≥ 2 can we be certain that (205) is applicable. Then an0 +1 = (−3)n0 +1 − 6an0 − 9an0 −1 1 = (−3)n0 +1 − 6 · (n0 − 1)(n0 − 2)(−3)n0 2 1 −9 · (n0 − 2)(n0 − 3)(−3)n0 −1  2  1 = 1 + (n0 − 1)(n0 − 2) − (n0 − 2)(n0 − 3) (−3)n0 +1 2 1 = ((n0 + 1) − 1)((n0 + 1) − 2)(−3)n0 +1 2 

proving (206) for n = n0 + 1. It follows by the Second Principle of Mathematical Induction that (206) is true for all n ≥ 0, as claimed. (Note: This problem is not concerned with how the conjecture above was developed. It could have been found by experimentation. However, there is a systematic method for solving inhomogeneous linear recurrences of this type; that method is, however, beyond the scope of this course. We shall, however, consider the solution of a related, but simpler type of recurrence — homogeneous linear recurrences. For the general solution of inhomogeneous linear recurrences, the reader is referred to [11, §3.2].)

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

E.3

1161

Solved Problems from the Third 1998 Problem Assignment

1. [17, Exercise 4.1.38] Determine the number of binary strings (strings of 0’s and 1’s) of length 10 which contain either a substring consisting of at least five consecutive 0’s or a substring consisting of at least five consecutive 1’s, or both. [Hint: One way of attacking this problem is to consider cases, according to where the string of length at least 5 begins.] Solution: An ad hoc solution. (a) First consider the cases where strings of length 5 occur with both 0’s and with 1’s. In such a case 5+5 = 10 symbols are accounted for, so there are no symbols other than those in the two strings of length 5. There are 2! = 2 ways of forming such a string out of the two substrings of length 5. (b) Now suppose that there is a string of 1’s of length ≥ 5, but no such string of 0’s. The first member of this string may be any any one of the positions ##1,2,3,4,5,6. If the string is at the beginning of the word, we can fix the first 5 symbols in the word, and then choose the remaining 5 in 25 − 1 ways, since we have to exclude the case where the last 5 symbols are 0’s as this was counted above. (c) If the string begins anywhere past position #1, it must be immediately preceded by a 0. The digits before that 0 are arbitrary, as are the digits after the 5th 1; except that we cannot permit a string of 5 0’s to precede, as we already counted it. Thus the number of strings of this type is the number of possible locations for that preceding 0 — 5 — multiplied by the number of ways of filling the positions before that 0 and the positions after the 5th 1 — 24 ; from which 1 must be subtracted, to account for the string 0000011111. We have (5 × 16) − 1 = 79 strings. (d) Analogously to the foregoing, if there is only a string of 0’s, the total number of words is also 31 + 79 = 110. (e) Summing, we obtain 2 + (2 × 110) = 222 strings. A more systematic solution. With one type of exception that will be noted below, every admissible binary string can be uniquely characterized as follows: (a) It is an alternating concatenation of m strings where the first consists of x1 1’s (respectively, of x1 0’s), the next consists of x2 0’s (respectively, of x2 1’s), etc., x1 + x2 + ... = 10 , (207) (m = 1, 2, ...).

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1162

(b) With the exception of the case where m = 2 and x1 = x2 = 5, there is exactly one xi which is at least 5, the other xi being at least 1. By a change of variable we can convert the problem to considering variables y1 = x1 − 1, y2 = x2 − 1, ..., yi = xi − 5, yi+1 = xi+1 − 1, ..., ym = xm − 1. Here (207) is replaced by y1 + y2 + ... + ym = 10 − (m − 1) − 5 .

(208)

These solutions can be represented by strings in 2 characters — 6 − m copies of a, and m−1 copies of b, where the length of the first string of a’s is y1 , of the second string is y2 , etc., and where the b’s   serve as separators. The number (6−m)+(m−1) 5 of such strings is = m−1 . We must multiply this binomial m−1 coefficient by 2 for the number of choices of the first character — is it a 0 or a 1. We must also multiply by the number of different ways of positioning the string whose length is at least 5. With one exception, this is precisely m. However, in the case m = 2, this leads to double counting, so we must subtract 1 before multiplying by 2. The resulting sum is   6 X 5 2 m· − 2 = 222 . m−1 m=1 Although it was not required, we do know how to evaluate such a sum in general. For an indeterminate x we have 5   X 5 i 5 (1 + x) = x . i i=0 This can be rewritten, through the change of variable m = i + 1, as  6  X 5 5 (1 + x) = xm−1 . m − 1 m=1 If we multiply by 2x, we obtain 5

2x(1 + x) = 2

6  X m=1

 5 xm . m−1

Differentiation with respect to x yields 6 X

 5 2(1 + x) + 10x(1 + x) = 2 m· xm−1 , m − 1 m=1 5

4



an identity which is valid for all x. Giving x the value 1 yields (2·32)+(10·1·16) as the value of the desired sum, from which 2 must be subtracted.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1163

2. [Students were notified that this problem would not be graded.] We wish to count all words of length n formed from an alphabet containing only the symbols a, b, c in the following way: • There is no restriction on the a’s – an a may appear at any place in a word, without restriction on its precedessors or successors. • b’s may appear in substrings of even length. • c’s may also appear only in substrings of even length. Thus the words of lengths 0 through 4 are as shown below: Length 0: The “empty” word, which we may denote by ∅. Length 1: Only a. Length 2: aa, bb, cc. Length 3: aaa, abb, bba, acc, cca. Length 4: aaaa, aabb, abba, bbaa, aacc, acca, ccaa, bbcc, ccbb, bbbb, cccc. (a) Determine a generating function for the number of words of length n. [Hint: One approach — surely not the only one — is to consider the words as being built up of components a, bb, cc.] (b) By expanding the generating function determine a general formula for the number of words of length n. Solution: (a) If we follow the hint, the generating function for words of length n will be ∞ X

x + 2x2

r

r=0

=

1 1 − (x + 2x2 )

(b) The generating function factorizes, and may then be expanded into partial fractions as 1 1 = 2 1 − (x + 2x ) (1 − 2x)(1 + x)   1 2 1 + = 3 1 − 2x 1 + x

Notes Distributed to Students in Mathematics 189-240A (2000/2001) 1 = 3

2

∞ X

∞ X n n 2 x + (−1)n xn

n=0

n=0

1164 !

∞ X 2n+1 + (−1)n n = x 3 n=0

so that the number of words of length n is “experimental” data given above.

2n+1 +(−1)n , 3

which agrees with the

3. In [17, Example 4.2.7] you have seen a solution to the following problem: “During a month with 30 days a baseball team plays at least 1 game a day, but no more than 45 games (in the month). Show that there must be a period of some number of consecutive days during which the team must play exactly 14 games.” Suppose that a team plays bi games on day #i where bi ≥ 1 (i = 1, 2, ..., 30), and 30 P bi ≤ 45 as before. Show carefully that there is no way in which the team may i=1

avoid playing exactly 15 games in a period of consecutive days. Solution: We follow the notation of the solution in [17, Example 4.2.7], defining i P ai = bk (i = 1, 2, ..., 30). Here again the sequence a1 , a2 , ..., a30 is strictly k=1

increasing, as is the sequence a1 + 15, a2 + 15, ..., a30 + 15. If, for some i and j, aj + 15 = ai , then exactly 15 games will be played on successive days ## j + 1, j + 2, ..., i. Suppose that this never happens for any i, j, i.e. that the two 30member sequences are disjoint. As all 60 members of these sequences lie between 1 and 45 + 15 = 60 inclusive, we conclude that every integer between 1 and 60 is attained exactly once — some in the sequence S = {ai }i , and some in the sequence T = {aj + 15}j . As all members of T are ≥ 16, we know that 1, 2, ..., 15 are attained only as elements of S, so ai = i (i = 1, 2, ..., 15), and b1 = b2 = ... = b15 . Thus the hypothesis that there is no period of consecutive days in which exactly 15 games are played implies its own contradiction, as there will then be exactly 15 games played in the first 15 days! From this contradiction we infer that the hypothesis is invalid: there will always be a period of consecutive days in which exactly 15 games are played. 4. (cf. [17, Exercise 4.3.42]) Determine a general formula for the coefficient of xk in the  n expansion of 2x − 3 x1 , where n is any integer. [Hint: The answer may depend upon the parity of n. You could begin by bringing the expression to a common denominator.]

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1165

Solution: 

1 2x − 3 x

n =

2x2 − 3

n

x−n

n   X n i = 2 (−3)n−i x2i−n i i=0

It follows that, when 2i − n = 2j , so

(209)

n , (210) 2  n n is j+n n (−3)−j+ 2 2j+ 2 if n is even; and 0 if n is odd. And, i=j+

the coefficient of x2j when

2

2i − n = 2j + 1 , so i=j+ the coefficient of x2j+1 is

n j+ n+1 2



(−3)−j+

(211)

n+1 , 2 n−1 2

2j+

n+1 2

(212) if n is odd; and 0 if n is even.

5. [17, Exercise 4.3.50] Let n be a positive integer. Prove the identity     2n n =2 + n2 2 2 in each of the following ways: (a) By applying the general formula   m! m = . s s!(m − s)! (b) By a combinatorial argument — i.e. by interpreting the two sides of the equation as representing two ways of counting the same set of objects. [Hint: Count the subsets of cardinality 2 of a set of 2n elements. Aside from the obvious way of counting these sets, one could proceed as follows. First divide the set up into two parts — you could call them A and B. Then there are three different types of subsets of cardinality 2: those contained entirely in A, those contained entirely in B, and those with one member in A and one member in B. Each subset of cardinality 2 is of precisely one of these types, so the total number can be expressed as a sum.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1166

(c) By working with power series. For example, you could compute, in two ways, the coefficient of x2 in the expansion of (1 + x)2n . Solution: (a) We use the fact that

Thus

  m m! m(m − 1) = = . 2 2!(m − 2)! 2   2n (2n)(2n − 1) = 2 2 = n(n − 1 + n) = n(n − 1) + n2   n = 2 + n2 . 2

(In the foregoing we have used an old equivalent of parentheses, called a vinculum; by n − 1 we mean (n − 1). This notation was discouraged by printers, who found it was difficult to set into type. It is convenient in situations where the overline does not have other meanings.) (b) We will prove a more general result. Suppose that |A| = a, |B| = 2n − a, and A ∩ B = . Then there are three types of sets of cardinality 2 in A ∪ B:  Sets contained entirely in A. Their number is a2 .  Sets contained entirely in B. Their number is 2n−a . 2 Sets having one element in A and one element in B. The element in A may be selected in a ways, and any one of these may be associated with any element from B, which may be selected in 2n − a ways. In all, by the Rule of Product, the number of subsets of this type is a(2n − a).   Summing, we obtain a2 + 2n−a + a(2n − a) , which must 2  be equal to the 2n number of distinct unordered pairs in A ∪ B, which is 2 . The special case a = n is the one that interests us. (c) We may compute the coefficient of x2 in (1 + x)2n in several ways. By the  Binomial Theorem, the coefficient is 2n . But we may also express the poly2 n n nomial as a product, (1 + x) · (1 + x) , and expand each of the binomial powers separately, ignoring terms which cannot contribute to the term in x2 , i.e. terms in powers greater than the second. This yields (1 + x)2n = (1 + x)n · (1 + x)n        n 0 n 1 n 2 = x + x + x + ... 0 1 2

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1167

       n 0 n 1 n 2 · x + x + x + ... 0 1 2        2 n n n n n 0 x + + x1 = 0 0 1 1 0          n n n n n n + + + x2 0 2 1 1 2 0 +terms in higher powers Equating coefficients of x2 yields               2 2n n n n n n n n n = + + =2 + 2 0 2 1 1 2 0 2 1 6. We wish to count the non-negative integer solutions to the following inequality, x1 + x2 + x3 + x4 ≤ 15

(213)

possibly subject to additional constraints. (a) Determine the number of solutions in non-negative integers, without additional constraints. (b) Determine the number of solutions in non-negative integers to the strict inequality x1 + x2 + x3 + x4 < 15 (214) such that 1≤ 3 0 1

x1 ≤ ≤ ≤

≤5 x2 x3 x4

(215) (216) (217) (218)

(c) Determine the number of solutions to (213) in non-negative integers such that x1 is odd and x3 is even. [Hint: It is usually easier to work with equations than inequalities. Inequality (214) may be transformed into an inequality by defining a new “slack variable” x5 by x5 = 15 − (x1 + x2 + x3 + x4 ) ,

(219)

and imposing the constraint that x5 ≥ 1; as x1 , ..., x4 are integers, x5 will also be an integer. Then the inequality is equivalent to the equation (219). That is, UPDATED TO September 19, 2000

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1168

any solution (x1 , x2 , ..., x4 ) to the inequality gives rise to precisely one solution (x1 , x2 , x3 , x4 , x5 ) to the equation; and, conversely, any solution to the equation corresponds to precisely one solution to the inequality.] Solution: (a) Introduce a slack variable as suggested in the hint. We can set up a correspondence between solutions to this equation and binary words in 15 1’s and 4 0’s, where the 0’s serve as separators, and the lengths of the strings of 1’s are, respectively, x1 , ..., x5 . The number of such words is 15+4 = 3876. 4 (b) This problem could be solved using ordinary generating functions, however, we will present a solution along the lines of the preceding problem, by changing variables. We will introduce new variables, so that the lower constraint on each of the new variables will be ≥ 0. (The strict inequality is replaced by the constraint x5 ≥ 1, which is then transformed as below. Specifically, we define y1 y2 y3 y4 y5

= = = = =

x1 − 1 x2 − 3 x3 x4 − 1 x5 − 1

so the equation transforms to y1 + y2 + y3 + y4 + y5 = 9

(220)

which is to be solved in non-negative integers, subject only to the one additional constraint y1 ≤ 4 . (221) We can then count the number of solutions without considering (221) and subtract the number of solutions that violate (221). The number of nonnegative solutions to (220) is the number of binary words in 9 1’s and 4 0’s, i.e. 9+4 = 715. The solutions which violate (221) can be counted by changing 4 the variables a second time: define z1 = y1 − 5 and zi = yi (i = 2, 3, 4, 5), and count the non-negative solutions to the equation z1 + z2 + z3 + z4 + z5 = 4 .  These are equinumerous with the binary words in 4 1’s and 4 0’s, i.e. 4+4 = 4 70. It follows that the number of solutions to the original problem is 715−70 = 645.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1169

To solve this problem using ordinary generating functions, we would have sought the coefficient of t15 in the expansion of  2 t3 1 t t(1 − t5 ) · · · 1−t 1−t 1−t 1−t which is the coefficient of t15−6 in the expansion of (1 − t)−5 minus the coeffi  4+9 4+4 cient of t15−11 in the same expansion, i.e. 4 − 4 = 715 − 70 = 645, as before. (c) This problem is easily solved using ordinary generating functions. Interpret x1 as the exponent of a power of a variable t in the power series t + t3 + t5 + ... + tx1 + ..., and x3 as the exponent of a power of t in the power series 1 + t2 + t4 + ... + tx3 + .... The other three variables may be interpreted as exponents of general powers of t in the power series 1 + t + t2 + .... Thus we are interested in determining the number of ways in which a term t15 arises in the expansion t(1 + t2 + t4 + ...)2 (1 + t + t2 + ...)3 where we need not be concerned about the maximum powers of t in the parenthesized power series, as the only constraint is on the total. (Had there been an additional constraint that, for example, x1 ≤ 12, we would have had to be more careful.) This expansion is also the Maclaurin expansion of t·

1 1 · 2 2 (1 − t ) (1 − t)3

which we now determine: t·

1 1 t · = (1 − t2 )2 (1 − t)3 (1 − t2 )2 (1 − t)3 t(1 + t)3 = (1 − t2 )5  ∞  X 4 + i 2i = (t + 3t + 3t + t ) t i    i=0   4+6 4+7 = ... + 1 · +3· t15 + ... 7 6 = 960 , 2

3

4

where only the values i = 7 and i = 6 yield terms that contribute to the coefficient of t15 .

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1170

[Note: The version of the problem that was first circulated in print was ambiguous, and some students could have assumed it referred to inequality (214) instead of to (213). In that case we would be seeking the coefficient of t14 , which by similar computations to the foregoing, could be shown to be   29·10! 5+5 1 · 5+6 + 3 · = = 1218.] 6 5 6!5! 7. You have a supply of 5 1’s, 4 2’s, 3 3’s, and 2 4’s. Determine the number of 5digit strings that can be formed from these symbols, where you may not use more than the stated multiplicities in any string. (The strings are not to be formed simultaneously. The problem is to determine which 5-digit strings can be formed from the given population; for example, 44433 is not permitted, as you have only two 4’s available; 11224 is permitted.) Solve the problem in two ways: (a) By dividing the problem up into disjoint cases, counting the numbers of strings of each type separately, and adding. (b) By using exponential generating functions. Solution: (a) There are different ways in which the problem can be decomposed into disjoint cases. One way is to subdivide according to the non-ordered partitions of 5 into sums of positive integers; then count the numbers of ways of selecting symbols with those multiplicities, and multiplying by the numbers of ways of ordering those symbols. We will list the cases in order of the maximum summand size. 5 = 5. There is only one symbol that is available in at least 5 copies: the symbol 1 is available in exactly 5 copies. Thus the number of ways in  which to choose 5 symbols, all of the same type, is 11 = 1. These 5 symbols, once chosen, may be arranged in 5! = 1 way. That is, there is 5! precisely 1 × 1 = 1 word of this type. In fact, this is the word 11111.  5 = 4 + 1. The symbol to have multiplicity 4 may be selected in 21 = 2 ways — it must be either of 1 or 2, since 1 is available in multiplicities up to 5, and 2 in multiplicities up to 4. That symbol having been chosen, we may  4−1 choose a (different) symbol to have multiplicity 1 in 1 = 3 ways: it cannot be the symbol chosen in multiplicity ≥ 4 — hence the subtracted 1 — but it may be any of the others, as all have multiplicity at least 1; (in fact, all have multiplicity at least 2. Thus the symbols for these words may be selected in 2 × 3 = 6 ways. Once the symbols have been chosen, 5! they may be arranged in 4!1! = 5 ways. Thus the total number of words of this type is 6 × 5 = 30.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1171

 5 = 3 + 2. Choose the symbol of to have multiplicity 3 in 31 = 3 ways — as it must be one of 1, 2, 3. Then choose the symbol to have multiplicity 2 in 4−1 = 3 ways — it may be any of the three symbols not yet used. 1 In all there are 3 × 3 = 9 ways to choose the symbols for the string, and 5! = 10 ways in which to order them; so there are 9 × 10 = 90 words of 3!2! this type.   5 = 3 + 1 + 1. Choose the letters in 31 32 = 9 ways, and order them in 5! = 20 ways; the total number of words of this type is 9 × 20 = 180. 3!1!1!   5 = 2 + 2 + 1. Choose the letters in 42 21 = 12 ways, and order them in 5! = 30 ways; the number of strings is 12 × 30 = 360. 2!2!1!   5 = 2 + 1 + 1 + 1. Choose the letters in 41 33 = 4 ways, and order them in 5! = 60 ways, for a total number of words of 4 × 60 = 240. 2!1!1!1! 5 = 1 + 1 + 1 + 1 + 1. This case is impossible, as there do not exist 5 distinct types of symbol. Summing the numbers of the different types of words we have 1 + 30 + 90 + 180 + 360 + 240 = 901 distinct 5-symbol strings. (b) The total number of strings will be 5! times the coefficient of x5 in the expansion of the exponential generating function   1 1 1 2 1 3 1 4 1 5 1+ x + x + x + x + x 1! 2! 3! 4! 5!   1 1 1 1 · 1 + x1 + x2 + x3 + x4 1! 2! 3! 4!   1 1 1 · 1 + x1 + x2 + x3 1! 2! 3!   1 1 · 1 + x1 + x2 1! 2!  4  3   1 1 1 2 1 1 1 2 3 3 2 4 1 5 = 1+ x + x + 1+ x + x · x + x + x 1! 2! 1! 2! 3! 4! 5! 6 +terms in x or higher powers 21 121 4 901 5 = 1 + 4x + 8x2 + x3 + x + x + higher power terms 2 12 120 Thus the number of words is 5! × compuation by cases.

901 120

= 901, which agrees with our earlier

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

E.4

1172

Solved Problems from the Fourth 1998 Problem Assignment

1. Consider the recurrence with initial conditions (n ≥ 0)

an+2 + 4an = 12 a0 = 2 a1 = 4

(222) (223) (224)

(a) Referring to [17, Definition 5.2.1, p. 318], explain why this recurrence is linear , but is not homogeneous. ∞ P (b) Defining the generating function a(x) = ai xi , solve the recurrence, subject i=0

to the stated initial conditions, by determining a(x) as a sum of ratios of polynomials in x, and by finding the MacLaurin expansion of that sum. [Hint: At some stages of that solution you may wish to expand a ratio of the form c0 +c1 x2 by treating x2 as the variable.] c2 +c3 x2 +c4 x4 Solution: (a) The recurrence permits us to express an as a linear combination of preceding members of the sequence (where the coefficients are known constant functions of n) to which is added a known function of n. Indeed, an = −4an−2 + 12

(n ≥ 2).

(225)

Because one of the summands — the term +12 — in equation (225) is not a multiple of some ai , the recurrence is inhomogeneous. (b) We multiply (222) by xn+2 and sum over the range 0 ≤ n ≤ ∞, to obtain ∞ X



n=0 ∞ X m=2

an+2 x

n+2

+ 4x

am xm + 4x2

2

∞ X

n

an x = 12

∞ X

xn+2

n=0 ∞ X

n=0 ∞ X n+2

n=0

n=0

an xn = 12

x

applying in the first sum a change of variable m = n + 2 x2 ⇔ a(x) − a0 − a1 x + 4x2 a(x) = 12 1−x 12x2 ⇔ (1 + 4x2 )a(x) = a0 + a1 x + 1−x

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1173

12x2 by (223), (224) 1−x 2 + 4x 12x2 ⇔ a(x) = + 1 + 4x2 (1 − x)(1 + 4x2 )

⇒ (1 + 4x2 )a(x) = 2 + 4x +

which is the desired expression of a(x) as a sum of rational polynomials. We will modify the procedure described in [17, Appendix 3, Example 10] in that we will not factorize the polynomial 1 + 4x2 , since that would entail the use of complex coefficients, and we can solve the problem more simply without that factorization. We will simply treat x2 as the variable where necessary. Then ∞ X 2 + 4x = (2 + 4x) (−4)r x2r 1 + 4x2 r=0 ∞ ∞ X X r 2r = 2 (−4) x + 4 (−4)r x2r+1 r=0

r=0

We will have to use partial fractions in expanding the second term, however. Setting, temporarily, t = x2 , and assuming A B t = + (1 − t)(1 + 4t) 1 − t 1 + 4t (1 + 4t)A + (1 − t)B = (1 − t)(1 + 4t) yields the polynomial identity t = (1 + 4t)A + (1 − t)B , from which we determine, by assigning values t = 1, 14 , that 1 = 5A and − 41 = 54 B, so A = 15 , B = − 15 , and 12x2 12x2 (1 + x) = (1 − x)(1 + 4x2 ) (1 − x2 )(1 + 4x2 )   12 1 1 = (1 + x) − 5 1 − x2 1 + 4x2 ! ∞ ∞ X X 12 = (1 + x) x2r − (−4)r x2r 5 r=0 r=0 It follows that  ∞  X 12 12 r r a(x) = − (−4) x2r 2(−4) + 5 5 r=0

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1174

 ∞  X 12 12 r r + 4(−4) + − (−4) x2r+1 5 5 r=0 =

∞ X −2(−4)r + 12 r=0

so ( an =

5

x2r +

∞ X 8(−4)r + 12 r=0

5

x2r+1

n

−2(−4) 2 +12 5 n+1 −2(−4) 2 +12 5

n≡0

(mod 2)

n≡1

(mod 2)

, i.e.

n+1 −2(−4)b 2 c + 12 an = . 5 2. A hostess has invited 2n persons to a party, but knows that among them every person has precisely one enemy (distinct from herself/himself), and the relation of being an enemy is symmetric. She wishes to seat the visitors in such a way that mutual enemies are separated.

(a) If the persons are to be seated around a single round table with unmarked chairs, in such a way that no person is immediately to the left or right of her/his enemy, what is the number of distinct seatings? (The hostess must also be seated somewhere at the table.) (b) Repeat the preceding, under the assumption that the hostess is not seated. (c) In each case, verify your formula when n = 0, 1, 2 by listing the actual seatings, or by counting them in some other way. Solution: Because of the large number of prohibited subseating configurations, the natural way to attack this problem is using the Principle of Inclusion and Exclusion. Label the pairs of enemies xi and yi (i = 1, 2, ..., n). (a) The total number of unrestricted seatings is (2n)!, since we are seating 2n + 1 persons around a round table. Define Ai to be the set of (prohibited) seatings in which xi and yi are seated together (i = 1, 2, ..., n). Then |Ai | = 21 (2n−1)!, since there are two orders in which the enemies could have been seated. More generally, considering the adjacently seated enemies as one unit, we have |Ai ∩ Aj | = 22 (2n − 2)! (i, j = 1, 2, ..., n; i 6= j); and, in general, the number of arrangements in the intersection of precisely r of the sets Ai is exactly 2r (2n − r)! (r = 0, 1, ..., n). By the Principle, the number of seatings is the alternating sum   n X n r (2n − r)! 2 (−1)r , (226) r r=0

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1175

 since there are nr ways of choosing a set of r violated adjacency conditions. We verify formula 226 for n = 0, 1, 2. n = 0: Here the hostess sits alone, in only one way. n = 1: The formula yields a sum of 0. This corresponds to the impossibility of separating the two enemies with only one separator around a round table. n = 2: The formula yields a sum of 8. Think of the circular ordering of 5 persons as being transformed into an oriented linear ordering of 4 persons by being “cut open” at the hostess. In this linear ordering persons x1 and y1 may not be adjacent, so they are either separated by one of x2 and y2 , or by both of them. The latter case is impossible, as then x2 and y2 would be adjacent. Hence the oriented linear arrangement is of one of the forms x1 ∗ y1 ∗ or y1 ∗ x1 ∗ or ∗x1 ∗ y1 or ∗y1 ∗ x1 ; there are two ways in each case of placing x2 and y2 into the positions marked ∗. (b) If n = 0, the number of seatings is 1 — the table is empty. Next, if n = 1, the total number of ways of seating 2 persons around an unlabelled round table is (2 − 1)! = 1; but |A1 | = (1 − 1)! = 1, the number of arrangements of one object around a round table. Note that in this case there is no power of 2 in the formula, since there is no distinction between left and right. InclusionExclusion yields the number 1 − 1 = 0 of permitted arrangements. Assume now that n > 1. Analogously to the preceding, we have number of = |Ai | = · · · = r \ Aij =

unrestricted arrangements of 2n persons 20 (2n − 1)! (n > 1) 21 (2n − 2)! ··· 2r (2n − r − 1)!

j=1

By Inclusion-Exclusion, the number of permitted arrangements when n ≥ 2 is   n X n r 2 (−1)r (227) (2n − r − 1)! r r=0 We verify when n = 0, 1, 2. n = 0: In the only seating the table is empty. n = 1: It is impossible to seat two persons at a round table without their sitting side-by-side.

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1176

n = 2: Analogously to the argument earlier in the case n = 2, the two pairs of enemies must be separated. Once we seat x1 and y1 in non-adjacent seats — and this can be done in only one way at a round table with unlabelled seats, the other two seats may be filled in just 2! = 2 ways. This agrees with formula (227) when r = 2:   2 X 2 r (3 − r)! 2 (−1)r = 3! − 2! · 2 · 2 + 1! · 1 · 22 = 6 − 8 + 4 = 2 r r=0 3. (cf. [17, Supplementary Exercise 6.2, p. 423]) Construct relations on the set {a, b, c, d} with each of the following properties, or prove that no such relation exists. (a) reflexive and symmetric, but not transitive (b) irreflexive42 , symmetric, and transitive (c) irreflexive, antisymmetric, and not transitive (d) reflexive, neither symmetric nor antisymmetric, and transitive (e) possessing none of the properties: reflexive, irreflexive, symmetric, antisymmetric, transitive. Solution: (a) This relation must contain (a, a), (b, b), (c, c), (d, d), as it is to be reflexive. In order to be intransitive, it must contain two sides of a triangle without the third. The smallest examples will have the following structure: R = {(a, a), (b, b), (c, c), (d, d), (a, b), (b, a), (a, c), (c, a)}. (We had to include the edges in reverse pairs, as the relation is to be symmetric.) The largest example will be of the form R = A × A − {(a, b), (b, a)}. (b) The smallest example is the empty relation,

.

(c) A smallest example is R = {(a, b), (b, c)}. (d) One example is R = {(a, a), (b, b), (c, c), (d, d), (a, b), (b, a), (c, d)} (e) One example is R = {(a, a), (a, b), (b, a), (b, c)} 4. (cf. [17, Supplementary Exercise 6.25, p. 424]) Let R(S) be a set consisting of some binary relations on a set S, i.e. R(S) ⊆ P(S × S). Define the relation on R(S) by R1 R2 iff R1 ⊆ R2 , where R1 and R2 are relations on S. 4

4

42

A relation R on a set A is defined [17, p. 365] to be irreflexive if (∀a ∈ A)((a, a) ∈ / R).

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1177

(a) Show that (R(S), ) is a poset. 4

(b) Taking S = {a, b, c}, and R(S) to be the set of posets on S, determine the Hasse diagram for (R(S), ). 4

Solution: (a) Given any set, the relation ⊆ is a partial ordering. The details of a proof — which were expected here — can be found in [17, Example 6.6.3, p. 403]. (b) We must first determine the set of posets on S. There are 5 distinct types; we list them according to their Hasse diagrams. : Only the relation

r

r

r

R1 = {(a, a), (b, b), (c, c)} r

:

r

r

R2 R3 R4 R5 R6 R7

= = = = = =

{(a, a), (b, b), (c, c), (a, b)} {(a, a), (b, b), (c, c), (b, a)} {(a, a), (b, b), (c, c), (a, c)} {(a, a), (b, b), (c, c), (c, a)} {(a, a), (b, b), (c, c), (b, c)} {(a, a), (b, b), (c, c), (c, b)}

r

A

:

r



A

 r

R8 = {(a, a), (b, b), (c, c), (b, a), (c, a)} R9 = {(a, a), (b, b), (c, c), (c, b), (a, b)} R10 = {(a, a), (b, b), (c, c), (a, c), (b, c)} r

r



: R11 = {(a, a), (b, b), (c, c), (a, b), (a, c)} R12 = {(a, a), (b, b), (c, c), (b, c), (b, a)} R13 = {(a, a), (b, b), (c, c), (c, a), (c, b)}

A  r

A

Notes Distributed to Students in Mathematics 189-240A (2000/2001)

1178

r r

: These are the total orders:

r

R14 R15 R16 R17 R18 R19

: : : : : :

a