Analyzing Language $L_1$
$L_1=\{\langle M\rangle \mid M$ is a Turing Machine with an even number of states $\}$
This language asks about a property of the Turing Machine's description or encoding ( $\langle M\rangle$ ), not the language it accepts ( $L(M)$ ).
- Property: Does the TM's description list an even number of states?
- Decidability: This is a syntactic property. We can build a simple algorithm (another Turing Machine, let's call it $D$ ) that does the following:
1. Takes the encoding $\langle M\rangle$ as input.
2. Parses the encoding to find the section that defines the states.
3. Counts the number of states.
4. Checks if the count is even. If yes, it accepts. If no, it rejects.
- This algorithm is guaranteed to halt for any given TM encoding. Therefore, $L_1$ is decidable.
Analyzing Language $L_2$
$L_2=\{\langle M\rangle \mid M$ is a Turing Machine and the language $L(M)$ is finite $\}$
This language asks about a property of the language accepted by the TM, which is a semantic property. We can use Rice's Theorem to analyze this,
Rice's Theorem states that any non-trivial property of the language of a Turing machine is undecidable.
To apply the theorem, we need to check two conditions for the property "the language is finite":
1. Is the property non-trivial? A property is non-trivial if there is at least one Turing machine that has the property and at least one that does not.
- Yes, some TMs have the property: A TM that accepts only the string "01" has a finite language ( $L=\{01\}$ ).
- Yes, some TMs do not have the property: A TM that accepts all strings over $\{0,1\}^*$ has an infinite language. Since the property is non-trivial, Rice's Theorem applies.
2. Is it a property of the language? Yes, "finiteness" describes the set of strings accepted, not the structure of the TM itself.
Since both conditions are met, Rice's Theorem tells us that $L_2$ is undecidable.