Question
Let and be finite alphabets and let # be a symbol outside both and . Let be a total function from to . We say is computable if there exists a Turing machine which given an input in , always halts with on its tape. Let denote the language . Which of the following statements is true:
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 be a total function, and let .
Direction 1: If is computable, then is recursive (decidable).
Because is a computable total function, there exists a Turing machine that always halts and writes for any input .
To decide whether a string belongs to :
- Check if matches the format where and . If not, reject.
- Run on input . Since is total, always halts with .
- Compare with . If , accept; otherwise, reject.
Because always halts, this decision procedure always halts. Thus, is recursive.
Direction 2: If is recursive, then is computable.
Suppose is recursive with decider . To compute on input :
- Enumerate all strings in standard lexicographic order:
- For each string , run on .
- Because is a total function, there exists exactly one string . When accepts , output and halt.
Because a unique match is guaranteed to exist and testing each candidate halts, this algorithm always halts and produces . Thus, is computable.
Therefore, is computable if and only if is recursive.
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.