Skip to content
Official PYQ · 2004

GATE CS 2004 Q89 — Undecidability

Explain with AI

L1L_1 is a recursively enumerable language over Σ\Sigma. An algorithm AA effectively enumerates its words as ω1,ω2,ω3,… .\omega_1, \omega_2, \omega_3, \dots . Define another language L2L_2 over Σ∪{#}\Sigma \cup \left\{\text{\#}\right\} as {wi#wj∣wi,wj∈L1,i<j}\left\{w_i \text{\#} w_j \mid w_i, w_j \in L_1, i < j \right\}. Here # is new symbol. Consider the following assertions.

  • S1:L1S_1:L_1 is recursive implies L2L_2 is recursive
  • S2:L2S_2:L_2 is recursive implies L1L_1 is recursive

Which of the following statements is true?

Choose one option
View worked solution

Answer: A

To determine the truth value of the assertions, we analyze both directions:

Assertion S1S_1: L1L_1 is recursive   ⟹  L2\implies L_2 is recursive

To decide if a string z∈L2z \in L_2:

  1. Verify if zz is of the form x#yx \# y where x,y∈Σ∗x, y \in \Sigma^*. If not, reject.
  2. Since L1L_1 is recursive, decide if x∈L1x \in L_1 and y∈L1y \in L_1. If either is not, reject.
  3. Since both x,y∈L1x, y \in L_1, run the enumerator AA until both xx and yy are printed. This is guaranteed to terminate in finite time.
  4. If xx is printed before yy (i.e., i<ji < j), accept; otherwise, reject.

Since this procedure always halts and gives the correct answer, L2L_2 is recursive. Thus, S1S_1 is true.

Assertion S2S_2: L2L_2 is recursive   ⟹  L1\implies L_1 is recursive

If L1L_1 is empty or contains only one string, it is finite and trivially recursive. Otherwise, we can run the enumerator AA to find the first generated string, say w1w_1. To decide if any string x∈Σ∗x \in \Sigma^* is in L1L_1:

  1. If x=w1x = w_1, accept.
  2. Otherwise, query the decider of L2L_2 with the string w1#xw_1 \# x.
  3. If w1#x∈L2w_1 \# x \in L_2, then x∈L1x \in L_1 (accept). If w1#x∉L2w_1 \# x \notin L_2, then x∉L1x \notin L_1 (reject), because if xx were in L1L_1 (and x≠w1x \neq w_1), its index jj would be >1> 1, which would force w1#x∈L2w_1 \# x \in L_2.

Thus, L1L_1 is recursive. So, S2S_2 is true.

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

Published
Report a correction
Keep exploringMore Undecidability questions