Skip to content

Commit abef43d

Browse files
committed
added lec 3
1 parent 29e4f0b commit abef43d

File tree

2 files changed

+62
-8
lines changed

2 files changed

+62
-8
lines changed

2.do.txt

+16-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
======= Russell's Paradox and Diagonalization =======
55

66
*There is a village where the barbers shave only those people who
7-
do not shave by themselves. Now will a does a barber shave himself?*
7+
do not shave by themselves. Now does a barber shave himself?*
88

99
If YES, then he cannot shave himself. If NO, then he can shave himself.
1010

@@ -63,6 +63,21 @@ input $x$. It is just another TM having its own transition function, alphabets a
6363
such that it can accept a TM encoding $\langle M \rangle$ as in part of the input, and the transition function
6464
is defined such that it simulates the running of $M$ on a string $x$.
6565

66+
__Configuration.__ An important concept for doing simulation is the configuration of a TM. Lets
67+
stick to 1-tape TMs for now. The "state" of the algorithm (not the TM state) is
68+
really consist of the the TM's state, the contents of its tape as well as the position
69+
of the tape heads. If a TM is at state $\omega_i$, has the string 101101111 in
70+
its tape and the tape head is at the 5th position, then its current configuration is
71+
1011 $\omega_i$ 01111. Note that this is a string over the alphabet $\mathcal{T} \cup \Omega$.
72+
The computation of TM is a graph in the space of all TM configurations. If the TM
73+
halts, it is a path which ends in a configuration having an accept or reject state.
74+
If it loops, there will be a cycle in this graph.
75+
76+
77+
A universal TM, goes over a configuration string, then goes over the encoding of the delta function,
78+
finds out which rule in the delta function to use, and can update the configuration,
79+
to reflect the next configuration of the TM begin simulated.
80+
6681

6782
======= Halting Problem =======
6883

3.do.txt

+46-7
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,49 @@
33

44
======= Non Deterministic Turing Machines =======
55

6-
7-
8-
9-
10-
11-
12-
======= NP and Search Problems =======
6+
Last lecture we saw that TM's can be encoded as strings and simulated by a
7+
universal TM using the configurations. We also saw that simulation of a TM,
8+
is essentialy tracing a path in the configuration space. But in the TMs that
9+
we defined, the out degree of any node (a configuration)
10+
in the graph (in the configuration space) is one.
11+
12+
Similar to the Nondeterministic finite automata, we can also define TMs
13+
with delta rules that results in multiple next states
14+
(called Nondeterministic Turing Machines or NTMs). Then the delta rules
15+
will be of the form $\delta:\Omega\times \mathcal{T} \rightarrow \mathcal{P}(\Omega\times \mathcal{T}\times \{\langle, \rangle, -\})$.
16+
($\mathcal{P}$ denotes the power set). So the configuration graph of a
17+
NTM can have out degree greater than $1$. However the it still has to be a finite
18+
number since the size of $\mathcal{P}(\Omega\times \mathcal{T}\times \{\langle, \rangle, -\})$ is
19+
finite. Following the different paths, an NTM could accept, reject or keep looping.
20+
So we need to define what is meant by deciding a language by an NTM.
21+
22+
An NTM is said to decide a language (a descision problem) $L$ iff,
23+
for all strings in the language, there exists one path in the configuration
24+
space that results in accept state. For strings not in the language, all
25+
paths in the configuration space should result in reject state.
26+
27+
We know that NFA (Nondeterministic Finite automata) can always be converted to
28+
a deterministic one. However for Pushdown Automaton this coverstion is not possible
29+
always. We will see that for TMs, this conversion can always be done. That is the
30+
set of languages that can be decided by TMs does not change by allowing
31+
nondeterminism.
32+
33+
Recall that UTM simulated a deterministic TM, by tracing the path in the configuration
34+
space. But for NTMs, the graph in the configuration space is a tree. A simple
35+
idea is for a UTM to do a graph traversal. DFS might be a bad idea, because
36+
some of the paths go into infinite loops. Hence it can to BFS. The first time,
37+
it finds that the NTM has reached the accept state, the UTM can also accept.
38+
If it never finds an accept state, the simulating TM rejects.
39+
40+
======= NP and Search Problems =======
41+
42+
As we disscussed earlier, an NTM can take different paths in the configuration space.
43+
The length of the path is essentialy the number of steps. Now we will define
44+
the worst case running time for a NTM.
45+
46+
For a language $L$, on inputs of size $n$, the worst case running time of an NTM
47+
is the length of the longest path in the configuration space on any of the inputs
48+
of size $n$.
49+
50+
NP or Nondeterministic Polynomial time is the class of descision problems for which,
51+
there is an NTM which decides it in worst case polynomial time.

0 commit comments

Comments
 (0)