# Why does a simple marking algorithm not work for deciding ETM, the set containing all TMs whose language is the empty set? [duplicate]

ETM = {|M is a TM and L(M) is the empty set} is not decidable.

This is typically shown by a reduction from HALT. I can kind of comprehend the proof, but intuitvely I still find it very strange that ETM is undecidable.

For example, why wouldn't the following algorithm not work?

1) Mark all states that can be reached starting at the starting state

2) If no final state was marked: return True

3) else: return False

A TM has a finite number of states, so this algorithm should always halt. Why doesn't it decide ETM?

• Because reachability itself, the first paragraph, may fail if it encounters infinite loop. – Evil Sep 16 '17 at 23:27
• You haven't really described the algorithm. Once you describe the algorithm, we will be able to tell you whether it sometimes gives the wrong answer, or whether it sometimes never halts. At least one of the two must be the case. – Yuval Filmus Sep 17 '17 at 7:27
• @Evil Yes thanks, that answer my question. I searched for quite some time, looks like I somehow overlooked that thread – mango-dango Sep 17 '17 at 7:32