Instructions To Students: NOT NOT
Instructions To Students: NOT NOT
Student Number:
A
Examiner’s use only
Question Marks
INSTRUCTIONS TO STUDENTS
1
1. Do NOT turn over this cover page and do NOT
start writing until your invigilator tells you to do 2
so.
3
2. Write your Student Number only. Do not write
your name. 4
3. This exam paper contains SEVEN questions. It 5
comprises TEN pages excluding this cover page.
4. Answer ALL questions. 6
In this question, you may use without proof the fact that, for all x, y ∈ N, if x < y, then x2 < y 2 .
(i) Prove by induction that, for all n ∈ N, there exists x ∈ N such that (n, x) ∈ f . [4 marks]
2 2
Solution. (Base step) Note that 0 ⩽ 0 < 1 . So (0, 0) ∈ f .
(Induction step) Let k ∈ N such that some x0 ∈ N makes (k, x0 ) ∈ f . Fix such an x0 ∈ N.
Then x0 2 ⩽ k < (x0 + 1)2 by the definition of f . As k ∈ N, this implies k ⩽ (x0 + 1)2 − 1.
Case 1: suppose k < (x0 + 1)2 − 1. Then
So (k + 1, x0 ) ∈ f .
(F2) Let n, x1 , x2 ∈ N such that (n, x1 ), (n, x2 ) ∈ f . Then the definition of f tells us
Alternative proof for (F2). We prove the contrapositive. Let n, x1 , x2 ∈ N such that
x1 ̸= x2 . Say x1 < x2 . Since x1 , x2 ∈ N, this implies x1 + 1 ⩽ x2 . We want to show that
(n, x1 ) ̸∈ f or (n, x2 ) ̸∈ f .
1
CS1231
2
CS1231
2. Let A = {x ∈ R : x ⩽ 12} and B = {y ∈ R : y ⩾ 31}. Prove that A has the same cardinality
as B. [5 marks]
Solution. Define f : A → B by setting, for each x ∈ A,
f (x) = −x + 43.
(Injectivity) Let x1 , x2 ∈ A such that f (x1 ) = f (x2 ). Then −x1 +43 = −x2 +43, and so x1 = x2 .
g(y) = −y + 43.
First, we verify that g is well defined. Let y ∈ B. By the definition of B, we know y ⩾ 31. So
−y + 43 ⩽ −31 + 43 = 12. This means −y + 43 ∈ A, as required.
So g = f −1 by Proposition 7.4.13. Hence, we know from Further Exercise 7.11 that f is bijective.
31–
x
p
12
3
CS1231
(Injectivity) If x1 , x2 ∈ P(N) such that f (x1 ) = f (x2 ), then (0, x1 ) = (0, x2 ), and so x1 = x2 .
Recall from Corollary 9.3.2 that P(N) is uncountable. Since we have an injection f : P(N) →
N × P(N) where P(N) is uncountable, Proposition 9.2.5 tells us N × P(N) is uncountable too.
Alternative solution. Define g : N × P(N) → P(N) by setting, for each (n, x) ∈ N × P(N),
g(n, x) = x.
Recall from Corollary 9.3.2 that P(N) is uncountable. Since we have a surjection g : N × P(N) →
P(N) where P(N) is uncountable, Proposition 9.2.5 tells us N × P(N) is uncountable too.
4. How many permutations of the string ELDERFLOWER are there? Justify your answer.
You may leave your answer as products and quotients of expressions of the form n, nr , P (n, r), n!
n
or r where n, r ∈ N. [3 marks]
Solution. Define Γ = {E1 , L1 , D, E2 , R1 , F, L2 , O, W, E3 , R2 }. In view of the General Multiplica-
tion Rule,
number of
number of number of ways to
permutations = permutations of × arrange
of Γ ELDERFLOWER E1 , E2 , E3 into
3 positions
number of number of
ways to ways to
× arrange × arrange
.
L1 , L2 into R1 , R2 into
2 positions 2 positions
number of
∴ 11! = permutations of × 3! × 2! × 2! by Corollary 10.3.7.
EDLERFLOWER
11!
From this, we see that the number of permutations of ELDERFLOWER is 3! 2! 2! = 11!/24.
Alternative solution. The string ELDERFLOWER has 11 letters. So to form a permutation of
this string,
• there are 11
3 ways to choose the positions of the three E’s;
• there are 11−3 = 82 ways to choose the positions of the three L’s;
2
• there are 8−2 = 62 ways to choose the positions of the three R’s; and
2
4
CS1231
0 1 2 3 4 5 6 7
In this question, you may leave your answers as products and quotients of expressions of the form
n, nr , P (n, r), n! or nr where n, r ∈ N.
(i) Calculate the number of graphs that satisfy all of the following: (a) have the same vertices
as G, and (b) are isomorphic to G. Explain your working. [2 marks]
Solution.
• There are 44 = 1 way left to choose 4 vertices that share an edge with the bottom
vertex.
Each such choice gives the same graph as exactly one other choice. More specifically,
a b
c d e f g h i j and d c f e h g j i
b a
8
are the same graph. Therefore, the number of such graphs is 10 × 9 × 4 /2 = 3150.
(ii) Calculate the number of graphs that satisfy all of the following: (a) have the same vertices
as G, and (b) are isomorphic to G, and (c) have the vertex 0 in exactly 4 edges. Explain your
working. [2 marks]
Solution.
• Choose the top vertex to be 0.
• There are 44 = 1 way left to choose 4 vertices that share an edge with the bottom
vertex.
5
CS1231
(iv) Calculate the number of graphs that satisfy all of the following: (a) have the same vertices
as G, and (b) are isomorphic to G, and (c) have the vertex 0 or the vertex 1 in exactly 4 edges.
Explain your working. [2 marks]
Solution. By symmetry, the number of graphs that have the same vertices as G and are
isomorphic to G and have the vertex 1 in exactly 4 edges is equal to the number of graphs
that have the same vertices as G and are isomorphic to G and have the vertex 0 in exactly
4 edges, and is thus equal to 630 by (ii). So the Inclusion–Exclusion Rule tells us
number of graphs that have the same vertices as G and are isomorphic
to G and have the vertex 0 or the vertex 1 in exactly 4 edges
number of graphs that number of graphs that
have the same vertices have the same vertices
= as G and are isomorphic + as G and are isomorphic
to G and have the to G and have the
vertex 0 in exactly 4 edges vertex 1 in exactly 4 edges
number of graphs that have the same vertices as G and are isomorphic
−
to G and have the vertex 0 and the vertex 1 both in exactly 4 edges
= 630 + 630 − 70 by (ii) and (iii)
= 1190.
6
CS1231
6. For a, b ∈ R, denote by Ia,b the closed interval {x ∈ R : a ⩽ x ⩽ b}. Consider the undirected graph G
where
7
CS1231
7. A multipus is defined to be a finite tree in which there is exactly one vertex that is in three or
more edges. This vertex is called the head of the multipus. For example, the left graph below is a
multipus, while the right one is not. The head is indicated by a filled circle in the multipus.
A tip of a multipus is a vertex that is in exactly one edge in the multipus. A span in a multipus
is a path between two different tips in the multipus. For example, the dashed lines below indicate
spans, while the dotted lines do not.
(i) How many multipuses are there with exactly 5 vertices if we count isomorphic multipuses as
one? Explain your answer. [2 marks]
Solution. There are 2, as listed below.
(ii) Calculate the number of spans in the following multipus. Explain your working. [2 marks]
h0
h1 h2
h
k1 k2
f1 f2
Solution. By definition, a span must be between two vertices that are both in exactly one
edge. There are exactly 5 such vertices in the given graph, namely h0 , h1 , h2 , f1 , and f2 . Any
two of these, i.e., any 2-combination of {h0 , h1 , h2 , f1 , f2 }, uniquely determine(s) a span in the
multipus by Proposition 12.1.3. Thus
8
CS1231
• In view of the definition of multipuses, there are three mutually exclusively cases for
what the variable v can take.
(1) If the variable v takes the head h, then the variable e can take one of the d edges
that contains h.
(2) If the variable v takes a vertex that is in exactly two edges in M , then the variable e
can only take one of the two edges that contains v.
(3) If the variable v take a tip, then the variable e can only take the edge that con-
tains v.
So, by the Additional Rule and the General Multiplication Rule, there are exactly
1 × d + j × 2 + t × 1 = d + 2j + t ways to substitute objects into (v, e).
• The variable e can take one of j + t edges in M , and then the variable v can only take
one of the two vertices that are in e. So there are exactly (j + t) × 2 ways to substitute
objects into (v, e).
4. Output vi .
// This vi must be a tip for the while-loop to end.
This procedure defines a function from the set of all edges containing the head to the set of
all tips. In view of Theorem 8.3.1, it suffices to verify that this function is bijective.
(Surjectivity) Take any tip u. Use connectedness to get a path u0 u1 . . . uℓ where u0 = h
and uℓ = u. A run of the procedure above on input u0 u1 gives a tip vi , and in the process a
path v0 v1 . . . vi where v0 = u0 and v1 = u1 . Moreover, this procedure must give v2 = u2 , and
v3 = u3 , and . . . , until we get to vi = ui , where vi is a tip. However, the only tip in the path
u0 u1 . . . uℓ is uℓ . So ℓ = i and u = uℓ = ui = vi .
(Injectivity) Suppose this procedure gives output u on inputs v0 v1 and w0 w1 , where
v0 = h = w0 . Runs on these inputs give paths, say v0 v1 . . . vi and w0 w1 . . . wj respectively,
where vi = u = wj . Since these are two paths between h and u, they must be equal by
Proposition 12.1.3. In particular, we have v0 v1 = w0 w1 , as required.
9
CS1231
Case 1: suppose p − 1 ⩾ 1. By the smallestness of p, we again have vp−2 = wp−2 . Note that
vp−2 vp−1 and vp−1 vp and wp−1 wp are three different edges that contain vp−1 = wp−1 .
So vp−1 = wp−1 must be the unique head h.
Case 2: suppose p − 1 = 0. Then vp−1 = v0 = h = w0 = wp−1 .
10
CS1231
(iv) Alternative solution. Work in M . On the one hand, since the head is not a tip, any span
must have at least three vertices (i.e., the head and two different tips), and thus at least
two edges by Further Exercise 11.7. On the other hand, by assumption, all spans have at
most 2d − 2 edges. So the length of a span must be amongst 2, 3, 4, . . . , 2d − 2. There are
(2d − 2) − 2 + 1 = 2d − 3 such numbers.
Recall that d ⩾ 3 by the definition of heads and multipuses. Split into two cases.
Case 1: suppose d = 3. Then M must be isomorphic to one of the following multipuses.
v1 v1 v1 v1 v1
u u u u u
v2 v2 v2 v2 v2
In each of these cases, there are two different spans of the same length, one between u and v1 ,
and the other between u and v2 .
Case 2: suppose d ⩾ 4. A span is uniquely determined by the two different tips it contains.
From (iii), we know there are exactly d tips. Therefore, there are exactly d2 spans. We know
d − 2 > d − 3 ⩾ 4 − 3 = 1 > 0 as d ⩾ 4. So 0 < (d − 2)(d − 3) = d2 − 5d + 6 = (d2 − d) − (4d − 6).
This implies
d2 − d
4d − 6 d(d − 1) d
2d − 3 = < = = .
2 2 2 2
This tells us there are strictly fewer lengths than there are spans. So there must be two spans
that have the same length by the Pigeonhole Principle.
Extra explanation for the application of the Pigeonhole Principle. For this appli-
cation, we are considering the function f : A → B, where A is the set of all spans, and
B = {2,3, 4, . . . , 2d − 2}, and where f (S) is the length of S for all spans S. We saw that
|A| = d2 > 2d − 3 = |B|. So the Pigeonhole Principle tells us that f is not injective. This
non-injectivity gives distinct spans S1 , S2 satisfying f (S1 ) = f (S2 ), i.e., two distinct spans
that have the same length. ■
END OF PAPER
11