Assignment2
Assignment2
Explain whether the PDAs you submitted for Assignment 2, Exercises 5 and 6 are determini-
stic. Note, that it is not relevant whether your solutions were correct.
b → a, L
a→
R a→
c, L
t→R t→R
? ?
-qaccept
q1 q2
- -
(a) Design a Turing machine (draw its graph) which for a given binary string calculates the
binary string obtained by adding 1. For example, for the initial configuration with 11011
on the tape the Turing machine will halt with 11100 on the tape where the scanner should
be on the first digit: q1 11011 `∗ qaccept 11100.
(b) Give the computations for the input strings 01 and 11.
Consider the 2-tape Turing machine depicted. Let Σ = {a, b}, Γ = {a, b, $, t}. The two rows of
the arc inscription give in the upper row the effect of the transition on tape 1 and, respectively,
!
x→S
in the lower row the effect on tape 2. For example, the transition inscription
t → x, R
means that if an x in under the scanner of the upper tape and a blank under the scanner of
the lower tape then the upper scanner will not rewrite x and it will stay at its current position,
while the lower scanner will write x onto the current cell and then move one position to the
right, where x ∈ {a, b}. Recall that multiple tape machines have three options regarding the
scanner: it can move one position to the left (L), one position to the right (R) or it can stay at
its current position (S).
! ! !
x → t, R t→S t → x, L
t → x, R x→L x → t, R
! ! ! !
x→S t→S t→L x→S
t → $, R t→L $ → t, R t→R
? ? ?
q1 q2 q3 q4 qaccept
- - - - -
Explain in words what the Turing machine is doing when it is started with a word w ∈ {a, b}∗
on the upper tape and the lower tape is empty. What is happening when the machine is in state
q2 , q3 and q4? What is the contents of the two tapes when the machine reaches the accept state?
(a) Explain how a DFA A can be converted into a Turing machine M such that L(A) = L(M).
In other words, explain how the Turing machine M simulates A.
(b) Apply the conversion method under (a) to a DFA acceptiong the regular language (a +
bb)∗ (c + ε).
(a) Explain how a PDA A accepting with final states can be simulated by a Turing machine.
(b) Explain how a PDA A accepting with empty stack can be simulated by a Turing machine.
(c) Demonstrate your method under (b) with a context free language which is not regular.
Give the accepting PDA and the respective Turing machine.