GateAI
Turing Machines and Undecidability

GATE CSE 2017 Set 1 · Q39

MCQ2 marksMedium

Time

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:

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: A) f is computable if and only if Lf is recursive.

Turing Machines and Undecidability

We analyze the equivalence between ff being computable and LfL_f being recursive (decidable):

  1. If ff is computable   ⟹  Lf\implies L_f is recursive:

    • Given an input string ww, a Turing machine first verifies if ww is of the form x#yx \# y where x∈A∗x \in A^* and y∈B∗y \in B^*. If not, it rejects.

    • Since ff is a total computable function, the machine can compute f(x)f(x) on a separate track/tape, which is guaranteed to halt.

    • It then compares $f(x)$ with $y$. If they are identical, it accepts; otherwise, it rejects.

    • Since this procedure halts on all inputs, LfL_f is decidable (recursive).

  2. If LfL_f is recursive   ⟹  f\implies f is computable:

    • Given an input x∈A∗x \in A^*, we can compute f(x)f(x) by enumerating all strings y∈B∗y \in B^* in standard canonical/lexicographical order: y1,y2,y3,…y_1, y_2, y_3, \dots.

    • For each candidate yiy_i, we run the decider for LfL_f on x#yix \# y_i.

    • Because ff is a total function, there exists exactly one string y=f(x)y = f(x), and the decider will accept in finite time for that yy.

    • The machine then outputs this yy and halts. Thus, ff is computable.

Hence, ff is computable if and only if LfL_f is recursive, which corresponds to option (A).

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Turing Machines and Undecidability previous year question is Q39 of the GATE CSE 2017 Set 1 paper. Find more GATE CSE PYQs on Turing Machines and Undecidability in Theory of Computation, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Turing Machines and Undecidability PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Turing Machines and Undecidability in GATE CSE

Turing Machines and Undecidability has 30 GATE CSE PYQs across 20 papers from 2012 to 2026. 13 of them are 2-mark MCQs like this one, and it is the only one in GATE CSE 2017 Set 1.

How GATE tests Turing Machines and Undecidability

More from GATE CSE 2017 Set 1

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2017 Set 1 · Q39 · MCQ

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

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.