Halting Problem
Halting Problem
By
Shaheer Shahbaz Hyder
Fa17-MSCS-0081
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.
Decidable Problem
• A Problem is said to be decidable if there exist an
algorithm which can solve the problem in finite
amount of time.
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
Undecidable Languages