FLAT-Unit 5
FLAT-Unit 5
Unit 5
2 marks:
1. Lu is recursively enumerable but not recursive. Lu is the set of binary strings that
consist of encoded pairs (M, w) such that M is an encoding of a Turing machine
and w is an encoding of a binary input string accepted by that Turing machine.
1. No one has yet found a natural example of an algorithm that could not
be simulated by a Turing machine.
2. Also, the fact that all reasonable extensions to Turing machines do
not increase their power is a justification of the Church-Turing thesis.
Using the Church-Turing thesis, if one can show that a problem cannot be
solved on a Turing machine, then it is reasonable to conclude that it cannot be
solved by any computer or by any human.
A language which is Turing Recognizable if there is a Machine that will halt and
accept only the strings in that language and not in that language, then that TM
either rejects, or does not halt at all.
A = {hM, wi | M is a TM and w ∈ L(M)} is recognizable.
5. P-Class: Problem solvable in polynomial time. i.e. these problems can be solved in time
O(n k) in the worst-case, where k is constant.
7. Universal Turing machine (UTM) is a Turing machine that can simulate an arbitrary Turing
machine on arbitrary input. The universal machine essentially achieves this by reading both the
description of the machine to be simulated as well as the input to that machine from its own
tape.
8. RECURSIVE LANGUAGE:
If there is some Turing machine M that halts on every input W ε Σ, then L=L(M).
Eg: L={anbncn |n>=1}, then it moves to the final state when W=anbncn ,otherwise it
moves to non-final state.
10. Cook's theorem, states that the Boolean satisfiability problem is NP-complete.
That is, it is in NP, and any problem in NP can be reduced in polynomial time by
a deterministic Turing machine to the Boolean satisfiability problem.
PART B
1.
Universal Turing machine, which we’ll call U. U is not truly “universal” in the
sense that it can compute “everything”. U is, however, universal in the sense that,
given an arbitrary Turing machine M and an input w, U will simulate the operation
of M on w.
○ If M accepts, accept.
○ If M rejects, reject.
● Tape 3 will contain the encoding of the state that M is in at any point during
the simulation. Think of tape 3 as holding the program counter.
When U begins, it will have <M, w> on tape 1. (Like all multitape machines, it
starts with its input on tape 1 and all other tapes blank.)
In each step (transitions), TM reads symbols scanned by all heads, depending on those
and current state, each head writes, moves R or L, and control-unit enters into a new state.
Actions of heads are independent of each other.
The tapes of the universal Turing machine U
U begins simulating M with the read/write heads of its three tapes as shown above.
More generally, it will start each step of its simulation with the read/write heads
placed as follows:
● Tape 1’s read/write head will be over the a that is the first character of the
encoding of the current character on M’s tape.
● Tape 2’s read/write head will be at the beginning of <M>.
● Tape 3’s read/write head will be over the q of the program
counter. Following initialization as described above, U operates as
follows:
1. Until M would halt do:
Scan tape 2 for a quintuple that matches the current state, input pair.
Perform the associated action, by changing tapes 1 and 3. If necessary, extend the
simulated tape that is encoded on tape 1. If no matching quintuple is found, halt.
2. Report the same result M would report:
● ·If M is viewed as a deciding or semideciding machine for some language L: if
the simulated state of M is y, then accept. If the simulated state is n, then reject.
● If M isviewed as a machine that computes a function: reformat the tape so that
the value of tape 1 is all that is left.
How long does it take U to simulate the computation of M? If M would halt in k
steps, then U must go through its loop k times. Each time through the loop, it must
scan <M> to find out what to do. So, U takes O(|M|×k) steps.
Now we know that if we wanted to build real Turing machines, we could build one
physical machine and feed it descriptions of any other Turing machines that we
wanted to run. So, this is yet another way in which the Turing machine is a good
general model of computation.
Now for sequence 1, 2, 1, 3 first list will yield aabbaaabb and second list will yield
same string aabbaaabb. So, the solution to this PCP becomes 1, 2, 1, 3. Post
Correspondence Problems can be represented in two ways:
Domino’s Form:
Table Form:
Eg:
Explanation –
● Step-1: We will start with tile in which numerator and denominator are
starting with same number, so we can start with either 1 or 2. Let’s go with
second tile, string made by numerator- 10111, string made by denominator
is 10.
● Step-2: We need 1s in denominator to match 1s in numerator so we will go
with first tile, string made by numerator is 10111 1, string made by
denominator is 10 111.
● Step-3: There is extra 1 in numerator to match this 1 we will add first tile in
sequence, string made by numerator is now 10111 1 1, string made by
denominator is 10 111 111.
● Step-4: Now there is extra 1 in denominator to match it we will add third
tile, string made by numerator is 10111 1 1 10, string made by denominator
is 10 111 111 0.
Final Solution - 2 1 1 3
Lu is not Recursive
● Suppose Lu were recursive. Then there would exist a TM M that accepts the
complement of Lu.
● But now we can transform M into a TM M' that accepts Ld as follows:
○ M' transforms its input string w into a pair (w, w).
○ M' simulates M on (w, w) assuming the first w is an encoding of a TM Mi and the
second w is an encoding of a binary string wi. Since M accepts the complement
of Lu, M will accept (w, w) if and only if Mi does not accept wi.
● Thus, M' accepts w if and only if w is in Ld. But we have previously shown there does
not exist a TM that recognizes Ld.
● We conclude Lu is not recursive.
5. (i)Undecidability of PCP:
The most common proof for the undecidability of PCP describes an instance of PCP
that can simulate the computation of an arbitrary Turing Machine on a particular
input.
the full state of the machine consists of three parts:
● The current contents of the tape.
● The current state of the finite state machine which operates the tape head.
● The current position of the tape head on the tape.
5. (ii) RICE THEOREM:
6.(i).P-Class
The class P consists of those problems that are solvable in polynomial time, i.e.
these problems can be solved in time O(n) in worst-case, where k is constant.These
problems are called tractable, while others are called intractable or
superpolynomial.
class. NP-Class
The class NP consists of those problems that are verifiable in polynomial time. NP
is the class of decision problems for which it is easy to check the correctness of a
claimed answer, with the aid of a little extra information. Hence, we aren't asking
for a way to find a solution, but only to verify that an alleged solution really is
correct.
Every problem in this class can be solved in exponential time using exhaustive search.
NP-Class
Example
Step 1 − If a problem is in class P, it is nothing but we can find a solution to that type of
problem in polynomial time.
Step 2 − If a problem is in class NP, it is nothing but that we can verify a possible solution in
polynomial time.
Step 3 − Consider another way, NP means that a problem is NondeterministicallyPolynomial.
Specifically, that means that if you could build a machine that had the ability to try all the
possible solutions of your problem at once, it could finish in polynomial time.
We know this to be true because we know that we can verify a possible solution in polynomial
time, and what that machine is basically doing is trying to verify (test) all of the potential
answers to the problem at the same time.
Step 4 − So, if you can solve a problem in polynomial time, you can certainly verify that your
answer is correct in polynomial time, can't you? Sure, if you can prove that your algorithm is
correct and that it can find an answer in polynomial time, which it must to be in P.
The P in the P class stands for Polynomial Time. It is the collection of decision
problems(problems with a “yes” or “no” answer) that can be solved by a
deterministic machine in polynomial time.
Features:
1. The solution to P problems is easy to find.
2. P is often a class of computational problems that are solvable and tractable.
Tractable means that the problems can be solved in theory as well as in
practice. But the problems that can be solved in theory but not in practice
are known as intractable.
This class contains many natural problems like:
1. Calculating the greatest common divisor.
2. Finding a maximum matching.
3. Decision versions of linear programming.
NP Class: