Sei sulla pagina 1di 3

COMP 2613- Fall 2018

Assignment #3
Due no later than Wednesday, December 5th , 2018, 10:20 am (during the lecture)

This assignment consists of three (3) pages (including the cover page). Full answer is 9 points. There is
an addition 0.5 bonus point.

1. Recursive enumerable language (2 points)

Define the language


..................................... Double = {hM, xi | x ∈ L(M ) and λ ∈ L(M )}

Show that the language Double is recursive enumerable.


2. Reduction (3 points)
Consider the language
.................. 2Strings = {hM i | L(M ) contains at least 2 distinct strings & M is a T M }

1. Show that the language 2Strings is recursive enumerable.

2. Argue that the language 2Strings is not recursive.

3. Language classification (2 points)


Answer exactly one of the four possible answers REG, CF, REC, or RE for each of the following
languages. Here REG means regular, CF context-free, REC recursive, and RE recursive enumerable.

1
4. Turing Machine Construction (2 points)
We want to construct a Turing Machine that replaces a0 s by b0 s, and b0 s by a0 s. E.g. if the input is
w = bbaab, the Turing Machine starts in the initial configuration

and it ends in the following final configuration

That is, the Turing Machine ends in state qf with its head pointing at position 1 and with all a0 s and
b0 s interchanged.

Give the transition function δ of a Turing Machine that given any input string w ∈ {a, b}∗ interchanges
the symbols a and b in w.

5. Closure property (Bonus: 0.5 point)


Prove that if L1 ∈ REC and L2 ∈ RE, then L1 − L2 ∈ co-RE. Make your proof succinct.

Submission
You must submit the hard copy of your assignment on or before Wednesday, December 5th , 2018, 10:20
am (during the lecture). No late submissions will be accepted. The deadline is firm. Use the last page
of this assignment as the front page of your assignment. Assignments submitted without the front page
will be deducted 1 point.

Collaboration and plagiarism

You are welcome to work and discuss the assignment with other students enrolled in this course (i.e.,
COMP 2613- Fall 2018). You must clearly state whom your collaborators are, if any, for each problem
on the assignment.
Verbal collaboration is allowed. Written collaboration is strictly forbidden. For instance, notes, papers,
emails, messages, texting, twitter, chats, blogs, discussion boards, whiteboards, blackboards, and photos
used as communication devices are strictly forbidden. All written work that you submit must be your
own sole work. Anything else will be considered plagiarism. When you are discussing this assignment
with others, do not use any form of writing.
The use of published literature is allowed. If you use any published literature (texts, articles, websites,
etc) to complete your assignment, you must quote your sources. I suggest that you develop your own
solutions however, without the use of any published materials. You will be asked to answer similar
questions on the exams for this course and during the exams no such sources will be available.
Note that no collaborations or sources are allowed for the bonus problem, Problem 5.
If you have any doubt whether a collaboration is allowed or not, ask the lecturer before entering the
collaboration.

2
COMP 2613- Fall 2018

Assignment #3
Due no later than Wednesday, December 5th , 2018, 10:20 am (during the lecture)

Name:

My sources and my collaborators, if any, on this assignment were:

Problem 1:

Problem 2:

Problem 3:

Problem 4:

Problem 5: (no collaboration permitted)

Potrebbero piacerti anche