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

GMN Atc Module 5

This document discusses decidability and algorithms. It defines: - An algorithm as a procedure that terminates in a finite number of steps for any input. - Recursively enumerable and recursive languages using Turing machines. - A decidable language as one for which there is an algorithm to determine if a string is in the language. - That the languages of DFAs and CFGs are decidable but the halting problem for Turing machines is undecidable.

Uploaded by

SIDHARTH RAM
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views

GMN Atc Module 5

This document discusses decidability and algorithms. It defines: - An algorithm as a procedure that terminates in a finite number of steps for any input. - Recursively enumerable and recursive languages using Turing machines. - A decidable language as one for which there is an algorithm to determine if a string is in the language. - That the languages of DFAs and CFGs are decidable but the halting problem for Turing machines is undecidable.

Uploaded by

SIDHARTH RAM
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

AUTOMATA THEORY AND COMPUTABILITY (18CS54): MODULE 5

DECIDABILITY
Procedure:
 A procedure for solving a problem is a finite sequence of instructions which can be mechanically
carried out for a given any input.

THE DEFINITION OF AN ALGORITHM


 The formal definition of algorithm emerged after the work carried out by Alan Turing and Alanzo
Church in 1936. The Church-Turing thesis states that any algorithmic procedure that can be carried out
by a human or a computer can also be carried out by a Turing machine. Thus the Turing machine arose
as an ideal theoretical model for an algorithm.
 An algorithm can be defined as a Procedure that terminates after a finite number of steps for any
input.
 i.e., it is defined as a collection of unambiguous instructions occurring in some specific sequence and
such an algorithm should produce output for a given set of input in finite amount of time.
 Some of the properties of an algorithm:
 Non-ambiguity: Each step in algorithm should be non-ambiguous. Instruction should be clear and
precise. Instruction should not denote any conflicting meaning.
 Range of Input: Input range should be specified. If not algorithm can go in an infinite state.
 Multiplicity: Same algorithm can be represented in several different ways. For example, Searching
algorithm, we can use sequential search method or binary search method.
 Speed: Algorithm should be efficient and should produce the output in a faster manner.
 Finiteness: Algorithm should be finite. After certain number of steps, it should terminate.

DECIDABILITY

Note: The below are some definitions required to understand the concept.
1. A recursively enumerable set is a set X for which we have a procedure to determine
whether a given element belongs to X or not.
2. A set X is recursive if we have an algorithm to determine whether a given element
belongs to X or not.
Since Languages are also sets, the above definition holds good for languages as well.

It is also true that a recursive language is a subset of recursively enumerable language.

Gayana M N, Dept. of CSE, SJEC, Mangaluru 1


AUTOMATA THEORY AND COMPUTABILITY (18CS54): MODULE 5
 The notion of a recursively enumerable languages and recursive languages are also defined using Turing
machines, as follows:
 TM halts when it reaches a final state after reading the entire input string w.
 Turing machine M halts when M reaches a state q and a current input symbol a to be scanned so
that δ(q, a) is undefined.
 There are TMs that never halt on some inputs in any one of these ways. (it may enter into infinite
loop)
 So we make a distinction between the languages accepted by a TM that halts on all input strings and a
TM that never halts on some input strings. That leads to the property of decidability and un-decidability
of the language.
 Recursively Enumerable Languages
A language L ‫*∑ ﬤ‬is a recursively enumerable language if there exists a TM M, such that L = T(M).
 Recursive Languages:
A language L ⸦∑* is a recursive language if there exists a TM M, that satisfies the following two
conditions.
i. If the string w is defined in the language, then the TM accepts the string w (reaches an accepting
state on processing w) and halts.
ii. If the string w is not defined in the language, then the TM eventually halts without reaching an
accepting state.
Recursive language definition here formalizes the notion of an algorithm and assures us that TM always
halts just as an algorithm eventually terminates.

DECIDABLE LANGUAGES
 A problem with two answers Yes/No is decidable if the corresponding language is recursive. In this
case, the language L is also called decidable.
 A decidable problem is called a solvable problem.
 A problem/language is undecidable if it is not decidable.
 Decidability of regular languages:
o Problem of testing whether a deterministic finite automaton accepts a given input string wis
decidable?
ADFA = {(B, w) | B accepts the input string w}
o Theorem:

