Professional Documents
Culture Documents
CT Test 2 Portion
CT Test 2 Portion
CT Test 2 Portion
In this chapter, we will learn about the decidability and undecidability. In order understand
above mentioned terms the following definition needs to know.
Recursive language
The language L is said to be recursive if there exists a Turing machine,which will accept all
the strings in ‘L’ and reject all the strings are not in ‘L’.The turing machine will halt every
time and give an answer(accepted or rejected) for each and every string input.
Decidable Language
Undecidable Language
The above definitions are given in below table for quick understating.
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:
Example 1
Find out whether the following problem is decidable or not:
Is a number ‘m’ prime?
Solution
Prime numbers = {2, 3, 5, 7, 11, 13, …………..}
Divide the number ‘m’ by all the numbers between ‘2’ and ‘√m’ starting from ‘2’.If any of
these numbers produce a remainder zero, then it goes to the “Rejected state”, otherwise it
goes to the “Accepted state”. So, here the answer could be made by ‘Yes’ or ‘No’.
Hence, it is a decidable problem.
Example 2
Given a regular language L and string w, how can we check if w∈ L?
Solution
Take the DFA that accepts L and check if w is accepted
Note:
1. If a language L is decidable, then its complement L' is also decidable.
2. If a language is decidable, then there is an enumerator for it.
Note:
1. If a language L is decidable, then its complement L' is also decidable.
2. If a language is decidable, then there is an enumerator for it.
The acceptance problem for DFAs of testing whether a particular deterministic finite
automaton accepts a given string can be expressed as a language, ADFA. This language
contains the encodings of all DFAs together with strings that the DFAs accept. Let
ADFA = { < B, w > | B is a DFA that accept s input string w }.
The problem of testing whether a DFA B accepts an input w is the same as the problem of
testing whether a <B,w> is a member of the language ADFA. Similarly we can formulate other
computational problem in terms of testing membership in a language.
In the following theorem we show that ADFA is decidable. Hence this theorem shows that the
problem of testing whether a given finite automaton accepts a given string is decidable.
Theorem 1.
ADFA is decidable language.
Proof Idea: we simply need to present a TM M that decides ADFA.
M= “ On input <B,w>, where B is DFA and w is a string.
1. Simulate B on input w.
2. If the simulation ends in an accept state, accept. If it ends in a non accepting state,
reject.”
Let’s examine the input <B,w>. it is a representation of a DFA B together with a string w.
one reasonable representation of B is simply a list of its five components, Q,,δ,q0 and F.
when M receives its input, M first determines whether it properly represents a DFA B and a
string w. if not, M rejects.
Then M carries out the simulation directly. It keeps track of B’s current state and B’s current
position in the input w by writing this information on the tape. Initially, B’s current state is q0
and B’s current input position is the leftmost symbol of w. The states and position are
updated according to the specified transition function δ. When M finishes the last symbol of
w, M accepts the input if B is in an accepting state; M reject the input if B is in a non-
accepting state.
We can prove similar theorem for nondeterministic finite automata. Let
ANFA = {< B, w > | B is a NFA that accept s input string w }.
Theorem 2.
ANFA is decidable language.
PROOF: we present a TM N that decides ANFA. We could design N to operate like M,
simulating an NFA instead of a DFA. Instead, we will do it differently to illustrate a new idea
have N use M as a subroutine. Because M is designed to work with DFA. N first converts the
NFA it receives as input to a DFA before passing it to M.
N= “On input <B,w> where B is a NFA and w is a string
1. Convert NFA B to an equivalent DFA C by using the procedure for this conversion.
2. Run TM M from Theorem 1 on input <C,w>.
3. If M is accepts, then string w is accepted. Otherwise rejected”.
Similarly, we can determine whether a regular expression generates a given string.
Let AREX = {<R,w> R is a regular expression that generates string w}.
Theorem 3.
AREX is decidable language.
PROOF: The following TM P decides AREX.
P=”On input <R,w> where R is a regular expression and w is a string.
1. Convert regular expression R to equivalent NFA A by using the procedure for this
conversion.
2. Run TM N on input <A,w>.
3. If N is accepts, then string w is accepted. Otherwise rejected”.
Theorem 1, 2 and 3 illustrate that, for decidability purposes, presenting the Turing machine
with DFA, NFA, or regular expression are all equivalent because the machine is able to
convert one form to another.
Now we turn to a different kind of problem concerning finite automata: emptiness testing for
the language of a finite automaton. In the preceding three theorems we had to determine
whether a finite automaton accepts a particular string. In the next proof we must determine
whether a finite automaton accepts any string at all.
Undecidable Language
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.
Rice Theorem
Rice’s theorem states that, every non-trivial property of a recursively enumerable language is
undecidable.
Proof -A non-trivial property is one that is possessed by some objects of a class, but not all.
For example, being a mathematician is a property that is possessed by some humans but not
by all. Some cats are black but not all. So black colour property cannot be trivially
associated with cats.
Let χ be a non-trivial property that is not possessed by all recursively enumerable
languages. This problem can be reduced to one consisting of a pair (M, w) such that L
possesses χ iff w ∈ L(M ). We take a UTM U that takes a pair (M, w); its output is yes iff χ
is possessed by L.
Since L is a recursively enumerable language, there must be a TM, ML that accepts L. Let
x be a string belonging to L. Now, we design a machine M J to decide χ as shown below:
Here U is a UTM.
UTM, U takes the pair (M, w) and checks if w ∈ L(M ). If the output is yes, then the
machine ML that accepts the string x starts and the output of the machine M J is yes. Thus
the decidability of the problem of possessing the trivial property reduces to the problem
of Lu . If the pair (M, w) ∈ Lu , then L possesses χ ; otherwise not. Since Lu is not
recursive, possession of χ by L is also not decidable.
Let there be two series, x series and y series of size n with same charactere set Σ with
their ith element as xi and yi, respectively; does there exist a solution that forms the same x
series and y series?
The generic solution of PCP can be written as,
xi1 xi2 xi3.. xik = yi1 yi2 yi3 yik
Example 3:
Let there be two series of strings, say x series and y series as shown below:
i xi yi
1 10 101
2 01 100
3 0 10
4 100 0
5 1 010
Both X series and Y series contains 5 strings.
Let us call the strings in X
series as X substrings,
and the strings in Y series
as Y substrings.
If we concatenate X substrings x1x5x2x3x4x4x3x4,
we get 1010101001000100. If we concatenate
Y substrings y1y5y2y3y4y4y3y4, we get
1010101001000100. Let us call these strings as x
string and y string.
It can be seen that x string and y string are same.
Here we say that this instance of PCP has a solution in the form 15234434.
If we take 23,
x string is, x2x3 =010
y string is, y2y3 =10010.
Here x string and ys tring are different. Hence 23 is not a solution to this instance of PCP.
Example 4:
Find the solution to the instance of PCP given in the following table.
i xi yi
1 0 000
2 0100 01
0
3 01 1
Solution,
x2x1x1x3= 010000001
y2y1y1y3= 010000001
Example 5:
Find why the instance of PCP given below cannot have a solution.
i xi yi
1 0 000
2 010 0100
3 01 100
4 11 110
It can be seen that for every pair, |xi| > |yi|.
So, in whatever way we concatenate the string, the length of the x string will be longer
than the corresponding y string. Thus there is no solution for this instance of PCP.