Assignment 2
Assignment 2
COSC 1107/1105
Assignment 2: Universality
1 Overview
This assignment requires you to demonstrate your knowledge of the key concepts of
Turing machines, universality, and computability . You are also required to report
on some further experiments with the Platypus game.
2 Assessment details
1. Turing machines (4+4+4+6 = 18 marks)
Consider the Turing machine M1 below. You can download this from Canvas here
(a) What language is accepted by M1 ? Explain your answer. Show some examples
of strings accepted and rejected to justify your answer. You must show at least
one accepted string of length at least 12, and at least one rejected string of
length at least 12. (4 marks)
(b) There are only three transitions in this machine that alter the symbol on the
tape. These are below.
State Input Output Direction New State
q0 a X L q1
q2 b Y L q3
q4 c Z L q5
What happens to the language of M1 if we replace these transitions by the
ones below?
State Input Output Direction New State
q2 a X L q3
q4 b Y L q5
q0 c Z L q1
Explain your answer. Show some examples of strings accepted and rejected to
justify your answer. You must show at least one accepted string of length at
least 12, and at least one rejected string of length at least 12. (4 marks)
(c) Give a deterministic machine equivalent to M1 (i.e. the machine in part a
above). Give a description English explaining why it is equivalent. Use the
same examples of strings accepted and rejected as in the first question above
to support your answer. (4 marks)
(d) Consider the Turing machines M2 and M3 below. You can download these
from Canvas here and here.
2
These machines are clearly very similar. What languages are accepted by these
machines? Explain your answer. Use examples of strings accepted and rejected
by each machine to support your answer. All such strings must contain exactly
two # symbols. You must show at least one accepted string of length at least
12, and at least one rejected string of length at least 12 for each machine. (6
marks)
13, 700, 000, 000 × 365.25 × 24 × 60 × 60 = 43, 233, 912, 000, 000, 000
seconds ago.
Calculate the value of n for which the Towers of Hanoi problem can be solved
in this time at the rate of 1 move per second.
Compare this value with the number of machines that could play a complete
Platypus tournament in this time at the rate of 1 match per second. In other
3
words, find the value of m for which m teams can play a tournament involving
43, 233, 912, 000, 000, 000 matches.
You will also find a spreadsheet very useful for this. (2 marks)
(c) Calculate the largest Platypus tournament you can play on your machine in 4
hours, ie 4 × 60 × 60 = 14, 400 seconds. Use the value calculated in the first
assignment for how long it takes you to play a match. (2 marks)
(d) Intractable problems are decidable problems, but for which the best known
solution is exponential (or worse). Describe two intractable problems and
their practical application. You should write one paragraph on each problem,
and a reason that you selected each one. Some suggestions will be given in
class and on Canvas. (6 marks)
(e) The generalised Platypus game is defined as follows. Let M1 and M2 be Tur-
ing machines, which share the same tape. The tape is initially blank. The
configuration of the two machines may be considered as shown below.
As in the Platypus game, each machine takes turns to move (but there is no
scoring involved).
Show that the halting problem for the generalised Platypus game is undecid-
able.
Hint: Reduce the Blank Tape problem to the halting problem for the gener-
alised Platypus game. In other words, assuming you have a machine to decide
the halting problem for the generalised Platypus game, use it to construct a
machine to solve the Blank Tape problem. (4 marks)
4
4. Platypus game (6+2+4+2 = 14 marks)
As discussed in lectures, some variations of the Platypus game seem appropriate.
Your tasks is to rerun your tournament with your allocated machines, with different
parameters, and to compare the results.
(a) You should include at least the variations below (and more if you wish). The
code to do all this will be provided.
Variation Description
Standard No changes; this is the original version
Tree 5 points for whenever either tree is reached
Green 2 points rather than 1 for changing green to yellow
Short Maximum game length of 50 rather than 100
Long Maximum game length of 200 rather than 100
Tiebreaker A random starting configuration is chosen with game length is 200
For each of the variations above, you should report the following results.
5
Time taken
Top 10 machines
Number of wins
Number of draws
Number of winless machines
Report your results in a table like this.
(c) Investigate some combinations of the above six variations of the game. Which
of them produces the most interesting results? Explain your conclusion. (4
marks)
(d) Two further changes are to use more than two players. Run your tournament
(with otherwise standard rules) for 3 and 4 players. How does the time taken
to do this compare to the standard 2-player game?
Report your results as follows.
(2 marks)
6
3 Submission
You should submit PDF file containing your answers to the questions, and all .csv files
generated by your exploration of the Platypus game. Do not use a .zip file. No file
formats other than .pdf or .csv will be accepted.
4 Marking guidelines
Your assignment will be marked out of 60, according to the criteria below.
Satisfactory completion of the required tasks for the Platypus game tournament.
5 Rubric
Your assignment will be graded in accordance with the rubric in Canvas.