Gayana M N, Dept. of CSE, SJEC, Mangaluru 2


AUTOMATA THEORY AND COMPUTABILITY (18CS54): MODULE 5
ADFA is decidable.OR Show that the language accepted by a DFA is decidable.
Proof:
By simulating the working of DFA B and input w in TM M
Let ADFA = {(B, w) | B accepts the input string w}
We define a TM M as follows:
1. Let B be a DFA and w an input string. (B,w) is an input for the Turing Machine M.
The input (B, w) is represented by representing the five components Q, ∑, δ, q0, F by strings of
∑*and input string wϵ∑*.
2. Simulate B and input w in the TM M.
A Turing Machine M checks whether (B, w) is a valid input. If not it rejects (B, w) and Halts. If
the input (B, w) is a valid input, TM M writes the initial state q0 and the leftmost input symbol
of w. It updates the state using the transition function of DFA δ and then reads the next input
symbol in w.
3. If the simulation ends in an accepting state of B for the input w, then M accepts (B, w) otherwise
M rejects (B, w).
i.e., M accepts (B, w) if and only if w is accepted by DFA B.
Hence, the proof.
 Decidability of context free languages:
o ACFG = {(G, w) | The context-free grammar G accepts the input string w }
o Theorem:
ACFG is decidable. OR Show that the language accepted by a CFG is decidable.
Proof:
We convert a CFG into Chomsky Normal Form.
Then any derivation of w of length k requires 2k-1 steps if the grammar is in CNF. So, to check if
any string is in L(G), it is enough to check derivations in 2k-1 steps.
Now, we design a TM M that halts as follows:
1. Let G be a CFG in Chomsky Normal Form and w an input string. (G,w) is an input for M.
2. If k=0, list all the simple step derivation. If k≠0, list all the derivations with 2k-1 steps.
3. If any of the derivations in step 2 generates the given string w, M accepts (G,w). Otherwise M
rejects.

Gayana M N, Dept. of CSE, SJEC, Mangaluru 3


AUTOMATA THEORY AND COMPUTABILITY (18CS54): MODULE 5
 Decidability of context sensitive languages:
o The context-sensitive grammar G accepts the input string w is decidable.

UNDECIDABLE LANGUAGES
 If the language L is not a recursive language, then such a language is called un-decidable language.
 If there is any language L which is recursively enumerable then there exists a TM which semi- decides
it(either accept or reject or loops forever). Every TM has description of finite length. Hence the number
of TM and number of Recursively Enumerable languages is countably infinite.
 ATM = {(M, w) | The TM M accepts w} is un-decidable.(Proof: Refer Text Book:10.4)

HALTING PROBLEM OF TURING MACHINE


 The halting problem is a critical problem in computability theory. It is the theoretical problem of
determining whether a computer program will halt (produce an answer) or loop forever on a given input. In 1936,
Alan Turing proved that the halting problem is un-decidable, and therefore, cannot be solved.

 One can determine the decidability of other computational problems by combining reduction techniques
and the un-solvability of the halting problem.
 The undecidability of halting problem of Turing Machine can be proved using Reduction technique
 We say that A is reducible to problem B if a solution to problem B can be used to solve problem A. For
example, if A is the problem of finding some root of x4- 3x2 + 2 = 0 and B is the problem of finding
some root of x2- 2 = 0, then A is reducible to B. As x2- 2 is a factor of x4- 3x2 + 2 a root ofx2- 2 = 0 is
also a root of x4- 3x2 +2.
 If A is reducible to B and B is decidable then A is decidable. If A is reducible to B and A is
undecidable then B is undecidable.
 The Turing machine M halts on input w is undecidable. The output of TM can be:
o Halt: The machine starting at this configuration will halt after a finite number of states.
o No-Halt: The machine starting at this configuration never reaches a halt state, no matter how
long it runs.
 Based on these two observations:
Given any functional matrix, input data tape and initial configuration, then is it possible to determine
whether the process will ever halt? This is called Halting problem. That means is there any procedure
which solves the halting problem for every pair of machine input as: (Machine, Tape symbol). The
answer is No. i.e.,Halting problem is undecidable or unsolvable.

Gayana M N, Dept. of CSE, SJEC, Mangaluru 4


