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

CHAPTER II: Undecidability Turing Decidable Turing Acceptable Undecidable Problems

The document discusses decidable and undecidable problems in computability theory. It provides examples of decidable problems, such as determining if a deterministic finite automaton (DFA) accepts the empty language or a finite language. It also discusses undecidable problems, where no algorithm can provide an answer for every input. Two fundamental undecidable problems are proven: the membership problem of determining if a Turing machine accepts a given string, and the halting problem of determining if a Turing machine will halt on a given input. The proof that these problems are undecidable relies on reaching a contradiction by assuming the problems are decidable.

Uploaded by

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

CHAPTER II: Undecidability Turing Decidable Turing Acceptable Undecidable Problems

The document discusses decidable and undecidable problems in computability theory. It provides examples of decidable problems, such as determining if a deterministic finite automaton (DFA) accepts the empty language or a finite language. It also discusses undecidable problems, where no algorithm can provide an answer for every input. Two fundamental undecidable problems are proven: the membership problem of determining if a Turing machine accepts a given string, and the halting problem of determining if a Turing machine will halt on a given input. The proof that these problems are undecidable relies on reaching a contradiction by assuming the problems are decidable.

Uploaded by

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

CHAPTER II: Undecidability

Contents
 Turing Decidable
 Turing Acceptable
 Undecidable Problems

08/20/21 WSU, Computer Science Department 1


Decidable Language
 A language is called Decidable or Recursive if there is a Turing
machine which accepts and halts on every input string w.
 A language is Decidable iff there is a Turing Machine which will
accept strings in the language and reject strings not in the
language.
 Every decidable language is Turing-Acceptable.

 A decision problem P is decidable if the language L of all yes


instances to P is decidable.
08/20/21 WSU, Computer Science Department 2
 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

 A language is Turing-decidable (or decidable) if some Turing


machine decides it
08/20/21 WSU, Computer Science Department 3
Cont..
Example
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

08/20/21 WSU, Computer Science Department 4


Undecidable Languages
 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.

08/20/21 WSU, Computer Science Department 5


For an undecidable language,
the corresponding problem is
undecidable (unsolvable):

there is no Turing Machine (Algorithm)


that gives an answer (yes or no)
for every input instance.

08/20/21 WSU, Computer Science Department 6


Decidable problems
 A problem is said to be Decidable if we can always construct a
corresponding algorithm that can answer the problem correctly.
 Decidability in terms of TM,
 A problem is said to be a Decidable problem if there exists a
corresponding Turing machine which halts on every input with an
answer- yes or no.
 It is important to know that these problems are termed as Turing
Decidable since a Turing machine always halts on every input,
accepting or rejecting it.
 A decidable problem has an algorithm to determine the answer
for a given input either yes or no.

08/20/21 WSU, Computer Science Department 7


Problem: Does DFA M accept
the empty language L(M )   ?

Corresponding Language: (Decidable)


EMPTYDFA 
{ M : M is a DFA that accepts empty language  }

Description of DFA M as a string


(For example, we can represent M as a binary string,
as we did for Turing machines)
08/20/21 WSU, Computer Science Department 8
 Here you need to remember the formal definition of DFA
(deterministic finite automaton) accepting a string or a language.
 A string w is accepted by a DFA < Q , , ,q0, , , A > , if and only if

 A language L is accepted by a DFA


 That is, the language accepted by a DFA is the set of strings
accepted by the DFA.
 That is a string is accepted by a DFA if and only if the DFA
starting at the initial state ends in an accepting state after
reading the string.
 Since the language L=∅ is regular, there must be a finite
automaton that recognizes it.

08/20/21 WSU, Computer Science Department 9


Cont..

 A DFA accepts if it's in an accepting state after it read


its input.
 If the input is the empty string, the DFA makes no
transitions so, after reading it's input, it's still in its
initial state, q0.
 If q0 is an accepting state, the automaton accepts the
empty string.

08/20/21 WSU, Computer Science Department 10


Decider for EMPTYDFA :

On input M :
Determine whether there is a path from
the initial state to any accepting state

DFA M DFA M

L (M )   L (M )  
Decision: Reject M Accept M
08/20/21 WSU, Computer Science Department 11
Problem: Does DFA M accept
a finite language?

Corresponding Language: (Decidable)


FINITE DFA 
{ M : M is a DFA that accepts a finite language}

08/20/21 WSU, Computer Science Department 12


Decide for FINITE DFA :
On input M :
Check if there is a walk with a cycle
from the initial state to an accepting state

DFA M DFA M

infinite finite
Decision: Reject M Accept M
(NO) (YES)
08/20/21 WSU, Computer Science Department 13
Problem: Does DFA M accept string w ?

Corresponding Language: X (Decidable)


ADFA 
{ M ,w : M is a DFA that accepts string w }

08/20/21 WSU, Computer Science Department 14


Decide for ADFA :

On input string M ,w :

Run DFA M on input string w

If M accepts w
Then accept M ,w (and halt)
Else reject M ,w (and halt)

