0% found this document useful (0 votes)
96 views

Module 7 Automata

The document discusses recursive and recursively enumerable languages. It defines recursive enumerable (RE) or Type-0 languages as those generated by Type-0 grammars and accepted by a Turing machine, which may loop forever on non-language strings. Recursive languages are a subset of RE languages that are decided by Turing machines, which always halt. RE languages are also called Turing recognizable, and recursive languages are also called Turing decidable. The relationship between RE and recursive languages is illustrated in Figure 1.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
96 views

Module 7 Automata

The document discusses recursive and recursively enumerable languages. It defines recursive enumerable (RE) or Type-0 languages as those generated by Type-0 grammars and accepted by a Turing machine, which may loop forever on non-language strings. Recursive languages are a subset of RE languages that are decided by Turing machines, which always halt. RE languages are also called Turing recognizable, and recursive languages are also called Turing decidable. The relationship between RE and recursive languages is illustrated in Figure 1.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Module 7 (automata)

Recursive and Recursive Enumerable Language

Recursive Enumerable (RE) or Type -0 Language


RE languages or type-0 languages are generated by type-0 grammars. An RE language
can be accepted or recognized by Turing machine which means it will enter into final
state for the strings of language and may or may not enter into rejecting state for the
strings which are not part of the language. It means TM can loop forever for the strings
which are not a part of the language. RE languages are also called as Turing
recognizable languages.

A recursive language (subset of RE) can be decided by Turing machine which means it
will enter into final state for the strings of language and rejecting state for the strings
which are not part of the language. e.g.; L= {anbncn|n>=1} is recursive because we can
construct a turing machine which will move to final state if the string is of the form
anbncn else move to non-final state. So the TM will always halt in this case. REC
languages are also called as Turing decidable languages. The relationship between RE
and REC languages can be shown in Figure 1.

A language is recursively enumerable if there exists a Turing machine that accepts


every string of the language, and does not accept strings that are not in the language.
(Strings that are not in the language may be rejected or may cause the Turing machine
to go into an infinite loop.)

Clearly, every recursive language is also recursively


enumerable. It is not obvious whether every recursively
enumerable language is also recursive.

UNSOLVABLE PROBLEM
For an undecidable language, there is no Turing Machine which accepts the
language and makes a decision for every input string w (TM can make
decision for some input string though). A decision problem P is called
“undecidable” if the language L of all yes instances to P is not decidable.
Undecidable languages are not recursive languages, but sometimes, they
may be recursively enumerable languages.

Example
 The halting problem of Turing machine

 The mortality problem

 The mortal matrix problem

 The Post correspondence problem, etc.

Language Decidability
A language is called Decidable or Recursive if there is a Turing machine
which accepts and halts on every input string w. Every decidable language
is Turing-Acceptable.

A decision problem P is decidable if the language L of all yes instances


to P is decidable.

For a decidable language, for each input string, the TM halts either at the
accept or the reject state as depicted in the following diagram −
Turing Machine Halting Problem
Input − A Turing machine and an input string w.

Problem − Does the Turing machine finish computing of the string w in a


finite number of steps? The answer must be either yes or no.

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 −

RICE THEOREM AUTOMATA THEORY


What is Rice Theorem?

Theorem

L = {<M> | L (M) ∈ P} is undecidable when p, a non-trivial property of the Turing machine, is


undecidable.
Incase if the below mentioned properties hold, it will be called as undecidable −

Property 1 − If M1 and M2 find out the same language, then either <M1> <M2> ∈ L or <M1>
<M2> ∉ L
Property 2 − For some M1 and M2 like that <M1> ∈ L and <M2> ∉ L
Proof −

Assume that if the two Turing machines X1 and X2.


Then assume <X1> ∈ L such that
L(X1) = φ and <X2> ∉ L.
For an input ‘w’ in a particular instant, follow the following steps −
 If X accepts w, then simulate X2 on x.
 Run Z on input <W>.
 If Z accepts <W>, Reject it; and if Z rejects <W>, accept it.