AUTOMATA THEORY AND COMPUTABILITY (18CS54): MODULE 5
 Theorem:
Prove that Halting Problem of TM is un-decidable
OR
HALTTM= {(M, w) | The Turing Machine M halts on input w} is un-decidable

Proof:
o Let us assume that Halting problem (HALTTM) is decidable.
o Let M1be the TM which decides whether or not any computation performed by another TM M
will ever halt, where the description of the TM is given as M and tape symbol asw.
That means input to M1will be (machine, tape) pair: (M, w)
o Then, for every input (M, w) to M1:
 If TM M accepts input w, then M1 halts which is called Accept-halt.
 If M does not accept input w, then the machine M1 will halt which is called Reject-halt.

o Now we construct one more TM M2which takes an input M.


o It first copies M and duplicates M on its tape and then this duplicated tape information are given as
input to machine M1. But machine M1 is a modified machine with modification, that whenever M1
is supposed to reach an Accept halt,M2 loops forever.
o The behavior of M2 is as shown below:
o It Loops if M halts for input w and Halts if M does not halt for input w.

o As M2 itself is one TM we will take M2 = M. that means we will replace M by M2 from the above

Gayana M N, Dept. of CSE, SJEC, Mangaluru 5


AUTOMATA THEORY AND COMPUTABILITY (18CS54): MODULE 5
given machine.

o Thus the machine M2 halts for input M2, if M2 does not halt for M2. This is a contradiction. That
means a machine M1 which can tell whether any other Turing machine will halt on particular input,
which does not exist.
o Hence halting problem is un-decidable.

THE POST CORRESPONDENCE PROBLEM (PCP)


 The Post Correspondence Problem (PCP) was first introduced by Emil Post in 1946. Later, the problem
was found to have many applications in the theory of formal languages.
 The problem over an alphabet Σ belongs to a class of yes/no problems and is stated as follows:
Consider the two lists of non-empty strings over an alphabet Σ
x = ( x1, x2,x3,x4, ............................ xn)
y = ( y1, y2,y3,y4, ............................... yn)
The PCP is to determine whether or not there exist i1,i2 ............ im where 1 ≤ ij≤ n such that
xi1 xi2………………… xim=yi1 yi2 ........................... yim
The indices ij need not be distinct and m may be greater than n. Also, if there exist a solution to PCP,
there exist infinitely many solutions.
 Q1: Does the PCP with two lists x = (b, bab3, ba) and y = (b3, ba, a) have a solution?
Answer:
We have to determine whether or not there exists a sequence of substrings of x such that the string
formed by this sequence and the string formed by the sequence of corresponding substrings of y are
identical.
x = (b, bab3, ba) and y = (b3, ba, a)
The required sequence is given by:i1= 2, i2= 1, i3= 1, i4= 3, ie: (2, 1, 1, 3) and m = 4
The corresponding strings are:

Gayana M N, Dept. of CSE, SJEC, Mangaluru 6


AUTOMATA THEORY AND COMPUTABILITY (18CS54): MODULE 5
bab3 bbba =bab3 b3a ie: babbbbbba=babbbbbba
Thus, the PCP has a solution.

 Q2: Does the PCP with two lists x = (11, 100, 111) and y = (111, 001, 11) has a solution?

The required sequence is given by:


i1= 1, i2= 2, i3= 3, ie: (1, 2, 3) and m = 3
The corresponding strings are:
11100111 =11100111 ; Thus the PCP has a solution

 Q3: Prove that PCP with two lists x = (01, 1, 1), y = (01 2 , 10, 11) has no solution

For each substring xiϵ x and yiϵ y, we have |xi | < | yi | for all i.
Hence the string generated by a sequence of substrings of x is shorter than the string generated by the
sequence of corresponding substrings of y.
Therefore, the PCP has no solution.

 Q4: Explain how a Post Correspondence Problem can be treated as a game of dominoes.
The PCP may be thought of as a game of dominoes in the following way: Let each domino contain
some xi in the upper-half, and the corresponding substring of y in the lower-half. A typical domino is
shown as
xi upper-half

yi lower-half
The PCP is equivalent to placing the dominoes one after another as a sequence. To win the game, the
same string should appear in the upper-half and in the lower-half. So, winning the game is equivalent
to a solution of the PCP.

 Note: If the first substring used in PCP is always xl and y1, then the PCP is known as the Modified
