Dec Id Ability
Dec Id Ability
Corresponding language:
PRIMES {1, 2, 3, 5, 7, }
(Input string)
NO
Reject (Reject)
Corresponding Language: X
EMPTYDFA
{ M : M is a DFA that accepts empty language }
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 )
Corresponding Language: X
FINITE DFA
{ M : M is a DFA that accepts a finite language}
Decidable language
DFA M DFA M
infinite finite
Corresponding Language: X
ADFA
{ M ,w : M is a DFA that accepts string w }
Decidable language
On input string M ,w :
If M accepts w
Then accept M ,w (and halt)
Else reject M ,w (and halt)
Corresponding Language: X
EQUALDFA
{ M1 , M2 : M1 and M2 are DFAs that accept
the same languages }
Decidable language
On input M1 , M2 :
Let L1 be the language of DFA M1
Let L2 be the language of DFA M2
(combination of DFAs)
Fall 2003 Costas Busch - RPI 14
( L1 L2 ) ( L1 L2 )
L1 L2 and L1 L2
L1 L2 L L2 L1 L1
2
L1 L2 L2 L1
L1 L2
Fall 2003 Costas Busch - RPI 15
( L1 L2 ) ( L1 L2 )
L1 L2 or L1 L2
L1 L2 L2 L1
L1 L2 L2 L1
L1 L2
Fall 2003 Costas Busch - RPI 16
Therefore, we only need
to determine whether
L(M ) EMPTYDFA ?
Membership problem
Halting problem
Corresponding language:
ATM { M ,w : M is a Turing machine that
accepts string w }
Fall 2003 Costas Busch - RPI 22
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 also Turing recognizable
A contradiction!
Fall 2003 Costas Busch - RPI 23
Suppose that ATM is decidable
Input
string Decider
M ,w for ATM
M YES M accepts w
H
w NO M rejects w
Contradiction!!!!
END OF PROOF
Fall 2003 Costas Busch - RPI 27
We have shown:
Undecidable ATM
Decidable
Turing recognizable
ATM
Decidable
Run M on input w
M ,w If M accepts w
then accept M ,w
Corresponding language:
Proof:
Basic idea:
Suppose that HALTTM is decidable;
we will prove that
every decidable language
is also Turing recognizable
A contradiction!
Fall 2003 Costas Busch - RPI 32
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 input w
s ML halts on 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
Contradiction!!!!
END OF PROOF
Fall 2003 Costas Busch - RPI 36
An alternative proof
Proof:
Basic idea:
Assume for contradiction that
the halting problem is decidable;
Input
string Decider
M ,w for HALTTM
M YES M halts on w
H
w NO doesn’t
M w
halt on
Fall 2003 Costas Busch - RPI 38
Looking inside H
Decider for HALTTM
H q y YES
Input string:
M ,w q0 M halts on w?
qn NO
F
Copy M M, M
M
on tape
H
If M halts on input M
Then loop forever
Else halt
Fall 2003 Costas Busch - RPI 41
Run F with input itself
F
Copy F F ,F
F
on tape
H
If F halts on input F
Then F loops forever on input F
Else F halts on input F
CONTRADICTION!!!
END OF PROOF
Fall 2003 Costas Busch - RPI 42
We have shown:
Undecidable HALTTM
Decidable
Turing recognizable
HALTTM
Decidable
Run M on input w
M ,w If M halts on w
then accept M ,w