Professional Documents
Culture Documents
Lecture #5
Sarmad Abbasi
Virtual University
Theory of Computation
1 / 25
Lecture 5: Overview
Theory of Computation
2 / 25
Variants of TMs
We will show that multi-tape TMs are not more powerful than single
tape TMs.
Theory of Computation
3 / 25
Variants of TMs
Theory of Computation
4 / 25
Theorem
Every multi-tape TM has an equivalent single tape TM.
A single tape TM can actually simulate a multi-tape TM.
Theory of Computation
5 / 25
Variants of TMs
Let us look at a 3-tape TM.
Theory of Computation
6 / 25
Variants of TMs
q3 #aaaab#baa
ab#a
aaab
The main point is that this configuration can be written on a single tape.
Theory of Computation
7 / 25
Multi-tape TMs
place dots on all symbols that are currently been scanned by the
TM.
Theory of Computation
8 / 25
Multi-tape TMs
q0 #w 0 ##
Which denotes the initial configuration of M on w.
Theory of Computation
9 / 25
Multi-tape TMs
Here w 0 is the same string as w except the first character has a dot
placed on top of it.
Now, I can keep scanning the entire tape to find out which symbols are
being read by M. In the second pass I can make all the modifications
that M would have done in one step.
Theory of Computation
10 / 25
Multi-tape TMs
Theory of Computation
11 / 25
Put the tape in the format that represents the initial configuration
of M; that is,
##
#q0 w1 w2 wn ##
Theory of Computation
12 / 25
Theory of Computation
13 / 25
#q0 aabb#
#
and suppose (q0 , a, , ) = (q2 , b, c, a, R, R, R). That means the next
configuration will be written as:
#q2 babb#c
#a
#
This represents the machine in the following configuration:
Theory of Computation
14 / 25
#q3 bc bb#
cb#ab
#
represents the next configuration.
Theory of Computation
15 / 25
In the first pass it finds out the current symbols being scanned by
Ms heads.
Theorem
M accepts w if and only if S accepts w.
Theory of Computation
16 / 25
Theorem
Every multi-tape TM has an equivalent single tape TM.
A few words about this theorem:
Theory of Computation
17 / 25
Theory of Computation
18 / 25
Theory of Computation
19 / 25
Theorem
Every k-head TM has an equivalent single tape TM.
The proof of this theorem is almost a ditto copy of the previous
theorem. However, there are some subtle differences. You must write
the proof in detail to understand these differences.
Theory of Computation
20 / 25
Multi-tape TMs
Theory of Computation
21 / 25
Multi-tape TMs
In the first pass make sure the input is of the form w1 #w2 .
Note that this is a much more natural solution than matching symbols
by shuffling over the input.
Theory of Computation
22 / 25
Multi-tape TMs
Theory of Computation
23 / 25
Enumerators
Let us now look at another model of computation called enumerators.
Enumerators are devices that do not take any input and only produce
output. Here is a picture of an enumerator:
Theory of Computation
24 / 25
Enumerators
Enumerators are another model of computation. They do not take any
input and only produce output. Let us define them formally: An
enumerator E = (Q, , , q0 , ).
1
Theory of Computation
25 / 25
Enumerators
Theory of Computation
26 / 25
Enumerators
Theory of Computation
27 / 25
Enumerators
Theory of Computation
28 / 25
Enumerators
The answer is yes. Consider a TM M and suppose:
1
is accepted by M.
0 is rejected by M.
1 is accepted by M.
On 00 M loops forever.
01 is accepted by M.
Theory of Computation
29 / 25
Enumerators
This does not work. Since, M loops for ever on 00 thus it will never
output 01!
Theory of Computation
30 / 25
Dovetailing
We can use dovetailing to get over this problem. The idea is to use
time sharing so that one bad string does not take up all the time.
Theory of Computation
31 / 25