Post Correspondence Problem.

SUPPLEMENTARY EXAMPLES

1. If L1 and L2 are recursive languages then Show that L1 U L2 is also recursive language.
OR

Gayana M N, Dept. of CSE, SJEC, Mangaluru 7


AUTOMATA THEORY AND COMPUTABILITY (18CS54): MODULE 5
Show that the recursive languages are closed under union.
OR
Union of two recursive languages is recursive.

Solution:
Let L1 and L2 be two recursive languages.
Let M1 and M2 be the corresponding TMs that halt.(i.e, accepts L1 and L2 respectively)
Now we need to design a TM M as a two tape TM that accepts the language L such that L = L1 U L2
The construction of TM M is as follows:
1. w is an input string to M
2. M copies w on its second tape.
3. M simulates M1 on the first tape. If w is accepted by M1, then M accepts w.
4. M simulates M2 on the second tape. If w is accepted by M2, then M accepts w.

M always halts for any input w:


(i) If string w belongs to L1UL2 then it implies that either w ϵ L1 or w ϵ L2 or both, then the string w is
accepted either by M1 or M2 or both, thus the TM M produces the output as Accept(Yes).
(ii) If string w does not belong to L1UL2 then it implies that string w does not belongs to L1 as well as
L2, resulting in both the machine M1 and M2 producing the output as Reject. Thus, the TM, M also
produces the output as Reject (No).
Thus, L1UL2 =L(M)=L and hence the language L = L1UL2 is recursive.
(It produces only two outputs: Yes or No)

Gayana M N, Dept. of CSE, SJEC, Mangaluru 8


AUTOMATA THEORY AND COMPUTABILITY (18CS54): MODULE 5
2. If L1 and L2 are recursively enumerable languages then Show that L1UL2 is also recursively enumerable
language.
OR
Show that the recursively enumerable languages are closed under union.
OR
Union of two Recursively Enumerable Languages is recursively enumerable.

Solution:
Let L1 and L2 be two recursively enumerable languages.
Let M1 and M2 be the corresponding TMs that halt.(i.e, accepts L1 and L2 respectively)
Now we need to design a TM M as a two tape TM that accepts the language L such that L = L1 U L2
The construction of TM M is as follows:
1. w is an input string to M
2. M copies w on its second tape.
3. M simulates M1 on the first tape. If w is accepted by M1, then M accepts w.
4. M simulates M2 on the second tape. If w is accepted by M2, then M accepts w.

M mostly halts for any input w:


(i) If string w belongs to L1UL2 then it implies that either w ϵ L1 or w ϵ L2 or both, then the string w is
accepted either by M1 or M2 or both, thus the TM M produces the output as Accept(Yes).
(ii) If string w does not belong to L1UL2 then it implies that string w does not belongs to L1 as well as
L2, resulting in both the machine M1 and M2 producing the output as Reject. Thus, the TM, M also
produces the output as Reject (No).

M doesn’t halt for some input w:

Gayana M N, Dept. of CSE, SJEC, Mangaluru 9


AUTOMATA THEORY AND COMPUTABILITY (18CS54): MODULE 5
There exist some w which doesn’t belong to L1 and L2, for which both M1 and M2 never halts, resulting
in Loop Forever. As M1 and M2 need not halt, M need not halt, thus resulting in Loop forever.
Thus, L1UL2 =L(M)=L and hence the language L = L1UL2 is recursively enumerable.
(It produces the outputs: Yes, No , Loops Forever)

3. If L is a recursive language over Σ, show that L̅ ( L̅ is defined as Σ* - L ) is also recursive.


OR
Show that complement of a recursive language is also recursive language.
Solution:
If L is recursive then there exists a TM with two outputs Yes (Accept) or No (Reject). Thus the machine
halts and T(M) = L, as shown below:

Let us construct a new machine M1 such that T(M1) = L̅ and M1 eventually halts.
M1 is obtained by modifying M as follows:
1. Accepting states of M are made non-accepting states of M1 and there is no transition from that state
in M1. That means we have created a state in M1 that will HALT without accepting.
2. Create a new accepting state for M1 say qf and there is no further transition from it.
3. If q is a non- accepting state of M and δ(q, x) is not defined, then add a transition from q to qf for
M1

