Title: Tutorial 11 CSC3130 : Formal Languages and Automata Theory
1Tutorial 11-- CSC3130 Formal Languages and
Automata Theory
- Tu Shikui (sktu_at_cse.cuhk.edu.hk)
- SHB 905, Office hour Thursday 230pm-330pm
- 2008-11-16
2Outline
- Examples for
- Decidable
- Undecidable but Recognizable
- Unrecognizable
3The difference -- between Recognizable and
decidable
- If L is decidable, then L is recognized by a TM M
that halts on all inputs. Note that, L might be
recognized by other TM M that does not always
halt. - If L is recognizable, then there might be such TM
M that recognizes L but run forever, rather than
rejecting, some inputs not in L. - Simply, Decidable ---- always halt
- Recognizable ---- halt or loop
4Example 1 -- Is it decidable?
L(A)
L(B)
The shaded area
Proof Decidable.
Construct a TM M as follows
5Example 2 -- Is it decidable?
The answer NOT decidable. The difficulty How
to prove a language to be not decidable?
The target problem is embedded.
A decider of target problem
Construct Mw
accept
reject
w
6Example 2 -- Is it decidable? ? NO.
Proof (reduce it to Halting problem.)
Accept, if L(M) finite
D
Suppose we have a TM D such that
Reject, if L(M) NOT finite
Then, we should consider
HALTTM (, w) M is a TM that halts on input
w
D
Construct Mw
Accept, if M halts
Reject, if M does not halt
w
7How to construct Mw ?
Our Target
Construction
On any input string s
Simulate M on w
If M halts,
accept s,
else
reject s,
end
8Example 2 -- Is it decidable? ? NO.
halts on
if and only if
HALTTM (, w) M is a TM that halts on input
w
is infinite
D
Construct Mw
reject
Accept, if M halts
accept
Reject, if M does not halt
w
9Example 3 -- Is it decidable?
Proof (reduce it to Halting problem.)
Accept, if
D
Suppose we have a TM D such that
Reject, if NOT
Then, we should consider
HALTTM (, w) M is a TM that halts on input
w
D
Construct Mw
Accept, if M halts
Reject, if M does not halt
w
10How to construct Mw ?
Our Target
Construction
halts on
On any input string s
Simulate M on w
if and only if
If M halts,
accept if sa or sb
else
reject s,
end
Contains two equal length strings
11Example 4 -- Is it decidable?
Proof
Suppose we have a TM D such that
Accept, if
D
Reject, if NOT
ATM (, w) M is a TM that accepts w
D
Construct Mw
Accept, if M accept w
Reject, if not
w
12End of this tutorial!Thanks for coming!