Question

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 xx in A∗A^*, always halts with f(x)f(x) on its tape. Let LfL_f denote the language {x#f(x)∣x∈A∗}\{x \# f(x) \mid x \in A^*\}. Which of the following statements is true:

Choose one option
Official answer and solution
Official answer
A
From
Official GATE 2017 answer key

Solution

Examine the equivalence between computable total functions and the recursive decidability of their graph languages.

Let f:A∗→B∗f: A^* \to B^* be a total function, and let Lf={x#f(x)∣x∈A∗}L_f = \{x \# f(x) \mid x \in A^*\}.

Direction 1: If ff is computable, then LfL_f is recursive (decidable).
Because ff is a computable total function, there exists a Turing machine MfM_f that always halts and writes f(x)f(x) for any input x∈A∗x \in A^*.
To decide whether a string ww belongs to LfL_f:

  1. Check if ww matches the format x#yx \# y where x∈A∗x \in A^* and y∈B∗y \in B^*. If not, reject.
  2. Run MfM_f on input xx. Since ff is total, MfM_f always halts with f(x)f(x).
  3. Compare yy with f(x)f(x). If y=f(x)y = f(x), accept; otherwise, reject.
    Because MfM_f always halts, this decision procedure always halts. Thus, LfL_f is recursive.

Direction 2: If LfL_f is recursive, then ff is computable.
Suppose LfL_f is recursive with decider MdecM_{\text{dec}}. To compute f(x)f(x) on input xx:

  1. Enumerate all strings y∈B∗y \in B^* in standard lexicographic order: y1,y2,y3,…y_1, y_2, y_3, \dots
  2. For each string yiy_i, run MdecM_{\text{dec}} on x#yix \# y_i.
  3. Because ff is a total function, there exists exactly one string y=f(x)y = f(x). When MdecM_{\text{dec}} accepts x#yix \# y_i, output yiy_i and halt.
    Because a unique match is guaranteed to exist and testing each candidate halts, this algorithm always halts and produces f(x)f(x). Thus, ff is computable.

Therefore, ff is computable if and only if LfL_f is recursive.

Final answer

A

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2017 Computer Science and Information Technology (CS) Session 1
Question
39 of 65, printed as CS Q.39
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.