As M halts, M1 also halts. (If M reaches an accepting state on w, then M1 does not accept w and halts and
conversely.)

Gayana M N, Dept. of CSE, SJEC, Mangaluru 10


AUTOMATA THEORY AND COMPUTABILITY (18CS54): MODULE 5
Also, M1 accepts w if and only if M does not accept w.
Therefore, L̅ is recursive.

4. If L and L̅ are both recursively enumerable, show that L and L̅ are recursive.
Solution:
Let M1 and M2 be two TMs such that language L =T(M1) and L̅=T(M2)
We construct a new two- tape TM M that simulates M1 on tape 1 and M2 on tape 2 as follows:

If the input string w of M is in L, then M1 accepts w and we declare that M accepts w.


If w ϵ L̅ , then M2 accepts w and we declare that M halts without accepting.
Thus in both cases, M eventually Halts.
By the construction of M it is clear that T(M) = T(M1) = L.
Hence L is recursive.

COMPLEXITY
The efficiency of an algorithm can be decided by measuring the performance of an algorithm. We can measure
the performance of an algorithm by computing two factors:
i. Amount of time required by an algorithm to execute
ii. Amount of storage required by an algorithm.
Hence we define two terms- Time complexity and space complexity.
Time complexity: of an algorithm means the amount of time taken by algorithm to run. By computing time
complexity we come to know whether the algorithm is slow or fast
Space complexity of an algorithm means the amount of space (memory) taken by an algorithm. By computing

Gayana M N, Dept. of CSE, SJEC, Mangaluru 11


AUTOMATA THEORY AND COMPUTABILITY (18CS54): MODULE 5
space complexity we can analyze whether an algorithm requires more or less space.
To select the best algorithm, we need to check efficiency of each algorithm. The efficiency can be measured
by computing time complexity of each algorithm. Asymptotic notations such as Ω, Ѳ and O are the shorthand
way to represent the time complexity. Using this notation we can give time complexity as “fastest possible”,
“slowest possible” or “average time”.
Big Oh Notation: The Big oh notation is denoted by O, is a method of representing the upper bound of
algorithm’s running time. Using Big Oh notation, we can give longest amount of time taken by algorithm to
complete.
Definition of Big Oh notation:
Let f(n) and g(n) be two non-negative functions. Let n0 and constant c are two integers such that n0 denotes
some value of input and n > n0.Similarly c is some constant such that c > 0 we can write f(n) ≤ c * g(n) then
f(n) is Big Oh of g(n). ie: f(n) = O(g(n))

GROWTH RATE OF FUNCTIONS


When we have two algorithms for the same problem, we may require a comparison between the running time
of these two algorithms.
Measuring the performance of an algorithm in relation with the input size ‘N’ is called order of growth.

Corollary: The order of a polynomial is determined by its degree.

Gayana M N, Dept. of CSE, SJEC, Mangaluru 12


AUTOMATA THEORY AND COMPUTABILITY (18CS54): MODULE 5

Definition: An exponential function is a function : N->N defined by q(n)=an for some fixed a>1
When n increases, each of n, n2, 2n increases. But a comparison of these functions for specific values
of n will indicate the vast difference between the growth rate of these functions.

From the above table, it is easy to see that the function q(n) grows at a very fast rate when compared to f(n) or
g(n). In particular the exponential function grows at a very fast rate when compared to any polynomial of
large degree.

THE CLASSES P AND NP PROBLEMS


Problems can be classified under two groups
1. P- problem: The class of Problems that can be solved by a deterministic algorithm (i.e. by a Turing Machine
that halts) in polynomial time.
2. NP-problem: The class of Problems that can be solved by a nondeterministic algorithm (i.e. by a Non
deterministic Turing Machine) in polynomial time.
Note: P stands for polynomial and NP for nondeterministic polynomial.

Definitions:
1. A Turing Machine M is said to be of time complexity T(n) if the following holds:
Given an input w of length n, M halts after making at most T(n) moves.
Note that, in this case, M eventually halts and the TM is deterministic (Standard TM).

2. A Language L is in Class P if there exists some polynomial T(n) such that L=T(M) for some deterministic
TM M of Time complexity T(n).

