You are on page 1of 3

LECTURE 26: 6/2 Unsolvable Problems Part II

Unsolvable Problems
 Outside even recognizable languages = Finding Non-RE Languages
 Let’s jump right into proving that there exists a language that is not recognizable
 Opening thought question: let’s list off all TMs and look at how they behave when
they are fed other TM codes (as strings) as input
o Expand the definition of code and TMs beyond the understanding that only
some machines take TMs as input. The alphabet of a TM isn’t that important
since we can always convert to other alphabets (eg: binary code). Bottom
line, just accept that every TM that exists can in
some sense take other TM source code as input.
 Start mechanically listing down TMs starting with all
possible single lines of code, then 2 lines, etc… --- infinite
list. Then observe what the behavior would be when fed
other TMs (accept vs no).
o Here’s an example of how this table could look…
o Check in question: What is L(M0)?
 {⟨M0⟩, ⟨M3⟩, ⟨M4⟩, ... }
o L(M1) and L(M2) are potentially Σ* if pattern continues
o Aside: even if M1 and M2 accept every TM code, doesn’t necessarily mean
their language is Σ* if there are strings that they also accept but that are not
the code of TMs. We don’t need to worry about the existence of any of these
strings but could include union of {w | w is a string that isn’t a TM’s code and
M accepts w) in the language of M.
o Pollev: How many TMs don’t accept their own source
code? 2: M3 and M5
o Throwback to Cantor’s theorem: we’re going to take a
collection of the diagonal and flip – is there any TM that
can accept that language (set of acc and no for TMs).
o No possible TM can have the language in light blue at the
bottom! We cannot recognize this language; L = {⟨M⟩| M is
a TM and M ∉ L(M)}

Diagonalization Language
 The language we saw in proof above is called diagonalization language.
LD = {⟨M⟩| M is a TM and M ∉ L(M)}
 This is our first unrecognizable language (note: there’s actually an infinite number
of unrecognizable language)
 (Note 2: LD is a special name that we should recognize, just like A TM)

 Theorem: LD ∉ RE
 Proof:
By contradiction; assume that LD ∈ RE. Then there must be some recognizer R such
that L(R) = LD.
Let M be an arbitrary TM. Since L(R) = LD, we know that:
⟨M⟩ ∈ LD iff ⟨M⟩ ∈ L(R). -- (1)
From the definition of LD, we see that ⟨M⟩ ∈ LD iff ⟨M⟩ ∉ L(M).
Combining this with statement (1) tells us that
⟨M⟩ ∉ L(M) iff ⟨M⟩ ∈ L(R). -- (2)
Since our choice of M was arbitrary, we see that statement (2) holds for any TM M.
In particular, this means that statement (2) holds for the TM R, which tells us that
⟨R⟩ ∉ L(R) iff ⟨R⟩ ∈ L(R). -- (3)
This is clearly impossible. We have reached a contradiction, so our assumption must
have been wrong. Thus LD ∉ RE. ■
 This result can be formalized as Gödel’s incompleteness theorem

What This Means


 There are inherent limits about what
mathematics can teach us
 Side note for last pset: looking at big picture,
sometimes will be helpful to ask if we can
find a verifier for a given language to
determine whether it can be recognized
 Up to this point, we were questioning
whether we can solve this problem
(computability theory). Now we must consider whether the time/resources
required are practical even if we can solve (complexity theory).

Classifying Given Languages: Examples from PS9


 Σ*: Regular //can write a DFA/NFA/Regex for this!
 LD: Non-recognizable
 {an| n ∈ N}: Regular //DFA/NFA/Regex
 {an| n ∈ N and multiple of 137}: Regular //Regex: (a137)*
 {1m + 1n = 1m+n| m, n ∈ N}: CFL //can’t be regular because have to remember
how many seen
o How to be sure? Can you build an infinite distinguishing set = not regular.
Can you build a CFG? If so at least CFL (can also be regular!)
 {⟨M⟩| M is a TM and M is a recognizer for a language other than ∅}:
o Any time a language is code of TM, odds are it’s not decidable since ATM fits
this template. There are a few exceptions! But presumed RE unless proved
otherwise.
o This language here says M accepts at least one string. Could you design a TM
that asks a hypothetical decider for this and then does the opposite?
Bottom line: this is a pretty classic example of an undecidable language.
o So now between recognizable and unrecognizable – best way is to ask if you
could build a verifier for this? In this case – yes! Just give the string that it
accepts and give a step count. M with w for at most c steps – if accepts, true
else false == this is a verifier for this language!
Therefore final answer: RECOGNIZEABLE (RE)
 {⟨M⟩| M is a TM and M is a recognizer for ∅}:
o Can we build a verifier?
o Pollev: discussion of answers:
 String w and step count c: must always reject – problems with that,
can’t prove that string w is particularly rejected because it could be
the step count c at fault. Also, just because one string is rejected
doesn’t mean all are. Are we going to be able to provide a finite c that
explains behavior for every single string? (need to prove that M
rejects/infinite loops on an infinite # of strings)
 The language given itself is not empty, it’s the source code of any TM
whose language is empty!
 We can’t use this to prove that this language isn’t recognizable, but
since we aren’t able to think of a verifier for this, final answer: NOT
RECOGNIZEABLE

Decidable vs Recognizable
 {⟨M⟩|…} is generally assumed not decidable but not always.
 There’s a great theorem that formalizes that: Rice’s theorem: Any language that
consists of certain TMs but not others and claims to make any distinguishing based
on the language of the TM (i.e. distinguishes based on their language/ behavior) is
not decidable.
o However, if the claim about the behavior is true about every TM or no TM,
then this theorem does not apply
o Eg: L = {⟨M⟩| M is a TM and ε ∈ L(M) or ε ∉ L(M)}: initially looks like Rice’s
applies, but actually this is true for everything (ε always either in or out) ---
this language is not only decideable, but it’s actually regular!
o Similarly L = {⟨M⟩| M is a TM and ⟨M⟩ is odd} has nothing to do with L(M) so
Rice’s does not apply! (again regular language land)

You might also like