Sunteți pe pagina 1din 281

McGILL UNIVERSITY

FACULTY OF SCIENCE
DEPARTMENT OF
MATHEMATICS AND STATISTICS
MATHEMATICS 189240A
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

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 (rst part)

4 First Problem Assignment

5 Class Quiz

4
4

8
8

14

6 Solutions to Problems on the Class


Quiz
17
7 Second Problem Assignment
8 References

21
901

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 coecients . . 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 Problems1232
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 dierent . . . . . 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)

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:3015:20;
F 10:0011:00
or by appointment
3983836
BROWN
@MATH.MCGILL.CA
MAASS 112
MWF 15:3016:30

TUTORS
I. Dch`ne
e e
BURN 1017
Th 114:0016:00

L. Dembl
ee
BURN 1029

DECHENE
@MATH.MCGILL.CA
ARTS W-120
W 16:3018:00

DEMBELE
@MATH.MCGILL.CA
ENGMC 122
T 14:3016: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
Instructors permission.) Abstractly dened 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 rst 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)

In your instructors eyes the main purpose of the test is as a dry run for the nal
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 insignicant; 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 signicant. 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 students 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 students nal 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

Calculators

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

1.8

Final Grade

The nal 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 oce 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

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 years 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 les in pdf format ( .pdf), which can be read by
Adobe Acrobat. Some older les on the Website are presently in PostScript format,
( .ps), for which an appropriate viewer is required (e.g. ghostview). Some of these les
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 nal examination be machine scored? No.

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

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

11

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;
Browns Friday oce
hour advanced to today.

16
23
30

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 = September 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
Verication Period (Graduating Students): October 1013
THANKSGIVING 11 4.3
13 4.3
DAY
Deadline for withdrawal (with W) from course via MARS = 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. Browns Oce


hour advanced to 13
Sept.

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

distribution of assignment #

assignment #n due

Read Only

reserved for eXpansion or review

distributed notes

Notation:

Section numbers refer to the text-book.

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


MONDAY

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

20
27

6.6
7.5

22
29

8.1

5.4, N 3
5.6 5
6.4, 6.5

24

7.4

7.8

5.4, 5.5, N
X

3
10
17

6
13

1
8
15

(This timetable could be subject to additional revisions.)

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

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 Quantiers
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
21
2
11
2

(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. 7678) 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.

11
2

1
2

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

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
briey here to maintain the integrity of
the present text-book. We will avoid the
authors use of the modulus as a unary
function [19, Denition 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 (rst part)


Section Name
Relations
and Their Properties
n-ary Relations and Their
Applications

Comments

Time
1-

The database application will be discussed very briey, 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)

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 nd a proposition which is logically equivalent to , in
which uses only the connectives , and (at most).
(b) Illustrate your algorithm by nding , 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) xyP (x, y)
(c) yxP (x, y)
(d) xyP (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) yxT (x, y)
(b) xyT (x, y)
(c) yxT (x, y)
(d) xyT (x, y)
(e) xyT (x, y)
(f) xyT (x, y)
(g) xyT (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 dened 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 denitions actually dene a function.
If the denition is defective, explain precisely what has gone wrong.

(a) f : N N, dened by f (n) = n.

(b) h : R R, dened by h(x) = x.


1
(c) F : R R, where F (x) =
.
x5
x + 2 if x 0
(d) : R R, where (x) =
x 1 if x 4
(e) : R R, where (x) =
(f) : Q Q, where

p
q

x2
if x 2
x 1 if x 4
= 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)

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 justied. Unless you are instructed to
the contrary, it is never sucient 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 dicult.
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 others 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) xyP (x, y)
(d) yxP (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) xyT (x, y)
(b) xyT (x, y)
(c) xyT (x, y)
(d) yxT (x, y)
(e) yxT (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 justication is requested.)
(a) {b, c} P (A)
(b)

(c)

AA

(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 justication
is requested.)
(a) c A B
(b)

P (B)

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

AA

9. Suppose D = {x, y} and E = {x, {x}}, where x = y. For each of the following
statements, determine whether it is true or false. (Because of time limitations no
justication 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)

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 rst 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) xyP (x, y)
(d) yxP (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 nd that
x
2
y=
=1+
, when x = 2. Thus, for every value of x distinct from
x2
x2
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 = 1 P (x, y) x =
. Thus no y other than possibly y = 1
y1
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) xyT (x, y)
UPDATED TO September 19, 2000

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

19

(b) xyT (x, y)


(c) xyT (x, y)
(d) yxT (x, y)
(e) yxT (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 justication is requested.)
(a) {b, c} P (A)
(b)

(c)

AA

(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 justication
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)

AA

Solution: TTFTT
9. Suppose D = {x, y} and E = {x, {x}}, where x = y. For each of the following
statements, determine whether it is true or false. (Because of time limitations no
justication 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)

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 denition [19, Denition 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
quantied 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:
reexivity
symmetry
antisymmetry
transitivity
All negative statements should be justied 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 denition of a|b requires that a = 0. Some authors dene the concept dierently, 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 denition 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 dened by aR7 b a = 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 = 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
A

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)
pn1 pn
pn
p1
A

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 dening 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 dierent 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 dierent. [Hints: (1) It suces 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)

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, 17361936. 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. 128140. 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 020154983
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. Knig, Theorie der endlichen und unendlichen Graphen. Kombinatorische


o
Topologie der Streckenkomplexe. (Theory of nite and innite 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 Birkhuser Verlag (1990), ISBN 0817633898.
a
Another reprint of the original version, published by Teubner Verlagsgesellschaft,
Leipzig (1986), ISBN 3-211-95830-4, has Eulers 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 9009700938133X.
[13] L. Lovsz, Combinatorial Problems and Exercises. North-Holland Publishing Coma
pany, Amsterdam, etc. (1979). ISBN 0444852190.
[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,
713714.
[17] K. H. Rosen Discrete Mathematics and its Applications, 3rd Edition, (McGrawHill, Inc., 1995), ISBN 007-853965-0.
[18] K. H. Rosen Student Solutions Guide for Discrete Mathematics and its Applications, 3rd Edition, (McGraw-Hill, Inc., 1995), ISBN 007-853966-9.
[19] K. H. Rosen Discrete Mathematics and its Applications, 4th Edition, (McGrawHill, Inc., 1999), ISBN 007-289905-0.
[20] K. H. Rosen Student Solutions Guide for Discrete Mathematics and its Applications, 4th Edition, (McGraw-Hill, Inc., 1999), ISBN 007-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. Sierpiski, Cardinal and Ordinal Numbers, Second Edition Revised . Polish Scin
entic 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. Erds, The Art of Counting, Selected Writings, edited by J. Spencer. MIT Press
o
(Cambridge, 1973). ISBN 0-262-19116-4.
[26] P. Erds, Gy. Szekeres, A combinatorial problem in geometry, Compositio Math.
o
2 (1935), 463470.

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

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

1
such that R2 = R2

(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 = 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

1
such that R1 = R1

(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 = 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 1s.
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 = 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] Dene 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 nd
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] Dene 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 nd
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 nd
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] Dene 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] Dene 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 nd
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 supercial 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
satises the initial conditions is an = (1 3n)(3)n (n 0).

Using ordinary generating functions: Dene b(t) =

bn tn to be the ordi-

n=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

bn+2 t

n+2

= 6t

n=0

n+1

bn+1 t

bn t n

9t

n=0

n=0

which reduces, after changes of variables of summation, to

bn t n ,

b t 9t

bk t = 6t
k=2

=1

n=0

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

b(t) =

= (1 + 12t)
m=0

m+21
(3)m tm
21

m m

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

(m + 1)(3) t 4

m=0

m=0

(n + 1)(3)n tn 4

=
n=0

n(3)n tn
n=1

(n + 1)(3)n tn 4

=
n=0

n(3)n tn
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 dening
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 satised 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),
is 9+3 . Those solutions which violate the right inequality of constraint (4)
3
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 nd that the number of solutions to (2) satisfying the given constraints is
12
8 7 + 3 = 130.
3
3
3
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 congurations. Here we transformed the problem so that the forbidden
congurations corresponded to y2 5 and y3 4. Computing the number
of points in the union allowed us, by complementation, to nd 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
A1
A2
A3
A4

=
=
=
=

{(x1 , x2 , x3 , x4 )|x1 + x2 + x3 + x4
{(x1 , x2 , x3 , x4 )|x1 + x2 + x3 + x4
{(x1 , x2 , x3 , x4 )|x1 + x2 + x3 + x4
{(x1 , x2 , x3 , x4 )|x1 + x2 + x3 + x4

= 12; i[xi
= 12; i[xi
= 12; i[xi
= 12; i[xi

0]; x1
0]; x2
0]; x3
0]; x3

1}
5}
= 0}
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.

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
=

1t 1t
1t
1t
t3 (1 t4 t5 + t9 )
=
(1 t)4

m+3 m
t
3

12

= (t t t + t )
m=0

in which the coecient 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 rst. Consider the nn 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 o-diagonal entries are restricted in pairs. For any symmetrically positioned
pair, say in positions (i, j) and (j, i) (where i = j) there are only two possible

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

1010

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

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 o-diagonal symmetric pairs of entries in the
adjacency matrix to be anything except both 1: thus there are 3 acceptable values that the pair may take, corresponding to the three possible cases for i = j:
(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 o-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 sucient 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 dened 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

fi2 = fn fn+1

(8)

i=1

Solution: Let P (n) denote statement (8).


2
Basis Step: P (1) states that f1 = f1 f2 . We know this to be true, since f2 =
2
f1 + f0 = 1 + 0 = 1, so f1 = 12 = 1 = 1 1 = f1 f2 .

Induction Step: Suppose that P (n) is true. Then


n+1

fi2

i=1

n+1

fi2

2
fn+1

by denition of

i=1

=
=
=
=

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 dened 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

f2i1 = 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

f2i1 =
i=1

n+1

f2i1 + f2n+1

by denition of

i=1

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 nding 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 remaining 2 points. There are 3 = 3 ways of partitioning a set of 3 into 2 sets of
1
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 = 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 nding 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 remaining 2 points. There are 3 = 3 ways of partitioning a set of 3 into 2 sets of
1
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 3 pairs of distinct vertices.
2

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 verication6 procedures may have been taken
more seriously than other errors. It is particularly important to implement verication
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.
pr
qr
(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 sucient 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 = nx1 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 + ...) =
t2 (1 t)3 =

m=0

m+2
2

tm+2 =

n=2

n
2

tn . (The factor series begin with the term

t1 because the summands x1 and x2 were to be positive.) Hence the number of


solutions for n is n ; as the coecients of powers of t lower than the 2nd are 0,
2
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. Dene 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 1s and n 2 0s, whose number is
evidently n . Note that there are 0 solutions when n 1.
2
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
is (1 t2 )1 (1 t)1 =

1+t
(1t2 )2

= (1 + t)
m=0

m+1
1

(t2 )m . The coecient of t2m is

m + 1, so there are m + 1 solutions to x1 + x2 = 2m; the coecient 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 n+1 .
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. Dene the subset Ai to consist of all strings that contain exactly 2
is (i = 0, 1, ..., 9). Then |Ai | = 4 92 , since there are 4 ways of selecting the
2
2
locations for the prohibited is, 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
j, |Ai Aj | = 4 , the number of ways of choosing the locations for the is after
2
which the js must be placed in the remaining two locations. By the Principle of
Inclusion-Exclusion, the total number of strings is
104

10
1

4 2
10
9 +
2
2

4
2

= 10, 000 4860 + 270 = 5410 ,

where 10 counts the number of prohibited subsets, and


1
of pairs of prohibited subsets.

10
2

counts the number

Although it was required that students solve this problem using the Principle of
Inclusion-Exclusion, we present, for verication 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,
x2
e
2
x

10

45 4 8x
x e ...
4
104
92 45
5
+
x4 + ...
4!
2!
4

= e10x 5x2 e9x +


= ... +

As the coecient of x4 is 5410 , the number of words is 5410, conrming 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. Dene the subset Ai to consist of all strings that contain exactly 3
is (i = 0, 1, ..., 9). Then |Ai | = 6 93 , since there are 6 ways of selecting the
3
3
locations for the prohibited is, 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 | = 6 , the number of ways of choosing the locations for the is after
3
which the js must be placed in the remaining three locations. By the Principle of
Inclusion-Exclusion, the total number of strings is
106

10
1

6 3
10
9 +
3
2

6
3

= 1, 000, 000 145, 800 + 900 = 855, 100 ,

where 10 counts the number of prohibited subsets, and


1
of pairs of prohibited subsets.

10
2

counts the number

Although it was required that students solve this problem using the Principle of
Inclusion-Exclusion, we present, for verication 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,
ex

x3
6

10

= e10x
= ... +

10 3 9x 90 6 8x
x e + x e ...
6
72
6
10
5 93 5

+
x6 + ...
6!
3 3! 4

As the coecient of x4 is 855100 , the number of words is 855,100, conrming 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.)
3
Solution: The characteristic equation, 4r2 12r + 9 = 0, has a solution r = 2 , 3 ,
2
n
of multiplicity 2. Hence the general solution is an = ( + n) 3 . Imposing the
2
initial conditions yields two equations,

= 4
( + )

3
2

= 2

from which we determine that = 16 . It follows that the particular solution is


3
an =
Thus a60 = 316

16n
4
3

3
2

3 60
.
2

XI. [10 MARKS] Solve the recurrence 25bn+2 + 10bn+1 + bn = 0 subject to the initial
conditions b0 = 3, b1 = 1 , and determine the value of b80 . (The value of b80
2
should be expressed without s or ...s, using not more than one + or sign.)
1
Solution: The characteristic equation, 25r2 +10r+1 = 0, has a solution r = 5 , 1 ,
5
n
1
of multiplicity 2. Hence the general solution is bn = ( + n) 5 . Imposing the
initial conditions yields two equations,

= 3
1
1
( + )
=
5
2
from which we determine that = 1 . It follows that the particular solution is
2
bn = 3 +
Thus b80 = 37 580 .

n
(5)n
2

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 reexive.
Solution: Represent each relation by a zero-one matrix M . There are

n
2

on
diagonal pairs of entries that must be lled alike: these pairs can be lled in 2( 2 )
ways. The diagonal entries may be lled in any way save one they cannot all be
1, as then the relation would be reexive; thus the diagonal entries may be lled
in 2n 1 ways. By the product rule, the number of symmetric relations that are
n
n+1
n
not reexive 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 reexive.
Solution: Represent each relation by a zero-one matrix M . There are n o2
diagonal pairs of entries that may not both contain a 1: these pairs can be lled
n
in (2 2 1)( 2 ) ways. The diagonal entries may be lled in only one way each
they must all be 1 for the relation to be reexive. Accordingly, the number of
n
antisymmetric relations that are also reexive 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 reexive.
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 lled in 2 ways, independently of the others. We shall
subtract from this number the number of relations which are both symmetric and
reexive.

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

1021

n
2

For these, there are

o-diagonal pairs of entries that must be lled alike: these


(n) ways. The diagonal entries may be lled in only 1 way
pairs can be lled in 2 2
each must be a 1. Hence the number of binary relations that are not both
n
2
symmetric and reexive 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 lled independently. From this we subtract
the number of relations which are antisymmetric: the o-diagonal symmetrically located pairs may be lled in 22 1 ways each, since one of the 4 possible
cases placing 1 in both locations is forbidden; the diagonal entries may
be lled 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 o-diagonal symmetrically
located pairs may each be lled 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 o-diagonal
entries may only be lled with 0s, so there is freedom only in the lling 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

2n 3 ( 2 ) 2 n 2 ( 2 ) 2 n + 2 n = 2 n 2n 3( 2 ) + 2 ( 2 ) 1
2

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 lling each row in
all, nn functions. The number of derangements is, by Inclusion-Exclusion,
n! 1

1
1
1
1
+ + ... + (1)r + ... + (1)n
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


nn n! 1

1
1
1
1
+ + ... + (1)r + ... + (1)n
1! 2!
r!
n!

A.6.2 Solution of linear homogeneous recurrences with constant coefcients


For problems of this type the generating function approach is usually more dicult.
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 5 and 1 .
2
2
n
n
The general solution is of the form an = A 5 + B 1 . Imposing the initial
2
2
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 satises the
n
initial conditions is an = (3 (5)n 1) 1 .
2
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 satises the


initial conditions is bn = (4 n)7n .
8. Using any method, solve the following recurrence subject to the stated initial conditions:
9un + 9un1 4un2 = 0 (n 2)
u0 = 1
u1 = 3
1
Solution: The auxiliary polynomial is 9r2 + 9r 4, whose roots are 3 and 4 .
3
n
n
The general solution is of the form un = E 1 + F 4 . Imposing the initial
3
3
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 satises the
n
initial conditions is un = (1 2(4)n ) 1 .
3
Solution Using Generating Functions: Multiply the recurrence by xn and sum over
all valid values, i.e. from n = 2 to . If we dene the generating function u(x) =

, 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+9x4x2 . Factorizing the denominator, and expanding by
partial fractions, we obtain u(x) = 111 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 12gn1 + 9gn2 = 0 (n 2)
g0 = 2
g1 = 3
2

Solution: The auxiliary polynomial is 4r2 12r+9 = (2r3)2 = 4 r 3 . As this


2
n
has a root 3 of multiplicity 2, the general solution is of the form gn = (G+Hn) 3 .
2
2

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 satises the


n
initial conditions is gn = (2 + 4n) 3 .
2
Solution Using Generating Functions: Analogously to the solution to the preceding

problem, we can show that the generating function g(x) =

gn xn satises an

n=0

equation (4 12x + 9x2 )g(x) = 8 + 36x, from which we can show that
g(x) =
=

2 + 9x
1 3x + 9 x2
4
2 + 9x
1 3x
2

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 satised.
Solution: The number of solutions will be the coecient of tn in the expansion of
(t + t2 + t3 + ...)(t2 + t3 + t4 + ...)(t3 + t4 + t5 + ...)
t3
t
t2
=

1t 1t 1t

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

1025

= t6 (1 t)3

= t
m=0

m + 2 m+6
t
2

=
m=0

n4 n
t
2

=
n=6

i.e.

n4
2

m+2 m
t
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 satised.
Solution: The number of solutions will be the coecient of tn in the expansion of
(1 + t + t2 + ...)(t3 + t4 + t5 + ...)(t4 + t5 + t6 + ...)
1
t3
t4
=

1t 1t 1t
= t7 (1 t)3

= t7
n=0

=
n=0

=
m=7

i.e.

m5
2

n+2 n
t
2

n + 2 n+7
t
2
m5 m
t
2

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 satised.


Solution: The number of solutions will be the coecient of tn in the expansion of
(t + t2 + t3 + ...)4
t
1t

= t
m=0

=
m=0

=
n=4

i.e.

n1
3

= t4 (1 t)4
m+3 m
t
3

m + 3 m+4
t
3
n1 n
t
3

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 satised.

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

1027

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


(1 + t + t2 + t3 + ...)(1 + t1 + t2 + t3 + ...)(1 + t + t2 )
1
1
1 t3
=

1t 1t 1t
= (1 t3 ) (1 t)3

= (1 t )
m=0

m+2 m
t
2

m+2 m
m + 2 m+3
t
t
2
2
m=0

=
m=0

m+2 m
n1 n
t
t
2
2
n=3

=
m=0

For n 3 the coecient of tn is the dierence


n+2
n1

2
2

= 3n .

Alternatively, one could proceed as follows:


(1 + t + t2 + t3 + ...)(1 + t1 + t2 + t3 + ...)(1 + t + t2 )
= 1 + t + t2 (1 t)2

m+1 m
n n
n1 n
t +
t +
t
1
1
1
n=1
n=2

=
m=0

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 rst problem
below, the proposition we have called P (1) is true, you need to prove that the
instance of the claimed formula, in this case 312 is equal to the sum, in this case
3
1
i(i + 1). Your proof could consist of evaluating the two expressions, and
i=1
observing that they are equal; or it could consist of a sequence of equations like
1

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

(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

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 nd that
1

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

i(i + 1) =
i=1

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


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

j(j + 2) =
j=1

(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 nd that


1

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

j(j + 2) =
j=1

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


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:
ab
(b c) a
ac
ab
A

Solution: (Many students misunderstood the signicance 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

ab
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:
uv
w (u)
(w v) u
vu
A

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 dened by
(x, y) R x = y
is an equivalence relation.
Solution: This relation is not transitive. For example, 1 = 2 and 2 = 1, but it is
not true that 1 = 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 reexive indeed, it is
irreexive 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 dened by
(a, b) S a|b
is a partial ordering.
Solution: This relation was dened 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 conned 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 3 = 3 pairs of these sets each contains exactly
2
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 3 ways, and multiply by the number of ways in which the two points
1
mapped on to it may be chosen, i.e. by 4 . This leaves two points, each of which
2
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
1

4
2! = 36
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 dening n = b 1. However, it could happen that we cannot
dene 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

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

1033

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 rst 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 specically 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 nal 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
to replace 5 by 10, but you will not be expected to evaluate 10 . Where the reduction
4
3
requires little energy, you should carry it out in case the reduced nal 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
pq
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.
A

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 rst 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.
A

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.
A

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 rst 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.
A

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 denition 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 dicult, a rst 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 nding 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) denition 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 1
(x = 2, 3). Let us dene g to be the function 1 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 1
(x = 2, 3). Let us dene g to be the function 1 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 ) denition 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 coecients. These coecients are determined,
for example, by substituting the form into the recurrence and either comparing
coecients 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 coecients. Many students failed to complete
the solution by determining the coecients.
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 satises 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 coecients 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 dicult than the preceding method. We dene A(t) =

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

an+2 t

n+2

4t

n=0

= t2 t
n=0

an t = t

n(2t)n
n=0
2

+ 3t A(t)

1
1 2t

1 4t + 3t2 A(t) = a0 + (a1 4a0 )t +

A(t) =

n=0

an t n = t 2

4t A(t) a0 t

d
d
((2t)n ) = t3
dt
dt

n(2t)n

n=0
1

n=0

m=1

A(t) a0 t a1 t

+ 3t

am tm + 3t2

n=0

m=2

an+1 t

am tm 4t

n+1

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

3
=
2

1
3 t
2
n=0

n n

tn
n=0

2t
1
1
1
1
=

+
2
2
(1 3t)(1 t)(1 2t)
1 3t 1 t (1 2t)
1 2t

(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
have the form ahomog = C 3n + D n2n , where C and D are any real numbers.
n

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

1039

(3n 1 n 2n ) tn

=
n=0

so the general solution is

A(t) = (a0 + (a1 4a0 )t)


m=0

3 m 1 m m
3 1
t +
(3m 1 m 2m ) tm
2
2
m=0

= a0
m=0

3 m 1 m m
3 1
t + (a1 4a0 )
2
2
m=0

3 m 1 m m+1
3 1
t
2
2

(3m 1 m 2m ) tm

+
m=0

= a0
n=0

3 n 1
3
2
2

tn + (a1 4a0 )
n=1

1 n 1
3
2
2

tn

(3n 1 n 2n ) tn

+
n=0

a0
n=0

3 n 1
3
2
2

+ (a1 4a0 )

1 n 1
3
2
2

+ (3n 1 n 2n ) tn

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 satises 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 coecients of like powers of n yields equations as follows:
0 = 0
10A = 1
7A + 5B = 1
which we may solve, to obtain A =
2 17
an = 5n 50 .

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 satises 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 coecients of like powers of n yields equations as follows:
4A = 6
4A + 4B = 3
3
which we may solve, to obtain A = 2 , B = 9 . Hence one particular solution is
4
3
an = 4 (2n 3).

L Showing all your work, determine a sequence a0 , a1 , ..., an , ... (i.e. a particular
solution) which satises 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 simplies to 9A(4n + 4) + 36B = n (n = 0, 1, 2, ...).. Equating coecients of
like powers of n yields equations as follows:
36A = 1
4A + 4B = 0
which we may solve, to obtain A =
an = n1 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 sucient to observe, for example, that the integer
1200
= 2.
610
P Assume that friendship is a symmetric irreexive 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 ve 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 ve vertices: friendships
yields a pentagon with one colour, non-friendship is given by the remaining 5 5 =
2
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 Ramseys Theorem [19, Example 4.2.10], or of the theorem of P.
Erds and Gy. Szekeres [26], [25, p. 18].
o
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, classied 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 1 = 1 way, and the letter


1
of multiplicity 1 in 41 = 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
which are available in multiplicities of at least 2 in 2 = 1 way. The chosen
2
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 the letter having multiplicity 2 in 2 = 2 ways, and
1
the other two letters in 41 = 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 4 = 1 way. They may be arranged in 4! = 24 ways.
4
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, classied 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
which are available in multiplicities of at least 2 in 2 = 1 way. The chosen
2
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 the letter having multiplicity 2 in 2 = 2 ways, and
1
the other two letters in 51 = 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 5 = 5 ways. They may be arranged in 4! = 24 ways. Thus
4
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, classied 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
which are available in multiplicities of at least 2 in 3 = 3 ways. The chosen
2
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 the letter having multiplicity 2 in 3 = 3 ways, and
1
the other two letters in 41 = 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
be chosen in 4 = 1 way. They may be arranged in 4! = 24 ways. Thus there
4
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, classied 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.
5 = 3 + 2: We can choose the letters of multiplicity 3 from {A,B,C} in 3 ways;
1
the letter of multiplicity two can then be chosen in 2 ways. The chosen
1

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 the letter having multiplicity 3 in 3 = 3 ways, and


1
the other two letters in 31 = 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.
5 = 2 + 2 + 1: Choose the letters of multiplicity 2 in 3 = 3 ways, and the letter
2
5!
of multiplicity 1 in 32 = 1 way. The letters may be arranged in 2!2!1! = 30
1
ways. Thus there are 3 1 30 = 90 such words.
5 = 2 + 1 + 1 + 1: This case cannot occur, as there dont exist as many as four
dierent kinds of letters.
5 = 1 + 1 + 1 + 1 + 1: This case also cannot occur: there are only three dierent
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 veried 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 verication 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 nding 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 + ... = 1t ; the enumerator
1
for x2 is t0 + t1 + t2 + ... = 1t ; the enumerator for x3 is t3 + t4 + t5 + ... =

t3
.
1t

The generating function for the number of solutions

t
1t

1
1t

t3
1t

t4
(1t)3

= t4

m=0

m+2
2

tm =

n=4

bn tn is the product,

n=0
n2
2

tn , so bn =

n2
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 nding 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 + ... = 1y ; the enumerator for x2 is y 0 + y 1 + y 2 + ... = 1y ;
1
the enumerator for x3 is 1 + y + y 2 + ... = 1y ; the enumerator for x4 is also
1
.
1y

The generating function for the number of solutions

1
1y

=
n=0

cn y n is the product,

n=0
n+3
3

y , so cn =

n+3
3

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 nding 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 + ... = 1t ; the enumerator for y2
2
t
t
is t2 +t3 +t4 +... = 1t ; the enumerator for y3 is t+t2 +t3 +... = 1t . The generating

function for the number of solutions


t6

m=0

m+2
2

tm =

n=6

bn tn is the product,

n=0
n4
2

tn , so bn =

n4
2

t3
1t

t
t
1t 1t =

t6
(1t)3

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 nding 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 + ... = 1y ; the enumerator for y2 is y 0 + y 1 + y 2 + ... = 1y ;
1
the enumerator for y3 is 1 + y + y 2 + ... = 1y ; the enumerator for y4 is also
1
.
1y
1
1y

The generating function for the number of solutions

=
n=0

n=0
n+3
3

y , so cn =

n+3
3

cn y n is the product,

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

1048

Problems on 1995 1999 examinations


These examinations were printed in a book, size 8 1 inches 14 inches, with adequate
2
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) ,

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 denition 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+
induction proof that S(m + 1, m) = m 1 for all m 2. Only an induction
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 xed integer, (k 5), and let a
relation be dened on the set by
(x, y) (u, v) i (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 = 1) (b = 2) (c = 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 dierent, 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


positions, in any order, in the row.

consecutive

(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) ,

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:

(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 dened 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)2n1 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 reexive.

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 dierent 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 + 3an1 , (n 1), subject to initial conditions a0 = 1, a1 = 7.
5. (a) [5 MARKS] Determine the number of dierent strings that can be formed
from all the letters of the word PEPPERCORN.
(b) [5 MARKS] Determine the number of dierent 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 dierent strings that can be formed
from all the letters of the word PEPPERCORN where no two Ps 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
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 nd, 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 + 4an1 4an2 = 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
1
n=0
ai =
.
4an1 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 dened 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),
(yxP (x, y)) (xyP (x, y))

by

i ((U V ) (V U ))

Showing all your work, determine whether or not

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

is a partial order.

10. [10 MARKS] Give an example of a graph G dierent 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:
pq
pr
tp
tr
rs
ts
tp
pt

(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.


pq
qr
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 dierent ways in which
a student can obtain a grade of 10.
4. [10 MARKS] Using any method studied in this course, solve the recurrence
9an1 = 6an an+1 , (n 1), subject to initial conditions a0 = 1, a1 = 3.
5. (a) [5 MARKS] Determine the number of dierent strings that can be formed
from all 12 of the letters of the words FREEZING RAIN.
(b) [5 MARKS] Determine the number of dierent 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 dierent strings that can be formed
from all the letters of the words FREEZING RAIN where no two Rs can
appear side by side.
6. (a) [5 MARKS] Prove or disprove: If S is a reexive 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 reexive 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 R such that R R , where R is to have certain specied properties. In each of the following separate cases either prove that, for any R, a relation
R must always exist; or prove by a counterexample that it may happen that no
such R exists.

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

1056

(a) [3 MARKS] R is reexive.


(b) [3 MARKS] R is symmetric.
(c) [3 MARKS] R 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 As, and you may use any number of them.
There are 3 Bs and you must use only an odd number of them.
There are 4 Cs, 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 = 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 dened 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 satises 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 Eulers formula for maps on the plane or sphere (or for
graphs embedded in the plane or on the sphere).
(b) [7 MARKS] Apply Eulers 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 nite set A, where |A| = n. Showing
all your work, determine the number of such relations such that
(a) [3 MARKS] R is reexive.
(b) [3 MARKS] R is symmetric and not reexive.
(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 As, and you may use any number of them.
There are 4 Bs, and you must use only a positive, odd number of them.
There are 4 Cs, 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)
A

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 + x 4 = 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 satises 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 satises the recurrence
bn = bn+1 + 5bn+2 + 3bn+3

(n 0) .

7. (a) [2 MARKS] State Eulers formula for maps on the plane or sphere (or for
graphs embedded in the plane or on the sphere).
(b) [4 MARKS] Apply Eulers formula to prove that the complete graph K5 cannot
be embedded in the plane or sphere.
(c) [3 MARKS] Apply Kuratowskis 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)
rs
A

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

1060

2. (a) [2 MARKS] Dene 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 dened 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

n2 n
n=2

1
2n
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 satises the recurrence
2an+2 3an+1 + an = 21n

(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)
rs
A

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] Dene what is meant by an partial ordering on S.


(b) [3 MARKS] Showing all your work, determine exactly how many reexive
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

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
satises the recurrence
an+2 2an+1 + an = n2 2n

(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)

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 nd 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 innitely 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 yxP (x, y) is true, does it necessarily follow that xyP (x, y) is true? If the answer is YES, prove it! If NO,
give a specic counterexample.10
(b) If xyP (x, y) is true, does it necessarily follow that yxP (x, y) is true? If
the answer is YES, prove it! If NO, give a specic 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 specic 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 yxP (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 rst 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 rst 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:
AC = BC
AC = BC

(38)
(39)

Prove or disprove each of the following statements.


(a) AB(C(38) A = B)
(b) AB(C(39) A = B)
(c) AB(C(38) A = B)
(d) AB(C(39) A = B)
Solution: Both with binary connectives and with quantiers there are often situations where the interpretation of a statement can be ambiguous. In the case
of quantiers the usual convention is that the quantier 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 specic choices of A
and B. Let A = {1, 2}, B = {1}, C = {2}. Then A C = {1, 2} = B C,
but A = B.
(b) The statement is false: we give a counterexample, with specic 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 = B.11
11

We observe that, notwithstanding the two preceding results, AB(C((38) (39)) A = B)) is
true. We can express A C and B C as disjoint unions as follows;
AC
BC

= (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 satised:
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 dened by the action a g(f (a)), i.e. by
(g f )(a) = g(f (a)) for all a A. (This is essentially [17, Denition 1.10,
p. 66], except we emphasize that it is not sucient to specify the action of a
function: both its domain and its codomain must be unambiguously specied,
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 justication 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 dierent 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 suces 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 denition of
denition of A ; and
by denition of
denition of B

for any a A, proving that f A = f = B f .


The diculty 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 rst step is to show that, by virtue of the denition 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 denition of m
m( (f (a)))
by denition of f
(m )(f (a))
by denition of m
((m ) f )(a)
by denition 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 innitely 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 dened by
3n + 1 i = 0
f (2n + i) =
. One enumeration in the present, more complicated
3n + i = 1
2
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 innitely many other possible enumerations. The systematic way in which we have, in eect, 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 reexive relations on a set A.
Prove or disprove each of the following statements:
(a) R S is reexive
(b) R S is symmetric
(c) R S is irreexive
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 reexive relation i.e. just the diagonal elements {(a, a)|a A}. Let R be
a reextive relation which is not symmetric; for example, R could consists of
the diagonal together with some element (a, b), where a = 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 dierence (sometimes denoted by
RS). Since the diagonal elements are present in both R and S, none is
present in R S. This is precisely the denition of irreexivity [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.

reexive?
irreexive?
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 dierent from what is intended, or through the choice of an ambiguous word. One such case is the
word asymmetric: a relation R is asymmetric i ab((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 (ab((a, b) R (b, a) R)) is true,
i.e. if ab(((a, b) R (b, a) R)) is true, i.e. if ab(((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. Reexive: The reexive relations have a 1 in the diagonal entries in the
table: 1001, 1011, 1101, 1111
ii. Irreexive: A relation is dened to be irreexive 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 reective 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 o-diagonal
entries (in the present case there is only one such pair) must be dierent.
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 dicult 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 dened by
xyz((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
AAA; 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, Denition 6.2.3]) is the same as S 2 ([17, Denition
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 dened 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 rst writes
down the positive integers 2, 3, 4, 5, ..., n. In the rst 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 rst 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 nd 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) =
273 384 521 7110 = 24 34 51 711 .
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 dened sequence, the Fermat primes dened
to be those primes of the form 2n + 1. You should be familiar with the identity
x2m+1 + 1 = (x + 1) x2m x2m1 + ... 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(2m1)d + ... 2d + 1 .
The rst factor, 2d + 1, is evidently greater than 1. The second factor may be
expressed as a sum
(22md 2(2m1)d ) + (2(2m2)d 2(2m3)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 4s 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 + ek1 3k1 + ... + 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, nd 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
38+2
32+2
30+2

from which we conclude that 79 = 1 + 2 31 + 2 32 + 2 33 . Now we progressively


eliminate coecients 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
391
33+0
31+0
30+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 suce 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 nd 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 rst 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 dened 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+. . .+(2n1), the
n

notation is just an abbreviation for the nite sum normally denoted by

(2i 1),
i=1

n+1

(2i 1) = 1,

which is dened recursively by


i=1

(2i 1) =
i=1

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


i=1

where the sum is innite 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
dened recursively.
For example, the rst use of . . . appears in [17, p. 186, l. 2], in the sequence 1, 2,
3, . . ., n. Here the dots connect the rst 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

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 dened
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
notation. So we could represent 1 + 2 + 22 + . . . + 2n + 2n+1 by

n+1

2i , which

i=0

can be dened recursively as a function of n.


(d) [17, p. 189, last 2 paragraphs]: Here there are several instances where dots are
used to describe innite 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
(nite) 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 nite sum that could have been dened 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 rst n or n + 1 terms of this
sequence. These sums could be dened 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. Dene
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 dened, then Q(r + 1) is dened 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 nite
number of logical propositions.
2. [17, Exercise 3.2.16] Use mathematical induction to prove that
n

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

i(i + 1)(i + 2)
i=1
n

n+1

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


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 a100 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
b
positive rational number. Then a is expressible as a ratio c of positive integers.
b
But now the rational number 2c 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 1002 (since
the dierence 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 [104 n, 104 (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 = , this algorithm must terminate.
1
1
4. [17, Exercise 3.2.18] Prove that 1 + 1 + 1 + + n2 < 2 n whenever n is a positive
4
9
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 dicult 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

the value. For example, it is known that i1 = 6 = 1.64493.... which gives a


i=1 2
better bound than the one you are asked to prove, as soon as n 3.
2

1
Let P (n) denote the statement n i1 < 2 n . P (2) states that
i=1 2
is evidently true. Suppose that P (n) has been proved. Then
n+1

i=1

1
=
i2

i=1

1
1
+
2
i
(n + 1)2
1
n

1
(n + 1)2
1
1
= 2
+
(n + 1)2 n
1
n
=
=
n(n + 1)
n+1
<

5
4

< 2 1 which
2

n+1

by recursive denition of
by induction hypothesis
2

1
1
+
n(n + 1) n

Why?

5. In the propositional calculus, the set W F F of well formed formul is dened


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: Dene 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 rst such integer will be 9 1000 = 1008;
9
the last is 9 9999 = 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 rst digit is not a zero. The rst
digit may be chosen in 9 ways. Following that, the second may be chosen
independently of the rst, from the residual population of 9 digits (excluding
the rst 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 1000 = 1002. Their number is 99991002 +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 | = 9999 999 = 1428142 = 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 999 = 28; the number of such multiples not
35
exceeding 9999 is 9999 = 285; hence the number of multiples of 35 in the
35
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 aected 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 the image of 1
point in 3 = 3 ways, and the point of A to be mapped to it in 5 = 5 ways.
1
1
Then we can select the points of A to be mapped on to one of the remaining 2
points of B in 4 = 6 ways; there is no choice for the action on the remaining
2
points. Applying the Product Rule we nd that the total number of surjective
mappings associated with this partition to be 3 5 6 = 90.
In the case of partition 3 + 1 + 1, choose the point of B to receive 3 points in
3
= 3 ways, and the points to be mapped on to it in 5 = 10 ways. Then
1
3
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 denition 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.) Dene 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 Si .
i=0
A similar denition, 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 = 2 2 .
9. [17, Exercise 4.3.28] How many bit strings contain exactly ve 0s and 14 1s, if
every 0 must be immediately followed by 2 successive 1s
Solution: Every 0 appears as the rst 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 rst 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 72 = 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

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
1s; follow each of these strings except the last by a 0, serving as a separator.
Conversely, any binary integer in 29 1s and 5 0s 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 0s and 1s. Dene 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 1s and 5 0s is

17+5
5

= 26 334.

(b) x i (i = 1, 2, 3, 4, 6); x5 > 5: We shall change the variables. Dene


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
1s and 5 0s is 7+5 = 792.
5
(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
ber of solutions satisfying the present condition is 29+5 28 = 278 256
5
5
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 ,
i.e. 25 = 53 130. From these we wish to exclude the solutions corresponding
5
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 dierent strings can be made from all
the letters in AARDVARK, subject to the condition that the three As 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 Rs been distinguishable, the number would have been 6!. Here, as the Rs 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 coecients, unless knowing their values can help you verify
your work.

1. Showing all your work, determine the total17 coecient of z 7 in the expansion of
(x 2yz + 3z 2 )11 .
Solution:
Using the Multinomial Theorem [17, Exercise 4.6.49]: The coecient 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 coecient 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 coecient is evidently 0.

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

1089

11 4
11 5
x (2y + 3z)7 z 7 +
x (2y + 3z)6 z 6
7
6
11 6
11 7
+
x (2y + 3z)5 z 5 +
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 0s, an odd number of 1s, and an
unrestricted number of 2s. [Hint: ex ex = 2

n=0

x2n+1
.
(2n+1)!

A similar relation holds

for the sum of even powers.]


x

Solution: The enumerators for 0s, 1s, and 2s 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 = 1 (e3x ex ) =
2
2
4
1
4

n=0

3n (1)n
.
n!

Hence the number of ternary words sought is n! times the preceding

nth degree coecient, or

1
4

(3n (1)n ).

3. The proprietor of a book shop wishes to arrange 15 dierent books on ve 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 rst: there are 15! ways of
placing the 15 books. Thus we need only solve the rst phase and multiply by 15!
by the Product Rule.
The rst 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 coecient of t15 in the
expansion of (t + t2 + t3 + t4 )5 = t5 (1 t4 )5 (1 t)5 , i.e. the coecient of t10
in the expansion of

4 5

(1 t ) (1 t)

n+4 n
t
4

= (1 5t + 10t ...)
n=0

= (1 5t + 10t ...)
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
4
4
4

15!

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 dene 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 0s and k 1 1s, which serve as separators. That
number is the number of ways of selecting positions for the k 1 separators
in the (n + k 1)-digit word, i.e. n+k1 or, equivalently, n+k1 .
k1
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
is 10+4 .
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,
namely 2+4 = |C1 C2 |. The same value holds for all 5 intersections of
4
2
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 dierent points of view that
will lead to the same numerical solution. This particular point of view leads
to very tedious computations.
We dene 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

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
1
15 + 0
0
10 + 4
4
10 + 3
3

= 16
=1

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
4

5 18
+
1
3
5 17
+
2
2
5 16
+
3
1
5 15
+
4
0
5
5
+
4
3

5
1
5
1
5
2
5
3

14
4
4 13
5
+
1
3
2
3 12
5
+
1
2
2
5
2 11
+
2
1
1
6
5
+
1
2

9
4
3
1
3
2

8
5
+
3
3
5
7
+
1
2

4
4
4
3

3
3

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 = 2an1 + an2 2an3 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) reexivity
(c) symmetry and reexivity
(d) antisymmetry, and are not reexive
(e) (for n = 4 only) reexivity 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 i it adjacency matrix is symmetric. Pair o the
corresponding o-diagonal entries in an n n-matrix. A relation is symmetric i both members of each of these n pairs are related, or both are not
2
related. We also may include or exclude each of the n diagonal entries. The
total number of inclusions and exclusions is n + n = n+1 . These are all
2
2
n+1
independent, so, by the Product Rule, the number of relations is 2( 2 ) .
(b) Reexivity corresponds to the presence of 1s 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 reexivity both, the diagonal entries are now determined,
and the o-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 reexivity. The o-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 0s: there are thus 2n 1 choices for the main diagonal. By the
product rule, the total number of antisymmetric but non-reexive relations is
n
3( 2 ) (2n 1).
(e) The three stated properties dene 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 4 = 4 ways.
3
4 = 2 + 2. This case requires some thought. There are 4 = 6 ways to choose
2
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 4 = 6 ways; then the
2
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 specic 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 corresponding entries
of

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 i entries that position in the two given matrices
the
in
0 0 0
are dierent. 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 i 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) Reexivity. For any ordered pair (a, b), since ab = ba, ((a, b), (a, b)) R.
Symmetry. abcd
((a, b), (c, d)) R
ad = bc by denition of R
cb = da by commutativity of integer multiplication
((c, d), (a, b)) R by denition 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]

Specializing a := y and b := x in (47) yields y


antisymmetry of , these statements imply x = y.
(b) The dual of the preceding result.

(47)
x and x

y; by the

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| 1 |V |2 .
4
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
1
1
f (x) = |V |2 x |V | |V |2 .
4
2
4
This could also have been solved using the calculus. Since f (x) = |V | 2x, and
f (x) = 2 < 0, f attains a maximum at x = 1 |V |; as f 1 |V | = 1 |V |2 , the
2
2
4
number of edges in a bipartite graph on |V | vertices cannot exceed 1 |V |2 .
4
[With greater care we could show that the maximum number of edges is

|V |2
4

.]

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 Eulers 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 rst 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 aect 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. 500501], 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 vertices in the cycle may be chosen; hence the indepence number
of Cn cannot exceed n . When n is even, this is indeed attained: the graph
2
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 dier in exactly one bit position. One independent set
consists of all vertices whose number of 1s 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 = 211 .
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 nal coordinate 0, and
the vertices with nal coordinate 1. By the induction hypothesis neither
of these independent sets can have more than 2n1 vertices, hence their
union cannot contain more than 2 2n1 = 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 o-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 o 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 i the common


valency is even, i.e. i n 1 is even i.e. i 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 i n is even. When
m 3 there always exists an m-colouring, (as we dont 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
sucient, 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 dierent
from all the rim vertices. There can be no colourings of a wheel with
fewer than 3 colours; and 3 colours suce only when n is even. When n
is odd, 4 colours are required, and suce.
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, S56].

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 satised 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 specied; 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 dened above. (Hint: First apply the preceding method to .)
Solution:
Many students may have found the second part of this problem dicult.
That should not be surprising, since you were being asked to discover a
theorem, based on some minimal evidence in the rst 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 nd 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
(xyP (x, y)) (yxP (x, y))
is a tautology.

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

1106

(b) [17, Supplementary Exercise 10, p. 94] If yxP (x, y) is true, does it necessarily follow that xyP (x, y) is true?
Solution:
(a) As a hypothesis, assume that xyP (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. yxP (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 ys. Here is a counterexample to the alleged
implication: In the universe
of all real numbers, dene 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 innity
(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
quantiers, i.e. and , to write symbolically the statement
The function f (x) has no limit as x .
Take as universe for the quantiers the set

Solution: The denition 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 nd 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 sucient 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 = = C,
the second condition above would not be satised. 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 sucient 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
ABC = ABC
(A B) C A C
A (B C) = (A B) C

(51)
(52)
(53)

(The symmetric dierence [17, p. 56] A B of sets A and B is dened 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 dicult, 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 nd it necessary to use, in the course of part of your solution, the
Rule of Inference p q p [17, Simplication Rule, Table 1, p. 170].
Solution:
(a) (51) Each of the following implications is, in fact, reversible. Thus, while we
are proving
ABC ABC
we can obtain as a corollary to this proof the inclusion
ABC ABC
Alternatively, we could combine the two proofs by replacing each by
in the following proof.
xABC
(x A B C)
denition of complementation
((x A) (x B) (x C))
denition of
((x A)) ((x B)) ((x C))
de Morgan Laws
(x A) (x B) (x C) denition of complementation
xABC
denition of intersection

Hence A B C A B C.
(52)

x (A B) C
(x (A B)) ((x C))
denition of (A-B)-C
((x A) ((x B))) ((x C)) denition 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 justied, 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) Simplication 28 .


To make our proof rigorous we have to apply this Rule of (Conjunctive)
28

p q p, i.e.

pq
.
p

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

1109

Simplication more carefully. We begin with statement (58) and rst


apply the associativity of :
((x A) (x C)) (x B)

(60)

and then apply the Rule of (Conjunctive) Simplication to conclude that


(x A) ((x C))
which, by denition of , is equivalent to x AC. Thus (AB)C
A C.
(53) For any sets R, S,
RS =
=
=
=
=
=

(R S) (R S)
denition 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

ABC ABC ABC


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 denition 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,
Denition 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 denition, 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)

denition of composition
denition of C
denition of B
denition 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 nd 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 briey
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
n4

(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 k . 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 sucient 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 innite, since any integer k yields an
integer congruent to 4 modulo 12.
(d) By [17, Denition 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)
ps
tq
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 specic 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)
ps
tq
s
p
qr
tr
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
dont 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 eect this is a proof by contradiction.)
3. Prove that the following argument is invalid.
pq
qr

(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 ve 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 justications for the various steps. You are to supply valid justications.
The object is to prove the validity of the following argument.
ur
Premiss
(r s) (p t) etc.
q (u s)
t
q
p

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

You are to supply justications 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)
us
u

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

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

1117

ur
r
s
rs
(r s) (p t)
pt
t
p

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

Solution: (cf. [6, Example 2.34, p. 92])


q
q (u s)
us
u
ur
r
s
rs
(r s) (p t)
pt
t
p

Premiss
Premiss
Modus Ponens applied to (118), (119)
Conjunctive Simplication of (120)
Premiss
Modus Ponens applied to (121), (122)
Simplication 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


i=1

i
N

i1
. N 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

i=1

i i1
1 11 2 21
.
=
.
+ .
2 21
2 21 2 21
= 0+1=1
2+1
=
3

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

1118

as claimed.
N

Inductive Step. Suppose that


i=1
N +1

i=1
N

=
i=1

i
N

i1
. N 1 =

N +1
.
3

Then

i
i1
.
N + 1 (N + 1) 1
i
i1
N + 1 (N + 1) 1
.
+
.
N + 1 (N + 1) 1 N + 1 (N + 1) 1

N 1
N
=
.
N +1 N

i=1

i i1
.
+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 = x5+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 innitely dierentiable: i.e. not only


does f exist, but, the derivative of f (denoted by f ) exists, and its derivative
f , etc. We can dene the r-times-iterated derivative f (r) recursively by
f (1) = f

(131)

f (r+1) = f (r)
r 1.

(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 denition can be extended
by dening f (0) = f . Then it can be shown that (134) holds even when either or
both of r and s are zero.
[Hint: Dene 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 dened 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
f (1+1) = f (1)

(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

(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)

=
=
=

f (t)

(u1+1)

f (t)

(u1)

f (t+u1)

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

by (132) applied to the function f (t)

(u1)

by induction hypothesis
by (132) applied to the function f (t+u1)

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 quantied rs, 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 rst 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
dierent 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
dened 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 dierent truth tables.
n

[Note that we are not claiming that there are only 22 distinct propositions. Every
proposition will be logically equivalent to innitely 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 rst 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 n2 . 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
24
(n 1)! n2 = (n1)24!
(26n)!
(d) The total number of n-letter words containing a and b, in which all letters
24
are distinct, is n! n2 : we apply the product rule after selecting the n 2
letters distinct from a and b. Since there is no essential dierence 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) = (26n)! . 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, ..., n2)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

(i + 1)P (24, n 2) =

of strings is
i=0

n
2

P (24, n 2). From this expression

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 dene 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
0s and 3 1s: the 1s 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 coecients of x up to the 11th power. The coecient
of x11 in the expansion of (1 x)3 (1 x12 )(1 x11 )1 = (1 x)4 x12 (1 x)4
is the same as the coecient of x11 in the expansion of (1 x)4 , i.e. 11+3 as
3
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 dierent, 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 dicult than might be expected on an examination.
(a) From rst 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 1 = 1 way (as it
1
is uniquely I. The letter of multiplicity 1 may be chosen in 81 = 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 4 = 6
2
4!
ways; and arrange in 2!2! = 6 ways. Thus there are 6 6 = 36 words with
this partition.
4 = 2 + 1 + 1. Choose the letter which is to contribute 2 copies in 4 = 4
1
ways; then choose the 2 other letters in 81 = 21 ways. Order the
2
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 8 = 70 ways, and order in 4! = 24
4
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
x 2 x3
1+x+
+
2!
3!

x2
1+x+
2!

x 2 x3
+
2!
3!
9
9
1 + 3x + x2 + 4x3 + x4 + ...
2
4
1+x+

(1 + x)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 coecient 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 n = 1.
0
The number of words obtainable by changing precisely r digits is n . We
r
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
t

|S|
r=0

n
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
more than 16 = 3 words. Suppose that we have such a code, whose words
5
are a1 a2 a3 a4 , b1 b2 b3 b4 and c1 c2 c3 c4 . Suppose rst that two of these words,
say a1 a2 a3 a4 and b1 b2 b3 b4 , dier in all 4 digits. Then the 3rd word will dier
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 dier in 4 digits: so


every pair dier in exactly 3 digits. Suppose, without limiting generality, that
a1 = b1 , a2 = b2 , a3 = b3 and a4 = b4 . Then c1 c2 c3 c4 must dier from each of
a1 a2 a3 a4 , b1 b2 b3 b4 in at least 2 of the rst 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 0s is even and the number of 1s is odd the 2 conditions to hold
simultaneously. There are to be no restrictions on the numbers of 2s or the
number of 3s.
(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 0s is even and the number of 1s is odd
the 2 conditions to hold simultaneously. There are to be no restrictions on
the numbers of 2s or the number of 3s.
2
1
[Hint: (1x)2 = 1+2x+x .]
(1x2 )2
Solution:
(a) We use exponential generating functions. The enumerator for the symbol 0,

which is selected an even number of times, is


n=0

x2n
,
(2n)!

which is equal to the

1
MacLaurin expansion of 2 (ex + ex ). (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

an odd number of times, is


n=0

x2n+1
,
(2n+1)!

which is equal to the MacLaurin expan-

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

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


1 4x
1
=
e 1 =
4
4

n=1

1127

4n n
x
n!

from which it follows that vn = 4n1 (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
=
1x
Hence the ordinary generating function for selections of this type of length n
is
1
x
1
1

2 1 x2 1 x 1 x
1x
x
=
2 )2 (1 x)2
(1 x
We need to nd 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 1x
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 + 2x + x )
n=0

x2

n + 3 2n
n + 3 2n
n + 3 2n
x + 2x2
x + x3
x
3
3
3
n=0
n=0

= x
n=0

n+3
3

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
dene m = n + 1, in order to develop a formula for the coecient of even
powers of x; in the third sum dene n = n + 1 in order to eventually combine
the rst and third sums, which both yield odd powers of x. The result is
x
(1

x2 )2 (1

n=0

n=0

n+3
n+2
+
3
3

=
n=0

2n+1

+2
m=1

m + 2 2m
x
3

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


+
6
6

=
n=0

+2
m=1

n=0

n + 3 2n+1
m + 2 2m
n + 2 2n+1
x
+2
x +
x
3
3
3
m=1
n=1

n + 3 2n+1
m + 2 2m
n + 2 2n +1
x
+2
x +
x
3
3
3
m=1
n =1

x)2

x2n+1

m + 2 2m
x
3

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


n + 2 2m
x
+2
x
6
3
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 dening
an =

bn
2
c n

if n is even
if n is odd

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

9
having a unique solution, (A, B, C, D) = 3 , 3 , 15 , 2 . Hence the partic2
2 2
ular solution to (137) satisfying the given initial conditions is

15 9n
2

3
an = (1 + n)(3)n +
2
(b) Denote the ordinary generating function
(137) by tn+4 and summing for n 0 yields

n=0

3n .

(140)

an tn by A(t). Multiplying

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


n=0

an+4 t

n+4

18

n=0

an+2 t

n=0

am tm 18t2

n+4

m=4

n=0

a t + 81t4
=2

an tn+4 = 0

+ 81

an tn = 0
n=0

changing to new variables m = n + 4,

an tn 18t2

n=4

an tn + 81t4
n=2

=n+2

an tn = 0
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 coecients of corresponding powers of t; or by assigning
convenient values to t; and these methods may be combined. Two con1
venient values of t are 3 , since these cause most of the terms of (141) to
vanish. We thus obtain U = 9 , and W = 3 . We need two more equa2
2
tions to determine the remaining constants. One or other of the methods
mentioned yields V = 12 and X = 0, from which we nd 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
9
=
2
=
=

9
2
3
2

n+1
3
(3t)n + 12
(3t)n
1
2
n=0

n=0

(n + 1)3n tn + 12
n=0

3n t n
n=0

3
2

n=0

n+1
(3t)n
1

(n + 1)(3)n tn
n=0

((n + 1)(3)n + (3n 5)3n ) tn


n=0

We could avoid the use of partial fractions by rewriting in the form


A(t) =

6 (1 27t2 ) 18t (1 18t2 )


+
(1 9t2 )2
(1 9t2 )2

= 6 1 27t

2
k=0

k+1
(9t2 )k + 18t 1 18t2
1

(k + 1)9k t2k 162t2

= 6
k=0

(k + 1)9k t2k
k=0

k 2k

+18t

(k + 1)9 t
k=0

(k + 1)9k t2k

324t

k=0

k=0

k+1
(9t2 )k
1

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

1132

k 2k

= 6

(k + 1)9 t

(k + 1)9k t2k+2

162

k=0

k=0

k 2k+1

+18

(k + 1)9 t

(k + 1)9k t2k+3

324

k=0

k=0

(k + 1)9k t2k 18

= 6

9 t2

k=0

=1

k 2k+1

+18

(k + 1)9 t

9 t2 +1

36

k=0

=1

(k + 1)9k t2k 18

= 6

9 t2

k=0

=0

(k + 1)9k t2k+1 36

+18
k=0

9 t2 +1
=0

k 9k t2k

(k + 1)9k t2k 18

= 6

k=0

k=0

k 2k+1

(k + 1)9 t

+18

k 9k t2k+1

36
=0

k=0

extending 2 summations to include zero terms

2k 2k

6(k + 1)3 t

18k 32k t2k

k=0

k=0

2k+1 2k+1

6(k + 1)3

k=0

k=0

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

6(1 2k)32k t2k +

12k 32k+1 t2k+1

k=0

k=0

from which we may read o the values


an =

6(1 n)3n if n is even


(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 dierent 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 n ways of selecting r pairs, the
r
Principle of Inclusion-Exclusion gives
an = (2n 1)! 21
+(2)r

n
n
(2n 2)! + 22
(2n 3)!
1
2

n
(2n r 1)! + ... + (2)n (n 1)!
r

(146)

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,
lets place pair {a1 , a2 } rst.
Case 1 a1 and a2 are in opposite seats: In this case there are two
seats to be lled in each of the residual portions of the table. Each
of the seats in one portion must be lled 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 (222)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 lled 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 4 = 4 ways. Each of the corresponding relations contains 32 +
1
12 = 10 ordered pairs.
4 = 2 + 2: The number of ways of dividing 4 elements into two distinguishable i.e.
labelled parts, each containing 2 elements, is 4 = 6. If, however, we are
2
concerned only with the partition, and the parts are not labelled, then the
6
number of partitions is 2! = 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
number of ordered pairs is 22 + 12 + 12 = 6.

4
2

= 6 ways. The total

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 sucient. 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 reexive 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 reexive nor irn
reexive32 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), denition of R
(150), symmetry of R
(151), denition 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) Dene A = {a, b, c}, and let R be the reexive 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 irreexive 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 denition 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 = R1 = {(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 reexive a relation cannot have loops at every point of its digraph;
to not be irreexive 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 benet 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 edge. There is only one graph with 1 edge. One incidence matrix is

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 1 4 1 =
2
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, bc, ca}), a
triangle and an isolated vertex. One incidence matrix is

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

and 0 0 1 1 .
1 1 0 0
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 dier in just one coordinate. For this graph
i. Show that the graph is regular, and determine the degree.
ii. Dene 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. dene 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. [Dicult] 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
2
meets the xy-plane in the point with parameter value u = 3 , 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 2 , 2 , 0 are joined by a line segment with
3 3
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. Lets consider, with greater generality, the n-cube, whose vertices are
strings of 1s and 1s of length n, with two strings being adjacent i they
dier 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 dierent colours. Thus the
graph is bipartite.
iii. Pairs of vertices of opposite colours which are not adjacent must be precisely those which dier by an odd number of minus dierent from the
odd number 1, i.e. vertices whose coordinates dier 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 dier 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 nd 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, adthe

0 1 1 0 0
2 1 1 0 0
1 0 1 0 0
1 2 1 0 0

2
jacency matrix is A = 1 1 0 0 0 . Then A = 1 1 2 0 0 , and

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 dier 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 at 11 side36 ,
can she nish at the centre of the cube? Set up a graph whose vertices are
located at the centres of the 111 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 dierent 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 = 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 Kuratowskis 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 gures 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 dierent 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
suce. 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 suce 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 dicult problem. Thus, for example, there are 2 distinct
tournaments when n = 2.)
(b) Show that40 deg (i) + deg+ (i) = n 1 for all i, and that
n
n
+
i=1 deg (i) = 2 .

n
i=1

deg (i) =

(c) Show that


n

deg+ (i)
i=1
39

deg (i)

i=1

The prex 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, Denition 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 n pairs of vertices. Each of these unordered pairs must be assigned
2
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 n directed edges contributes exactly 1 to the sum of in-degrees,
2
and exactly 1 to the sum of out-degrees. Hence the two sums are equal, and
each is equal to the total number of unordered pairs of vertices, viz. n .
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 = 4.
n

deg (i)

n 1 deg+ (i)

i=1

i=1
n

(n 1)2 2(n 1) deg+ (i) + deg+ (i)

=
i=1
n

(n 1) 2(n 1)
i=1

deg (i) +
i=1

= n(n 1)2 2(n 1)

deg+ (i)

n
+
2

i=1
n

deg+ (i)

i=1

deg+ (i)

= n(n 1)2 n(n 1)2 +

i=1
n
2

deg+ (i)

=
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)

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 denition given f is expressed as a disjunction of the form uv ...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 4 = 6. The disjunction of
2
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 signicant. 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
pqrs

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
pqrs

(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:
pq
qr
pm
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 rst
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 rst premise, p q could be
true only if q is true; and nally, 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 ve 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 ve 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 dicult!] (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.
AB C C
C C AB

(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:
AC
BC
CA
CB

(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


AB,

(165)

A=B.

(166)

so
But now (163) implies
AAC 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 = C and B = 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 2n1 elements. Show also that this result is best
possible, i.e. that the bound of 2n1 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 2n1 elements.
The following example shows that 2n1 is best possible: x one element a0 A,
and dene 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| < 2n1 , it is possible to adjoin new sets to B until the
resulting collection has precisely 2n1 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 denition 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.32.4 by reading [17, pp. 111120; 126130] 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 that may be chosen from a set of n + 1 distinct elements is
n+1
= (n+1)n . 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 one. Any integer n is expressible in the form 6t + u,
ve
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 way is to consider the six


ve
possible values of u:
u
u(u + 1)(u + 2)
0
012=0=60
1
123=6=61
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 n = (n+2)(n+1)n ; as the value is an integer,
3
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 rst 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 rst 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

41

315

10

+ 315

7 + 315

72 + ... + 315

78 + 315

79 + 710

But this na reasoning would not work if we wished to prove, for example, that n(n+1)(n+2)(n+3)
ve
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 dierence
of two powers would be even. As it is evident that this dierence is neither
+2 nor 2, it is surely composite.
(c) In this case there is no useful factorization. 1 = 127. If it is not prime,
27
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
pq
qr
pm
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 dierent 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)
pq

premiss

(167)

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


qr
pm
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.
pq
qr
pm
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 justications.
ab
bd
ac
(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
dc

(193)
(194)

Solution:
ab
bd
ac
a b
a d
d a
d c
dc

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 innite set of proposition letters. Dene the formul


n

pi recursively for all n 0 as follows:


i=1
0

pi is dened to be T.
i=1
n

n+1

If

i=1

i=1

i=1

pi pn+1 .

pi is dened to be

pi has been dened, then

pi p1 .

(a) Show that, according to this denition,


i=1
2

pi p1 p2

(b) Show that, according to this denition,


i=1
n

(c) Dene, for any integer n 0,

pi to be the formula
i=1

pi F.

i.

i=1
n+1

pi

ii.
i=1

pi pn+1 .
i=1

(d) Prove that, for all n 0,


n

pi
i=1

pi . Prove that
i=1

pn+1

(pi pn+1 )
i=1

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


Solution:
(a)
1

pi

pi

i=1

p1

i=1

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

pi

pi

i=1

i=1

p1 p2
(c)

p2 by recursive denition
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

pi

pn+1

pi

(pn+1 )

i=1
n


i=1

by De Morgan Law

1158

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

1159

pi

pn+1

by Double Negation

i=1
n

pn+1

pi

by denition of

i=1

i=1

(d) Our proof is by induction on n.


Case n = 0:
0

pi

p1 T p1

by denition

i=1

by Domination Law

(pi p1 ) by denition 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.
n0 +1

pi

pn0 +2

pi

pn0 +1

pn0 +2

pi

pn0 +2

(pn0 +1 pn0 +2 )

i=1
n0

by denition of

i=1
n0

i=1

by distributivity of over
n0

(pi pn0 +2 )

(pn0 +1 pn0 +2 )

by induction hypothesis

i=1
n0 +1

(pi pn0 +2 )

by denition of

i=1

(Note that two applications of the denition of


are used above, over
dierent sequences of formul.) This completes the proof of the induction
step.
6. Suppose that a sequence {an }n=0,1,2,... of integers is dened recursively by
a0 = 1

(203)

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


a1 = 0
an = (3)n 6an1 9an2

1160
(204)
(205)

(n 2)

Prove, using the Second Principle of Mathematical Induction, that


1
(n) an = (n 1)(n 2)(3)n
2

(206)

Solution:
Base Case: Since, by one of the given initial conditions, a0 = 1 = 1 (0 1)(0
2
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 =
(11)(12)
(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 0s and 1s)
of length 10 which contain either a substring consisting of at least ve consecutive
0s or a substring consisting of at least ve consecutive 1s, 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 0s and with 1s. 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 1s of length 5, but no such string
of 0s. The rst 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 x
the rst 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 0s
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 0s 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 lling 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 0s, 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 rst consists of
x1 1s (respectively, of x1 0s), the next consists of x2 0s (respectively, of
x2 1s), 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 m1 copies of b, where the length of the rst string of as is y1 , of the
second string is y2 , etc., and where the bs serve as separators. The number
5
of such strings is (6m)+(m1) = m1 . We must multiply this binomial
m1
coecient by 2 for the number of choices of the rst character is it a 0 or
a 1. We must also multiply by the number of dierent 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

5
m1

2
m=1

2 = 222 .

Although it was not required, we do know how to evaluate such a sum in


general. For an indeterminate x we have
5

5 i
x .
i

(1 + x) =
i=0

This can be rewritten, through the change of variable m = i + 1, as


6

5
xm1 .
m1

(1 + x) =
m=1

If we multiply by 2x, we obtain


6
5

2x(1 + x) = 2
m=1

5
xm .
m1

Dierentiation with respect to x yields


6

2(1 + x)5 + 10x(1 + x)4 = 2

m
m=1

5
xm1 ,
m1

an identity which is valid for all x. Giving x the value 1 yields (232)+(10116)
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 notied 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 as an a may appear at any place in a word,
without restriction on its precedessors or successors.
bs may appear in substrings of even length.
cs 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 + 2x2

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

=
n=0

n n

1164

(1)n xn

2 x +
n=0

n=0

n+1

+ (1) n
x
3

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

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], dening
i

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 rst 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 coecient of xk in the
1 n
expansion of 2x 3 x , 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

2x2 3
n

xn

n i
2 (3)ni x2in
i

=
i=0

It follows that, when


2i n = 2j ,
so

(209)

n
,
(210)
2
n
n
(3)j+ 2 2j+ 2 if n is even; and 0 if n is odd. And,
i=j+

the coecient of x2j is


when

n
j+ n
2

2i n = 2j + 1 ,
so

n+1
,
2

i=j+
the coecient of x2j+1 is

n
j+ n+1
2

(3)j+

(211)

n1
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
2

=2

n
+ n2
2

in each of the following ways:


(a) By applying the general formula
m
s

m!
.
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 dierent 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 coecient of x2 in the expansion of (1 + x)2n .
Solution:
(a) We use the fact that
m
2
Thus

2n
2

m!
m(m 1)
=
.
2!(m 2)!
2

(2n)(2n 1)
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 dicult 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 a .
2
Sets contained entirely in B. Their number is 2na .
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 a + 2na + a(2n a) , which must be equal to the
2
2
number of distinct unordered pairs in A B, which is 2n . The special case
2
a = n is the one that interests us.
(c) We may compute the coecient of x2 in (1 + x)2n in several ways. By the
Binomial Theorem, the coecient is 2n . But we may also express the poly2
nomial as a product, (1 + x)n (1 + x)n , 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)


n 0
n 1
n 2
x +
x +
x + ...
0
1
2

n
0

1167

n
0

n
n n
+
1
1
0
n n
n n
n
+
+
+
0
2
1
1
2
+terms in higher powers
x0 +

x1
n
0

x2

Equating coecients of x2 yields


2n
2

n
0

n
n
+
2
1

n
n
+
1
2

n
0

=2

n
n
+
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 dening 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 1s and
4 0s, where the 0s serve as separators, and the lengths of the strings of 1s
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. Specically, we dene
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 1s and 4 0s,
i.e. 9+4 = 715. The solutions which violate (221) can be counted by changing
4
the variables a second time: dene 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 1s and 4 0s, i.e. 4+4 =
4
70. It follows that the number of solutions to the original problem is 71570 =
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 coecient of t15 in the expansion of
t3
1
t(1 t5 )

1t
1t 1t

t
1t

which is the coecient of t156 in the expansion of (1 t)5 minus the coecient of t1511 in the same expansion, i.e. 4+9 4+4 = 715 70 = 645, as
4
4
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)3
(1 t

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

= (t + 3t + 3t + t )
i=0

4 + i 2i
t
i

4+6
4+7
= ... + 1
+3
7
6
= 960 ,

t15 + ...

where only the values i = 7 and i = 6 yield terms that contribute to the
coecient of t15 .

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

1170

[Note: The version of the problem that was rst 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 coecient
of t14 , which by similar computations to the foregoing, could be shown to be
1 5+6 + 3 5+5 = 2910! = 1218.]
6
5
6!5!
7. You have a supply of 5 1s, 4 2s, 3 3s, and 2 4s. 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 4s 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 dierent 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 1 = 1. These 5
1
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 2 = 2 ways
1
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
choose a (dierent) symbol to have multiplicity 1 in 41 = 3 ways: it
1
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 3 = 3 ways as


1
it must be one of 1, 2, 3. Then choose the symbol to have multiplicity 2
in 41 = 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 3 3 = 9 ways, and order them in
1 2
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 4 2 = 12 ways, and order them in
2 1
5!
= 30 ways; the number of strings is 12 30 = 360.
2!2!1!
5 = 2 + 1 + 1 + 1. Choose the letters in 4 3 = 4 ways, and order them in
1 3
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 dierent 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 coecient of x5 in the expansion of the exponential generating function
1 1 1 2 1 3 1 4 1 5
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!
1+

1 1 1 2
1
1
3 3 2 4 1 5
x + x
+ 1 + x1 + x2
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
=

1+

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, Denition 5.2.1, p. 318], explain why this recurrence is linear ,
but is not homogeneous.

(b) Dening 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 nding 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 coecients are known constant functions
of n) to which is added a known function of n. Indeed,
an = 4an2 + 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

an+2 x

n+2

+ 4x

n=0

m=2

xn+2

an x = 12
n=0

am xm + 4x2

n=0

an xn = 12
n=0

xn+2
n=0

applying in the rst sum a change of variable m = n + 2


x2
a(x) a0 a1 x + 4x2 a(x) = 12
1x
12x2
(1 + 4x2 )a(x) = a0 + a1 x +
1x

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

1173

12x2
by (223), (224)
1x
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 coecients, and we can solve the problem more simply without that
factorization. We will simply treat x2 as the variable where necessary. Then

2 + 4x
= (2 + 4x)
(4)r x2r
1 + 4x2
r=0

r 2r

= 2

(4)r x2r+1

(4) x + 4
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, 1 , that 1 = 5A and
4
1
4 = 5 B, so A = 1 , B = 1 , and
4
5
5
12x2
12x2 (1 + x)
=
(1 x)(1 + 4x2 )
(1 x2 )(1 + 4x2 )
12
1
1
=
(1 + x)

2
5
1x
1 + 4x2
12
=
(1 + x)
5

2r

(4)r x2r

x
r=0

r=0

It follows that

2(4)r +

a(x) =
r=0

12 12
(4)r x2r
5
5

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

4(4)r +

+
r=0

=
r=0

12 12
(4)r x2r+1
5
5

2(4)r + 12 2r
x +
5

so

1174

r=0

8(4)r + 12 2r+1
x
5

an =

2(4) 2 +12
5
n+1
2(4) 2 +12
5

an =

n0

(mod 2)

n1

(mod 2)

2(4)

n+1
2

, i.e.

+ 12

.
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 congurations, 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. Dene Ai to be the set of (prohibited) seatings
in which xi and yi are seated together (i = 1, 2, ..., n). Then |Ai | = 21 (2n1)!,
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 = 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

(2n r)!
r=0

n r
2 (1)r ,
r

(226)

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

1175

since there are n ways of choosing a set of r violated adjacency conditions.


r
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 | =
=

unrestricted arrangements of 2n persons


20 (2n 1)! (n > 1)
21 (2n 2)!

Aij

= 2r (2n r 1)!

j=1

By Inclusion-Exclusion, the number of permitted arrangements when n 2


is
n
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 lled in just 2! = 2 ways. This agrees
with formula (227) when r = 2:
2

(3 r)!
r=0

2 r
2 (1)r = 3! 2! 2 2 + 1! 1 22 = 6 8 + 4 = 2
r

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) reexive and symmetric, but not transitive
(b) irreexive42 , symmetric, and transitive
(c) irreexive, antisymmetric, and not transitive
(d) reexive, neither symmetric nor antisymmetric, and transitive
(e) possessing none of the properties: reexive, irreexive, symmetric, antisymmetric, transitive.
Solution:
(a) This relation must contain (a, a), (b, b), (c, c), (d, d), as it is to be reexive. 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). Dene the relation on
R(S) by R1 R2 i R1 R2 , where R1 and R2 are relations on S.
R

42

A relation R on a set A is dened [17, p. 365] to be irreexive 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.


R

(b) Taking S = {a, b, c}, and R(S) to be the set of posets on S, determine the
Hasse diagram for (R(S), ).
R

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 rst determine the set of posets on S. There are 5 distinct types;
we list them according to their Hasse diagrams.
: Only the relation

R1 = {(a, a), (b, b), (c, c)}


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)}

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

:
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)}

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

1178

r
r

: These are the total orders:

R14
R15
R16
R17
R18
R19

:
:
:
:
:
:

a<b<c
a<c<b
b<c<a
b<a<c
c<a<b
c<b<a

The Hasse diagram for R(S) has four levels. At the bottom is R1 ; at the
top are R14 through R19 . The second layer from the bottom consists of R2
through R7 , and the level above it consists of R8 through R13 . Every vertex
in the second level is connected to 2 vertices in the level above it. From that
level every vertex is connected to two vertices in the top level. All other
connections are obvious.
5. Determine all solutions {an }n=0,1,... to the recurrence
an+2 + 2an+1 3an = 0

(228)

which are also solutions of exactly one of the recurrences


an+2 2an+1 + an = (3)n
an+2 + an+1 6an = 2n

(229)
(230)

Solution: As the auxiliary polynomial of (228) is t2 + 2t 3, with roots 1 and 3,


all solutions have the form
an = A1n + B(3)n = A + B(3)n

(231)

1
This solution satises (229 i 16B(3)n = (3)n for all n, i.e. i B = 16 ; it satises
(230) i 4A = 2n for all n, which is impossible. Thus we are seeking sequences
satisfying both of (228) and (229). These are all sequences

an = A +
where A is any constant.

(3)n
16

(232)

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

E.5

1179

Solved Problems from the Fifth 1998 Problem Assignment

Students were advised that


Students whose solutions demonstrate a serious attempt at solution will
receive full marks on the basis of the submission only. Full solutions will be
distributed and/or mounted on the Web.
1. The converse of a directed graph G = (V, E) is dened to be the directed graph
on the same vertex set, in which every directed edge (a, b) of G is replaced by a
directed edge (b, a); that is, it is obtained from G by reversing the directions of all
directed edges. A digraph is self-converse if it is isomorphic to its converse.
(a) Prove or disprove: For digraphs without loops, (but possibly with edges in
both directions between distinct vertices), the complement of the converse is
the converse of the complement. (By complement of a digraph G = (V, E) we
mean the graph G = (V, E) on the same vertex set whose edges are all the
edges of the complete directed graph with vertex set V and with |V |(|V | 1)
edges (i.e. one in each direction between every pair of distinct vertices). We
are excluding loops from both G and its complement.)
(b) For each of the isomorphism types of digraphs on 3 vertices inclusive determine
the converse. (In considering only isomorphism types we are using the fact
that isomorphism is an equivalence relation. You are asked to indicate the
structure of each digraph, but not to dierentiate between two digraphs that
dier only in the way in which the vertices are labelled.)
(c) In your determination above indicate which pairs of digraphs are converses of
each other, and which digraphs are self-converse.
Solution:
(a) Lets denote the operation of taking the converse by C. For convenience we
will write e G to represent the fact that e is an edge of the digraph G. Then
(a, b) CG

(b, a) G
(b, a) G
/
((b, a) G)
((a, b) CG)
(a, b) CG

so the digraphs CG and CG have the same set of directed edges. (By denition
of complementation and the converse they have the same vertex sets.) So they
are one and the same digraph.

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

1180

(b), (c) By virtue of the preceding problem, it suces to consider digraphs with at
most 1 6 = 3 directed edges. We will describe the digraphs with up to
2
3 directed edges; the remainder of the catalogue can be compiled by taking
complements. (Because of the diculty of entering graphics into these notes,
we will describe the digraphs in words and symbols; it would be much more
appealing to use sketches for small digraphs like these.)
0 edges. Only one digraph has 0 edges, and it is its own converse.
1 edge. Up to isomorphism there is only one digraph with one edge, and it
is its own converse.
2 edges. There are four dierent digraphs with two edges. One of these has
a pair of edges in opposite directions, and it is its own converse. The
other three consist of an orientation of a simple path of length 2. Where
the two edges are consistently directed, we have a self-converse digraph.
In the other two cases the edges are either both directed to their common
incident vertex, or both directed away from their common incident vertex;
each of these is the converse of the other.
3 edges. There are two digraphs containing a pair of oppositely directed
edges. In one of these the direction of the third edge is away from the
common vertex with the other two, in the other it is towards that vertex;
these two digraphs are mutually converse.
The other digraphs consist of orientations of the triangle: one is the cyclically oriented triangle, and the other the transitively oriented triangle;
each of these is self-converse.
2. Use Eulers polyhedron formula [17, Theorem 1, p. 502] and the fact that a bipartite
graph has no triangles to prove that K3,3 is not planar.
Solution: The graph has v = 6 vertices, and e = 9 edges. If it were planar, then
the number of faces in any embedding would be, by Eulers polyhedron formula,
9 6 + 2 = 5. As the sum of the degrees of the regions would be twice the number
of edges, i.e. 2 9 = 18, the average degree of a region would be 18 < 4, so, by
5
the Pigeonhole Principle, some region would be bounded by fewer than 4 edges.
But this graph contains no cycles of length less than 4. From this contradiction we
infer that no embedding in the plane exists.
The preceding is a proof from rst principles based directly on Eulers Polyhedron
Formula. One could also base a proof on the Corollary to that Theorem [17, p.
504] that states that e 2v 4 in a planar graph that contains no triangles.
3. (a) Show that the Petersen graph [17, Exercise 7.5.*56, p. 487] is not Hamiltonian,
i.e. does not possess a Hamilton circuit. You may assume that (as shown in

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

1181

the lectures) the Peterson graph has 10 vertices, all of degree 3, and that it
contains no circuit of length less than 5.
(Hint: If the graph were Hamiltonian, we could label the vertices v1 , v2 , ...,
v10 so that v1 , v1 v2 , v2 , v2 v3 , ..., v9 v10 , v10 , v10 v1 is a 10-gon. Then, if we were
to represent the 10-gon as a circle in the plane, the remaining 5 edges in the
graph can be represented as diagonals of this circle, joining the 10 boundary
points in pairs. This proof uses a representation of the graph in the plane,
wherein we are not concerned about whether edges cross in the representation,
but were we will use the fact that crossing occur to prove the non-existence
of a Hamilton circuit. Consider two cases:
Case 1. All diagonals join a vertex to the diametrically opposite
point on the (alleged) Hamilton circuit.
Case 2 In at least one case a vertex is joined to a point which is not
diametrically opposite.
Show that in either of these cases we arrive at a contradiction, so the hypothesis that there exists a 10-gon in the graph is unjustied.)
(b) Show by a direct application of Kuratowskis Theorem [17, Theorem 2, p. 506]
(without using the Corollaries to [17, Theorem 1, p. 502]) that the Petersen
graph is not planar.
Solution:
(a) Case 1. If diametrically opposite vertices were adjacent, we would have edges
v1 v6 , v2 v7 , etc. But then the graph would contain a quadrangle v1 v6 v7 v2 ,
and we know that the shortest circuit in a Petersen graph is a pentagon.
Case 2. Without limiting generality we may now assume that the vertex v1
is joined to some vertex other than v6 ; and, by hypothesis, it is also joined
to v10 and v2 . It cannot be joined to v3 or v9 , as these edges would give
rise to a triangle; nor to v4 or v8 , as these would give rise to a quadrangle.
So the only available neighbours are v5 or v7 ; without limiting generality,
assume that v1 is joined to v5 . This reasoning applies to each of the points
in the 10-gon: each of them must be connected either to the diametrically
opposite vertex, or to one of the two vertices on either side of that vertex.
So v6 can only be connected to one of v1 (the diametrically opposite
vertex), or v2 , or v10 ; but the rst of these alternatives is not available,
as v1 already has degree 3. Nor could it be connected to v10 , as then
we would have a 4-gon v1 0v1 v5 v6 , which is not present in the structure
of the Petersen graph; thus the remaining adjacency of v10 is completely
determined: v6 v2 is an edge. But this also produces a 4-gon, namely
v1 v2 v6 v5 . So this second case also leads to a contradiction.

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

1182

(b) cf. [17, Example 8, pp. 506-507]


We conclude that the Petersen graph contains no Hamilton circuit.
4. In the graph Qn called the n-cube there are 2n vertices which can be labelled by
the 2n binary strings of length n. If we represent these vertices by vectors like
x = (x1 , x2 , ..., xn ), where each coordinate is 0 or 1, then two vertices will be
adjacent i their coordinate vectors dier in precisely one place.
(a) Prove by induction on n that Qn has, for n 2, a Hamilton circuit.
(Hint: Show how Qn+1 can be viewed as two horizontal copies of Qn , connected by vertical edges joining corresponding vertices. Then show how a
Hamilton circuit in each of these copies can be reduced to a Hamilton path
by erasing corresponding edges in the two copies, after which the two copies
are joined together by 2 vertical edges. In order to understand this hint, it
is suggested that you try this out in R3 with two copies of a square, one in
the plane z = 0, and one in the plane z = 1.)
(b) Show that Qn is bipartite.
Solution:
(a) The base case is Q2 the square, which is evidently Hamiltonian.
Suppose that Qn has a Hamilton circuit in which (x1 , ..., xn ) and (y1 , ..., yn ) are
two successive vertices. Take two copies of Qn , each containing this Hamilton
circuit, and add to the coordinates of the rst copy an (n + 1)st coordinate 0,
and to the coordinates of vertices in the second copy an (n + 1)st coordinate
1. Erase the edges (x1 , ..., xn , i)(y1 , ..., yn , i) (i = 0, 1) and adjoin the edges
(x1 , ..., xn , 0)(x1 , ..., xn , 1) and (y1 , ..., yn , 0)(y1 , ..., yn , 1) to create a Hamilton
circuit in Qn+1 . By induction all cubes on 22 or more vertices are Hamiltonian.
(The 1-cube has the structure of K2 , and is not Hamiltonian.)
(b) Let A denote the set of vertices whose coordinates contain an even number
of 1s, and B the set whose coordinates contain an odd number of 1s. Then,
as the coordinates of two adjacent vertices dier by a 1 in one position only,
vertices in A cannot be adjacent to each other, nor can vertices in B; so the
graph is bipartite.

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

1183

Solutions to 1999 Assignment Problems

F.1

First 1999 Problem Assignment, with Solutions


Distribution Date: Wednesday, September 29th, 1999
Solutions were to be submitted on Friday, September 24th, 1999

1. [19, Exercise 1.1.10] For each of the following sentences, determine whether an
inclusive or or and exclusive or is intended. Explain your answer. [Note:
This is a language problem, not a mathematical one: in some cases it is possible
to justify both possible types of or.]
(a) Experience with C++ or Java is required.
(b) Lunch includes soup or salad.
(c) To enter the county you need a passport or a voter registration card.
(d) Publish or perish.
Solution: In several of the parts we give arguments to justify either interpretation
of the word or.
(a) The sentence appears to describe a minimum condition. We usually operate
under the postulate that the more experience one has, the better. In that
spirit, we would expect the intention here to be the inclusive or.
(b) Here we appear to have a maximum condition. If the sentence describes the
rights of an individual customer in an eating establishment, we would interpret
the intention to be the exclusive or.
The other interpretation is also plausible here. If one interprets the sentence
as part of a description of a nourishing lunch, then an individual might be
encouraged to include both soup and salad, if she wished. In this interpetation
we have an inclusive or.
(c) The intention appears to be proof of citizenship, which could be demonstrated
with either document. If the intention is that the document be presented to
an immigration ocer, who can read a document and render a decision, then
one would interpret the or here as inclusive.
Another far fetched interpretation could be that the document is to be
analyzed by a machine, which is capable of reading only one document. In
that case the exclusive or would apply.
(d) This aphorism is often used to describe the atmosphere for academic sta at a
research university; perish means that the professors appointment will not

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

1184

be renewed. The intention must be read as the inclusive or, since there
are reasons other than the absence of research for not renewing an academic
appointment (for example, moral turpitude).
2. (cf. [19, Exercise 1.1.16]) Write each of the following statements in the form p
q.
(a) I will remember to send you the address only if you send me an e-mail message.
(b) To be a citizen of this country it is sucient that you were born in this country.
(c) If you keep your textbook, it will be a useful reference in your future courses.
(d) The Habs will win the Stanley Cup if their goalie plays well.
(e) The beach erodes whenever there is a storm.
(f) It is necessary to have a vaild password to log on to the server.
Solution: We may temporarily use a connective , dened so that p q i q p.
(a) (I will remember to send you the address) (you send me an e-mail message).
(b) (To be a citizen of this country) (you were born in this country). Equivalently,
(You were born in this country.) (You are a citizen of this country.)
(c) (You keep your textbook.) (It will be a useful reference in your future
courses.)
(d) (The Habs will win the Stanley Cup) (their goalie plays well). Equivalently,
(The Habs goalie plays well.) (The Habs will win the Stanley
Cup.)
(e) (The beach erodes) (there is a storm). Equivalently,
(There is a storm.) (The beach erodes.)
(f) (You have a valid password) (You are able to log on to the server.) Equivalently,
(You are able to log on to the server.) (You have a valid password.)
3. [19, Exercise 1.1.26] Determine the truth table for ((p q) r) s.
Solution: We denote truth by 1, falsity by 0. (We have chosen to order the rows of
the table lexicographically i.e. in the order of the binary words that describe

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


the truth value
order.)
p
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1

1185

assignments; many authors would give the data in the reverse


q
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1

r
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1

s
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1

p q (p q) r
1
0
1
0
1
1
1
1
1
0
1
0
1
1
1
1
0
1
0
1
0
1
0
1
1
0
1
0
1
1
1
1

((p q) r) s
1
1
0
1
1
1
0
1
0
1
0
1
1
1
0
1

4. [19, Exercise 1.3.22] Determine the truth value of each of the following statements,
if the universe of discourse of each variable is the set of real numbers. Justify your
claims.
(a) x(x2 = 2)
(b) x(x2 = 1)
(c) xy(x2 = y)
(d) xy(x = y 2 )
(e) xy(xy = 0)
(f) xy(x + y = y + x)
(g) x = 0y(xy = 1)
(h) xy = 0(xy = 1)
(i) xy(x + y = 1)
(j) xy(x + 2y = 2 2x + 4y = 5)
(k) xy(x + y = 2 2x y = 1)
(l) xyz(z = (x + y)/2)

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

1186

Solution: Some of these statements will become more meaningful in course 189-340,
where we consider algebraic systems which lack some of the familiar properties of
R.
(a) The statement asserts the existence of a square root of 2. Where the universe
is R, this is TRUE there are, in fact, two square roots. (Were the universe
to be the rational numbers, the statement would be false.)
(b) Here the statement asserts the existence of a square root of 1. As all squares
of real numbers are non-negative, this statement is FALSE. (Were the universe
to be, for example, the complex numbers, the truth value would be TRUE.)
(c) This statement is TRUE. More generally, if f : R R is any function, then
xy(f (x) = y) is true, since, the codomain of the function is R.
(d) This statement asserts that all real numbers have a square root. This is
FALSE for the universe R, as, for example, 1 is not a square.
(e) This statement is true; one solution in fact, the only solution is x = 0.
(f) This statement asserts that addition of real numbers is non-commutative.
As commutativity is a basic property of the set R, the negation is FALSE.
(g) This statement asserts the existence, for every non-zero real number, of a
multiplicative inverse. This statement is TRUE; the inverse is unique, and is
1
usually denoted by x or x1 . Note that the statement would not be true if
the universe were taken to be the set of 2 2 real matrices.
(h) The reversal of the order of the quantiers has completely changed the meaning of the statement. This statement asserts that there exists a real number
which can serve as multiplicative inverse for all non-zero reals. This is FALSE,
since xy1 = 1 = xy2 y1 = y2 ; thus, if we take distinct non-zero real numbers
y1 and y2 , their multiplicative inverses will have to be distinct.
(i) TRUE. For every x the real number 1 x has the desired property.
(j) The truth of the two equations would entail the truth of the equation obtained
by subtracting twice the rst from the second, which is 0 = 1. From this
contradiction we deduce that the conjunction is FALSE.
(k) Let x be xed. The two equations respectively require that y = 2 x and
y = 2x 1. These two equations imply that 2 x = 2x 1, which implies that
x = 1. Except for the value x = 1, the conjunction of the two equations if false.
Thus the universally quantied conjunction is FALSE, as there exist values of
x for which the two equations are not simultaneously true; for example, when
x = 0.

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

1187

(l) This statement asserts the existence in the given universe of a midpoint for
any interval. While it is TRUE for the given universe R, it would not have
been true for the universe consisting of the union of the two coordinate axes
in R2 , where addition is taken to be the usual vector addition.
5. [19, Exercise 1.3.24] Rewrite each of the following statements so that negations
appear only within predicates (that is, so that no negation is outside a quantier
or an expression involving logical connectives.) Show all intermediate steps.
(a) yxP (x, y)
(b) xyP (x, y)
(c) y(Q(y) xR(x, y))
(d) y(xR(x, y) xS(x, y))
(e) y(xzT (x, y, z) xzU (x, y, z))
Solution:
(a)
yxP (x, y) yxP (x, y)
yxP (x, y)
(b)
xyP (x, y) xyP (x, y)
xyP (x, y)
(c)

y(Q(y) xR(x, y))


y(Q(y) xR(x, y))
y(Q(y) xR(x, y))
y(Q(y) xR(x, y)) de Morgan law
y(Q(y) xR(x, y)) Double negation law

(d)
y(xR(x, y) xS(x, y))
y(xR(x, y) xS(x, y))
y((xR(x, y)) (xS(x, y))) de Morgan law
y((xR(x, y)) (xS(x, y)))

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

1188

(e)

y(xzT (x, y, z) xzU (x, y, z))


y((xzT (x, y, z)) (xzU (x, y, z)))
y((xzT (x, y, z)) (xzU (x, y, z))) de Morgan law
y((xzT (x, y, z)) (xzU (x, y, z)))
y((xzT (x, y, z)) (xzU (x, y, z)))

6. (a) (cf. [19, Exercise 1.3.30]) Use quantiers to express the laws of distributivity
of multiplication over addition of 2 2 matrices with real entries.
(b) [19, Exercise 1.3.50] A real number x is called an upper bound of a set S R
if x is greater than or equal to every member of S; x is the least upper bound
of S if it is an upper bound which is less than or equal to every upper bound
of S. It can be shown that, if the least upper bound exists, it is unique. (One
may dene, in an analogous way, a lower bound and the greatest lower bound .)
i. Using quantiers, express the fact that x is an upper bound of S.
ii. Using quantiers, express the fact that x is the least upper bound of S.
Solution:
(a) Distributivity of multiplication over addition is given by x(y+z) = xy+xz and
(y+z)x = yx+zx, which must hold for all choices of x, y, z R. We must thus
triply quantify both statements: xyz(x(y + z) = xz + yz), xyz((y +
z)x = yx + zx). Do we need both of these statements? Either of these would
be a consequence of the other and the commutative law of multiplication,
which could be written as xy(xy = yx); unfortunately, commutativity does
not hold for the full set of 2 2 real matrices, so both laws are required
here. We could call the rst statement left distributivity and the second
right distributivity.
(b)

i. We could write s S(s x), which is an abbreviation for s((s S)


(s x)).
ii. The statement (s S(s x)) y((s S(s y)) (x y)) is an
abbreviation for (s((s S) (s x))) y((s(s S) (s y))
(x y))

7. (a) Prove the following set equation:


(A B) (C D) = (A C) (B D)
UPDATED TO September 19, 2000

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

1189

(b) Carry out some experimentation to determine whether a statement of the


form
(A B) (C D) ? (A C) (B D)
is always true, where ? is one of the relations , , =. If your experimentation
suggests that such a theorem is true, try to prove the theorem.
Solution:
(a)

(x, y) (A B) (C D)
(x A B) (y C D) by denition of
((x A) (x B)) ((y C) (y D) by denition of
((x A) (y C)) ((x B) (y D)
by associativity, commutativity of
((x, y) A C) ((x, y) B D) by denition of
(x, y) (A C) (B D) by denition of

(b) Experimentation, or the use of Venn diagrams, suggests the general truth of
the following inclusion:
(A B) (C D) (A C) (B D)

(233)

We can prove this inclusion as follows:


(x, y) (A C) (B D)
((x A) (y C)) ((x B) (y D)) denitions of ,
((x A) (y C)) ((x B) (y D))
((x A) (y D)) ((x B) (y C))
(This last step is an instance of the Rule of (Disjunctive) Amplication,
which states that p (p q) is a tautology (cf. Notes, ??).)
((x A) (y C)) ((x A) (y D))
((x B) (y C)) ((x B) (y D)
commutativity, associativity of
((x A) ((y C) (y D)) ((x B) ((y C) (y D))
distributivity of over
((x A) (x B)) ((y C) (y D)) distributivity of over
(x A B) (y C D) denition of
(x, y) (A B) (C D) denition of

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

1190

The student should be able to prove by constructing a simple counterexample that (233) is best possible, in the sense that we cannot replace
the symbol by =.
8. Let x and x respectively represent43 the oor and ceiling functions, dened
for any x R by
x = max{n|(n Z) (n x)}
x = min{n|(n Z) (n x)}

(234)
(235)

x
x+1
+
= x . [Hint: Consider the
2
2
function f (x) = x + x+1 x . Each of the three summands is constant
2
2
throughout intervals into which R can be decomposed. By examining these
intervals, you can determine a decomposition of R into intervals in which
all three of the summands are constant. This permits you to determine f
completely.]

(a) Prove carefully that x R

(b) It has been suggested that the following identity holds for the oor function:
x
x+1
x2

=
2
2
4

(236)

Is this an identity?
Solution:
(a) The function x is constant throughout intervals of the form m x < m + 1;
x
is constant throughout intervals of the form 2m x < 2m + 2; x+1 is
2
2
constant throughout intervals of the form 2m x + 1 < 2m + 2, equivalently,
2m 1 < x 2m + 1, where m Z. Thus the sum/dierence of these
functions is constant throughout all intervals of the form
m x < m + 1,

(m Z).

(237)

When 2n x < 2n + 1, f (x) = x + x+1 x = n + n 2n = 0; when


2
2
2n + 1 x < 2n + 2, f (x) = x + x+1 x = n + (n + 1) (2n + 1) = 0.
2
2
As R decomposes into a union of intervals of these two types, the property
holds throughout R.
43

Older notations for these functions are respectively [x] and {x}; the oor function is/was often
called the greatest integer function.

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

1191

(b) All that was expected of students was to demonstrate that (236) is not an
identity, i.e. that there exist values of x for which it fails. In the following
solution we determine precisely where equality holds: this solution is more
intricate than we would expect students in this course to provide, and is
being supplied only for completeness.
2

i. When 0 2n x < 2n+1, x x+1 = nn = n2 , while n2 x < n2 +n+ 1 .


2
2
4
4
So equality
does indeed hold when x = 2n; in fact, equality holds in the interval
2n x < 2 n2 + 1, and fails to hold in the interval
2 n2 + 1 x < 2n + 1 .

(238)

When 1 2n + 1 x < 2n + 2, x x+1 = n(n + 1) = n2 + n, while


2
2
2
1
n2 + n + 4 x < n2 + 2n + 1. Here equality holds in the interval 2n + 1
4

x < 2 n2 + n + 1, and fails to hold in the interval


2 n2 + n + 1 x < 2n + 2 .

(239)

Thus (236) holds at all non-negative integer points, and also in the small intervals shown to the right of each non-negative integer point.
ii. For negative x the situation is more complicated, since squaring of inequalities
between negative numbers reverses the inequalities!
Suppose that
2n + 1 x < 2n + 2 < 0 .
(240)
x
x+1
2
= n and
= n + 1. Squaring of (240) yields (n + 1)2 < x
4
2
2
2
1
n2 + n + 4 , so equality will hold in (236) i n2 + n < x n2 + n + 1 , i.e. i
4
4

Then

1
2n + 1 x 2n 1 + n .
Finally, suppose that

2n x < 2n + 1 < 1 .

(241)

x
x+1
=n =
, so (236) holds only at the negative even integer
2
2
point x = 2n < 0, and not in a small interval to its right.
Then

9. (a) Explain why the function f : R R dened by x cos x is not invertible.


Include, in your explanation, reference to the well known inverse cosine
function cos1 x (or arccos x), and to the fact that
x(cos cos1 x = x) .

(242)

(b) The author of your textbook denes the set of natural numbers N to consist
of all non-negative integers, including 0; many other authors do not include 0

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

1192

among the natural numbers. Show that the sets N and N {0} can be put
into one-to-one correspondence. Conclude that an innite set S is countable
in the sense of the textbook i there exists a bijection between S and the set
of positive integers.
(c) (cf. [19, Exercise 1.7.36]) Show that the union of two disjoint innite countable
sets is countable. [Hint: Alternate the members of the two sets.]
Solution:
(a) The cosine is not invertible since, in particular, it is not injective. For example,
the cosine assumes the same value 0 at all odd integer multiples of . The
2
so-called inverse cosine function is the inverse of a restriction of the cosine
with a reduced codomain. More precisely, we may choose a reduced domain
in which the function is indeed injective; the usual choice is the interval 0
x , although there are innitely many other possibilities (e.g. 27 x
28). The function cos1 x has domain 1 x x; hence the composition
cos cos1 has the same domain, 1 1; but we have seen [19, p. 64] that the
composition f f 1 of a function f with its inverse must have the property
that f f 1 = codomain of f ; here the codomain of the cosine was taken to be R.
This last objection is a technical one44 : it would not have arisen if we had
dened f : R [1, 1]. But even then the function would fail to be invertible
because of the failure of the second composition property, f 1 f = domain of f .
Because the function f is not injective, we cannot uniquely dene a destination
for, for example, 0 under any proposed inverse mapping f 1 .
(b) Dene the function f : N N {0} by n n + 1. This function is injective,
since f (n1 ) = f (n2 ) n1 + 1 = n2 + 1 n1 = n2 . It is surjective since,
n N {0} n > 0 n 1 N f (n 1) = n, so n is in the image of
f.
only if: Suppose S is innite and countable in the sense of the textbook.
Then there exists a bijection g : S N. The composition f g : S
N {0} is also a bijection [19, Exercise 1,6,19].
only if: Suppose that h : S N {0} is a bijection. Then f 1 h : S N
is a bijection, so S is innite countable.
(c) Suppose that sets A and B are innite countable. By denition, this means
that there exist bijections between the sets and the non-negative integers; we
will indicate these bijections by calling the elements of the respective sets a0 ,
a1 , ..., am , ... and b0 , b1 , ..., bn , ... The bijection of the union with N is given
by 2n an and 2n + 1 bn (n = 0, 1, ...). This function is well dened,
44

Another way of phrasing the last objection is that f is not surjective.

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

1193

since we have separately described the image of any integer, whether it be


even or odd; it is injective since the sets of evens and odds are disjoint, and
since distinct evens m1 and m2 are mapped to distinct points a m1 and a m2 ,
2
2
and similarly distinct odds...; it is surjective since every an and every bn is in
the image.
The statement is true without the restrictions to disjoint and to innite sets.
10. [22, Exercise 2.1.5] Let Q denote the rational numbers. Of the two proposals below
show that one denes a function from Q Q to Q, and the other does not.
a c
,
b d
a c
,
b d

a+c
b+d
ad + bc

bd

(243)
(244)

(where, of course, b = 0 and d = 0).


Solution: There can be two kinds of problems here:
Since rational numbers admit innitely many expressions as fractions, we must
verify that the proposed denitions give the same value for all representations.
A rational number a is an ordered pair in which the second member the
b
denominator cannot be zero; we must check that the proposed denition
does not map to points that could have zero denominator.
(243) fails to dene a function since it violates both of these conditions. For
c
example, the fraction 1 is the same rational number as 2 . If we take d = 2 , then
1
2
3
a+c
will be equal to either 3 or 4 , depending on whether we take (a, b) = (1, 1)
b+d
4
5
or (a, b) = (2, 2). For a violation of the second condition, consider (a, b, c, d) =
(1, 1, 1, 1). We are operating on the ordered pair of rational numbers (1, 1) in
Q Q, where we choose to represent the rst 1 in the form 1 , and the second in
1
the form 1 . The proposed image is not a rational number!
1
But (244) is well dened. First observe that, if b and d are both non-zero,
e
then their product will surely be non-zero.45 Next, suppose that a = f and
b
be and ch = dg. Then ad+bc eh+f g = f h(ad+bc)bd(eh+f g) =
bd
fh
bdf h
eh+f g
0
ad+bc
= bdf h = 0, so bd = f h . This shows that the denition
does not depend upon the particular fraction representing the rational number; i.e.
that the mapping is well dened. Of course, the mapping we have given is just the
denition of the operation of addition of rational numbers.
g
c
= h , so af =
d
bedhf dgh+dgbf bhde
bdf h

45

This property is not universally true: there are algebraic contexts in which the product of two
non-zero objects can be zero for example, in the multiplication of 2 2 matrices.

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

F.2

1194

Second 1999 Problem Assignment, with Solutions


Distribution Date: Wednesday, October 27th, 1999
Solutions were to be submitted by Friday, October 8th, 1999
Caveat lector! There could be misprints in these solutions.

1. (a) [21, Exercise 1.9.16] Show that every integer greater than 11 is the sum of two
composite positive integers.
(b) Show that the preceding statement is best possible, in the sense that 11
cannot be replaced by a smaller positive integer.
Solution:
(a) Case I: n is odd. Consider the integers 9 and n 9. Since n is odd, and
greater than 11, n 9 is even, and greater than 2, hence n 9 is a
composite even number (as 2 is the only even prime); 9 is the smallest
composite odd positive integer.
Case II: n is even. Consider the integers 4 and n 4. As observed above,
4 = 2 2 is composite; and n 4 is even, and certainly greater than 2,
so it also is composite.
(b) We tabulate the unordered additive partitions of 11 into two positive integers:
Smaller Summand Larger Summand
Composite?
Composite?
1
No
10
Yes
2
No
9
Yes
3
No
8
Yes
4
Yes
7
No
5
No
6
Yes
Thus none of these partitions has two composite summands.
2. For each of the following sets, write a single congruence which will be satised by
its members, and by no other integers; or explain why the given set is not the
solution set of any congruence. (There is a method called the Chinese Remainder
Theorem [19, 2.5] for systematically solving some of these cases. However, you
are asked to use only methods of [19, 2.3] in solving this problem. This can include
[19, Theorem 7, p. 122], which can be used to justify operations on congruences
that resemble familiar reversible operations on equations and systems of equations.
Some ingenuity may be needed in some of these cases, and, as is often the case,
there may be more than one valid approach to the same problem.)

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

1195

(a) the set 2Z of all even integers


(b) the set of all odd integers
(c) the set of all integers which are congruent to 3 modulo 7, and also congruent
to 1 modulo 5
(d) the set of all integers which are congruent to 3 modulo 7, congruent to 1
modulo 5, and also congruent to -5 modulo 3
(e) the set of all integers which are congruent to 1 modulo 5 and also congruent
to 1 modulo 7
(f) the set of all positive integers which are congruent to 3 modulo 7 and also
congruent to 1 modulo 5
(g) the set of all integers which are both congruent to 1 modulo 10 and congruent
to 4 modulo 14
Solution:
(a) x 0 (mod 2) is one such congruence; if m is any integer, then x 2m
(mod 2) is a solution to this problem
(b) x 1 (mod 2); more generally, any congruence x 2m + 1
m Z.

(mod 2) for

(c) The solutions to the congruence x 3 (mod 7) are all integers x of the form
x = 7m + 3. Imposing the condition that 7m + 3 1 (mod 5), we obtain
that 7m 2 (mod 5). Multiplying by the congruence 3 3 (mod 5) [19,
Theorem 7, p. 122] (i.e. multiplying both sides of the given congruence by the
same integer 3) we obtain the congruence
21m 6

(mod 5) .

(245)

Since 5 0 (mod 5), 20m 4m 0 (mod 5), i.e. 20m 0 (mod 5);
adding this congruence to (245) yields m 6 (mod 5), so m is an integer of
the form m = 6 + 5n; hence x is an integer of the form x = 7(6 + 5n) + 3 =
35n 39. This can be written as a congruence:
x 39

(mod 35)

(246)

Conversely, any integer x of the form 35n 39 has remainder 4 when divided
by 7 and 3 when divided by 5. Thus the given set consists precisely of the
solutions to (246). (By adding one of the congruences 35 35 (mod 35) or
70 70 (mod 35) we could express (246) in forms that might be considered
prettier, e.g. x 4 (mod 35) or x 31 (mod 35).)

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

1196

(d) We have shown in the preceding part that the solutions to the rst two congruences are precisely the set of integers of the form x = 35n 39. Imposing
the condition that 35n 39 5 (mod 3) we have 35n 34 (mod 3), to
which we may add 36n 0 (mod 3) and then 0 33 (mod 3) to obtain
n 1 (mod 3) so n 2 (mod 3), i.e. n is of the form 3t + 2; then x is of
the form 35(3t + 2) 39 = 105t + 31; equivalently,
x 31

(mod 105) .

(247)

Conversely, any integer congruent to 31 modulo 105 satises the 3 stated


congruences.
(e) This problem is easier to solve. Since x 1 is divisible by both 5 and 7, it is
divisible by their product, 35; so the congruence is x 1 (mod 35). (This
argument is valid only because the two given moduli are relatively prime.)
(f) The solutions to any single congruence are integers which are equally spaced
throughout the line; in particular, there will be negative integers among them.
Thus, as we are asked to consider only positive solutions, we know that these
cannot be represented by a congruence.
(g) These two congruences are incompatible. Any integer which is congruent to
1 modulo 10 will be odd; any integer congruent to 4 modulo 14 will be even.
There is no congruence whose solution is the empty set.
3. Let us generalize the Csar cipher [19, pp. 124125] as follows: The alphabet
A consists of 28 = 256 characters (for example, an extension of the ASCII code),
represented by the integers from 0 to 255. An ane cipher will be a function
a,b : A A dened by x ax + b (mod 256).
For the purposes of this problem you may assume [19, Theorem 3, p. 140], which
asserts that, for any relatively prime integers a and m, there exists an inverse a of a
modulo m; that is, there exists an integer a such that the product aa is congruent
to 1 modulo m. While you do not have available the algorithm provided in [19,
2.4, 2.5] to nd the inverse, you could always nd it by systematically testing all
integers 0, 1, ..., m 1, since its existence is assured.
(a) Such a cipher will be useful only if it is reversible i.e. only if any two
distinct letters are encoded in distinct ways. Show that the cipher will not be
reversible (i.e. an invertible function) if a is even.
(b) Show that the cipher will be reversible if a is odd.
(c) Find the decoding function when f (x) = 7x + 13. (Hint: We are trying
to solve the congruence f (x) 7x + 13 (mod 256) for x in terms of f (x).

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

1197

If we had the inverse of 7 modulo 256 we could multiply both sides of the
congruence by it to obtain the necessary information. But we dont have the
inverse, and have been instructed not to use the algorithm to nd it. It is
still possible to multiply both sides of f (x) 13 = 7x by a suitable integer
n1 and then reduce modulo 256 to obtain a more amenable congruence of the
form n1 (f (x) 13) mx (mod 256); any number you multiply by should
be relatively prime to the modulus, 256, i.e. relatively prime to 2, i.e. odd,
so that the operation will be reversible. Try to nd a way to transform the
equation so that ultimately it yields x in terms of f (x).)
(d) Show that if two ciphers a,b and a ,b (with a and a both odd) act in exactly
the same way on all letters in the alphabet A, then a a (mod 256) and
b b (mod 256).
Solution:
(a) Suppose that a = 2c, where c , so f (x) = 2cx + b. If b is odd, then the
image of the function f will contain only at most the integers 1, 3, 5, . . . , 255
modulo 256; or, when b is even, the image will contain only at most 0, 2, 4,
. . . , 254 modulo 256. In either case f is not surjective, hence not invertible.
(b) If a is odd it has no common factor with i.e. is relatively prime to 28 = 236.
By the quoted theorem, there must exist a multiplicative inverse a modulo 256.
Multiplying f (x) = ax + b by a yields af (x) = 1x + ab, hence x = a(f (x) b).
Thus the inverse of a,b is a,ab .
(c) (Following is one possible ad hoc attack on the problem.) We could nd
the multiplicative inverse of 7 by successively trying 1, 2, . . . , 183 (which
happens to be the inverse, since 183 7 = 1 + 5 256), but this could be
tedious. The hint suggested another approach; actually the hint is related to
the algorithm which appears in 2.4. Let us multiply both sides of the equation
f (x) 13 = 7x by an integer that will yield, on the right side, a coecient
which is positive, but smaller than 7. The best value here is 37, which is 256 ,
7
and it yields 37(f (x) 13) = 259x 3x (mod 256). Now multiply by 85,
to yield 85 37(f (x) 13) 1x (mod 256). Thus, reducing the coecients
modulo 256, we obtain x 73f (x) + 181 (mod 256), or, equivalently,
x 183f (x) + 181.
(d) If ax + b a x + b then
(a a )x (b b ) (mod 256)

(248)

for all values of x. In particular, with x = 0, we have b b . Then, with


x = 1, we have a a 0.

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

1198

4. Prove the validity of the rule of inference we have called Resolution using the
Hypothetical Syllogism and the logical equivalence (p q) ((p) q) [19, Table
6, p. 18]
Solution: One solution is the following:
pq
(p) r
qp
q p
q p
pr
q r
qr

hypothesis
hypothesis
(249), commutativity of
(251), double negation
(252), [19, Table 6, p. 18]
(250), [19, Table 6, p. 18]
(253), (254), Hypothetical Syllogism
(255),[19, Table 6, p. 18]

(249)
(250)
(251)
(252)
(253)
(254)
(255)
(256)

5. Modify the proof by contradiction in [19, Example 18, 3.1] to show that 7 is
irrational.
Then explain carefully why your modications could not be used to
prove that 9 is irrational.
Solution:
(a)

7 is rational

(m, n Z)( 7 = m
n
((m, n) = 1))

a
7=
((a, b) = 1)
b

a
7=
b
a2 = 7b2
(a, b) = 1
7|a2
7|a
a
c :=
7
2
b = 7c2
7|b2

hypothesis
(257),
denition of rational

(257)
(258)

(258),

(259)

Existential specication
conj. simpl. of (259)

(260)

7 times square of (260)


conj. simpl. of (259)
(261)
(263),[19, Theorem 2,2.3]

(261)
(262)
(263)
(264)

(264), denition of c

(265)

(261),(265)
(266)

(266)
(267)

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


7|b
7|(a, b)
F

(267),[19, Theorem 2,2.3]


(264),(268)
(262),(269)

1199
(268)
(269)
(270)

(b) Lines (264),(268) both represent invalid conclusions if we replace 7 by a nonprime: for example, it does not follow from 9|32 that 9|3.
6. [19, Exercise 3.1.68] Use the resolution rule of inference to prove the statement
You will win the lottery or you will be promoted, given the three hypotheses,
You will quit your job or you will win the lottery, You will not quit your job
or you will nd a better job,, and You will not nd a better job or you will be
promoted. [Hint: First dene some elementary propositions p, q, ...; then express
the hypotheses in terms of them.]
Solution: We dene the following elementary propositions:

p
q
r
s

=
=
=
=

You
You
You
You

will
will
will
will

quit your job


win the lottery
nd a better job
be promoted.

Then we have the following proof:


pq
p r
r s
rq
qs

hypothesis
hypothesis
hypothesis
resolution of (272),(271)
resolution of (274),(273)

(271)
(272)
(273)
(274)
(275)

7. [19, Exercise 3.2.54] Show that, for any positive integer n, n lines in general
position (i.e. no two of them are parallel, no three of them pass through the same
2
point) in the plane R2 divide the plane into exactly n +n+2 regions. (Hint: Use the
2
fact that an n + 1st line will cut all n lines, and thereby create n + 1 new regions.)
Solution: Let P (n) denote the given proposition that n lines divide R2 into
n2 + n + 22 regions.
Basis Step: One line divides the plane into two regions, so P (1) is true.

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

1200

Induction Step: Let n be any positive integer. Suppose P (n) is true. Let lines
L1 , L2 , ..., Ln+1 be given. By the induction hypothesis, L1 , . . . , Ln divide R2
2
into n +n+2 regions. Line Ln+1 meets each of the other lines, thereby cutting
2
2
o n + 1 new regions. Thus the number of regions is, in all, n +n+2 + (n + 1) =
2
(n+1)2 +(n+1)+2
n2 +3n+4
=
. We have proved P (n) P (n + 1).
2
2
It follows by the (First) Principle of Mathematical Induction that P (n) is true for
all positive integers n.
8. A sequence {an }n=0,1,2,... of real numbers is dened recursively by a0 = a1 = 1,
an+2 = 3an+1 + 2an (n = 0, 1, 2, ...). Later in the course we will be studying how
to determine a general formula for an , but, for the purposes of this problem, you
must not use the methods we will be developing in [19, Chapter 5]. Your are now
asked to prove, using induction, that
1 n
1
3 < an < 4n
2
2

(276)

for n 2.
Solution: (Using methods we will meet later in the course, the exact value of an
can be shown to be

n
n
1
3 17
1
3 + 17
1
+ 1+
an =
1
2
2
2
17
17

As 32 17 is less than 1 in magnitude, its powers approach 0 with increasing n;


thus, for large n, an can be shown to be approximately equal to
1
2

1
1
17

3+

17
2

1
= (3.5615...)n .)
2

We shall use the Second Principle of Mathematical Induction.


Basis Steps: By the recursive denition, a2 = 3a1 + 2a0 = 3 1 + 2 1 = 5, so
1 2
9
3 = 2 < 5 < 1 42 and (276) is true for n = 2. This one case will not, however,
2
2
be enough to base the induction, since we will be using the recursive denition,
which requires information about two successive members of the sequence.
And, unfortunately, (the left inequality of) (276) is false when n = 1. We
will verify the case n = 3 manually: a3 = 3a2 + 2a1 = 3 5 + 2 1 = 17, and
1 3
3 = 27 < 17 < 32 = 1 43 .
2
2
2

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

1201

(Let us be precise about what constitutes the basis step. We are taking n = 3
to be that step. In the induction step below we will prove that the truth of
cases 3, 4, ..., n implies the truth for n + 1. This is a general argument for
every case but n = 3. In that one case the general argument given is not
quite correct, although the implication (Case n = 3 Case n = 4) is still
true. It is true not solely because of the single case n = 3, which is the stated
hypothesis, but also because we have established the case n = 2 above.)
Induction Step: Suppose that (276) is true for n N , where N 3. In particular, we have the two pairs of inequalities when n = N 1 and n=N :
1 N 1
1
3
< aN 1 < 4N 1
2
2
1 N
1
3 < a N < 4N
2
2

(277)
(278)

Adding 2 times (277) to 3 times (278) yields


1
2

2 3
+
9 3

3N +1 < aN +1 <

1
2

2
3
+
16 4

4N +1

(279)

Hence
1 N +1 1
3
<
2
2

2 3
+
9 3

3N +1 < aN +1 <

1
2

2
3
+
16 4

1
4N +1 < 4N +1
2

(280)

which is the instance n = N + 1 of (276).


9. Suppose R and S are relations on a set A. Prove or disprove each of the following
statements:
(a) [19, Exercise 6.1.28(b)] If R and S are both reexive, then R S is reexive.
(b) [19, Exercise 6.1.28(e)] If R and S are both reexive, then S R is reexive.
(c) If R and S are both irreexive, then R S is irreexive. (A relation R is
irreexive if a A((a, a) R).)
/
(d) If R and S are both antisymmetric, then R S is symmetric.
(e) If R and S are both transitive, then R S is transitive.
(f) If R is both symmetric and antisymmetric, then R is transitive.
Solution:

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

1202

(a)
R is reexive
S is reexive
aA
(a, a) R
(a, a) S
(a, a) R S
x(x, x) R S

hypothesis
hypothesis
hypothesis
(281), (283)
(282), (283)
(284), (285)
(283), (285),existential generalization

(281)
(282)
(283)
(284)
(285)
(286)
(287)

R is reexive
S is reexive
aA
(a, a) R
(a, a) S
(a, a) S R
x(x, x) R S

hypothesis
hypothesis
hypothesis
(288), (290)
(289), (291)
(291), (292)
(290), (293), existential generalization

(288)
(289)
(290)
(291)
(292)
(293)
(294)

(b)

(c) We give a proof by contradiction. Suppose that for some a A, (a, a) RS.
Then, by denition of , (a, a) R and (a, a) S are both true. Both of
these memberships contradict hypotheses of irreexivity. From this contradiction we conclude that a((a, a) R S), which is logically equivalent to
a((a, a) R S), which is the denition of irreexivity for R S. (Note
/
that the hypotheses of the problem are stronger than needed: it would have
suced to assume that some one of R and S is irreexive, without hypotheses
about the other relation.)
(d) This claim is false. For one counterexample take A = {a, b}, R = {(a, b)},
S = {(a, a)}. Then R S = {(a, b)} = R, which is not symmetric.
(e) Let a = {a, b, c, d, e}, R = {(d, b), (e, c)}, S = {(a, d), (b, e)}. Then both R
and S are (vacuously) transitive. But RS = {(a, b), (b, c)}, but (b, c) RS.
/
Thus R S is not transitive. (This seems unnecessarily complicated. Is there
a simpler counterexample?)
(f) Since R is symmetric, (a, b) R (b, a) R. Since R is antisymmetric,
(a, b) R (b, a) R a = b. Hence (a, b) R a = b. That is, the only
elements of the relation R are contained in the diagonal, {(a, a)|a A}.

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

1203

The only pairs of elements of R of the form (a, b) and (b, c) will therefore be of
the form (a, a) and (a, a); and transitivity would only require that (a, a) R.
Thus the statement is TRUE.

F.3

Third 1999 Problem Assignment, with Solutions

Distribution Date: Wednesday, November 3rd, 1999


Solutions were to be submitted on Friday, October 22nd, 1999
Caveat lector! There could be misprints and other errors in these draft solutions.
(An updated version may be posted on the Web.)
1. (cf. [19, Exercise 4.1.18]) How many positive integers less than 1000
(a) are divisible by 7?
(b) are divisible by 7 but not by 11?
(c) are divisible by both 7 and 11?
(d) are divisible by exactly one of 7 and 11?
(e) are divisible by neither 7 nor 11?
(f) are divisible by either 7 or 11 (inclusive or)?
(g) have distinct digits?
(h) have distinct digits, and are even?
(i) are divisible by 12 but not by 14?
Hints:
The numbers divisible by a non-zero integer m are equally spaced m units
apart along the real line, starting at 0. This is a special case of [19, Theorem
2.3.6], which implies that the solutions to the linear congruence
x b (mod m)
are all integers of the form x = b + km, where k ranges over all of Z .
Show all your work. It is dicult for the grader to determine your errors
the identication of which is the purpose of this exercise if (s)he cannot
see precisely where your reasoning is defective. Getting the right answers is
not the main purpose of this exercise.
If you have diculty with this problem, try to rst solve a simpler problem.
For example, you might wish to consider integers between 1 and 23 in the scale
of 2, or integers between 1 and 33 in the scale of 3; in these cases you could
actually list all the integers, to determine whether your counts are correct.

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

1204

Solution:
(a) The number of positive integers in the interval 1 n < 1000 which are
999
divisible by 7 is precisely
= 142. The 143rd multiple would be 1001,
7
which is outside of the given interval; the oor function counts the number of
consecutive subintervals of length 7, excluding intervals which are incomplete
(like the interval from 994 to 999).
999
999

= 142 12 = 130. Divisibility by both 7 and 11 is equivalent


7
77
to divisibility by the product, by virtue of the fact that 7 and 11 are relatively
prime.
999
(c)
= 12.
77

(b)

(d) If we add the numbers of multiples respectively of 7 and of 11 we will have


counted the integers divisible by both 7 and 11 twice. Hence the number of
integers in the given interval which are divisible by exactly one of 7 and 11
999
999
999
is
+
2
= 142 + 90 24 = 208. (Although students
7
11
77
were expected to solve this problem from rst principles, it can be seen as a
simple application of a generalization of the Principle of Inclusion-Exclusion
[19, 5.5]. )
(e) This will be the complement in 999 of the number of integers divisible by either
7 and 11 which is determined in part 1f q.v.46 ; thus it is 999 220 = 779.
(f) If we add the numbers of multiples respectively of 7 and of 11 we will have
counted the integers divisible by both 7 and 11 twice. Hence the number of
integers in the given interval which are divisible by either or both of 7 and
999
999
999
11 is
+

= 142 + 90 12 = 220. (This is a simple


7
11
77
application of the Principle of Inclusion-Exclusion [19, 5.5]. )
(g) We can apply the Product Rule: Choose the units digit in 10 ways; choose
the tens digit in 9 ways, since no repetitions are permitted;... the hundreds
in 8 ways. Thus the number of integers between 000 and 999 with distinct
digits is 10 9 8 = 720. The integer 000 has not been counted, as its digits
are not distinct. So the number of integers in the given interval with distinct
digits in a 3-digit decimal representation is 720. This is not the solution the
author expected, as there are problems with the leading zeros. Specically,
46

Latin quod vide = which see

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

1205

we have not included any of the integers between 1 and 9, although they have
no repeated digits when written without leading zeros; and, between 10 and
99, we have excluded all strings of the form 0x0, where x is one of 1, 2, ..., 9.
Thus the answer expected is 720+9+9=738.
This problem indicates a frequent diculty in combinatorial problems: the
wording of the problem was slightly ambiguous. It seemed reasonable to treat
the problem as one of counting 3-digit strings, but, as seen above, this led to
an unexpected answer.
Another approach to the expected solution would be to apply the Sum Rule
rst, by dividing the interval up into 1 n 9, 10 n 99, 100 n 999.
Within each of these 3 intervals the Product Rule can be applied, yielding, for
the 3 intervals, 9, (9 9), (9 9 8), whose sum is 738. (In the product 9 9,
the tens digit is chosen in 9 ways from {1, 2, 3, 4, 5, 6, 7, 8, 9}, and then the
units digit is chosen from the set {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} but must not be the
same as the tens digit; a similar rationale explains the product 9 9 8.)
(h) We will rst try to generalize the second method used above. The number of
1-digit integers will be 4 = |{2, 4, 6, 8}|. The 2-digit integers with an even tens
digit will be 4 4 in number; while those with an odd tens digit will be 5 5
in number, for a total of 16 + 25 = 41. (A simpler way of determining this
would have been to count the even integers between 10 and 98 there are
98
8

= 49 4 = 45 and then subtract the number with repeated


2
2
digits, i.e. |{22, 44, 66, 88}|.)
But the counting of the even solutions between 100 and 999 is more complicated. One solution is to think of adding a digit to the left of one of 02, 04,
06, 08 or of one of the 41 2-digit solutions. In most cases there are 7 possible
choices for the hundreds digit. The exceptions are the 2-digit strings already
counted in which there is a zero present, i.e. 10, 20, 30, ..., 90, and 02, 04, 06,
08; in any of which cases there are 8 possible choices for the hundreds digit.
This yields (7 (41 9)) + (8 (4 + 9)) = 328 integers.
In all we have 4 + 41 + 328 = 373.
Another approach would be to subtract from 738 the number of integers which
are odd. There are 5 1-digit such integers: 1, 3, 5, 7, 9. Among the 2-digit
odd integers we choose the units digit rst, in 5 ways, then the tens digit in
8 ways to avoid repeated digits, giving 40 integers. Among the 3-digit odd
integers, we choose the units digit in 5 ways, the hundreds digit in 8 ways,
and then the tens digit in 8 ways since 0 is permitted only there, giving
5 8 8 = 320. In all we have 738 (5 + 40 + 320) = 373 integers.
(i) This problem is slightly dierent from that of part 1b in that the two given

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

1206

integers are not relatively prime. The integers in the interval which are divisible by both 12 and 14 are not only those divisible by the product 12 14; as
divisibility by 12 is equivalent to divisibility by 4 and by 3, and divisibility by
14 is equivalent to divisibility by 2 and 7 (why?), divisibility by both 12 and
14 is equivalent to the conjunction of these four conditions, i.e.
(4|n) (3|n) (2|n) (7|n) .
As (4|n) (2|n), (4|n)(3|n)(2|n)(7|n) (4|n)(3|n)(7|n). In this last
conjunction the three divisors are, indeed, relatively prime; divisibility by each
of 4, 3, 7 is equivalent to divisibility by their product, 84. Hence the number
999
999
of integers satisfying the conditions of this problem is

=
12
84
83 11 = 72.
2. [19, Exercise 4.1.28] How many strings of eight English letters are there
(a) if any letters can be repeated?
(b) if no letters can be repeated?
(c) that start with the letter X, if letters can be repeated?
(d) that start with the letter X, if no letters can be repeated?
(e) that start and end with the letter X, if letters can be repeated?
(f) that start with the letters BO (in that order), if letters can be repeated?
(g) that start and end with the letters BO (in that order), if letters can be repeated?
(h) that start or 47 end with the letters BO (in that order), if letters can be
repeated?
Where the answers are very large, you need not reduce products or sums.
Solution:
(a) By the Product Rule there are 268 such words.
(b) Choose the rst member of the string in 26 ways, the second in 25, ..., the 8th
in 26-8+1=19 ways. The total number of words is the product, 26 25 ...
26!
20 19 =
. This is what your textbook calls P (16, 8) = 62 999 928 000.
18!
(c) Choose the 1st letter in 1 way, and each of the others in 26 ways; in all there
are 1 267 = 8 031 810 176 words.
47

inclusive or

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

1207

(d) The rst letter is chosen in 1 way, and the others successively in 25, 24, ..., 19
25!
ways, for a total number of
= 2 422 728 000 words.
18!
(e) The beginning 2-letter string is chosen in 1 way, following which the other 6 letters are chosen each in 26 ways independently, for a total of 266 = 308 915 776
words.
(f) Choose the beginning and end letters each in 1 way, and the intermediate 6
letters in 266 = 308 915 776 ways.
(g) Choose the beginning 2-letter string and the nal 2-letter string each in 1 way,
and the intermediate 4 letters in 264 = 456 976 ways.
(h) The numbers of words that end with BO is equal to the number that start
with BO, computed above to be 266 . Summing these, we must subtract the
number of words that both start and end with BO, as they are counted twice
in the sum: we obtain 2 (266 ) 264 = 617 374 576.
3. [19, Exercise 4.2.4] A bowl contains 10 indistinguishable red balls and 10 indistinguishable blue balls. A woman selects balls at random without looking at them.
(a) Carefully explaining your reasoning, determine how many balls she must select
to be sure of having at least three balls of the same colour?
(b) Carefully explaining your reasoning, determine how many balls she must select
to be sure of having at least three blue balls?
Solution:
(a) If she selects only 4 balls, it can happen that there are 2 reds and 2 blues; thus
the number selected must be at least 4 + 1 = 5. And, indeed, in a selection
5
of 5 balls, the majority colour will contain at least
= 3 balls.
2
(b) It could happen that all of the rst 10 balls selected are red. More precisely,
we see from the possible selection of 10 red balls and 2 blue balls, that the
minimum she needs to select cannot be less than 12 + 1 = 13. And, indeed,
if she selects 13 balls, even if all 10 red balls are among them, there will still
be at least 3 blue balls.
4. [19, Exercise 4.3.60] In how many ways can a horse race with four horses nish
if ties are possible.? (Note that, since ties are allowed, any numbers of the four
horses may tie. This includes the possibility, for example, that two horses tie for
rst place, and the other two horses tie for second place.)

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

1208

Solution: As with many combinatorial problems, there is more than one way to
interpret the constraints, because of possible ambiguities in the wording.
(a) One interpretation would have the horses being indistinguishable: as though
one was interested in counting only the possible congurations at the nish,
not how 4 specic horses fared in the race. What we are counting here are
ordered additive partitions of 4 , i.e. decompositions of 4 into a sum of positive
integers, where the order of the summands is relevant, as 4 = n1 + n2 + n3 + ...
We can think of n1 as denoting the number of horses coming rst, n2 as the
number coming second, etc. These ordered partitions can be represented by
binary strings i.e. words in the alphabet {0, 1} in which there are 4
0s (representing the 4 horses), and there are 1s to act as separators of the
parts. As the parts must contain positive numbers of horses, the 1s may
not be adjacent. Moreover, the parts are never zero, so the rst digit in the
string is a 0, and so is the last. An easy way to visualize this problem is that
there is a sequence of 4 0s, and we are to place 1s into some or all of the 3
spaces between successive 0s never more than one 1 in each place. But this
amounts to selecting a subset of the 3 possible locations between successive
0s: the number of subsets of a set of 3 objects is 23 = 8, and this must be
the number of ways in which the race can be nished.
(b) Another possible interpetation the interpretation that the author of the
textbook intended would have the 4 horses distinguishable: we are interested in the outcome of a specic race with 4 named horses. Here we can
rst consider the same ordered partitions considered above. But now we have
to associate multiplicities with the various partitions, so it is not enough to
count them; for example, the partition 4 = 2 + 1 + 1, in which 2 horses tie
for 1st place, 1 comes second and the other comes in alone, is associated with
4 2 1
= 12 outcomes of the race. But the multiplicities of the various
2 1 1
partitions is not always the same for example, the 4-horse-tie can occur in
only 1 way (i.e. 4 ways); so we cant solve this version of the problem by
4
multiplying the answer in the previous case by, for example, 4!.
We will list the ordered partitions, and compute the number of outcomes in
each case. We have chosen to order the cases by number of parts, and, within
that classication, lexicographically.
4
4

4 = 4: As mentioned above, this case occurs in


4 = 1 + 3: Select the horse to come rst in

4
1

= 1 way.

= 4 ways.

4 = 2 + 2: Select the two horses to come rst in


4 = 3 + 1: Select the three horses to come rst in

4
2

= 6 ways.
4
3

= 4 ways.

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

1209

4 = 1 + 1 + 2: Select the horse to come rst in 4 = 4 ways, then the horse to


1
come second in 41 = 3 ways, then the horses to come last in 42 = 1
1
2
way. In all the number of choices is 4 3 = 12.
4 = 1 + 2 + 1, 4 = 2 + 1 + 1: These cases will each yield the same count as
the preceding, i.e. 12 each.
4 = 1 + 1 + 1 + 1: Here we are counting the number of permutations of the 4
horses, so the number is 4!.
Summing the above we have 1 + (4 + 6 + 4) + (12 + 12 + 12) + 24 = 75 dierent
outcomes of the race.
This last case seems very complicated. In fact, it can be systematized. What
we are counting could be interpreted as the numbers of surjective functions
from a set of 4 elements (the horses) to sets of 1, 2, 3, or 4 elements. These
numbers are related to the so-called Stirling numbers of the second kind , which
count such functions up to the labelling of the points in the codomain. If you
apply the formula in [19, Theorem 5.6.1] for m = 4 and n = 1, 2, 3, 4, you can
see that the sum will be 1 + 14 + 36 + 24 = 75 again.
5. In how many ways can 27 dierent books be distributed to A, B, C so that A and
C together may receive exactly twice as many as B?
Solution: [24, Problem #117] If we denote the numbers of books received by A, B, C
respectively by a, b, c, then we have
a + c = 2b
a + b + c = 27
so a + c = 18, b = 9. The number of ways of selecting the books for B is
the remaining 18 books may be partitioned between A and C in exactly 218
27 18
So the total number of distributions is, by the Product Rule,
2 .
9

27
;
9
ways.

6. A pastry shop has twenty dierent kinds of pastry. The clerk is asked to pack a box
of six pastries, never including the same kind of pastry more than twice. In how
many ways can the box be packed (where the order of selection is not relevant)?
Solution: [24, Problem #207] Consider the possible unordered partitions of 6 which
represent the distributions of pastries selected. For each of these partitions we will
determine the number of realizations with the 20 available types of pastries.
6 = 1 + 1 + 1 + 1 + 1 + 1: Select the pastries in

20
6

= 232 560 ways.

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


6 = 2 + 1 + 1 + 1 + 1: Select the pastry having multiplicity 2 in
and the other 5 in 19 = 77 520 ways.
4

1210
20
1

= 20 ways,

6 = 2 + 2 + 1 + 1: Select the pastries having multiplicity 2 in 20 = 190 ways, and


2
the other 2 in 18 = 171 ways, for a total of 190 171 = 32 490 selections.
2
6 = 3 + 1 + 1 + 1: This partition is impossible, as one part exceeds 2.
6 = 4 + 1 + 1, 6 = 3 + 2 + 1: These partitions are also impossible, as a part exceeds 2.
20
3

6 = 2 + 2 + 2: Select the three types of pastries in

= 1140 ways.

Partitions into one or two parts: In either of these cases one part will exceed,
so these cases are impossible.
Summing, we obtain 38 760 + 77 520 + 29 070 + 1 140 = 146 490 selections.
This problem can be solved using (ordinary) generating functions. The enumerator
for each of the types of pastries is 1 + t + t2 .
20

coecient of t6 in (1 + t + t2 )
20
= coecient of t6 in (1 t3 ) (1 t)20
= coecient of t6 in (1 20t3 + 190t6 ) (1 t)20

= coecient of t in 1 20t + 190t

6
n=0

19 + n n
t
n

= coecient of t6 in 1 20t3 + 190t6 1 +


= 1

25
22
19
20
+ 190
6
3
0

22 3
25 6
t +
t
3
6

= 177 100 30 800 + 190 = 146 490

7. Determine the number of 4-letter words that can be made out of the letters of
the words MCGILL COLLEGE, where no letter may be used more often than it
appears in this population (for example, no more than 2 Gs may be used).
Solution: This population contains 4 Ls; 2 of each of C, G, E; and 1 of each of M,
I, O.
(a) Solution by cases: We divide the words up according to the multiplicities
of the letters chosen. We are looking at unordered partitions.
4=4: Choose the letters in 1 = 1 way. There is only one such word, LLLL.
1
4=3+1: Choose the letter of multiplicity 3 from the set {L} in 1 way, and
the other letter in 71 = 6 ways. The chosen letters may be ordered in
1
4!
= 4 ways. There are 1 6 4 = 24 such words.
3!1!

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

1211

4=2+2: Choose the letters from the set {C,G,E,L} in 4 = 6 ways, and
2
4!
order them in 2!2! = 6 ways. There are 6 6 = 36 such words.
4=2+1+1: Choose the letter which is to have multiplicity 2 in 4 = 4 ways,
1
4!
and the other two letters in 71 = 15 ways; order the letters in 2!1!1! = 12
2
ways. There are 4 15 12 = 720 such words.
4=1+1+1+1: Choose the letters in 7 = 35 ways, and order them in 4! =
4
24 ways, for a total of 840 words of this type.
Summing, we nd that there are 1 + 24 + 36 + 720 + 840 = 1621 words.
(b) Solution using exponential generating functions: The enumerator for
2
3
4
2
L is 1 + t + t + t + t ; each of C, G, E has enumerator 1 + t + t , and each of
2!
3!
4!
2!
M, I, O has enumerator 1 + t. The number of words is 4! times the coecient
of t4 in the expansion of the product, i.e. in the expansion of
3

t2
t2 t3 t4
+ +
1+t+
(1 + t)3
2! 3! 4!
2!
t4
t2 t3
=
1+t+ + +
2
6
24
9
9
1 + 3t + t2 + 4t3 + t4 + ...
2
4
2
3
1 + 3t + 3t + t
t2 t3
t4
=
1+t+ + +
2
6
24
33
55
123 4
1 + 6t + t2 + t3 +
t + ...
2
2
4
1621 4
= ... +
t + ...
24
1+t+

So the number of words is 24 1621 = 1621.

F.4

Fourth 1999 Problem Assignment, with Solutions

Distribution Date: Friday, November 5th, 1999


Solutions were to be submitted on Friday, November 5th, 1999
Caveat lector! There could be misprints and other errors in these draft solutions.
(An updated version may be posted on the Web.)
In grading this assignment, the grader assigned grades as follows: Problem 2: 8;
Problem 4: 10; Problem 5(c),5(d) 8 together; Problem 7: 12; Problem 8: 12. The other
problems were not graded.

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

1212

1. (cf. [19, Exercise 5.1.38]) Show by induction48 that the Fibonacci numbers, dened
recursively by
f0 = 0
f1 = 1
fn+2 = fn + fn+1

(n 0)

(295)
(296)
(297)

fn+4 = 3fn+2 fn ,

(298)

also satisfy the recurrence


Pn :

and use this recurrence without solving it explicitly to prove that

(mod 3) if n 0 (mod 4)
0
1
(mod 3) if n 1, 2, 7 (mod 8)
fn

2
(mod 3) if n 3, 5, 6 (mod 8)

(299)

for n 0.
Solution:
(a) Induction Proof of (298):
Basis Step: From the given initial conditions we determine that f2 = f1 +
f0 = 1 + 0 = 1, f3 = f2 + f1 = 1 + 1 = 2, f4 = f3 + f2 = 2 + 1 = 3,
f5 = f4 + f3 = 3 + 2 = 5. Hence f4 3f2 + f0 = 3 3 + 0 = 0, and
f5 3f3 + f1 = 5 6 + 1 = 0, so (298) is satised for n = 0 and n = 1.
The n = 0 case is the basis step; the n = 1 case will be needed in the
Induction Step.
Induction Step: Let N 2, and suppose that (298) is true for all n such
that 0 n < N ; it is actually sucient to assume that
f(N 2)+4 = 3f(N 2)+2 fN 2
f(N 1)+4 = 3f(N 1)+2 fN 1 .

(300)
(301)

Then summing these equations yields (298) for n = N , by virtue of (297)


when N 2.
In order to complete the induction step we must show that the truth of
(298) for 0 n < 1 implies its truth for n = 1, more precisely, that
P0 P1 is true. It is here that we apply our earlier establishment of P1 .
Equation (298) yields a congruence modulo 3: fn+4 fn
48

Do not solve the recurrence (297) explicitly.

UPDATED TO September 19, 2000

(mod 3).

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

1213

(b) Induction Proof of (299): First observe that, by two applications of (298),
fn+8 fn+4 fn

(mod 3)

(302)

Our proof will be by induction on n .


8
Basis Step: Earlier we computed fn for n 5. Continuing this computation,
we observe that f6 = f5 + f4 = 5 + 3 = 8 2 (mod 3), f7 = f6 + f5 =
8 + 5 = 13 1 (mod 3). From these and the earlier data we can verify
that (299) is true for 0 n 7. This is the case n = 0.
8
Induction Step: Suppose that we have proved (299) for non-negative n such
that n = t, where t 0. Suppose now that n = t + 1. Then
8
8
n8
= t, and the induction hypothesis is that fn8 has the desired
8
remainder modulo 3. But, by (302), fn fn8 (mod 3), so (299) also
holds for n. What we have proved is that the truth of the congruences
for n = 8t + s, where 0 s 7 implies its truth for n = 8(t + 1) + s,
(0 s 7).
It follows by the (First) Principle of Induction that the congruences hold for
all non-negative n.
2. [19, Exercise 5.2.18] Solve the recurrence relation
an
with a0
a1
a2

=
=
=
=

6an1 12an2 + 8an3


5
4
88

(303)
(304)
(305)
(306)

Solution: The characteristic polynomial of (303) is r3 6r2 + 12r 8, which can


be seen by trial to have a root r = 2.49 Dividing by r 2 yields the factorization
r3 6r2 + 12r 8 = (r 2) (r2 4r + 4); the quadratic factor may be further
factorized as (r 2)2 , so that the characteristic polynomial factorizes as r3 6r2 +
12r 8 = (r 2)3 . It follows that the general solution of (303) is
an = n2 + n + 2n ,

(307)

where , , are constants to be determined. Imposing the three initial conditions


yields the system of equations
= 5
2 + 2 + 2 = 4
16 + 8 + 4 = 88
49

A monic polynomial will have, as integer roots, only divisors of its constant term: in this case the
only possible integer roots would be 1, 2, 4, 8; of course, there is no reason that the roots need
to be integers for example, the roots are not even rational in the case of the Fibonacci numbers!

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

1214

from which we conclude that = 13 , = 1 , = 5, and that the particular


2
2
solution of the given recurrence which satses the initial conditions is
an = 13n2 + n 10 2n1

(n 0) .

3. (cf. [19, Exercise 5.2.26]) What is the general form of the particular solution of the
linear nonhomogeneous recurrence relation an = 6an1 12an2 + 8an3 + F (n) if
(a) F (n) = n2 ?
(b) F (n) = 2n ?
(c) F (n) = n2n ?
(d) F (n) = (2)n ?
(e) F (n) = n2 2n ?
(f) F (n) = n3 (2)n ?
(g) F (n) = 3?
(h) F (n) = (4n2 2n + 5)2n ?
Solution: We have seen in Problem 2 above that the roots of the characteristic
polynomial are 2, 2, 2 i.e. 2 with multiplicity 3. In all of these cases except the
last F (n) has the form nk an , where k is a non-negative integer, and a is a constant.
By [19, Theorem 5.2.6] the particular form we seek will, in all of these cases, be the
product of a polynomial and an . The polynomial factor is to have degree at least
k; this degree must be increased by 3 when a = 2; more precisely, the polynomial
should be multiplied by n3 when a = 2.
(a) When F (n) = n2 1n , a particular solution will be of the form (n2 + n1 +
) 1n , i.e. a polynomial of degree 2.
(b) When F (n) = 2n , a particular solution will be of the form n3 2n .
(c) When F (n) = n 2n , a particular solution will be of the form n3 (n + ) 2n ,
i.e. (n4 + n3 )2n .
(d) When F (n) = (2)n , a particular solution will be of the form (2)n .
(e) When F (n) = n2 2n , a particular solution will be of the form n3 (n2 + n1 +
) 2n .
(f) When F (n) = n3 (2)n , a particular solution will be of the form (n3 + n2 +
n + ) (2)n .
(g) When F (n) = 3 1n , a particular solution will be of the form 1n , i.e. a
constant.

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

1215

(h) When F (n) = (4n2 2n + 5)2n , the form will be the same as in case 3e above;
the presence of the lower degree terms does not introduce any additional
complication; nor does their absence in case 3e introduce any simplication.
4. (cf. [19, Exercise 5.2.18]) Solve the recurrence relation
an
subject to
a0
a1
a2

= 6an1 12an2 + 8an3 + (n2 3)


= 5
= 4
= 88

(308)
(309)
(310)
(311)
(312)

Solution: We rst look for a particular solution of the form an = (n2 +n+)1n ,
substituting this general expression into (308) to obtain, after regrouping by powers
of n: n2 + n + = (2 + 1)n2 + (12 + 2)n + (30 6 + 2 3); equating
coecients of corresponding powers of n yields
= 1
12 + = 0
30 6 + = 3
which we solve to obtain (, , ) = (1, 12, 39). Thus one particular solution
is a(p) = n2 12n 39. The general solution of (308) is therefore obtained from
the general solution of the related homogeneous recurrence relation by adding this
particular solution; i.e. it is
an = n2 + n + 2n (n2 + 12n + 39) .

(313)

It is on this function that we impose initial conditions (310), (311), (312), obtaining
the equations
(02 + 0 + ) 39 = 5
( + + )2 (1 + 12 + 39) = 4
(4 + 2 + )4 (4 + 24 + 39) = 88
We obtain

67 115
,
, 34
8
8
so the particular solution that satises the initial conditions is
(, , ) =

an =

67 2 115
n
n + 34 2n (n2 + 12n + 39) .
8
8

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

1216

5. [19, Exercise 5.4.6] Find a closed form for the generating function a(x) for the
sequence {an }, where
(a) an = 1 for all n = 0, 1, 2, ...
(b) an = 2n for n = 1, 2, 3, 4, ..., and a0 = 0
(c) an = n 1 for n = 0, 1, 2, ...
1
(d) an =
for n = 0, 1, 2, ...
(n + 1)!
(e) an =

n
2

(f) an =

10
n+1

for n = 0, 1, 2, ...
for n = 0, 1, 2, ...

You may appeal to [19, Table 5.4.1, p. 343] if you wish, but it would be preferable
if you knew from Calculus III how the series in the table are developed.
Solution:

1
. (The last equation is, technically, valid only for
1x
k=0
|x| < 1, if the generating function is interpreted as a real-valued function of a
real variable. A better point of view for generating functions is to consider
them as purely algebraic objects, but this requires more sophistication than
we can adopt at this time; it may be discussed in 189-340B. In the sequel
we will usually not concern ourselves with the intervals where equations like
the one above are valid, and will normally not even state the interval of
convergence.)

(a) a(x) =

(1)xk =

(b) a(x) = 0x0 +

2 k xk =
k=1

(2x)k =
k=1

2x
.
1 2x

(c)

(k 1)xk

a(x) =
k=0

(k + 1 2)x =

=
k=0

=
k=0

xk

(k + 1)x 2
k=0

d
1
xk+1 2
dx
1x

k=0

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


d
=
dx
d
dx

xk+1

k=0

xj
j=1

1217

2
1x

2
1x

1
2
1
1x
1x
1
2

=
(1 x)2 1 x
2x 1
=
(1 x)2
d
dx

(In this development we are appealing to the theorem that the derivative of
a power series within its interval of convergence is the sum of the derivatives
of the respective terms.)
(d)

a(x) =
k=0

1
x

1
=
x

1
1
xk =
(k + 1)!
x

j=1

j=0

k=0

1
xk+1
(k + 1)!

1 j
x
j!
1 j
x 1
j!

ex 1
.
x

(While this last mentioned function is the intended solution, strictly speaking
the function is not dened at 0. However, it has what is called a removable
x 1
singularity there; if the value is dened to be the lim e x , the extended
x0
function can be shown to be well behaved. As for the limit, it is clear that
x 1
x e0
d
lim e x = lim ex0 = dx ex evaluated at x = 0, i.e. e0 , which is 1.)
x0

x0

(e)

k k
k k
x = 0x0 + 0x1 +
x =
2
2
k=2

a(x) =
k=0

= x2
j=0

j=0

j+2 j
1
x2
x = x2
=
.
2
(1 x)3
(1 x)3

j + 2 j+2
x
2

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

1218

(f) Note that the generating function in this case will be a polynomial, since
an = 0 for all but a nite number of n. As a polynomial can be considered in
closed form, one response to this question would be to say that the function

k k
a(x) =
x is already in closed form. However, we can express it in a
2
k=0
more suggestive way, as follows:

1
10
xk =
k+1
x

a(x) =
k=0

1
x

1
=
x

j=1

j=0

k=0

10
xk+1
k+1

10 j
x
j
10 j
x 1
j

1
(1 + x)10 1 .
x

(This problem is like problem 5d above, in that the closed form we have
given has a removable singularity at x = 0. Here again the limiting value as
d
x 0 is a derivative, the value of dx ((1 + x)10 ) x=0 , i.e. 10.)
6. [19, Exercise 5.4.18] Use generating functions to nd the number of ways to select
14 balls from a jar containing 100 red balls, 100 blue balls, and 100 green balls, so
that no fewer than 3 and no more than 10 blue balls are selected. Assume that the
order in which the balls are drawn does not matter.
Solution: (We are using t as the indeterminate of the generating function.) The
1 t101
enumerator for the red balls is 1 + t + t2 + ... + t100 =
; the same enumerator
1t
applies to the green balls; but the enumerator for the blue balls is t3 + t4 + t5 + ... +
t3 t11
t10 =
. The generating function for selecting balls with these constraints is
1t
2
1 t101
t3 t11
(1 2t101 + t202 )(t3 t11 )
therefore

=
. We therefore require
1t
1t
(1 t)3
the coecient of t14 in the expansion of (t3 t11 )(1 t)3 , i.e. in the expansion of

k+2 k
3
11
(t t )
t , which is 11+2 3+2 = 78 10 = 68.
2
2
2
k=0
7. [19, Exercise 5.4.38] Use generating functions to solve the recurrence relation ak =
2ak1 + 3ak2 + 4k + 6 (k 2) with initial conditions a0 = 20, a1 = 60.
Solution: If we multiply both sides of the recurrence by xk , and sum over the range
2 k < , we obtain the following equation for the ordinary generating function

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

a(x) =

1219

ak xk :

k=0

a(x) a0 a1 x = 2x(a(x) a0 ) + 3x2 a(x) +

4k x k + 6
k=2
2

= 2x(a(x) a0 ) + 3x2 a(x) +

xk
k=2
2

16x
6x
+
1 4x 1 x

from which it follows that


(1 2x 3x2 )a(x) = a0 + (a1 2a0 )x +

6x2
16x2
+
1 4x 1 x

Multiplying both sides by (1 2x 3x2 )1 yields


2

16x
6x
20(1 + x) + 14x + 1x
a(x) =
(1 3x)(1 + x)
20
16x2
6x2
=
+
+
1 3x (1 4x)(1 3x)(1 + x) (1 3x)(1 + x)(1 x)

To determine the coecients ak we will need to nd the expansions of the last two
summands in partial fractions. These compuations are not dicult, because each
of the 1st degree factors in the denominators appears with multiplicity 1. The
second summand requires that we determine constants A, B, C such that
16x2
A
B
C
=
+
+
.
(1 4x)(1 3x)(1 + x)
1 4x 1 3x 1 + x
Multiplying both sides by the product (1 4x)(1 3x)(1 + x) yields the equation
16x2 = A(1 3x)(1 + x) + B(1 4x)(1 + x) + C(1 4x)(1 3x) .
While the usual method of determining these constants would be to set up equations
between the coecients of powers of x, we can apply a more ecient method here.
Simply assign convenient values to x, in order to obtain equations satised by
the constants. This technique is always applicable, as the equation is an identity
in x. Here it is convenient to choose for x values that make the three linear factors
1
vanish successively. So we set x equal to 1, 3 , and 1 , to obtain equations like
4
16 = C 5 4, which implies that C = 4 , and, in the same way, B = 4, A = 16 .
5
5
In the same fashion we can determine the following partial fraction expansion for
the third summand:
3
3
3
6x2
4
4
=
+
2 .
(1 3x)(1 + x)(1 x)
1 3x 1 + x 1 x

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

1220

Combining these expansions yields


4
3
16
20 4 + 3
+3
4
5
+ 5 4 2 +
1 3x
1 + x 1 x 1 4x

67
31
3
16
k k
k k
3 x +
(1) x
xk +
=
4 k=0
20 k=0
2 k=0
5

a(x) =

=
k=0

4k x k
k=0

3 16
67 k 31
3 + (1)k + 4k xk
4
20
2
5

so
ak =

67 k 31
3 16
3 + (1)k + 4k
4
20
2
5

8. A coding system encodes messages using strings of letters from the following alphabet: A = {A, B, C, D, E}, A codeword is valid if it satises all of the following
conditions:
(a) The number of As is even.
(b) The number of Bs is odd.
(c) There cannot be fewer than 1 C.
(d) There cannot be more than 1 D.
(e) There is no restriction on the number of Es.
Use exponential generating functions to determine a formula for the number of
words of length n. Verify the cases n = 1, 2, 3 by actually listing the valid codewords. [Hint: Observe that

k=0

k=0

1 2k
ex + ex
x
=
(2k)!
2

1
ex ex
x2k+1 =
(2k + 1)!
2

The functions on the right side are known as the hyperbolic cosine and hyperbolic
sine of x, and denoted respectively by cosh x and sinh x. They have interesting
properties that we do not require for this problem. If you are interested, consult
any good calculus book. You should meet these functions in Calculus II or Calculus
III.]

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

Solution: The enumerator for A is


k=0

1221

1 2k ex + ex
x =
; the enumerator for B
(2k)!
2

1
e e
x2k+1 =
. The enumerators for E and C respectively are
(2k + 1)!
2
k=0
ex and ex 1. The enumerator for D is 1 + x. It follows that the exponential
generating function for the numbers of codewords is
is

ex ex
ex + ex

(ex 1) (1 + x) ex
2
2
1 + x 4x
=
e e3x 1 + ex
4

4k 3k + (1)k k
1+x
=
x 1
4
k!
k=0
1+x
=
4
1
=
4
1
=
4
=
=

1
4
1
4

k=1

k=1

k=1

4k 3k + (1)k k
x
k!

4k 3k + (1)k k
4k 3k + (1)k k+1
x +
x
k!
k!
k=1
4k 3k + (1)k k
x +
k!

j=2

4j1 3j1 + (1)j1 j


x
(j 1)!

4k 3k + (1)k k
4k1 3k1 + (1)k1 k
x +
x
k!
(k 1)!
k=2

k=1

k=2

4 3k + (1)k + k 4k1 3k1 + (1)k1 k


x
k!

Hence the number of words of length k is


k! 4k 3k + (1)k + k 4k1 3k1 + (1)k1

4
k!
4k 3k + (1)k + k 4k1 3k1 + (1)k1
=
4
and is valid only if k 2.
The number obtained for k = 1 is 0, which agrees with the fact that any word
must have at least one C and at least one B, so there can be no words of length
1. By the same reasoning, words of length 2 must be permutations of the letters

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

1222

B, C; there are 2! = 1 such words, which agrees with the value computed above.
The value computed above for k = 3 is 15. As words of length 3 must contain at
least one B and at least one C, and the number of Bs must be odd, they contain
exactly one Bs. The third letter may only be one of C, D, E. The number of
3!
permutations of B, C, C is 2!1! = 3, while the number of permutations in either of
the other cases is 3! = 6; so the number of words of length 3 is 6 + 6 + 3 = 15,
which agrees with the computed value.
9. You are to determine the number of non-negative integer solutions (x1 , x2 , x3 ) to
the inequality
x1 + x2 + x3 n
(314)
subject to the intersection of all the following conditions:
1 x1 < 3
2 x2
x3 5

(315)
(316)
(317)

You are asked to solve the problem twice:


(a) First by using generating functions.
(b) Then by using the principle of inclusion and exclusion, without using generating functions.
Solution: Before attempting the solution, we introduce a 4th slack variable, x4 ,
dened by
x4 = n x1 x 2 x3 .
(318)
The inequality in (314) is then equilvalent to solving the equation
x1 + x 2 + x3 + x4 = n

(319)

subject to the additional constraint


0 x4

(320)

(a) Solution using ordinary generating functions. We will use t as the indeterminate. The enumerators for x1 , x2 , x3 , x4 respectively will be t + t2 , t2 + t3 +
6
t2
1
t4 + ... = 1t , 1 + t + t2 + t3 + t4 + t5 = 1t , 1t . The generating function for
1t
the number of solutions is then the product,
(t + t2 )

t2
1 t6
1

1t 1t 1t

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

1223

= (t3 + t4 )(1 t6 )(1 t)3

10

= (t + t t t )
k=0

k+2 k
t
2

k + 2 k+4
k + 2 k+3
t
+
t
2
2
k=0

=
k=0

k=0

k + 2 k+9
k + 2 k+10
t

t
2
2
k=0

a1 a
t +
2

=
a=3

b=4

b2 b
t
2

c=9

c7 c
d8 d
t
t
2
2
d=10

k1 k
k2 k
k7 k
k8 k
t +
t
t
t
2
2
2
2
k=4
k=9
d=10

=
k=3
3

= (t + 3t4 + 6t5 + 10t6 + 15t7 + 21t8 + 28t9 )


+(t4 + 3t5 + 6t6 + 10t7 + 15t8 + 21t9 ) t9

+
k=10
3
4

k8
k7
k2
k1

+
2
2
2
2

tk

= (t + 4t + 9t5 + 16t6 + 25t7 + 36t8 + 48t9 )

(12k 60)tk

+
k=10

Note that the formula 12k 60 holds in the cases k = 8, 9 even though our
general proof did not apply in those cases.
(b) Solution using inclusion-exclusion (without using generating functions). First
let us change variables in (319) to account for the lower bounds. We will dene
y1 = x1 1, y2 = x2 2, y3 = x3 , y4 = x4 . The transformed equation and
constraints are now
y1 + y2 + y3 + y4
0
0
0
0

n3
y1 1
y2
y3 5
y4

(321)
(322)
(323)
(324)
(325)

Let us denote the set of all non-negative integer solutions to (321) alone by ;
the set of solutions which violate the condition y1 1, i.e. for which y1 2 by

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

1224

A1 ; and the set of solutions which violate the condition y3 5, i.e. for which
y3 6 by A2 .
i. First let us assume that n 8. We wish to count, for any n, the points in
A1 A2 . By the Principle of Inclusion-Exclusion, we wish to determine
the value, for any n, of the alternating sum
|| |A1 | |A2 | + |A1 A2 |
We proceed to compute each of these cardinalities.
The unrestricted solutions in can be identied with sequences of n 3
0s and 3 1s (which serve as separators). Accordingly, their number is
(n3)+3
= n .
3
3
To determine |A1 |, dene wi = yi (i = 2, 3, 4), w1 = y1 2, and count
the number of non-negative integer solutions to w1 + w2 + w3 + w4 =
n 3 2 = n 5. By a similar argument to the preceding, this will be
(n5)+3
= n2 .
3
3
To determine |A2 |, dene zi = yi (i = 1, 2, 4) and z3 = y3 6. The
number of non-negative solutions to the equation z = z1 + z2 + z3 + z4 =
(n 3) 6 = n 9 is (n9)+3 = n6 .
3
3
Finally, to determine |A1 A2 |, dene u1 = y1 2, u2 = y2 , u3 = y3 6,
u4 = y4 . The number of non-negative integers solutions to u1 + u2 + u3 +
u4 = (n 3) 2 6 = n 11 is (n11)+3 = n8 . Then the number of
3
3
solutions of the original problem is
n
n2
n6
n8

+
3
3
3
3

= 12(n 5)

The preceding result applies only for n 8. For 6 n 7,


ii. Next suppose that 6 n 7. Here the Inclusion-Exclusion Principle
gives us the dierence n n2 n6 = (n 2)2 solutions.
3
3
3
iii. When 2 n 5, Inclusion-Exclusion gives
iv. When 0 n 1 there are no solutions.

n
3

n2
3

= (n 2)2 again.

We see that the same values have been obtained as when we used generating
functions.

F.5

Fifth 1999 Problem Assignment, with Solutions


Distribution Date: Friday, December 3rd, 1999
Solutions were to be submitted on Friday, November 26th, 1999
Caveat lector! There could be misprints and other errors in these solutions.

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

1225

1. Determine the number of binary relations R on a set A = {a1 , a2 , ..., am } of n


elements, which have each of the following combinations of properties.
(a) R is not restricted in any way.
(b) R is not antisymmetric.
(c) R is not both symmetric and reexive.
(d) R is symmetric and is not reexive.
(e) R is symmetric and irreexive.
(f) Suppose that A is the union of disjoint sets B and B, where |B| = r. Let R1
be the relation on B dened to be R (B B). Now count the relations R
on A such that R1 is a symmetric relation on B.
Solution:
(a) For every a A and b A, we may or may not include the pair (a, b) in
R. This decision is independent of our decision about any other ordered pair
(a, b). We have n choices for a and again n choices for b (which may be the
same as a). The total number of relations is, therefore, the product of n2
2
factors, each equal to 2, i.e. it is 2n .
(b) First let us count the number of antisymmetric relations. For any a A,
antisymmetry imposes no restriction on the ordered pair (a, a); so we have 2
choices for each a A, independently; by the Product Rule, this introduces
a factor of 2n . As for the pairs (a, b) and (b, a), where a = b, antisymmetry
permits any one of three possibilities:
Neither (a, b), nor (b, a) is in R.
Just one of (a, b) and (b, a) is in R there are two possibilities here.
Equivalently, we must delete from the 2 2 possibilities of membership or
non-membership, the one forbidden combination: ((a, b) R) ((b, a) R).
We thus have 3 choices for each of the symmetric o-diagonal pairs of points;
the number of such pairs is 1 (n2 n). Multiplying these factors of 3 for
2
n2 n

each pair introduces a factor of 3 2 . Hence the number of antisymmetric


n
relations is 2n 3( 2 ) .50 As the total number of binary relations on A is 2n , the
2

n
We have chosen to write n 2 in the form of a binomial coecient. This can also be seen by the
following alternative computations: add the numbers of elements in the upper half of the matrix MR
which represents R: 1 + 2 + ... + (n 1); students should be familiar with the sum of the rst n 1
integers a result that can easily be proved by induction. Yet another way of observing this fact is to
count the number of ways of selecting two distinct elements a and b from A: n .
2
50

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

1226

number of non-antisymmetric relations is


n

2n 2n 3( 2 ) .
2

(c) First we will count the relations that are both reexive and symmetric. In
this case each of the o-diagonal pairs in MR contributes a factor of 2: either
both (a, b) and (b, a) are in R, nor neither. The diagonal pairs (a, a) must all
n
be present. So the number of relations of this type is 2( 2 ) . It follows that the
n
2
complement of this set in the set of all relations has cardinality 2n 2( 2 ) .
(d) In this case there is a factor of 2 again for each o-diagonal pair; their product
n
is again 2( 2 ) . As for the diagonal, we can include or exclude any of the pairs
(a, a) independently, with one exception: we cannot include them all, as this
is the case of reexivity. This introduces a factor of 2n 1, so the total number
n
n
n+1
n
of such relations is 2( 2 )+n 2( 2 ) , which can be seen to equal 2( 2 ) 2( 2 ) .
(e) The number here will be the same as in Problem 1c, as the diagonal entries
in the matrix MR are again completely determined.
r+1
(f) The number of relations R1 is 2( 2 ) . Outside of the r r submatrix of MR
which corresponds to R1 , there is no restriction on R. This means there are
n2 r2 entries in the matrix that may be chosen independently, each in 2 ways.
r+1
r
2
2
2
Hence the total number of relations of this type is 2n r 2( 2 ) = 2n (2) .
2. Determine the number of ternary (i.e. 3-ary) relations on a set A of n elements.
Solution: Every ordered triple of points of A may or may not be included, independently of the others. Accordingly the number of such relations is 2 raised to
3
the power of the cardinality of the set A A A, i.e. 2n .
3. Carefully compile a catalogue of all relations R on a set A of no more than 3
points, such that R is both reexive and transitive. You should list only the
isomorphism classes do not list two relations if one can be obtained from the
other by relabelling the points. You may represent the relations by lists of ordered
pairs, by matrices, or by digraphs. It is suggested that you order the relations
1st by number of points; and, within that classication, by |R|. At every stage in
the development of your catalogue you should explain how you know you have all
relations.
Solution:
0 points: The only relation on 0 points is the empty relation , and it is both
reexive and transitive, so it must be included in our catalogue.

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

1227

1 point: Suppose A = {a}. Any symmetric relation on A must contain (a, a),
which is all of A A. This relation is also (trivially) transitive. This case
must also be included in the catalogue.
2 points: Suppose A = {a, b}. To be reexive, any relation on A must include
both (a, a), and (b, b).
R contains 2 points: R = {(a, a), (b, b)} is trivially transitive.
R contains 3 points: If we adjoint one more pair, i.e. either (a, b) or (b, a),
the relation remains trivially transitive. There is only one relation of this
type, up to the labelling of the points.
R contains 4 points: This is where R = A A. It is unique, and it is
transitive.
3 points: Taking A = {a, b, c}, where a, b, c are distinct, we must include (a, a),
(b, b), (c, c), since R must be reexive.
R contains 3 points: This is where R = {(a, a), (b, b), (c, c)}. It is unique.
R contains 4 points: We may adjoint one point to R in only one way up to
the labelling of the points; we obtain R = {(a, a), (b, b), (c, c), (a, b)}.
R contains 5 points: (a) Two points could be the two possible orderings of
two distinct points of A, giving a relation of the form
R = {(a, a), (b, b), (c, c), (a, b), (b, a)} .
(b) If the two added points do not involve the same two distinct points
of A, then they must not be such that the third side of a transitive
triangle would be needed and absent. Hence the two points added to
R must either both be directed into the same point, or both away from
the same point. We obtain either R = {(a, a), (b, b), (c, c), (a, b), (c, b)}
or R = {(a, a), (b, b), (c, c), (a, b), (a, c)}.
R contains 6 points: Suppose that two of the added points are the two
orientations of an unordered pair, like (a, b) and (b, a). Then, after relabelling, the third would have to be either (a, c), or (c, a). Neither of the
relations so constructed would be transitive, as the rst would be lacking
(b, c), and the second would be lacking (a, c). Thus there are no relations
of this type, and the only way in which 3 points can be added is if they
are orientations of the three sides of abc. There are only two ways of
orienting a triangle either transitively or cyclically; in the latter case
like (a, b), (b, c), (c, a), transitivity would entail the addition of three
more ordered pairs: (b, a), (c, b), (a, c); so the only possible case is a transitively ordered triangle, and that does indeed yield a transitive relation.

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

1228

Up to labelling, we thus obtain only one reexive, transitive relation with


6 pairs: R = {(a, a), (b, b), (c, c), (a, b), (b, c), (a, c)}.
R contains 7 points: It is easier to analyze these cases by looking at the
pairs that are missing.
(a) Could the missing pairs be the two orientations of a pair, as R =
{(a, a), (b, b), (c, c), (a, b), (b, a), (a, c), (c, a)}? Here transitivity would
imply, from the presence of (c, a) and (a, b), that (c, b) R. From
this contradiction we conclude that this case is impossible.
(b) Could the missing pairs constitute a path of lengh 2, as (a, b), (b, c)? If
R = {(a, a), (b, b), (c, c), (b, a), (a, c), (c, a), (c, b)}? Then transtitivity
would imply, from the presence of (a, c) and (c, b), that (a, b) R.
This contradiction shows that this case is also impossible.
(c) The only remaining cases are where the missing two edges are both
directed outward from the same point, or both directed into the
same point, as R = {(a, a), (b, b), (c, c), (b, a), (c, a), (b, c), (c, b)}, R =
{(a, a), (b, b), (c, c), (a, b), (a, c), (b, c), (c, b)}? These are both transitive.
R contains 8 points: By a suitable relabelling we can arrange that R =
{(a, a), (b, b), (c, c), (a, b), (a, c), (c, a), (b, c), (c, b)}. This is not transitive,
as the presence of (b, c) and (c, a) should imply the presence of (b, a). From
this contradiction we conclude that there is no relation with 8 members.
R contains 9 points: This is the relation R = A A which is obviously
reexive and transitive.
We list matrices representing the reexive transitive relations on 1 to 3 points in
Figure 3.
4. [19, Exercise 6.5.38] Determine whether or not the symmetric closure of the reexive
closure of the transitive closure of a relation is always an equivalence relation.
Solution: Note that the transitive closure is formed before the symmetrization. It
may be that in the symmatrization operation a path of length 2 (a, b)(b, c) is created
for which the diagonal (a, c) is missing. Here is a counterexample: Let A = {a, b, c}
where a, b, c are distinct points. Dene R = {(a, b), (a, c)} A A. Then R is
neither reexive, nor symmetric, nor transitive. The transitive closure of R is R
itself, since there are no directed paths of length 2 to be considered. The reexive
closure of R is {(a, b), (a, c), (a, a), (b, b), (c, c)}. This relation is not symmetric, but
we can symmetrize it by adjoining the reversals of all edges (except the loops which
are their own reversals), yielding {(a, b), (a, c), (a, a), (b, b), (c, c), (b, a), (c, a)}. This
relation lacks both (b, c) and (c, b). Since it contains both (b, a) and (b, c), it is not
transitive.

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

1229

1 0
0 1
0 0

1 1
0 1
0 0

1 1
0 1
1 1

1 0
0 1

0
0
1

1
0
1

1
0
1

1 1
0 1

1 1 0
0 1 0
0 0 1

1 0 0
1 1 0
1 0 1

1 0 1
1 1 1
1 0 1

1 1
1 1

1
1
0

1
0
0

1
1
1

1 0
1 0
0 1

1 1
1 1
0 1

1 1
1 1
1 1

Figure 1: Reexive Transitive Binary Relations on 1 to 3 Points


5. (cf. [19, Exercise 6.6.26]) The set S = {2, 4, 6, 9, 12, 18, 27, 36, 48, 60, 72} can be
endowed with the structure of a poset in many ways. For example
the partial ordering (actually, a total ordering) (dened on S S by x y
i y x N)
the partial ordering (also a total ordering) (dened on S S by x y i
x y N)
the partial ordering | (dened on S S by x | y i z N(y = xz))
the partial ordering P consisting only of the reexive pairs, P = {(a, a)|a
S}.
Answer each of the following questions for each of the 4 partial orderings we have
given.
(a) Find the maximal elements.
(b) Find the minimal elements.
(c) Is there a greatest element?
(d) Is there a least element?
(e) Find all upper bounds of {2, 9}.
(f) Find the least upper bound of {2, 9}, if it exists.

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

1230

(g) Find all lower bounds of {60, 72}.


(h) Find the greatest lower bound of {60, 72}, if it exists.
(i) Draw the Hasse diagram.
Solution: It might be easier to solve some of these problems by drawing the Hasse
diagram rst.
(a) Since and are both total orders, there is at most one maximal element
and at most one minimal in each case. The maximal element in is 72; the
maximal element in is 2.
The maximal elements for | are 27, 48, 60, 72, since none of them divides
another in the list. Finally, all elements of S are maximal for the relation P .
(b) The minimal element of is 2, and of is 72. The minimal elements of |
are 2 and 9, since neither has a (distinct) divisor in the S. All elements are
minimal for P .
(c) The greatest element for is its unique maximal element, 72; the greatest
element for is its unique maximal element (i.e. the unique minimal element
of ) 2. There is no greatest element for |, since any common multiple of 60
and 72 would have to be a multiple of their least common multiple, 360.
Nor is there a greatest element for P , since any points is related only to itself.
(d) The least element for is 2, and for is 72. There is no least element for |,
since it would have to be a divisor of the greatest common divisor of 2 and 9,
i.e. 1, and 1 S. Again, P has no least element, for the same reason as in
/
the preceding case.
(e) In , all elements of S not less than 9 are upper bounds for 2 and 9; so the
upper bounds are the members of {9, 12, 18, 27, 36, 48, 60, 72}. In there is
only one upper bound for 2, and 9, and it is 2. In | the upper bounds will
be the common multiples of 2 and 9, i.e. multiples of their greatest common
divisor, which is 18. The multiples of 18 present in S are 18, 36, 72. In P the
set {2, 9} has no upper bounds.
(f) In the least upper bound of {2, 9} is 9; in it is 2. In | it is 18, and in P
there is none.
(g) In the lower bounds of {60, 72} are 2,4,6,9,12,18,27,36,48,60; in the only
lower bound is 72. In | the lower bounds will be common divisors, 2,4,6,12.
In P there are no lower bounds for this set.
(h) In the greatest lower bound of {60, 72} is 60; in it is 72. In | it is 12. In
P there is none.

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

1231

27

72

60
r

36
d

d
d
d
d
d
d
d
d
d
d

d
d

18

12

40

Figure 2: The Hasse diagram for |, Problem 5i


(i) The Hasse diagram for is just 2 4 6 9 12 18 27 36 48
60 72 written vertically, usually with the 2 at the bottom. The Hasse
diagram for would be the same, but with the 72 at the bottom and 2
at the top. The Hasse diagram for P would consist of the members of
S = {2, 4, 6, 9, 12, 18, 27, 36, 48, 60, 72} all written, without connecting lines,
horizontally. The Hasse diagram for | is

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

G
G.1

1232

Solved Combinatorial Problems


Counting words formed from a given population of letters,
not necessarily all dierent

1. Determine how many 9-letter words can be formed from all the letters of the word
RECESSION.
2. Determine how many 4-letter words can be formed from letters of the word RECESSION; no letter may be used in a word more often than it appears in RECESSION.
3. Determine how many 4-letter words counted in the preceding part have the property
that no 2 successive letters are identical.
4. (cf. [7, Exercise 6.4.1]) A palindrome may be dened as a string that reads the
same forward and backward. Determine the number of palindromes that may be
formed from the letters of the word CLASSIFICATION, if no letter may be used
more often than it appears in the given word. Otherwise there is no restriction
as to the length of the words. The empty word, consisting of 0 letters, will be
accepted also. Do not attempt to list all the palindromes!
5. Let m and n be any positive integers. Determine the number of binary words
i.e. sequences of 0s and 1s consisting of m = 10 0s and n = 10 1s, in each of
the following cases:
(a) no 2 1s appear side-by-side
(b) no 2 1s appear side-by-side and no 2 0s appear side-by-side
(c) the rst and last digits are the same
(d) the rst and last digits are dierent
6. [7, Exercise 6.4.11] Find the number of words of length n formed using the three
letters a, b, and c, such that no two as appear in consecutive positions.
Solutions:
1. The multiplicities of letters available are: 2 each of E and S; one each of C, I, N,
O, R. The number of permutations of 9 distinct symbols would be P (9, 9) = 9!. To
count permutations where there are symbols which are identical, we must divide
by a factorial for each of the sets of identical symbols here by 2 factors of 2!.
9!
Thus the number of distinct 9-letter words is
= 90270.
2!2!

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

1233

2. We cannot simply take the number P (9, 4) and divide by a factor to allow for
multiplicities, since the number of repeated factors depends upon the selection or
combination of letters chosen for the word. We decompose the problem into three
parts, according to the multiplicities, and then divide by the appropriate factor
when multiplying by 4!.
(a) Multiplicities 2 + 2: The letters may be chosen in C(2, 2) = 1 way; then
(4,4)
4!
ordered in P2!2! = 2!2! = 6 ways; there are 1 6 = 6 words of this type.
(b) Multiplicities 2+1+1: The letter of multiplicity 2 may be selected in C(2, 1) =
2 ways; the letters to appear with multiplicity 1 may be selected from the
remaining population of 6 letters in C(6, 2) = 15 ways. Note that in this
case we may even use one of the two letters of multiplicity 2 not used. The
total number of selections is, therefore, 2 15 = 30; each selection admits
P (4,4)
= 12 arrangements; there are 30 12 = 360 words of this type.
2!1!1!
(c) Multiplicity 1 + 1 + 1 + 1: The letters may be chosen in C(7, 4) = 35 ways,
then ordered in P (4, 4) = 24 ways; there are 35 24 = 840 such words.
Adding, we nd that there are altogether 6 + 360 + 840 = 1206 words.
[This problem can also be solved using exponential generating functions. The
number of words is 4! times the coecient of x4 in the expansion of
x
1+
1!

x
x2
1+ +
1!
2!

.]

3. Words to be excluded occur in the 1st and 2nd cases counted above. Interpret each
of the multiple pairs as a single object consisting of two adjacent like letters. The
3!
number of words with adjacent Es is 2!1! = 3 where we permit the Ss to be
adjacent or not; similarly: the number of words with adjacent Ss is also 3; by the
Principle of Inclusion and Exclusion, the number with either of these properties is
3 + 3 2 = |A1 | = 2 4! = 4, since there are precisely two words obtainable by
permuting the two-letter word EE and the two-letter word SS.
The second set of words to be deleted from our count appear in the second part
above: these are simply 2 15 3! = 180 in number. (Treat the two adjacent like
letters as one object being permuted in a set of 3.)
We subtract 4 + 180 from 1206, to obtain 1022 words that have no two adjacent
like letters.
4. The multiplicities of the letters available are

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

1234

multiplicity letters
I
3
.
A,C,S
2
F,L,N,O,T
1
We consider two cases, according as there is a letter in the middle of the word or
not, i.e. according as the number of letters in the palindrome is odd or even.
Odd Length Palindromes: Each word may be decomposed into a middle letter
and two subwords, one of which is the mirror image of the other; conversely, if
we combine any word, its mirror image, and any letter to serve as the middle
subject to the multiplicity conditions we obtain a palindrome of this
type. We may consider cases, according to the multiplicity of the letter chosen
for the middle:
Middle Letter I: Of the remaining letters, including 2 Is, we must select an
even number of each. The letters available with positive even multiplicity
are then A, C, I, S, each with multiplicity 2. The words we obtain may be
put into 1-1 correspondence with those counted in the even case, below
(think of deleting the middle letter I), and can be seen below to number
4
4
4
4
4
4! +
3! +
2! +
1! +
0! = 65
4
3
2
1
0
Middle Letter A, C, or S: In using A as the middle letter we eliminate it
as a candidate for one of the pairs. Consequently the number of palindromes of this type is
3

3
3
3
3
3! +
2! +
1! +
0!
3
2
1
0

= 48

Middle Letter F, L, N, O, or T: None of the middle letters here could


serve as part of the reective pairs. Consequently, for each of the 5 choices
of middle letter there will be a set of palindromes which can be put into
one-to-one correspondence with the set of even palindromes, which we
nd below to number 65. Consequently the number of palindromes of
this type is 5 65 = 325.
The total number of palindromes of odd length is therefore 65 + 48 + 325 =
438.
Even Length Palindromes: Each of the palindromes of length 2n consists of
two mirror images of a word of length n, which is not restricted; and every
word of length n can be paired with its mirror image to yield a palindrome.

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

1235

In considering the multiplicities of letters available, we must select the letters


in pairs: thus we may choose either 0 or 2 Is, either 0 or 2 of each of A, C, S,
and only 0 of each of F, L, N, O, T. The half-palindromes we create therefore
contain permutations of any of the letters A, C, I, S. Separating into disjoint
cases we have:
4 letters: Select the letters in 4 ways and permute in 4! ways: 24 palin4
dromes
3 letters: Select the letters in 4 ways and permute in 3! ways: 24 palin3
dromes
2 letters: Select the letters in 4 ways and permute in 2! ways: 12 palin2
dromes
1 letter: Select the letter in 4 ways and permute in 1! way: 4 palindromes
1
empty half-palindrome: Select the letter in 4 ways (i.e. uniquely) and
0
permute in 0! = 1 way: 1 palindrome (the empty word
In all we have 24 + 24 + 12 + 4 + 1 = 65 palindromes of even length.
We nd that there are 438 + 65 = 503 palindromes in all.
5. We shall solve this problem for general m and n, although students were asked to
consider only the case m = 10 = n.
(a) Consider 2 cases:
Last digit is 1: If we detach the last digit we obtain a word that can be
considered as made up of 0s and of 2-letter subwords 10; there will be
n 1 of the subwords 10, hence exactly m (n 1) 0s aside from those
in the 2-letter subwords. We are permuting (n 1) + (m n + 1) objects,
of which n 1 are alike of one type and m n + 1 are like of the other
type. We obtain
m!
(n 1)!(m n + 1)!
m
n1

words of this type. It is necessary that m n1. If m = n = 10,


= 10.
Last digit is 0: These words can also be considered as arrangements of 0s
and 10s: there are n 10s and m n other 0s. The number of words is
therefore
m!
n!(m n)!
=

m
n1

=
m
n

m
n

words of this type. Here we require that m n. If m = n = 10,


= 1.

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

1236

m
Combining the two, we have n1 + m = m+1 . (The simplicity of this
n
n
solution suggests that there should be another possible attack on the problem.
We could instead count words in m + 1 0s and n 1s with the condition that
1 is always followed by a 0. These words must end in a 0, and could be put
into 1-1 correspondence with the words we wish to count.)

(b) The successor of any 1 is a 0, and the successsor of any 0 is a 1. These words
therefore are alternating strings of 1s and 0s. They can exist only when
|m n| 1. When m = n there will be two distinct words; when m = n 1
or m = n + 1 there will be just one word, with the majority symbol appearing
at the extremes.
(c) When the extreme symbol is a 0 we will be left with m2 0s and n 1s, which
can be arranged without restriction in m+n2 ways. When the extreme
n
symbol is a 1 we have, similarly, m+n2 words. The number of these words
n2
is therefore
m+n2
m+n2
+
n
m

=2

18
10

when m = n = 10.

(d) There are two equinumerous cases, according as the rst symbol is a 0 or a 1:
in all we have 2 (m1)+(n1) words, i.e. 2 18 when m = n = 10.
m1
9
This suggests another solution to the preceding case: it must be the complement of this case in the set of all words, which are m+n in number. Thus
n
the number of solutions to the preceding case must be
m+n2
m+n
2
m1
n
6. We begin by presenting a
Fallacious Solution: This attack is defective. Can you see what is wrong with
it?
The total number of n-letter words without restrictions on the as is, by the
Product Rule, 3n . Let us try to count the words with adjacent as. The
diculty is in avoiding multiple counting of the words we wish to exclude.
Any bad word may be decomposed into 3 parts: the rst appearance of
two adjacent as (counting from the left), the a-less word which precedes
this rst appearance, and the remaining unrestricted word. Conversely, any
concatenation of a b c-word, followed by aa, followed by an unrestricted
word of the appropriate number of letters will always yield one of the words
we wish to count (and exclude). The three parts of this word may be chosen

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

1237

independently. Suppose that the rst part consists of k letters; the number of
such words is exactly 2k . The middle word aa may be chosen in 1 way. The
nal word may be chosen in 3nk2 ways. Thus the number of words we wish
to exclude is
n2

n2
k nk2

2 3
k=0

=3

n2
k=0

2
3

=3

n2

1 2
3

n1
2
3

= 3n1 2n1

and the number of words without adjacent as is


3n 3n1 + 2n1
The error in the preceding argument is in the count of bad words: some
have been omitted. More precisely, it is assumed that the rst appearance of
the letter a, counting from the left, is in a pair aa. But this need not be the
case. For example, the word abaa is bad, but is still counted above. Cases
of the type we have just described do not appear for n < 4, so the answer
would appear to be correct when veried for the rst 3 cases.
Sketch of a correct solution. We shall dene fn to be the number of words in
a, b, c that have no adjacent as and end in an a; we dene gn to be the number
of words in a, b, c that have no adjacent as and end in b or c, (n = 1, 2, ...).
Then we have the following recurrences:
fn+1 = gn
gn+1 = 2(fn + gn )
(n = 1, 2, ...)
To see these relations, think of the operation of removing the last letter in a
word. In the rst case we obtain an acceptable word which does not end in
an a; and, conversely, any such word can be extended one letter by adding an
a. The second recurrence follows by similar reasoning. The problem reduces
to solving these recurrences. It is easy to see that
fn+2 = 2fn+1 + 2fn
gn+2 = 2gn+1 + 2gn
Thus both sequences satisfy the same recurrence. The initial values can be
determined heuristically to be
f1 = 1 f2 = 2 g1 = 2 g2 = 6

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

1238

Our interest is only in the sum hn = fn + gn , which can be seen to also satisfy
the same recurrence, viz.
hn+2 = 2hn+1 + 2hn

h1 = 1 + 2 = 3 h2 = 2 + 6 = 8

Systematic methods for solving recurrences of this type will be studied in [7,
Chapter 8]. In conjunction with that study we shall see that the (ordinary)
generating function f (x) = fn xn is
h(x) =

3x + 2x2
1
1

= (3x + 2x2 )
2
1 2x 2x
1 (1 + 3)x 1 (1 3)x

1 3
1+ 3
3x + 2x2

=
1 (1 + 3)x 1 (1 3)x
2 3
3x + 2x2

2 3

(1 +

n+1

3)
(1 3)n+1 xn

n=1

from which we may conclude that

1
(5 + 3 3)(1 + 3)n1 (5 3 3)(1 3)n1
2 3

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

hn =

As n , the substracted term approaches zero; thus the numbers behave

approximately like a constant multiple of (1 + 3)n .


An elegant but dicult derivation of the recurrence. The words in a, b, c
can be generated by summing all powers of a+b+c; we can think of (1ab
c)1 as their generating function; call this function H(a, b, c). We may think
of these unrestricted words as having grown out of the restricted words
without adjacent as by replacing a, wherever it appears, by a + a2 + a3 + ...,
a
i.e. by the function 1a . Thus, if h(a, b, c) denotes the generating function for
the restricted words, we have the equation
h
Replacing a by

x
1+x

1
, b, c
1a

= H(a, b, c)

(obtained by solving the equation

h(x, b, c) = H

x
, b, c
1+x

a
1a

= x) yields

1
bc

x
1+x

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

1239

But we are not interested in the words themselves, only in their numbers. So
let us set b = c = x, and simply look at the coecients of powers of x:
h(x, x, x) =

1+x
1 2x 2x2

(326)

The only reason why this is not identical with h(x) found earlier, is that we
have permitted the empty word, consisting of no letters. If we subtract 1
from the right side of equation (326) we obtain
3x + 2x2
1+x
1=
1 2x 2x2
1 2x 2x2
as before.

G.2

Problems on inclusion-exclusion

1. Use the Principle of Inclusion and Exclusion to determine the number of ways in
which 3 women and their 3 spouses may be seated around a round table, so that
no woman sits beside her spouse (on either side).
2. Determine the number of ways in which 3 women and their spouses may be seated
around a round table so that no two women may sit opposite one another at the
table (i.e. with 2 persons between them on either side).
3. Showing all your work, use the Principle of Inclusion and Exclusion to determine
for any natural number n the number of integers between 1 and 210n which
are divisible by all of 2, 5, or 7, but not divisible by 3.
Solutions:
1. The underlying set consists of all circular permutations, 5! in number. Let A1 , A2 ,
A3 be the subsets of permutations respectively in which the members of couples
##1, 2, 3 sit side by side. Then |A1 | = 2 4! = 48, etc.; |A1 A2 | = 22 3! = 24,
etc.; |A1 A2 A3 | = 23 2! = 16. By the Principle of Inclusion and Exclusion,
the number of arrangements in which some woman sits opposite her spouse is
(3 48 3 24 + 16) = 88. Hence the number of circular permutations without a
woman sitting beside her spouse is 5! 88 = 120 88 = 32.
2. We distinguish two cases, according as there exist two women sitting side by side
or not.

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

1240

(a) Where two women sit side by side, their opposite positions are occupied by
men, so the remaining vacant positions are beside these women; thus the only
conguration possible here has three women side by side; and 3 men similarly
side by side. The women are arranged in a linear order, since there is one that
is distinguishable as the left-most, in P (3, 3) = 6 ways. Similarly, the men are
arrangeable in 3! = 6 ways. We have altogether 3! 3! = 36 permutations.
The two groups are then arranged around the circle in (2 1)! = 1 way.
(b) Otherwise no woman sits beside another woman; here the seating has an
alternation of women and men around the table. The women may be seated
in (3 2)! = 2 ways; then the men may be seated in the seats remaining
for them in 3! ways. (Note that in the case of the men we may use woman
#1 as a reference point, so it is now a linear ordering rather than a circular
ordering.) This case gives rise to 2 3! = 12 permutations.
We add 36 + 12, to obtain 48 permutations.
3. Dene subset Ar to consist of those integers between 1 and 210n (inclusive) that
are divisible by r. An integer divisible by all of 2, 5, 7, will be divisible by 70, and
conversely; an integer divisible by 2, 5, 7 but not 3 will be divisible by 70, but not
by 210. As seen in [7, 1.9, Example 6], |A70 | = 210n = 3n; |A210 | = 210n = n. The
70
210
integers divisible by all of 2, 5, 7, but not by 3 will constitute the set A70 A3 =
A70 A210 . The application of the Principle of Inclusion and Exclusion here is a
trivial one: Let D1 = A70 A210 , D2 = A210 . Then
|D1 D2 | = |D1 | + |D2 | |D1 D2 |
i.e.
|A70 | = |A70 A210 | + |A210 | ||
hence A70 A210 =
one of 2, 5, 7 is
210n

210n
70

210n
210

= 2n. The number of integers divisible by at least

1 1 1
+ +
2 5 7

1
1
1
+
+
10 35 14

1
70

= 138n .

(327)

Let us count the integers integers between 1 and 210n which are divisible by at
least one of 2, 5, 7, and by 3; these will be the cases counted in (327) which should
be subtracted. One way to approach this problem is to dene Br to be the number
of integers between 1 and 210n divisible by both 3 and r (r = 2, 5, 7). We obtain
the identical expression to the preceding, except that we apply the various fractions
1
to a set now consisting of 3 210n:
1
210n
3

1 1 1
+ +
2 5 7

1
1
1
+
+
10 35 14

1
70

= 46n .

(328)

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

1241

Subtracting51 (328) from (327), we obtain


140n

G.3

1 1 1
+ +
2 5 7

1
1
1
+
+
10 35 14

1
70

= 92n .

A combinatorial identity

Let A and B be disjoint subsets of a set such that |A| = m, |B| = n.


1. Show that there exists a bijection f : P(A) P(B) P(A B) such that
|f (U, V )| = |U | + |V |.
2. Using f , or otherwise, show that52 for any r,
m+n
r

=
s=0

m
s

n
rs

Solutions:
1. Dene f (U, V ) = U V . This mapping is onto. For, given any W A B, sets
W A and W B are disjoint (since
(W A) (W B) = W (A B) = W = .)
Hence f (W A, W B) = (W A) (W B) = W (A B) = W . Show that
f is one-to-one.
2. The restriction of f to the pairs whose union has cardinality r is a one-to-one
correspondence with the subsets of A B of cardinality r. Denote the cardinality
of A by s. By the Product Rule the number of pairs consisting of a subset of
A of cardinality A and a subset of B necessarily of cardinality r s is
m
n
. As sets in one-to-one correspondence have the same cardinality,
s
rs
m+n
the sum of these products must equal
.
r
(Note that this identity could be proved algebraically or analytically by comparing
the coecients of xr on the two sides of the equation
(1 + x)m+n = (1 + x)m (1 + x)n .)
51

which is again a simple application of the Principle of Inclusion and Exclusion


a
52
We are representing C(a, b) by the symbol
; this is normally read a choose b, or a binomial
b
b.

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

G.4

1242

Lattice paths

1. [7, Exercise 6.8.18] How many ways are there for a person to travel from the
southwest corner to the northeast corner of an m n grid? Enumerate all the ways
possible if the grid is 5 3. How many ways are there if the grid is 10 10 and
no move may take the person below the main diagonal (those positions that are k
steps over and k steps up from the starting point where 1 k 10)?
Solution:
1. The problem is concerned with the number of paths in an m n rectangular grid,
in which all motion is either upward or to the right. The number of such paths is
precisely the number of (m + n)letter words built from m letters U (for up) and
n letters R (for right), i.e.
m+n
.
m
When the paths in an n n square are restricted so as never to pass below the
diagonal, the problem becomes more dicult, and is equivalent to the old problem
of the Catalan numbers the numbers of ways of dissecting a convex plane
polygon with labelled vertices into triangles by means of its diagonals in deference to the work of E. Catalan, one of the mathematicians who published papers on
the subject in the Journal de Mathmatiques Pures et Appliques in the 1830s.53
e
e
These numbers are usually evaluated by showing that a power series having them
as coecients (their ordinary generating function) satises a certain polynomial
equation, which may be solved without diculty. However, a very simple direct
evaluation may be based on the fact that the illegal paths may be put into oneto-one correspondence with the paths in a grid with dimensions (n 1) (n + 1),
2n
, hence the total number of paths not descending below
which number
n1
the main diagonal is
2n
n

2n
n1

1
n+1

2n
n

(cf. [13, pp. 163164])


53

The problem appears to have been posed by L. Euler to an amateur mathematician, J. A. v.


Segner, who published a note on the subject in Latin in 17581759, in the Novi Commentarii Academi
Scientiarum Petropolitan 7, pp. 13-14.

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

G.5

1243

Partitions of labelled objects into labelled boxes

1. [7, Exercise 6.12.43] (In) how many ways can 25 students be assigned to three
dierent lab sections, if each lab section has at least ve students?
2. [7, Exercise 6.12.49] A 6-person committee is to be chosen from 16 university
students, of which 4 of the available persons are from each of the 4 classes. How
many committees are possible if
(a) each class is represented
(b) no class has more than two representatives, and each class has at least one
representative.
Solutions:
1. If the problem had been concerned with indistinguishable students, but 3 distinguishable lab sections, the number of partitions would be equal to the coecient
of x25 in the expansion of
(x5 + x6 + x7 + ... + xn + ...)3
(Its not important to truncate the series at x25 , or at x15 ; in fact, its harmless to
allow the series to be innite and the computations are simpler!) The function
3
is equal to x15 (1 x5 ) . The coecient we seek is then the coecient of x10 in
3
the expansion of (1 x5 ) , i.e. the coecient of y 3 in the expansion of (1 y)3 ,
i.e. 10.
The number of partitions (of distinguishable students) into (distinguishable) lab
sections having respectively i, j, and 25 i j students is precisely
25 i
j

25
i

What we require is the sum of these products as (i, j) ranges over all integer lattice
points in the rst quadrant such that i + j 20 and i 5, j 5 i.e. on the
boundary of or inside a certain pentagonal region. This can be expressed as

25!
i!j!(25 i j)!

i5
j5
i + j 20
The computations involved are unpleasant. Some compression is possible.

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

1244

(An approach using exponential generating functions would show that the number
we seek is 25! times the coecient of x25 in the MacLaurin series expansion of
ex 1

x2 x3 x 4
x

1!
2!
3!
4!

.)

2. (a) Denote the number of representatives selected from the jth class by ij (j =
1, 2, 3, 4). Then, by the Product Rule, the total number of committees is
4
i1

4
i2

4
i3

4
i4

where the integer variables are restricted only by 4 ij 1 (j = 1, 2, 3, 4).


Thus the number we seek may be viewed as the coecient of x6 in the expansion of the product of four copies of
4 3
4 4
4 2
4 1
x
x +
x +
x +
4
3
1
2

or 4x1 + 6x2 + 4x3 + x4

(329)

i.e. the coecient of x2 in the expansion of


(4x0 + 6x1 + 4x2 + x3 )4
= (16x0 + 48x1 + 68x2 + terms of higher degree)2
= 256x0 + 1536x1 + 4480x2 + terms of higher degree
giving a total number of committees of 4480.
This computation could be simplied, if we observe that expression (329) may
be expressed as (1 + x)4 1 = (1 + x)16 4(1 + x)12 + 6(1 + x)8 ..., in which
the coecient of x6 is 16 4 12 + 6 8 = 4480.
6
6
6
(b) The only dierence in this case is that, in place of the 4th power of (329), we
take the 4th power of (4x + 6x2 ). The coecient of x6 in the expansion of
(4x + 6x2 )4 is equal to the coecient of x2 in the expansion of (4 + 6x)4 , i.e.
to 4 42 62 = 3456. (We can account for the dierence of 1024 with the rst
2
problem as follows: these are the cases in which 3 representatives are chosen
from one class and 1 from each of the other 3 classes. A single representative
from a class may be selected in 4 ways; and 3 representatives may be chosen
in 4 = again 4 ways. Thus we have 4 44 , where the rst factor 4 counts
3
the ways of selecting the class which contributes 3 rather than 1.)
Could we solve this problem without using generating functions? Of course. We
rst observe (a fact which was proved in the course of the generating function

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

1245

approach) that the only unordered partitions of the representatives among the
classes are 6 = 2 + 2 + 1 + 1 and 6 = 3 + 1 + 1 + 1, before we assign the numbers to
the classes. For example, in part (b), only the rst partition is possible, and it can
be realized in the 4 ways in which 2 classes may be selected as the contributors
2
of 2 representatives. The representatives are selected for each of those classes in
4
= 6 ways, and for each of the other two classes in 4 = 4 ways. In all we have
2
1
6 6 6 4 4 = 3456.

G.6

Circular permutations

You are given the integers 0, 1, 2, ..., 9. The exercise is to arrange them around the
edge of a disk subject to various conditions. Determine how many circular arrangements
there are in each of the following cases. (The disk has a distinguishable top and bottom;
the problem resembles the arrangement of persons around a circular table, rather than
the arrangement of beads around a necklace, which can be turned over.)
1. No two integers which are adjacent in the arrangement are congruent modulo 5.
2. No two integers which are directly opposite one another in the arrangement are
congruent modulo 5.
3. Every integer is congruent to one of neighbours modulo 5.
Hint: You may wish to apply the Principle of Inclusion-Exclusion. First consider the
problem for a smaller number of pairs, and verify your solution by making a list of all
arrangements.
Solution: Observe that for each of the integers there is exactly one other that is congruent
to it modulo 5. Thus the problem concerns the pairs {0, 5}, {1, 6}, {2, 7}, {3, 8}, {4, 9}.
1. Let Ai denote the set of arrangements where integer i is adjacent to i + 5 (i =
0, 1, 2, 3, 4). We wish to determine the number of circular arrangements which
exclude all those in the union 4 Ai . By the Principle of Inclusion-Exclusion the
i=0
number we seek is the alternating sum
(10 1)! |Ai | + |Ai Aj | |Ai Aj Ak |
+ |Ai Aj Ak A | |Ai Aj Ak A Am |

(330)

summed over all selections of conditions. For each i, Ai consists of the (9 1)!
circular arrangements of 9 objects (among which is the pair {i, i + 5}, considered
as one object, since the two integers must be positioned side-by-side) each
associated with one of the 2! possible permutations of the two objects. By the
Product Rule this case gives rise to (9 1)!21 forbidden permutations. The number

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


of selections of one condition Ai from among 5 is
obtain as the number of arrangements we seek
(10 1)!
+

5
(9 1)!21 +
1
5
(6 1)!24
4

5
1

1246

. Continuing in this way, we

5
5
(8 1)!22
(7 1)!23
2
3
5
(5 1)!25 = 112 512
5

2. Let Ai denote the set of arrangements where the integer i is opposite i + 5 (i =


0, 1, 2, 3, 4). Again the number of arrangements is given by the alternating sum
(330) summed over all selections of conditions. For each i, Ai consists of the
(9 1)! circular arrangements in which objects i and i + 5 are opposite; these are
equinumerous with the linear arrangements of 8 objects (excluding i and i + 5)
we can think of the circle as being cut open at i, and simply suppress object i + 5,
since it will always appear in a xed position at the middle of the linear sequence.
Thus
|Ai | = (9 1)!
In general, the enumeration of the cases in the intersection of k Ai s is more complicated. Every one of the cases in such a forbidden intersection induces a partition
of the set of 10 integers into 5 subsets of 2 members each. The number of such par(102k)!
titions into unlabelled pairs in which k pairs have been specied is (2!)5k (5k)! :
the factor (5 k)! in the denominator derives from the requirement that the 5 k
parts be unlabelled. Given these 5 k pairs, and the k specied pairs, all k pairs
may be arranged cyclically in (5 1)! ways. Finally, looking at the four integers to
the immediate right of 0, each is from a dierent pair; the representative of each
of the 4 pairs may be chosen in 2 ways. Thus we have a product
4!24

10!
5 8!
5 6!
5 4!
5 2!
5 0!

5 5!
4 4!
3 3!
2 2!
1 1!
2!
1 2!
2 2!
3 2!
4 2!
5 2!0 0!

i.e. 4!24 406 = 208 896.


3. We know that for each integer there is just one other available to be its congruent5-neighbour. Thus we may view the arrangements that are sought as being circular
arrangements of 2-element ordered pairs, each of which consists of one of the 2!
arrangements of the pair; in all we have 25 (5 1)! = 768 circular arrangements.

G.7

Counting ordered partitions of a positive integer

1. 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)

1247

(a) y1 , y2 , y3 , y4 are positive integers


(b) y1 > 1, y2 > 2, y3 > 3, y4 > 4
2. We wish to determine, in two dierent ways, the number fn of ways of expressing
an integer n as a sum of an even non-negative integer and an odd non-negative
integer.
(a) Determine the ordinary generating function for the sequence f0 , f1 , ..., fn ,
.... Then determine a formula for fn . (Hints: The generating function can be
expanded into power series by rst separating into partial fractions (as though
you were planning to integrate it); however, it can be found more easily by
rst nding another power series g(y) and then replacing y by a suitable power
of x. For this problem you will need to know the power series expansion of
(1 y)n , where n is a positive integer. This can be assumed to be what is
obtained by term-by-term dierentiation of the equation
(1 x)1 = 1 + x + x2 + ... + xn + ...
While these procedures can all be justied algebraically, in the present case
the various series are convergent for suciently small x, so familiar techniques
learned in the calculus are quite acceptable.)
(b) Solve the problem directly, without using generating functions.
Solution:
1. Dene zi = yi i 1 (i = 1, 2, 3, 4). Then the problem transforms into counting
the partitions of n 2 3 4 5 = n 14 into 4 labelled non-negative integers
z1 , z2 , z3 , z4 . These partitions are equinumerous with the binary words formed from
(n 14) 0s and 3 1s (serving as separators): n11 .
3
This problem could also be solved using ordinary generating functions. The series
corresponding to yi is
xi+1 + xi+2 + xi+2 + ... = xi+1 (1 x)1 .
The number we seek will be the coecient of xn in the expansion of
x2 (1 x)1 x3 (1 x)1 x4 (1 x)1 x5 (1 x)1
i.e. the coecient of xn14 in the expansion of (1 x)4 . We know that

(1 x)

i1

n+3 n
x
3

=
i=0

in which the coecient of xn14 is

(n14)+3
3

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

1248

2. (a) The odd summand is represented by the factor


x + x3 + x5 + ... = x(1 + x2 + x4 + ...) =

x
1 x2

while the even part is represented by the factor


1 + x2 + x4 + ... =

1
.
1 x2

Thus the ordinary generating function in this problem is

f n xn =

f (x) =
n=0

x
1
x

=
2
2
1x
1x
(1 x2 )2

To determine the integers fi , i.e. the coecients in the MacLaurin expansion of


f (x), it is not practical to proceed by dierentiation, since the dierentiation
x
of the quotient (1x2 ) up to the general nth derivative would be unpleasant.
We can proceed in several dierent ways:
Partial Fractions: If you had to integrate the function
rst express it as a sum

x
,
(1x2 )2

you could

A + Bx
C + Ex
x
=
2 +
2 )2
(1 x
(1 x)
(1 + x)2
corresponding to the identity
x = (A + Bx)(1 + x)2 + (C + Ex)(1 x)2
We can determine the constants A, B, C, E by equating coecients of
like powers of x, or by simply assigning to x suciently many distinct
values to obtain a system of equations that can be solved:
x=0
x=1
x = 1
x=2
yielding A =

1
4

0
1
1
2

=
=
=
=

A+C
(A + B)4 + (C + E)0
(A B)0 + (C E)4
(A + 2B)9 + (C + 2E)1

= C, B = 0 = E, so the partial fraction expansion is


x
1
1
1
1
=
2
2 )2
4 (1 x)
4 (1 + x)2
(1 x

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

1249

1
The expansions of (1x)2 could be obtained by dierentiation. It is simplest, however, to work with one of them and to obtain the other by
substitution: starting with
1
= 1 + y + ... + y n + ...
1y
dierentiate r times term by term to obtain
r!
(r + 1)! 1
(r + n)! n
= r!y 0 +
y + ... +
y + ...
(1 y)r+1
1!
n!
so that
1
r 0
r+1 1
r+n n
=
y +
y + ... +
y + ...
r+1
(1 y)
r
r
n
implying that
1
r+1 1
r+n n
r 0
=
y
y + ... + (1)n
y + ... (331)
r+1
(1 + y)
r
r
n
Taking r = 1 yields
1
f (x) =
(1 + 2x + 3x2 + 4x3 + ... + (r + 1)xr + ...)
4
(1 2x + 3x2 4x3 + ... + (1)r (r + 1)xr + ...)
= 1x1 + 2x3 + 3x5 + 4x7 + ... + (s + 1)x2s+1 + ...

from which we may conclude that


fn =

0
n even
s + 1 n = 2s + 1

(We could write n instead of s + 1.)


2
Substitution in Known Series: Rather than expanding by partial fractions, we could have replaced y by x2 in (331), again with r = 1, to
obtain
f (x) = x 1 + 2x2 + 3x4 + 4x6 + 5x8 + ... + (n + 1)x2n2
= 1x1 + 2x3 + 3x5 + 4x7 + 5x9 + ... + (n + 1)x2n1
as before, without the labour of computing coecients.
(b) Since n is to be the sum of an even and an odd part, n must be odd. As
soon as the even part 2x has been chosen, the odd part is then completely
determined to be n 2x. We need only determine the number of dierent
ways of nding an even non-negative integer which is not greater than n. The
number of even non-negative integers which are not greater than n is exactly
1 + n2 ; (the 1 comes from the summand 0, which is even).

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

G.8

1250

Counting vertex-labelled graphs

1. (a) You are given 4 points, labelled A, B, C, D. Determine the number of graphs
(undirected, without loops or multiple edges) on the vertex set {A, B, C, D}.
(b) Isomorphism is an equivalence relation on the set of graphs determined above.
Determine the equivalence classes under this relation, and list one member of
each equivalence class.
(c) For four dierent equivalence classes above carry out a combinatorial discussion to determine the number of members in the class. (For example, one
class consists of graphs consisting of the form . Labels could be
attached to the vertices here in exactly 4! ways, except that this would lead
to double counting: for example, we want A B C D to be the same as
D C B A. Thus the total number of members of this equivalence class
is exactly 4! = 12.)
2
2. Pr fer codes. The following description of a pair of algorithms is modied from
u
one in a text-book. You are to read the descriptions until you understand the
algorithms, then solve the problems which follow. The descriptions are not intended
to be elegant or lucid you must learn to read text which is formulated in less
than perfect language. You are unlikely to gain much from referring to the original
text-book [12, p. 223, 6.22].
Let T denote a tree with n vertices, labelled 1, 2, ..., n. Construct
a sequence of integers, a1 , a2 , ..., an2 as follows:
I. Let i = 1. Let T be the tree currently under examination.
II. Among all vertices of degree 1 in the tree currently under examination, select the one with the smallest label. Remove the edge that
is incident with this vertex, and let ai equal the label of the other
vertex with which this edge is incident.
III. The resulting tree in II becomes now the tree currently under examination. Increase i by 1, repeat II until a sequence of n 2 digits is
formed.
The degree of the vertex with label i in T is equal to the number of times
the letter i appears in a1 , a2 , ..., an2 plus one. (Whenever an edge is
deleted, the degree of the non-leaf vertex is decreased by 1. So, if this
vertex appears i times, its degree is decreased by i. Finally, this vertex
is removed as a leaf or is left as one of the two connected vertices. Its
degree is 1 in either case.)
Following is an algorithm for reconstructing a vertex-labelled tree from a sequence
a1 , a2 , ..., an2 of labels:

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

1251

Let d(i) be the degree of vertex i which can be calculated according


to the preceding paragraph.
i. Set i = 1.
ii. Among all vertices whose present degree is 1, nd the one, vi , with
the least name. Draw an edge connecting vi to vertex ai . Eliminate
vertex vi from the list, and reduce deg(Ai ) by 1.
iii. If i < n 2, increase i by 1 and go to step ii. If i = n 2, draw an
edge between the two remaining vertices (of degree 1) and stop.
It is claimed by the author that the algorithm always yields a tree. Furthermore, the tree yielded will be the only one which will produce the original number
sequence.54 You are not asked to verify the validity of the algorithms.
(a) Apply the preceding theory (called Prfer coding of labelled trees) to show
u
that there are precisely 100,000,000 distinct trees with 10 vertices labelled
with distinct labels 1, 2, ..., 10.
(b) Determine the number of vertex-labelled trees having 15 vertices: 5 vertices
of degree 2, 6 vertices of degree 1, and 4 vertices of degree 3.
(c) Compile a catalogue of the labelled trees of up to 4 vertices.
(d) Compile a catalogue of the isomorphism types of trees having 5 vertices. For
each of these types determine the number of ways of assigning labels 1, 2, 3,
4, 5 to its vertices. Verify that the sum of the various numbers of ways is 53 .
Solutions:
1. (a) There are exactly 4 edges that may or may not be chosen: may be thought
2
of as subsets of this set of available edges; i.e. the set of graphs corresponds
to the power set of {AB, AC, AD, BC, BD, CD} (where XY = Y X). Thus
the number of graphs is 26 = 64.
(b)+(c) We will list the various equivalence classes in order of the number of edges.
0 edges: There is only one graph of this type.
1 edge: Choose the ends of the edge in 4 = 6 ways. There is no restriction
2
on the other vertices: there are 6 graphs.
2 edges sharing a vertex: Choose the central vertex in 4 = 4 ways, then
1
its two adjacent vertices in 41 = 3 ways; the last vertex is then deter2
mined. There are 4 3 = 12 graphs of this type.
54

After the term is over , students who are interested in further reading on this subject could consult
[15], [9, 2.3.4.4].

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

1252

2 edges not sharing a vertex: Choose one pair of adjacent vertices in 4


2
ways; the other pair are then determined. This argument, however, distinguishes between the edges one is designated as that chosen rst,
while the other is then determined. Thus this could will include each
graph twice. The number of graphs of this type is 4 /2 = 3.
2
3 edges forming a triangle: Choose the point not in the triangle in 4 = 4
1
ways; the structure is then completely determined. There are 4 graphs of
this type.
3 edges forming a path: We considered this earlier, and found that there
were 4!/2 = 12 such graphs.
3 edges forming a star (one central point adjacent to three others): Choose the centre of the star in 4 = 4 ways; the others are then
1
completely determined, so there are 4 graphs of this type.
We have listed above all cases with up to 3 edges. The graphs with 4 or more
edges can be associated with their complements, having 2 or fewer edges. So
the total number will be
1 + 6 + 12 + 3 + 4 + 12 + 4 + 3 + 12 + 6 + 1 = 64
2. (a) The Prfer codes are (n 2)-tuples of labels selected, with repetitions peru
mitted, from the set of n labels 1, 2, ..., n for the vertices of an n-vertex tree.
For any n there are precisely nn2 available codes, hence nn2 labelled trees.
For n = 10 there are 100, 000, 000 labelled trees.
(b) In the Prfer code for these trees there will be 5 symbols appearing 2 1 = 1
u
time; 6 symbols appearing 1 1 = 0 times; and 4 symbols appearing 3 1 = 2
times. The number of 13-permutations of 4 distinct symbols appearing twice,
(13,13)
and 5 distinct symbols appearing once is P2!4 1!5 = 13! . The number of ways
16
in which the symbols having these weights may be selected from a population
of 15 distinct labels is
C(15, 4)C(15 4, 5) =

15
4

11
5

hence the total number of trees of this type is

15! 11!
15!
=
;
4!11! 5!6!
4!5!6!

15!13!
.
4!5!6!24

(c) The isomorphism types can be determined recursively by adjoining a new leaf
to a tree with one fewer vertex. For n = 1, 2, 3 the only isomorphism type of
tree is a path of length n 1; for n = 4 there are 2 types: the path, and the
star a tree with one vertex of degree 3. We will not show the labelled
trees explicitly here. Their numbers of labellings can be determined easily:

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

1253

n = 1: One label may be assigned in 1 way to one vertex.


n = 2: There are 2! 2-permutations of 2 distinct symbols; but the labelling of
any path may be associated with 2 such permutations, depending upon
which leaf is chosen as rst. The number of these labelled trees is
2!/2 = 1.
n = 3: As in the preceding case, the number of labelled paths is 3!/2 = 3.
n = 4 (path): As in the preceding case, the number of labelled paths is
4!/2 = 12.
n = 4 (star): The label for the vertex of degree 3 may be assigned in
C(3, 1) = 4
ways; the assignments of the other labels are then determined up to isomorphism. There are thus 4 labellings of this type, which, with the
labellings of the path, yield 12 + 4 = 16 = 442 labelled trees.
(d) Using the algorithm described in the preceding part, we can see that there
are 3 isomorphism types: the path, the star, and a tree with one vertex of
degree 3 from which emanate two paths of length 1 and one path of length 2.
The number of paths is, as before 5!/2 = 60; the number of stars is, as before
C(5, 1) = 5; in the remaining case the vertex of degree 3 may be labelled in
5 ways, after which the labels for the two leaves that are one edge away from
it may be chosen in C(5 1, 2) = 6 ways; of the remaining 2 labels, one is
selected to be assigned to the vertex of degree 2 in C(2, 1) = 2 ways. This
tree can be labelled in 5 6 2 = 60 ways; in all, trees on 5 vertices can be
labelled in 60 + 5 + 60 = 125 = 552 ways.

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