If X accepts w, then
L(W) = L(X2) and <W> ∉ P

If M does not accept w, then


L(W) = L(X1) = φ and <W> ∈ P

Here the contradiction arises. Hence, it is undecidable.

P, NP, NP-Complete, NP-Hard


July 9, 2016 by arjun 0 Comments
It might be because of the name but many graduate students find it difficult to
understand NPNPproblems. So, I thought of explaining them in an easy way.
(When explanation becomes simple, some points may be lost. So, please do
refer standard text books for more information)

PP Problems
As the name says these problems can be solved in polynomial time,
i.e.; O(n)O(n), O(n2)O(n2) or O(nk)O(nk), where kk is a constant.

NPNP Problems
Some think NPNP as Non-Polynomial. But actually it is Non-deterministic
Polynomial time. i.e.; “yes/no” instances of these problems can be solved in
polynomial time by a non-deterministic Turing machine and hence can take up
to exponential time (some problems can be solved in sub-exponential but
super polynomial time) by a deterministic Turing machine. In other words
these problems can be verified (if a solution is given, say if it is correct or
wrong) in polynomial time by a deterministic Turing machine (or equivalently
our computer). Examples include all P problems. One example of a problem
not in PP but in NPNP is Integer Factorization.

NPNP Complete Problems(NPC)(NPC)


Over the years many problems in NPNP have been proved to be
in PP (like Primality Testing). Still, there are many problems in NPNP not
proved to be in PP. i.e.; the question still remains whether P=NPP=NP (i.e.;
whether all NPNP problems are actually PP problems).
NPNP Complete Problems helps in solving the above question. They are a
subset of NPNPproblems with the property that all other NPNP problems can
be reduced to any of them in polynomial time. So, they are the hardest
problems in NPNP, in terms of running time. If it can be showed that
any NPCNPC Problem is in PP, then all problems in NPNP will be
in PP (because of NPCNPC definition), and hence P=NP=NPCP=NP=NPC.
All NPCNPC problems are in NPNP (again, due to NPCNPC definition).
Examples of NPCNPC problems

NPNP Hard Problems (NPH)(NPH)


These problems need not have any bound on their running time. If
any NPCNPC Problem is polynomial time reducible to a problem XX, that
problem XX belongs to NPNP Hard class. Hence, all NPNP Complete
problems are also NPHNPH. In other words if a NPHNPH problem is non-
deterministic polynomial time solvable, it is a NPCNPC problem. Example of
a NPNP problem that is not NPCNPC is Halting Problem.
From the diagram, its clear that NPCNPC problems are the hardest problems
in NPNP while being the simplest ones in NPHNPH.
i.e.; NP∩NPH=NPCNP∩NPH=NPC
Note:- Given a general problem, we can say its in NPCNPC, if and only if
we can reduce it to some NPNPproblem (which shows it is in NP) and
also some NPCNPC problem can be reduced to it (which shows all NP
problems can be reduced to this problem).

Also, if a NPHNPH problem is in NPNP, then it is NPC.

What are NP, P, NP-complete and NP-Hard problems?


P is set of problems that can be solved by a deterministic Turing machine in Polynomial
time.
NP is set of decision problems that can be solved by a Non-deterministic Turing
Machine in Polynomial time. P is subset of NP (any problem that can be solved by
deterministic machine in polynomial time can also be solved by non-deterministic
machine in polynomial time).
Informally, NP is set of decision problems which can be solved by a polynomial time via
a “Lucky Algorithm”, a magical algorithm that always makes a right guess among the
given set of choices (Source Ref 1).
NP-complete problems are the hardest problems in NP set. A decision problem L is NP-complete
if:
1) L is in NP (Any given solution for NP-complete problems can be verified quickly, but
there is no efficient known solution).
2) Every problem in NP is reducible to L in polynomial time (Reduction is defined below).
A problem is NP-Hard if it follows property 2 mentioned above, doesn’t need to follow
property 1. Therefore, NP-Complete set is also a subset of NP-Hard set.

You might also like