Flat Notes
Flat Notes
Flat Notes
UNIT - V
Decidability and Undecidability:
Decidable Problems:
Semi-Decidable problems are those for which a Turing machine halts on the
input accepted by it but it can either halt or loop forever on the input which
is rejected by the Turing Machine. Such problems are termed as Turing
Recognisable problems.
Undecidable Problems:
The problems for which we can’t construct an algorithm that can answer the
problem correctly in finite time are termed as Undecidable Problems. These
problems may be partially decidable but they will never be decidable. That is
there will always be a condition that will lead the Turing Machine into an
infinite loop without providing an answer at all.
Regularity of CFL, CSL, REC and REC: Given a CFL, CSL, REC or
REC, determining whether this language is regular is undecidable.
Note: Two popular undecidable problems are halting problem of TM and PCP
(Post Correspondence Problem).
For Example:
L1= {anbncn|n>=0}
L2= {dmemfm|m>=0}
L3= L1.L2
Kleene Closure: If L1is recursive, its kleene closure L1* will also be
recursive.
For Example:
L1= {anbncn|n>=0}
For Example:
L3=L1 ∩ L2
L1 says n no. of a’s followed by n no. of b’s followed by n no. of c’s and
then any no. of d’s. L2 says any no. of a’s followed by n no. of b’s
followed by n no. of c’s followed by n no. of d’s. Their intersection says
n no. of a’s followed by n no. of b’s followed by n no. of c’s followed by n
no. of d’s. So it can be decided by turing machine, hence recursive.
Similarly, complementof recursive language L1 which is ∑*-L1, will also
be recursive.
Proof − At first, we will assume that such a Turing machine exists to solve
this problem and then we will show it is contradicting itself. We will call
this Turing machine as a Halting machine that produces a ‘yes’ or ‘no’ in a
finite amount of time. If the halting machine finishes in a finite amount of
time, the output comes as ‘yes’, otherwise as ‘no’. The following is the block
diagram of a Halting machine −
Else, halt.
Rice Theorem:
Formal Definition
Proof
On input x
Run M on w
If M does not accept (or doesn't halt), then do not accept x (or do not
halt)
Example 1
Find whether the lists M = (abb, aa, aaa) and N = (bba, aaa, aa) have a
Post Correspondence Solution?
Solution
x1 x2 x3
M Abb aaa
N Bba aaa aa
Here,
x2x1x3 = ‘aaabbaaa’
x2x1x3 = y2y1y3
Example 2
Find whether the lists M = (ab, bab, bbaaa) and N = (a, ba, bab) have a
Post Correspondence Solution?
Solution
x1 x2 x3
M ab bab bbaaa
N a ba bab
In this case, there is no solution because −
Intractable problems
This algorithm, however, does not provide an efficient solution and is,
therefore, not feasible for computation with anything more than the
smallest input.
The reason there is no efficient algorithms for these problems is that these
problems are all in a category which I like to refer to as “slightly less than
random.” They are so close to random, in fact, that they do not as yet allow
for any meaningful algorithm other than that of brute-force.
If any problem were truly random, there would not be even the possibility of
any such algorithm.
Example:
As the size of the integers (i.e. the size of n) grows linearly, the size of the
computations required to check all subsets and their respective sums
grows exponentially. This is because, once again, we are forced to use
the brute-force method to test the subsets of each division and their
sums.
Given any graph with a large number of vertices, we see that we are
again faced with resorting to a systematic tracing of all paths,
comparison of neighboring colors, backtracking, etc., resulting in
exponential time complexity once again.
a) Pick an arbitrary edge (u, v) from set E and add 'u' and 'v' to result
4) Return result
3-SAT Problem:
A Boolean formula is in 3CNF if it is of the form C1 ∧ C2 ∧ · · · ∧ Ck where
each Ci is an ∨ of three or less literals.
A Boolean formula is in 3SAT if it in 3CNF form and is also SATisfiable.
3SAT is NP-complete and all NPC problems can be coded into SAT.