08/20/21 WSU, Computer Science Department 15


Undecidable Problems
 The problems for which we can’t construct an algorithm that can
answer the problem correctly in finite time are termed as
Undecidable Problems.
 These problems may be partially decidable but they will never be
decidable.
 There will always be a condition that will lead the Turing Machine
into an infinite loop without providing an answer at all.
 We can understand Undecidable Problems intuitively by
considering Fermat’s Theorem, a popular Undecidable Problem
which states that no three positive integers a, b and c for any n>2
can ever satisfy the equation: a^n + b^n = c^n.
 If we feed this problem to a Turing machine to find such a solution
which gives a contradiction then a Turing Machine might run
forever, to find the suitable values of n, a, b and c.

08/20/21 WSU, Computer Science Department 16


 But we are always not sure whether a contradiction exists or not
and hence we term this problem as an Undecidable Problem.
Example: Is it possible to convert a given ambiguous CFG into
corresponding non-ambiguous CFL?
 It is also an Undecidable Problem as there doesn’t exist any
algorithm for the conversion of an ambiguous CFL to non-
ambiguous CFL.
Another examples of undecidable problems
 Membership problem of a Turing Machine?
 Finiteness of a Turing Machine?
 Emptiness of a Turing Machine?

08/20/21 WSU, Computer Science Department 17


We will prove that two particular problems
are unsolvable:

Membership problem

Halting problem

08/20/21 WSU, Computer Science Department 18


Membership Problem
Input: •Turing Machine M
•String w

Question: Does M accept w ?


w L(M ) ?

Corresponding language:
ATM  { M ,w : M is a Turing machine that
accepts string w }
08/20/21 WSU, Computer Science Department 19
Theorem: ATM is undecidable
(The membership problem is unsolvable)

Proof:
Basic idea:
We will assume that ATM is decidable;
We will then prove that every decidable language
is Turing-Acceptable

A contradiction!
08/20/21 WSU, Computer Science Department 20
Suppose that ATM is decidable

Input
string Decider
M ,w for ATM
M YES M accepts w
H
w NO M rejects w

08/20/21 WSU, Computer Science Department 21


LetL be a Turing recognizable language

Let ML be the Turing Machine that accepts L

We will prove thatL is also decidable:

we will build a decider for L

08/20/21 WSU, Computer Science Department 22


String description of ML

Decider for L

ML Decider for ATM


YES accept s
ML accepts s ? (and halt)

s NO reject s
Input (and halt)
string

08/20/21 WSU, Computer Science Department 23


Therefore, L is decidable

Since L is chosen arbitrarily, every Turing-


Acceptable language is decidable

But there is a Turing-Acceptable language


which is undecidable

Contradiction!!!!

08/20/21 WSU, Computer Science Department 24


Halting Problem
Input: •Turing Machine M
•String w

Question: Does M halt while


processing input string w ?

Corresponding language:

HALTTM  { M ,w : M is a Turing machine that


halts on input string w }
08/20/21 WSU, Computer Science Department 25
Theorem: HALTTM is undecidable
(The halting problem is unsolvable)

Proof:
Basic idea:
Suppose that HALTTM is decidable;
we will prove that every decidable
language is also Turing-Acceptable

A contradiction!
08/20/21 WSU, Computer Science Department 26
Suppose that HALTTM is decidable

Input
string
M ,w
halts on
M YES M w
Decider for input

w HALTTM
NO doesn’t halt
M on inputw
08/20/21 WSU, Computer Science Department 27
Let L be a Turing-Acceptable language
Let ML be the Turing Machine that accepts L

We will prove that L is also decidable:

By building a decider for L

08/20/21 WSU, Computer Science Department 28


Decider for L
Decider for
HALTTM
ML
NO reject s
ML halts on s ? and halt
s YES

Input
accept s
ML halts
string and accepts
Run ML and halt

with input s
reject s
ML halts
and rejects
and halt

08/20/21 WSU, Computer Science Department 29


Therefore, L is decidable

Since L is chosen arbitrarily, every Turing-


Acceptable language is decidable

But there is a Turing-Acceptable language


which is undecidable

Contradiction!!!!

08/20/21 WSU, Computer Science Department 30


Semi- Decidable Problems
 A semi-decidable problem is subset of undecidable problems for
which Turing machine will always halt in finite amount of time
for answer as ‘yes’ and may or may not halt for answer as ‘no’.
 Such problems are termed as Turing Recognizable problems.
 Example: We will now consider few important semi Decidable
problems:
 Are two regular languages L and M equivalent?
 We can easily check this by using Set Difference operation.
L-M =Null and M-L =Null.
Hence (L-M) U (M-L) = Null, then L,M are equivalent.
 Emptiness of a Context Free Language
 By checking the production rules of the CFL we can easily state
whether the language generates any strings or not.

08/20/21 WSU, Computer Science Department 31


Cont..

08/20/21 WSU, Computer Science Department 32


The End

08/20/21 WSU, Computer Science Department 33

You might also like