HKYAS
HKYAS
August 2020
1
(SUMAC) for the problem that inspired this paper. I would also like to
extend gratitude towards Mr Mark Watson, my teacher and supervisor for
helping guide me through mathematics. Finally, to my teacher Mr Sunil
Kumar for providing the coding skills to create the graph visualisations
2
Commitments of Academic Honesty and Integrity
1. are fully committed to the principle of honesty, integrity and fair play
throughout the competition.
2. actually perform the research work ourselves and thus truly understand
the content of the work.
4. have declared all the assistance and contribution we have received from
any personnel, agency, institution, etc. for the research work.
3
Signatures
Aaryan Sukhadia
Mark Watson
4
Contents
1 Introduction to Problem 6
2 Background Information 8
5
1 Introduction to Problem
Babab does not have much in the way of natural resources or farm land
so nearly all food and supplies are provided by the Babab All Bulk Company
(BABCO). The people of Babab (Bababians) desire easy access to a BABCO
store, where “easy access” means there is a BABCO store on their own island
or on one that they can get to with a single ferry ride. However, BABCO
finds it uneconomical to give the people on one island easy access to two
different BABCO stores, and BABCO is willing to deny some Bababians
easy access to a BABCO store in order to meet this restriction.
6
one has easy access to more than one BABCO store?
7
2 Background Information
We will frame this problem using graph theory. To do this we will have to
formalise many notions.
8
Figure 1: A graph made using Networkx library in python. Note that not
every vertex requires an edge connected to it
9
3 Application to the problem
The first step to abstract the problem is to rename the islands. Instead of
a and b we will use the digits 1 and 0 respectively. That way, the names
of the islands in an n-letter Babab Ocean can now be represented as binary
integers of length n rather than alphabetical strings.
We consider each of the islands (binary integers) in as vertices in a graph.
The edges represent ferry routes between the islands, and so each vertex is
connected to n other vertices. Then, for every n = 2, 3, 4.., we denote the
graph of all the islands with names of length n as Gn For example, below is
a visualisation of G2
10
For each character, we have 2 choices: a 1 or 0. Thus, the total number of
possible strings is simply 2n .
A graph such as this with 2n vertices and n×2n−1 edges, with each vertex
connected to n others can also be seen as the graph of an n-dimensional
hyper-cube. (I.e n=2 is a square, n=3 is a cube, n=4 is a tesseract, and so
on).
All of the graphs we’ve seen so far can be described as uncolored. What
11
this means is that no vertex is different from any different vertex. However,
to simulate the situation in the question, we can start assigning vertices a
color. A color is essentially a label that marks a vertex out, in this case a
colored vertex represents an island with a store on it.
Thus, we have the following analogy: Each island is initially an uncolored
vertex of the graph, and adding a store to the island is analogous to coloring
the vertex. This provides a useful abstraction of the problem.
We can now construct the hyper-cube slightly differently, in layers. With-
out loss of generality, we set the first vertex to be colored (i.e the first island
that we put a store on) as v1 . We call this layer x0 . After that, every vertex
in Gn with a Hamming distance of 1 from v1 is put in layer x1 , a Hamming
distance of 2 in layer x2 , and so on until xn , which is a single vertex that is
the complete opposite of every character of v1 .
This is because the islands in layer xi all differ from x0 in i places, and
there’s ni ways to choose this. Another way to say this is the Hamming
For every vertex we color, we need to rule out or close off all other is-
lands/vertices with Hamming distance 2 or less from that island, else the
nodes with Hamming distance 1 would have easy access to more than one
store. Let us examine each graph for each case.
12
n=3
a vertex prevents us from coloring any vertex of a distance 2 or less away from
it, as otherwise the nodes adjacent to that node would have easy access to
more than one store. Thus, we see the only other place we can place another
store on the graph is if it is on the opposite vertex of our initial island. Thus,
the maximum number of stores we can place here is 2.
n=4
Again, drawing out the graph and placing a store on the initial island: x1
and x2 are ruled out. The only layers left are x3 and x4 , and coloring any
vertex in them any of them closes off any other islands. Thus, the maximum
for n = 4 is also 2 stores
13
Figure 5: Edges in middle layers of graph excluded for simplicity
n=5
The graph for n = 5 has 6 layers. After coloring v1 , a store can’t be placed
on layers x1 and x2 , else layers in x1 would have easy access to more than one
store. Thus, the next vertex we color must be in x3 . Note that the Hamming
distance between any pair of vertices in the same layer is always even, and
less than 5 (since 5 is the maximum hamming distance for a string of length
5) For any island that we choose in x3 , there will be 6 other islands in x3 of
Hamming distance 2 or less. We can see this because in x3 there will be 3 bs
and 2as. To get to the same layer with 2 characters different, we must switch
a 1 to an 0 and vice versa. There are 3 × 2 = 6 ways to do this. Thus, we
are left with 3 vertices for which the Hamming distance is 4 from the colored
vertex we chose in x3 (since it has to be even, and less than 5). Thus, each of
14
Figure 6: Layers x2 and x3 in the graph. The unmarked islands on x3 all
have Hamming distance 2 from the chosen island
these have Hamming distance 2 from one another and coloring any of them
rules out the rest in x3 .
Coloring a vertex in x3 also rules out x5 , and some vertices in x4 . Each vertex
in x3 will share edges with 2 vertices in x4 . We have added 2 stores in x3 ,
and thus we will rule out at most 4 out of 5 vertices, and at least 3.Thus we
can color one more vertex, bringing our maximum up to 4. Note also that
coloring a vertex in x4 rules out all other vertices in x4 .
n=3
Looking at our graph for n=3 before, we see that it also satisfies the condition
of every island having easy access to an store, and thus the minimum is also
2. It cannot be one, since that would only cover a total of 4 vertices out of
the 8.
15
n=4
n=5
We again start with our initial island v1 , which gives easy access to all vertices
in x1 . Our last two store placements were symmetrical, so symmetry seems
to be the way to go here. We color a vertex in x5 to give easy access to all
the vertices in x4 . Now we have x2 and x3 to worry about.
We need to try and connect to as many uncolored vertices as possible in x2
with as few colored vertices as possible. Adding a store to a vertex of x2
only rules out that vertex in x2 , since all other vertices in the same layer are
at least Hamming distance 2 away. Adding a store in x3 rules out 3 vertices
in x2 , since there’s 31 ways to swap one of the character repeated 3 times.
16
x2 will be ruled out (not 8, because they have Hamming distance 2 and
thus must have an island in x2 in common). The 3 remaining in x2 will
have Hamming distance 4 from that common island, since each island on x2
either has distance 4 or 2, and those with 2 are already accounted for by the
connections with the stores on x1 . This means that those 3 all connect to
the island with Hamming distance 5 from the common island on x2 , so we
color that vertex that to ensure all islands on x2 have easy access to a store.
We can repeat the same process with x3 and x4 to get a total of 8 stores
required.
17
4 Conclusion and Potential Applications in
Information Theory
18
Bibliography
References
[1] Jehoshua Bruck and Ching-Tien Ho. “Fault-tolerant cube graphs and
coding theory”. In: IEEE Transactions on Information Theory 42.6
(1996), pp. 2217–2221.
19