Skip to content
Official PYQ · 2017

GATE CS 2017 Set 1 Q39 — Undecidability

Explain with AI

Let AA and BB be finite alphabets and let #\# be a symbol outside both AA and BB. Let ff be a total function from A∗A^{*} to B∗B^{*}. We say ff is computable if there exists a Turing machine MM which given an input x∈A∗x \in A^{*}, always halts with f(x)f(x) on its tape. Let LfL_{f} denote the language {x#f(x)∣x∈A∗}\Bigl \{x\# f(x) \mid x\in A^{*} \Bigr \}. Which of the following statements is true:

Choose one option
View worked solution

Answer: A

To determine the correct statement, we need to analyze the relationship between the computability of the total function f:A∗→B∗f: A^* \to B^* and the decidability (recursiveness) of the language Lf={x#f(x)∣x∈A∗}L_f = \{x \# f(x) \mid x \in A^*\}.

1. If ff is computable, then LfL_f is recursive (decidable)

If ff is computable, there exists a Turing machine MfM_f that, when given any input x∈A∗x \in A^*, always halts with f(x)f(x) on its tape.

We can construct a decider MM for LfL_f as follows:

  1. Given an input string ww, first check if it is of the form x#yx \# y where x∈A∗x \in A^* and y∈B∗y \in B^*. If not, reject.
  2. Run MfM_f on xx to compute f(x)f(x). Since ff is a total computable function, MfM_f is guaranteed to halt and produce f(x)f(x).
  3. Compare the computed f(x)f(x) with yy.
  4. If they are identical, accept; otherwise, reject.

Since MfM_f always halts, the decider MM always halts and correctly decides LfL_f. Thus, LfL_f is recursive.

2. If LfL_f is recursive, then ff is computable

If LfL_f is recursive, there exists a Turing machine (decider) MLM_L that halts on all inputs and decides LfL_f.

We can construct a Turing machine MfM_f to compute f(x)f(x) for any input x∈A∗x \in A^* as follows:

  1. Given input xx, systematically generate all strings y∈B∗y \in B^* in lexicographical order (y1,y2,y3,…y_1, y_2, y_3, \dots).
  2. For each generated string yiy_i, run the decider MLM_L on the input x#yix \# y_i.
  3. Since MLM_L is a decider, it always halts and returns either accept or reject.
  4. Because ff is a total function, there is exactly one unique string y∈B∗y \in B^* such that y=f(x)y = f(x). Thus, MLM_L is guaranteed to accept x#yix \# y_i for exactly one yiy_i.
  5. As soon as MLM_L accepts x#yix \# y_i, halt the process and output yiy_i on the tape.

Since the correct yiy_i is guaranteed to be found in finite steps, MfM_f always halts and correctly computes f(x)f(x). Thus, ff is computable.

Conclusion

Since both directions hold, ff is computable if and only if LfL_f is recursive.

Therefore, the correct option is A.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Undecidability questions