Documente Academic
Documente Profesional
Documente Cultură
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
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)
5 Class Quiz
4
4
8
8
14
21
901
ii
General Information
Distribution Date: Wednesday, September 6th, 2000
(all information is subject to change)
1.1
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.
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.
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].
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
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
18
The next page will not be distributed until the syllabus has been revised.
distribution of assignment #
assignment #n due
Read Only
distributed notes
Notation:
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
Syllabus
Distribution Date: Wednesday, September 6th, 2000
This 0th version of the syllabus is subject to revision.
3.1
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
Section Name
Comments
Time
21
2
11
2
11
2
1
2
3.2
2.1
2.2
Section Name
Algorithms
Complexity of Algorithms
2.3
2.4
2.5
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.
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.
:
:
:
:
It
It
It
It
is
is
is
is
cold.
dry.
rainy.
warm.
(p q) (p r) .
10
11
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.
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.
13
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) .
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
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.
17
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]
18
19
(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
20
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.
21
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.
(i)
(j)
(k)
(l)
(m)
(n)
22
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.]
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!
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).
902
1001
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
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
1002
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
1003
A.2
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.
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)
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 .
A.3
A.3.1
Second Version
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.)
1006
A.4
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).
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
bn t n ,
b t 9t
bk t = 6t
k=2
=1
n=0
1007
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
1008
(2)
y1
y2 4
y3 3
y4
(3)
(4)
(5)
(6)
=
=
=
=
{(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.
1009
1t 1t
1t
1t
t3 (1 t4 t5 + t9 )
=
(1 t)4
m+3 m
t
3
12
= (t t t + t )
m=0
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
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
(n 0) .
(7)
1011
fi2 = fn fn+1
(8)
i=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)
f2i1 = f2n
(10)
i=1
1012
f2i1 =
i=1
n+1
f2i1 + f2n+1
by denition of
i=1
i=1
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
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
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.
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
1+t
(1t2 )2
= (1 + t)
m=0
m+1
1
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
2
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
As the coecient of x4 is 5410 , the number of words is 5410, conrming the result
4!
obtained using Inclusion-Exclusion.
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
10
2
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
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
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
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
A.6
1020
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
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.
1021
n
2
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!
1022
1
1
1
1
+ + ... + (1)r + ... + (1)n
1! 2!
r!
n!
1023
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) =
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
1024
3
2
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
1t 1t 1t
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
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
= 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.
1027
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
2
2
= 3n .
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
(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
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)
i(i + 1) = 1(1 + 1)
i=1
= 2=
(1 + 2)1(2)
3
i(i + 1) =
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
(12)
1029
j(j + 2) = 1(1 + 2)
j=1
= 3=
(2 + 7)1(2)
6
j(j + 2) =
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
=
1030
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.)
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.
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
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.
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
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
1034
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
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
1035
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
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
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
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.
1037
(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)
(15)
1038
n=0
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
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
1039
(3n 1 n 2n ) tn
=
n=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
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)
1040
1
,
10
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)
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)
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)
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
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.
1043
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
5!
3!2!
1045
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
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
1046
1
1y
=
n=0
cn y n is the product,
n=0
n+3
3
y , so cn =
n+3
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
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
1047
=
n=0
n=0
n+3
3
y , so cn =
n+3
3
cn y n is the product,
1048
B.1
= (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 .
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
1050
consecutive
= (127)(594)(683) ,
= (135)(24678)(9) .
(a) [10 MARKS] Showing all your work, determine disjoint cycle representations
for each of the following permutations:
B.3
1051
(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.
1052
B.4
(mod 127) .
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.
1053
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 ))
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.
1054
(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
(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.
1055
B.6
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.
1056
(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
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.7
1058
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.)
1059
(32)
(33)
(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
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
1060
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.)
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)
(35)
(36)
B.9
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
1062
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.)
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)
1064
C.1
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
(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
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 ) =
1065
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.
1066
(38)
(39)
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)
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)
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
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
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
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:
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!
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
1072
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 .
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)
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
=
=
=
=
3 26 + 1
38+2
32+2
30+2
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
=
=
=
=
=
=
=
=
=
=
=
1529 9 + 277
277 5 + 144
144 1 + 133
133 1 + 11
11 12 + 1
11 1 + 0
1077
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
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
(2i 1),
i=1
n+1
(2i 1) = 1,
(2i 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
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
(2i 1).
i=1
n+1
2i , which
i=0
1079
i=1
1
i(i + 1)(i + 2) = n(n + 1)(n + 2)(n + 3) .
4
(43)
i(i + 1)(i + 2)
i=1
n
n+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
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.
1081
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?
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.
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.
1084
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.
1086
This part has been changed from the version in the textbook.
(45)
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.
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.
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
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.
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)!
n=0
3n (1)n
.
n!
1
4
(3n (1)n ).
(46)
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!
(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
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 =
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
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.
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
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
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 .
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
1096
Transitivity. Suppose that ((a, b), (c, d)) R and ((c, d), (e, f )) R. Then
ad = bc, cf = de. Hence adf = bcf = bde, so af = be, implying that
((a, b), (e, f )) R.
(b) The digraph has 9 points, at each of which there is a loop. In addition, the
points (1, 1), (2, 2), (3, 3) are mutually adjacent by pairs of directed edges
as these three points constitute one equivalence class. There are no other
related pairs.
8. [17, Exercise 6.6.28]
(a) Show that there is exactly one greatest element of a poset, if such an element
exists.
(b) Show that there is exactly one least element of a poset, if such an element
exists.
Solution:
(a) For the poset (S, ), suppose that both x and y are greatest elements. Then
a[a
x]
and
b[b
y]
(47)
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].
C.5
1097
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
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.
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
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.
1101
1102
(a) Kn
(b) Cn
(c) Wn
(d) Qn
Solution:
(a)
(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].
1103
26
D
D.1
1104
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!
1105
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.
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
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 =
(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)
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)
(59)
p q p, i.e.
pq
.
p
1109
(60)
(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)
(63)
(64)
(65)
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
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
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
1112
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)
(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
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.
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
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:
1115
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)
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)
1117
ur
r
s
rs
(r s) (p t)
pt
t
p
(110)
(111)
(112)
(113)
(114)
(115)
(116)
(117)
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)
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
1118
as claimed.
N
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
1119
(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)
1120
(u)
f (t)
= f
(t+1)
by (131)
by (132)
(u)
=
=
=
f (t)
(u1+1)
f (t)
(u1)
f (t+u1)
= f (t+u1+1)
= f (t+u)
(u1)
by induction hypothesis
by (132) applied to the function f (t+u1)
quad erat demonstrandum = what was to be proved. Nowadays mathematicians often replace this
Latin clause by the symbol
.
D.3
1121
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.
1122
1123
(i + 1)P (24, n 2) =
of strings is
i=0
n
2
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)
(136)
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.
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
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
|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
1126
x2n
,
(2n)!
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
x2n+1
,
(2n+1)!
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
n=1
1127
4n n
x
n!
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
1128
(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=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
1129
D.4
(137)
=
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)
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 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
an tn 18t2
n=4
an tn + 81t4
n=2
=n+2
an tn = 0
n=0
1131
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
= 6 1 27t
2
k=0
k+1
(9t2 )k + 18t 1 18t2
1
= 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
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
2k 2k
6(k + 1)3 t
k=0
k=0
2k+1 2k+1
6(k + 1)3
k=0
k=0
k=0
k=0
(142)
1133
(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
1134
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
1135
4
2
4 = 1 + 1 + 1 + 1: There is just one relation of this type: it has 12 +12 +12 +12 = 4
ordered pairs.
1136
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)
1137
D.5
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
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
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
0
1
has the structure of K4 . Its incidence matrix is
1
1
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 .
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
evenness or oddness
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.
2
3
A3 = 3
0
0
number of
1142
3 3 0 0
2 3 0 0
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
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.
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) =
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].
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
=
i=1
n
(n 1) 2(n 1)
i=1
deg (i) +
i=1
deg+ (i)
n
+
2
i=1
n
deg+ (i)
i=1
deg+ (i)
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.
1146
E.1
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)
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
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.
1150
(155)
We assume A B = C C, i.e.
AB C C
C C AB
(156)
(157)
(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)
(164)
1151
(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!
E.2
1152
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)
(mod 2)
If n = 2t + 1, then
n(n + 1) = (2t + 1)(2t + 2) = 2(2t2 + 3t + 1) 0
(mod 2)
1153
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.
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)
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)
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)
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 p1 .
pi p1 p2
pi to be the formula
i=1
pi F.
i.
i=1
n+1
pi
ii.
i=1
pi pn+1 .
i=1
pi
i=1
pi . Prove that
i=1
pn+1
(pi pn+1 )
i=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
1159
pi
pn+1
by Double Negation
i=1
n
pn+1
pi
by denition of
i=1
i=1
pi
p1 T p1
by denition
i=1
by Domination Law
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
(203)
1160
(204)
(205)
(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
E.3
1161
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, ...).
1162
(208)
5
m1
2
m=1
2 = 222 .
5 i
x .
i
(1 + x) =
i=0
5
xm1 .
m1
(1 + x) =
m=1
2x(1 + x) = 2
m=1
5
xm .
m1
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.
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
=
n=0
n n
1164
(1)n xn
2 x +
n=0
n=0
n+1
+ (1) n
x
3
2n+1 +(1)n
,
3
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
ai =
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.]
1165
Solution:
1
2x 3
x
2x2 3
n
xn
n i
2 (3)ni x2in
i
=
i=0
(209)
n
,
(210)
2
n
n
(3)j+ 2 2j+ 2 if n is even; and 0 if n is odd. And,
i=j+
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.
=2
n
+ n2
2
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.
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
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
n
0
n
n
+
2
1
n
n
+
1
2
n
0
=2
n
n
+
2
1
(213)
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
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
(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.
1169
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
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 .
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.
1171
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+
901
120
E.4
1172
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.
i=0
(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
1173
12x2
by (223), (224)
1x
2 + 4x
12x2
a(x) =
+
1 + 4x2 (1 x)(1 + 4x2 )
(1 + 4x2 )a(x) = 2 + 4x +
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
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)
1175
Aij
= 2r (2n r 1)!
j=1
1176
(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,
42
1177
(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
R2
R3
R4
R5
R6
R7
=
=
=
=
=
=
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)}
1178
r
r
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)
(229)
(230)
(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)
E.5
1179
(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.
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
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.
1182
1183
F.1
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
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
1185
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)
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.
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)
(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)))
1188
(e)
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)
1189
(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)
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.]
(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)
Older notations for these functions are respectively [x] and {x}; the oor function is/was often
called the greatest integer function.
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
(238)
(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
(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
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
1193
a+c
b+d
ad + bc
bd
(243)
(244)
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.
F.2
1194
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.)
1195
(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).)
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)
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)
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)
(261)
(262)
(263)
(264)
(264), denition of c
(265)
(261),(265)
(266)
(266)
(267)
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
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.
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
1
1
17
3+
17
2
1
= (3.5615...)n .)
2
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)
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)
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}.
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
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
(b)
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
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
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.)
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
1
= 1 way.
= 4 ways.
4
2
= 6 ways.
4
3
= 4 ways.
1209
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
1210
20
1
= 20 ways,
= 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
6
n=0
19 + n n
t
n
25
22
19
20
+ 190
6
3
0
22 3
25 6
t +
t
3
6
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!
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+
F.4
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)
(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)
(mod 3).
1213
(b) Induction Proof of (299): First observe that, by two applications of (298),
fn+8 fn+4 fn
(mod 3)
(302)
=
=
=
=
(303)
(304)
(305)
(306)
(307)
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!
1214
(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.
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
(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
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 =
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
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
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
a(x) =
1219
ak xk :
k=0
4k x k + 6
k=2
2
xk
k=2
2
16x
6x
+
1 4x 1 x
6x2
16x2
+
1 4x 1 x
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
1220
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.]
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
4k 3k + (1)k k
4k1 3k1 + (1)k1 k
x +
x
k!
(k 1)!
k=2
k=1
k=2
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
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)
(319)
(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
1223
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
+
k=10
3
4
k8
k7
k2
k1
+
2
2
2
2
tk
(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
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)
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
1225
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
1226
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.
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.
1228
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
1230
1231
27
72
60
r
36
d
d
d
d
d
d
d
d
d
d
d
d
d
18
12
40
G
G.1
1232
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!
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
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
1235
m
n1
=
m
n
m
n
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
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
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
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 =
x
1+x
1
, b, c
1a
= H(a, b, c)
h(x, b, c) = H
x
, b, c
1+x
a
1a
= x) yields
1
bc
x
1+x
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.
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
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)
1241
G.3
1 1 1
+ +
2 5 7
1
1
1
+
+
10 35 14
1
70
= 92n .
A combinatorial identity
=
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
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
G.5
1243
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.
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
(329)
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
5
(9 1)!21 +
1
5
(6 1)!24
4
5
1
1246
5
5
(8 1)!22
(7 1)!23
2
3
5
(5 1)!25 = 112 512
5
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!
G.7
1. Showing all your work, determine the number of solutions to the equation y1 + y2 +
y3 + y4 = n with the properties that
1247
(1 x)
i1
n+3 n
x
3
=
i=0
(n14)+3
3
1248
x
1 x2
1
.
1 x2
f n xn =
f (x) =
n=0
x
1
x
=
2
2
1x
1x
(1 x2 )2
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
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 + ...
0
n even
s + 1 n = 2s + 1
G.8
1250
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:
1251
After the term is over , students who are interested in further reading on this subject could consult
[15], [9, 2.3.4.4].
1252
15
4
11
5
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:
1253