Gayana M N, Dept. of CSE, SJEC, Mangaluru 13


AUTOMATA THEORY AND COMPUTABILITY (18CS54): MODULE 5
Example:
Construct the time complexity T(n) for the Turing machine M to accept the language L = {anbn| n ≥ 1}
• TM Consists of going through the input string (anbn) forward and backward and replacing the
leftmost a by X and the leftmost b by Y. So, we require at most 2n moves to match a 0 with a 1.
• Repetition of the above step requires n number of times.
• Hence the number of moves for accepting anbn is at most (2n)(n).
• For strings not of the form anbn, TM halts with less than 2n2 steps. Hence T(n) =O(n2).

3. A language L is in class NP if there is a nondeterministic TM M and a polynomial time complexity T(n)


such that L=T(M) and M executes at most T(n) moves for every input w of length n.

QUANTUM COMPUTATION

It is the area of study that focuses on development of computer technology based on the principle of quantum
theory

Quantum Computer:
We know that a bit (a 0 or a 1) is the fundamental concept of classical computation and information. Classical
computer is built from an electronic circuit containing wires and logical gates. Let us study quantum bits and
quantum circuits which are analogous to bits and (classical) circuits.

Quantum computer maintains a sequence of qubits. Qubit can be mathematically described as:

A classical bit has two states, a 0 and a 1.The two possible states for a qubit are the states |0 > and |1 >

Unlike a classical bit, a qubit can be an infinite number of states other than |0 > and |1 >. It can be in a state,

• Where α and β are complex numbers such that |α|2 + |β|2 = 1.


• 0 and 1 are called the computational basis states
• |ψ > is called a superposition.

Gayana M N, Dept. of CSE, SJEC, Mangaluru 14


AUTOMATA THEORY AND COMPUTABILITY (18CS54): MODULE 5
• |ψ > =α|0> + β|0>, is called a quantum state.

Multiple qubits can be defined in a similar way.


Example: Two qubit system has 4 computational basis states,|00>, |01>, |10> and |11>
Quantum states can be:
|ψ > =α00|00> + α01|01> + α10|10> + α11|11> with |α00|2 + |α01|2 + |α10|2 + |α11|2 = 1

Qubit for Logical Not gate


It is possible to define logical gates using qubit. The classical NOT gate changes 0 to 1 and 1 to 0. In the case
of the qubit the NOT gate, α|0> + β|1>, is changed to α|1> + β|0>.

The action of qubit NOT gate can be represented using matrix as:

Thus, the quantum computer is a system built from quantum circuits, containing wires and elementary quantum
gates to carry out manipulation of quantum information.

CHURCH-TURING THESIS
Church Turing thesis asserts that Any algorithm that can be performed on any computing machine can be
performed on a Turing machine as well.
A strengthened version of Church Turing Thesis states that Any algorithmic process can be simulated efficiently
by a Turing machine.

But a challenge to the strong Church-Turing thesis arose from analog computation.
Certain types of analog computers solved some problems efficiently whereas these problems had no efficient
solution on a Turing machine. But when the presence of noise was taken into account, the power of the analog
computers disappeared.
In mid-1970s. Robert Solovay and Volker Strassen gave a randomized algorithm for testing the primality of a
number. (A deterministic polynomial algorithm was given by Manindra Agrawal, Neeraj Kayal and Nitein
Saxena of IIT Kanpur in 2003). This led to the modification of the Church thesis.

Gayana M N, Dept. of CSE, SJEC, Mangaluru 15


AUTOMATA THEORY AND COMPUTABILITY (18CS54): MODULE 5
Strong Church-Turing Thesis: Any algorithmic process can be simulated efficiently using a Non-
deterministic Turing machine
In 1985, David Deutsch tried to build computing devices using quantum mechanics. He stated that “Computers
are physical objects, and computations are physical processes. What computers can or cannot compute is
determined by the law of physics alone. And not by pure mathematics.”
But it is not known whether this notion of universal quantum computer will efficiently simulate any physical
process. In 1994, Peter Shor proved that finding the prime factors of a composite number and the discrete
logarithm problem could be solved efficiently by a quantum computer. This may be a pointer to proving that
quantum computers are more efficient than Turing Machines ( and Classical computers).

