Decidability
Decidability
ALGORITHM No ALGORITHM
(Decidable) (Undecidable)
• In simple words, for any problem if it is solvable than the next step is to deciding whether
we can write a step by step solution for it or not. And either it (algorithm) can work
properly or not.
Decidable Language in Theory of Computation?
Let suppose we take language and many strings can be developed by that language
or (language has a set of many string). Now at an instance we take a string as an
input then we will check it on Turing machine ,whether the Turing machine accepts
or rejects and this gives the output as a result , than it shows that machine is properly
working for every input and gives the output in the form of acceptance or rejection,
this language is called decidable language.
“The language L from which when any string is taken as input and machine
easily tells either it is accepted or non-accepted, is called Decidable language.”
Continued…………
Non-
Turing acceptable
Turing
languages
acceptable
languages Decidable
languages
Continued…………..
For a decidable language, for each input string, the Turing machine halts
either at the accept or the reject state as depicted in the following diagram:
Decision on Halt
Input Rejected
Accepted
Turing Machine
Examples……
Example 1:
Problem:
• Find out whether the following problem is decidable or not
Is a number ‘m’ prime?
Solution
1) Prime numbers = {2, 3, 5, 7, 11, 13, …………..}
2) Divide the number ‘m’ by all the numbers between ‘2’ and ‘m’. ‘m’ is starting
from ‘2’.
3) 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
Continued……………….
Example 2:
Problem
• Given a regular language L and string w, how can we check if w ∈ L?
Solution
1) Take the DFA that accepts L and check if w is accepted
w∈L
Qr
Input string w
Qi
w∈L
Qf
DFA
Continued…………...
Some Notations:
'RL' implies Regular language.
'CFL' implies Context free language.
'DCFL' implies deterministic context free language.
'CSL' implies Context sensitive language.
'REC.L' implies Recursive language.
'REL' implies Recursive enumerable language.
'D' implies that the problem is decidable.
'UD' implies that the problem is undecidable.
Continued………….
Problems RL DCFL CFL CSL Rec.L REL
Is L= null?
D D D UD UD UD
Is L= E*
D D UD UD UD UD
Is L1= L2 ?
D D UD UD UD UD
Is L1 subset of L2 ?
D UD UD UD UD UD
Is compliment of ‘L’ a
language of same type or D D UD D D UD
not?
Is intersection of two
languages of same type or D UD UD D D D
not?
Is ‘L’ regular language or D D UD UD UD UD
not?
Important Points: