Universität Koblenz-Landau FB 4 Informatik
Prof. Dr. Viorica Sofronie-Stokkermans∗1 18.10.2017
M.Ed. Dennis Peuter∗2
Exercises for Advances in Theoretical Computer Science Exercise Sheet 1
Due at 23.10.2017, 10:00 s.t.
Exercise 1.1
Get acquainted with the following denitions of Turing machines and related concepts:
A Turing machine (TM) Mis a tupleM= (K,Σ, δ, s) with
• K a nite set of states, h6∈K,
• Σan alphabet, L, R6∈Σand #∈Σ,
• δ :K×Σ→(K∪ {h})×(Σ∪ {L, R}) a transition function, and
• s∈K an initial state.
The transition δ(q, a) = (q0, x) describes that if a TM is in state q ∈ K and the symbol a∈Σis read, the TM changes its state to q0 ∈K∪ {h} and
• moves the head one step to the left, ix=L
• moves the head one step to the right, i x=R
• does not move the head but prints the symbol b∈Σon the tape, ix=b∈Σ A conguration C of a TM M= (K,Σ, δ, s) is a stringC=q, wau, with
• q ∈K∪ {h}, the current state,
• w∈Σ∗, the tape contents left of the head,
• a∈Σ, the tape content under the head (the current symbol),
• u∈Σ∗(Σ− {#})∪ {ε}, the tape contents right of the head,
The initial conguration C0 ofMis dened as C0=s,#w#with input w∈Σ∗.
C2 =w2a2u2 is a successor conguration ofC1 =w1a1u1, written as C1 `M C2, i there is a transitionδ(q1, a1) = (q2, b) and:
Case 1: b∈Σ. Thenw1 =w2, u1=u2, a2 =b.
Case 2: b=L. Then for w2 and a2 : w1 = w2a2. For u2 : If a1 = # and u1 = ε, then u2=ε, otherwiseu2=a1u1 .
Case 3: b=R. Then for w2 =w1a1. Fora2 and u2 : If u1 =ε, thenu2=εand a2= #, otherwise u1 =a2u2 .
C0 `∗MCn is called computation, i for allCi with0≤i < n,Ci+1 is a successor congu- ration of Ci.
Exercise 1.2
a) Dene a Turing machine Ma that accepts all wordsw∈ {|}∗ with an even length, i.e.
Maholds, i w has even length, otherwiseMa does not terminate.
b) Dene a Turing machineMd that decides if a wordw∈ {|}∗ has an even length.
s,#w#`∗M
d h,#Y#if w has even length s,#w#`∗M
d h,#N#if w has odd length
c) Dene a Turing machineMi that adds one|to an input wordw∈ {|}∗. s,#w#`∗M
i h,#w|#.
You can decide to give the formal denition of the Turing machines or to draw it in the ow chart notation.
∗1 B 225 sofronie@uni-koblenz.de https://userpages.uni-koblenz.de/~sofronie/
∗2 B 223 dpeuter@uni-koblenz.de https://userpages.uni-koblenz.de/~dpeuter/
If you want to submit solutions, please do so until 23.10.2017, 10:00 s.t. via the cardboard box in the shelf in room B 222 or via e-mail (with Homework ACTCS in the subject) to dpeuter@uni-koblenz.de.