Write a Short Note on the following:

1. Recursively Enumerable Languages

A language L which is a subset of ∑ * is a recursively enumerable language if there exists a TM M, such that
L = T(M). (Halts:(Accepts or Rejects) / Enters into infinite loop).
That means, languages accepted by a TM are called RE languages.

Structure of RE languages:
• An algorithm has a TM, that not only recognizes the language, but it always decides whether the input string
doesn’t belongs to the language. Such a TM always halts eventually regardless of whether or not it reaches
the accepting state.
• Recursively Enumerable languages that are not accepted by a TM with the guarantee of halting.
• These languages are accepted in an inconvenient way ie:
 If the input is in the language, then it is accepted by TM
 If the input is not in the language, then the TM may run forever, and we shall never be sure the
input won’t be accepted eventually.

2. Recursive Languages

A language L which is a subset of ∑* is a recursive language if there exists a TM M, that satisfies the following

Gayana M N, Dept. of CSE, SJEC, Mangaluru 16


AUTOMATA THEORY AND COMPUTABILITY (18CS54): MODULE 5
two conditions.
• If the string w is defined in the language, then the TM accepts the string w and Halts.
• If the string w is not defined in the language, then the TM eventually Halts without reaching an accepting
state.

Recursive language definition assures us that TM always Halts. It is clear that a recursive language is a subset
of recursively enumerable language.
Recursive languages are also called as decidable languages. The TM that always halt irrespective of whether it
accepts or not, is a good model for an algorithm.
If an algorithm exist to solve a problem, then the problem is decidable otherwise un-decidable(ie if it is not a
recursive language.)
The existence or non-existence of an algorithm to solve a problem is often more important than the existence
of some TM to solve the problem. Thus dividing the languages into decidable and un- decidable language is
often more important than the division of languages as Recursively enumerable( Those have some sort of TM)
or non-recursively enumerable languages ( which have no TM at all)
The relationship between the classes of languages are as shown below:

3. Decidable and Un-decidable Languages

A language L is said to be decidable language if the corresponding language L is recursive language. That is a
problem with two answers Yes/No is decidable if the corresponding language is recursive. The class of
decidable problems is called as solvable problems.

Gayana M N, Dept. of CSE, SJEC, Mangaluru 17


AUTOMATA THEORY AND COMPUTABILITY (18CS54): MODULE 5
Decidability of regular languages:
Problem of testing whether a deterministic finite automaton accepts a given input string w is decidable?. Yes
it is decidable.
• The context-free grammar G accepts the input string w is decidable
• The context-sensitive grammar G accepts the input string w is decidable
Un-decidable language: If the language L is not a recursive language, then such a language is called un-
decidable language.
If there is any language L which is recursively enumerable then there exists a TM which semi-decides it(either
accept or reject or loops forever). Every TM has description of finite length. Hence the number of TM and
number of RE languages is countably infinite.
• ATM = {(M, w) | The TM M accepts w} is un-decidable.
• Halting problem of TM is un-decidable.

4. Universal Turing Machines

Universal Turing Machine is a Turing machine that can simulate an arbitrary Turing Machine on arbitrary
input. The universal turing machine essentially achieves this by reading both the description of the Turing

Gayana M N, Dept. of CSE, SJEC, Mangaluru 18


AUTOMATA THEORY AND COMPUTABILITY (18CS54): MODULE 5
machine to be simulated as well as the input thereof from its own tape.

The language accepted by the Universal TM is called a universal language. It contains multiple tapes. Single
TM can be used as a stored program computer, taking its program as well as its data from one or more tapes
on which input is placed. The same idea is implemented in Universal TM. It is easiest to describe universal TM
U, as a multi-tape TM with transitions of M are stored initially on the first tape, along with the string w. A
second tape will be used to hold the simulated tape of M, using the same format as for the code of M. That is
tape symbol X i of M will be represented by 0i, and tape symbol will be separated by single 1’s, the third tape
of U holds the state of M, with state qi represented by i 0’s.

The universal TM U accepts the coded pair (M, w) if and only if M accepts w. If M rejects w then the machine
U also rejects w. Also if the machine M for input w enters a loop forever, then U also does the same.

Gayana M N, Dept. of CSE, SJEC, Mangaluru 19

You might also like