Assignment title: Information
COSC1105/1107 - Computing Theory
Assignment 2 (15%)
Total marks: 100
Deadline: Sunday 22 May, 11:59pm
Please read all the following information before attempting your assignment. This is an individual assignment. You may not collude with any other individual, or plagiarise their work. Students are expected to present the
results of their own thinking and writing. Never copy another student's work (even if the other student "explains it to
you first") and never give your written work to others. Never copy from the web or any other resource. Remember
you are meant to generate the solution to the questions by yourself. Suspected collusion or plagiarism will be dealt
with according to RMIT policy.
When asked to "briefly explain" something, or to describe something "informally", an answer of one to three
English sentences is expected. When asked to "explain" or "justify" something, an answer of one or two English
paragraphs is expected. When asked to "prove" or "show" something, a formal proof or argument is expected.
Submission Instructions: You will need to submit one PDF file via Blackboard. The PDF file should be named
-CT16A2.pdf and must be typeset in a word processor (for example, scanned files will
not be marked).
Submissions not compatible with the instructions above will attract zero marks and do not warrant a re-submission.
Corrections: From time to time, students or staff find errors (e.g., typos or wrong symbols) in the assignment
specification. In that case, corrected version will be uploaded to the course web page as quickly as possible and an
announcement will posted in the course web page and also sent by email to all students.
Forum postings on assignment: Do not ever post any information on the forum that may disclose how to solve
a question or what the solution may be. You can only post assignment related questions for clarification on what is
being asked, for example, whether a formal proof is required in a given exercise or to clarify certain notation. Any
post discussing possible solutions or strategies may directly be considered plagiarism, see above. If in doubt, do not
post and ask your question to the tutor instead.
Silent Policy: A silent policy will take effect 48 hours before this assignment is due. This means that no question
about this assignment will be answered, whether it is asked on the newsgroup, by email, or in person.
1
EXERCISE 1: TURING MACHINES [33 marks]
1. Consider the following Turing Machine M = (Q, Σ, Γ, #, δ, q0, F), where Σ = {1, 2, 3} is the input alphabet
and Γ = {1, 2, 3, a, b, #} is the tape alphabet (# is the blank symbol):
q0 q1 q2 q3
q4 q6
q5
#/#, R
1/1, R
3/3, R
b/b, R
1/1, L
3/3, L
b/b, L
b/b, R
3/3, R
1/a, R 2/b, R
2/b, R
2/2, L
#/#, L
3/3, R
a/a, R
A transition of the form 1/a, R means that when the head is reading 1, M can legally write a and move right.
(a) Trace the computation of M on input string 11222233 by completing the following derivation (location of
head is denoted by underlining the respective symbol): [2]
q0#11222233# ` q1#11222233# ` q2#a1222233# ` · · ·
Is the input string accepted?
(b) Explain informally, the working of the machine M. [4]
(c) Give the language L(M) in set notation. [3]
(d) Provide a grammar having 12 or less rules that accepts the same language as M. What type of grammar [6]
is it?
(e) What properties of formal languages would you use (and how) to formally prove that there is no NFA that [4]
can accept the language L(M). Explain briefly (note: you do not need to actually do any proof).
(f) Does there exist a PDA that accepts L(M)? Briefly explain your answer in one short sentence. [3]
(g) We obtain Turing Machine M 0 by modifying M as follows: (a) replace transition 3/3, R from state q1 to [3]
q5 with transition b/b, R; and (b) delete loop transition 3/3, R in state q5. Give the language L(M 0) in set
notation.
2. Show formally, by resorting to problem reduction, that the problem, of deciding whether a Turing machine halts [8]
on an input w where |w| is a multiple of 5, is undecidable.
2
EXERCISE 2: AUTOMATA [37 marks]
3. Let M1 = (Q, Σ, δ1, q0, F1) be the following finite state automaton defined over the alphabet Σ = {a, b, c, d}: [18]
q0 q1 q2 q3
a, λ
a
λ
d
c
b, λ
d
λ
AUTOMATON M1
Here, λ denotes the empty transition.
(a) You are told that the following DFA M2 = (Q2, Σ, δ2, q0, F2), built using the subset construction technique, is a deterministic equivalent version of automaton M1:
q0
q1q3
q1 q0q1q2q3
q1q2q3
∅
c
c
d
d
c
d
c
b
d
d
b
a, b
a
a, d
a, b, d
AUTOMATON M2
After careful analysis, you realise that M2 is incorrect: it is not a deterministic equivalent version of M1.
Construct a DFA M3 = (Q2, Σ, δ3, q0, F3), from M2, by only adding or removing transitions and toggling whether a state is final or not (but without changing the set of states and the initial state), such that
L(M1) = L(M3). In addition, you are asked ensure that the transition function δ3 is total. You do not
need to provide a diagram of M3; just answer the following questions by interpreting transition functions
as relations (e.g., (q0, c, q1) ∈ δ2, since δ2(q0, c) = q1) :
i. What is δ3 \ δ2?
ii. What is δ2 \ δ3?
iii. What is F3 \ F2?
iv. What is F2 \ F3?
(b) What modifications are required in M1 in order to make it λ-free without altering its language? Your
resulting machine M4 = (Q, Σ, δ4, q0, F4) will still be non-deterministic. You can only remove λ transitions, add transitions over Σ, or toggle whether a state is final or not, you must not change the set of
states and you cannot change the initial state. You do not need to provide a diagram of M4; just answer
the following questions:
i. What is δ4 \ δ1?
ii. What is δ1 \ δ4?
iii. What is F4 \ F1?
3
iv. What is F1 \ F4?
4. Emma's Pumping Lemma Dilemma: For her job application to tutor CT, Emma has been asked to prove that [4]
L = {anbma2m+3n | m, n ≥ 1} is not regular. The night before it was due, she finally finished the proof, wrote
it all down neatly, and went to bed. During the night, burglars came into her house with their dog, and the dog
chewed up her proof. In an attempt to cover their tracks, the burglars tried to recreate the proof. They gathered
all the shreds they could find, but on some of them the ink had washed out from the dog's saliva, and so they
couldn't read some parts of it. Can you help them put the proof back together? For each shred they found,
they rewrote it on a piece of paper. If they couldn't rewrite it, they wrote different interpretations of what they
thought it read onto different pieces of paper. Now they have many pieces of paper, but they don't know which
of them are correct and in which order they need to go. Help Emma's burglars.
There is one big piece, that reads:
Reminder: the Pumping lemma states, that for any regular language L, there exists a pumping length
k ∈ N, and for all w ∈ L, where |w| ≥ k, there exist substrings x, y, z ∈ Σ∗, such that:
w = xyz (1)
|y| ≥ 1 (2)
|xy| ≤ k (3)
xyiz ∈ L, for all i ≥ 0 (4)
Here are the other pieces they've transcribed:
(a) Now consider w = akbka5k.
(b) Now consider w = abaaaaa.
(c) Thus w = akbka5k = xyz such that |xy| ≤ k and |y| ≥ 1.
(d) Then, it follows that w ∈ L (where m = n = 1) and |w| = 7 ≥ 1.
(e) Then, it follows that w ∈ L (where m = n = k) and |w| = 7k ≥ k.
(f) Consider now i = 1. Then, xyiz = xyz = aqarasbka5k = aq+r+sbka5k.
(g) Consider now i = 0. Then, xyiz = xy0z = xz = aqasbka5k = aq+sbka5k.
(h) So, it follows that x = a, y = b, and z = aaaaa. Clearly w = abaaaaa = xyz.
(i) Assume that L is regular. Then, there exists a k ∈ N as per the Pumping Lemma.
(j) Consider now i = 2. Then, xyiz = xyyz = abbaaaaa. It is then clear that xyiz 6∈ L.
(k) Now, because q + r + s = k and r ≥ 1, we know that q + s 6= k, and therefore, xyiz 6∈ L.
(l) Thus we have a contradiction: our assumption (that L is regular) must be blue and L is true.
(m) Now, because q + r + s = k and r ≥ 1, we know that aqaras = ak, and therefore, xyiz ∈ L.
(n) So, according to the Pumping lemma, there exist substrings x, y, z ∈ Σ∗ such that (1)-(4) hold.
(o) Thus we have a contradiction: our assumption (that L is regular) must be false and L is not regular.
(p) So, it follows that x = aq, y = ar, z = asbka5k, where q + r ≤ k, r ≥ 1, s ≥ 0, and q + r + s = k.
You need not write out the entire proof, just provide the corresponding letters in the correct order as a word.
For example, the word badf denotes the proof built from statements (b), (a), (d), and (f) in that exact order. And
remember: the burglars wrote down multiple different interpretations of the same piece of the proof, so not all
of these will be necessary or correct. However, all necessary pieces are listed above.
4
5. Prove that L = {amb2man | m, n ≥ 0} is not regular. [8]
6. Show that the language L2 = {a, b}∗ \ {amb2man | m, n ≥ 0} is not regular. For this part, you can rely on the [4]
fact that L, from the previous question, is not regular.
7. Show that the language L3 = {an | n ≥ 0, n 6= 3 and n 6= 6} is regular. [3]
EXERCISE 3 [15 marks]
8. Prove mathematically that f(n) = 10n3 + 20n2 + 30 ∈ O(n4), for n ≥ 0. [4]
9. Suppose you are studying the computational complexity of a given problem X. It is known that the boolean [4]
satisfiability problem can be reduced to X in polynomial time. In addition, it is known that problem X is in
class PSPACE, as somebody has developed an algorithm for X that is guaranteed to consume no more than
polynomial amount of space. How would you prove that:
(a) X is NP-COMPLETE.
(b) X is PSPACE-Complete.
Observe that you do not need to develop any proof, but just explain briefly what task would you do.
10. Let X1 and X2 be two decision problems. Suppose it is known that X1 is NP-COMPLETE. Suppose further [7]
that there exists an exponential reduction of problem X1 into problem X2, that is, there exists a function f :
X1 → X2, whose implementation runs in exponential time, such that for any given instance x1 of X1 the answer
to x1 is "Yes" for problem X1 if and only if the answer to f(x1) is "Yes" for problem X2. What can be said
about the computation complexity of the problem X2. Is X2 NP-HARD? Explain in one or two paragraphs.
EXERCISE 4 [20 marks]
11. Explain the phase transition phenomenon observed in 3-SAT.
You're expected to submit between 400 and 500 words (excluding references).
Think of it, as if you were hired to write a textbook for Computer Science undergraduates who are taking
Computing Theory.
Besides providing enough technical information, your text needs to be enjoyable to read (or else the book will
not sell well!). Make sure you use multiple paragraphs, correct English grammar and spelling, and language of
appropriate formality with an adequate flow.
You must not copy and paste a single sentence from the web (this includes Wikipedia). Note that copied
sentences are trivial to identify, so you should re-phrase in your own words whatever you read. You should also
reference the material you used for your research.
Finally, we strongly recommend you proof-read your text, reflect on whether the reader (e.g., a fellow student)
would be satisfied with what you wrote and revise accordingly.
5