Recursive and Recursively Enumerable Languages
Recursive and Recursively Enumerable Languages
Enumerable Languages
Halt State
• The Turing machine's computation ends when it enters its
halt state. It is possible that a computation might never end
because the machine never enters the halt state. This is
analogous to an infinite loop in a computer program.
Recursive language
• A 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 not in ‘L’.
• The turing machine will halt every time and give an answer
(accepted or rejected) for each and every input.
Recursively Enumerable Language
• A language ‘L’ is said to be recursively enumerable language if
there exists a Turing Machine which will accept for all the input
strings which are in ‘L’.
• But may or may not halt for all input strings which are not in ‘L’
causing it to enter in loop.
Decidable Language
A language ‘L’ is decidable if it is a recursive language. All
decidable languages are recursive languages and vice-versa.
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
Language
• If a language L is decidable, then its complement L' is
also decidable.
2.TABLE FORM
Let us consider the following example:
Final Solution - 2 1 1 3 String made by numerators: 101111110 String made by denominators: 101111110
• Example-2:
• Step-1: We will start from tile 1 as it is our only option, string made by numerator
is 100, string made by denominator is 1.
• Step-2: We have extra 00 in numerator, to balance this only way is to add tile 3 to
sequence, string made by numerator is 100 1, string made by denominator is 1
00.
• Step-3: There is extra 1 in numerator to balance we can either add tile 1 or tile 2.
Lets try adding tile 1 first, string made by numerator is 100 1 100, string made by
denominator is 1 00 1.
• Step-4: There is extra 100 in numerator, to balance this we can add 1st tile again,
string made by numerator is 100 1 100 100, string made by denominator is 1 00 1
1 1. The 6th digit in numerator string is 0 which is different from 6th digit in string
made by denominator which is 1.
• We can try unlimited combinations like one above but none of combination will
lead us to solution, thus this problem does not have solution.
Undecidability of Post Correspondence Problem : As theorem says
that PCP is undecidable. That is, there is no particular algorithm
that determines whether any Post Correspondence System has
solution or not