0% found this document useful (0 votes)
4 views

Assignment2

This document outlines Assignment 2 for a course on Formal Languages and Automata Theory, due on August 25, 2020. It includes exercises on deterministic PDAs, Turing machines, and their design and simulation, with specific tasks such as explaining the language of a given Turing machine and designing a Turing machine for binary string addition. The assignment is structured with various exercises worth a total of 30 marks.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Assignment2

This document outlines Assignment 2 for a course on Formal Languages and Automata Theory, due on August 25, 2020. It includes exercises on deterministic PDAs, Turing machines, and their design and simulation, with specific tasks such as explaining the language of a given Turing machine and designing a Turing machine for binary string addition. The assignment is structured with various exercises worth a total of 30 marks.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

CS304 Assignment 2

Formal Languages and 21st August 2020


Automata Theory
Assignment 2
(30 marks, submit by Tuesday, 25th midnight)

Exercise 7 deterministic PDAs (2 marks)

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.

Exercise 8 The Language of a TM (2 marks)

Consider the following Turing machine.

b → a, L
a→
  R a→
  c, L

  

t→R t→R
? ?
-qaccept
q1 q2
- -
  


(a) Give the computation starting with the initial configuration q1 a t a.

(b) What is the language recognized by this Turing machine?

Exercise 9 Turing Machine Design (9 marks)

(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.

Exercise 10 Multiple Tape Turing Machine (4 marks)

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?

Exercise 11 Automata as Turing Machines (4 marks)

(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 + ε).

Exercise 12 PDAs as Turing Machines (9 marks)

(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.

You may use multiple tracks and/or multiple tapes.

You might also like