• edited by
19,508 views
66 66 votes

Consider the following problem $X$.

Given a Turing machine $M$ over the input alphabet $\Sigma$, any state $q$ of $M$ and a word $w \in \Sigma^*$, does the computation of $M$ on $w$ visit the state of $q$?

Which of the following statements about $X$ is correct?

  1. $X$ is decidable
  2. $X$ is undecidable but partially decidable
  3. $X$ is undecidable and not even  partially decidable
  4. $X$ is not a decision problem

3 Answers

Best answer
106 106 votes
$X$ is undecidable but partially decidable.

We have the TM $M$. Just make the state $q$ the final state and make all other final states non-final and get a new TM $M'$. Give input $w$ to $M'$. If $w$ would have taken $M$ to state $q$ (yes case of the problem), our new TM $M'$ would accept it. So, the given problem is partially decidable.

If $M$ goes for an infinite loop and never reaches state $q$ (no case for the problem), $M'$ cannot output anything. This problem is the state entry problem, which like word accepting problem and halting problem is undecidable.
• edited by
3 3 votes

Given a Turing machine $ M $ over input alphabet $ \Sigma $, a state $ q $ of $ M $, and a word $ w \in \Sigma^* $, does the computation of $ M $ on input $ w $ ever visit state $ q $?

First, observe that $ X $ is a decision problem: for every triple $ \langle M, q, w \rangle $, the answer is either yes (state $ q $ is visited during the computation of $ M $ on $ w $) or no (it is never visited). Hence, the claim that $ X $ is not a decision problem is incorrect.Next, consider whether $ X $ is decidable.

Suppose we try to construct a decider for $ X $. We can simulate $ M $ on input $ w $ step by step, keeping track of the current state. If at any point the current state equals $ q $, we accept. However, if $ M $ never enters $ q $ for example, if it loops forever in other states or halts without ever reaching $ q $—our simulation may run forever without halting. In the case where $ q $ is never visited and $ M $ does not halt, our procedure will not terminate. Therefore, we cannot guarantee halting on all inputs.

This shows that while we can recognize all yes-instances (by simulation), we cannot always recognize no-instances. Thus, $ X $ is not decidable. But as it halts for member its Recognizable ( semi decidable ) but not Recursive (decidable)

Method 2

Reduce the Halting Problem to $ X $.

Recall that the Halting Problem is:
$$
H_{\text{TM}} = \{ \langle M, w \rangle \mid M \text{ halts on input } w \}.
$$
$ H_{\text{TM}} $ is known to be undecidable.

Given an instance $ \langle M, w \rangle $ of the halting problem, construct a new Turing machine $ M' $ that behaves as follows on input $ w $:

  1. Simulate $ M $ on $ w $.
  2. If $ M $ halts, enter a distinguished new state $ q_{\text{halt}} $ and then halt.

Note that $ M' $ visits state $ q_{\text{halt}} $ during its computation on $ w $ if and only if $ M $ halts on $ w $.

Now, consider the instance $ \langle M', q_{\text{halt}}, w \rangle $ of problem $ X $. Then:
$$
\langle M, w \rangle \in H_{\text{TM}} \iff \langle M', q_{\text{halt}}, w \rangle \in X.
$$

Thus, a decider for $ X $ would yield a decider for $ H_{\text{TM}} $, contradicting the undecidability of the halting problem. Therefore, $ X $ is undecidable.

However, $ X $ is partially decidable (also called semi-decidable or recursively enumerable). As described earlier, we can simulate $ M $ on $ w $ and accept as soon as state $ q $ is entered. If the answer is yes, this procedure halts and accepts; if the answer is no, it may run forever. This satisfies the definition of a recursively enumerable language.

Hence, $ X $ belongs to the class of undecidable but partially decidable problems.


$$
\color{lime} \boxed{\text{B}}
$$

0 0 votes
Here we can say YES means halts if it visits state q but we cannot say NO it cannot halt because it may halt after some it could be 1000 years (if it stuck in inifinte loop) so this problem is Undecidable but partially decidable.

If we can say yes or no both then Decidable

If we can say only yes both then UnDecidable but partially decidable(Semidecidable). (RE but not REC)

If we not able to say yes or no both then UnDecidable (Not RE)
Answer:
Position:
Show:

Related questions

39 39 votes
3 answers 3 answers
9.1k
9.1k views
Kathleen asked Sep 14, 2014
9,062 views
Let a decision problem $X$ be defined as follows:$X$: Given a Turing machine $M$ over $\Sigma$ and any word $w \in \Sigma$, does $M$ loop forever on $w$?You may assume th...
31 31 votes
6 answers 6 answers
14.2k
14.2k views
Kathleen asked Sep 14, 2014
14,186 views
Consider the following languages:$L1=\left\{ww \mid w \in \{a,b\}^*\right\}$$L2=\left\{ww^R \mid w \in \{a,b\}^*, w^R \text{ is the reverse of w} \right\}$$L3=\left\{0^{2...
26 26 votes
2 answers 2 answers
7.7k
7.7k views
Kathleen asked Sep 14, 2014
7,734 views
Give a deterministic PDA for the language $L=\{a^ncb^{2n} \mid n \geq 1\}$ over the alphabet $\Sigma = \{a,b,c\}$. Specify the acceptance state.
47 47 votes
2 answers 2 answers
8.9k
8.9k views
Kathleen asked Sep 14, 2014
8,873 views
Construct DFA's for the following languages:$L=\left\{w \mid w \in \{a,b\}^*, \text{ w has baab as a substring } \right\}$$L=\left\{w \mid w \in \{a,b\}^*, \text{ w has ...