Skip to content
Official PYQ · 2003

GATE CS 2003 Q15 — Undecidability

Explain with AI

If the strings of a language LL can be effectively enumerated in lexicographic (i.e., alphabetic) order, which of the following statements is true?

Choose one option
View worked solution

Answer: D

A language LL is recursive (decidable) if and only if its strings can be effectively enumerated in lexicographic (alphabetic) order.

1. Why is LL recursive?

To show that LL is recursive, we must design a Turing Machine (decider) that halts on all inputs and decides membership for any string ww:

  • If LL is finite, it is trivially recursive.
  • If LL is infinite, we can run the lexicographic enumerator for LL. Since the enumerator outputs strings in strictly increasing lexicographic order (first by length, then alphabetically):
    • If the enumerator outputs ww, we halt and accept.
    • If the enumerator outputs a string lexicographically larger than ww, we know ww will never appear. We halt and reject.

Since the enumerator is effective and the order is lexicographic, this decision procedure is guaranteed to terminate in finite steps for any string ww. Thus, LL is recursive.

2. Why is LL not necessarily context-free?

There are many recursive languages that are not context-free. For example, the language L={anbncn∣n≥0}L = \{a^n b^n c^n \mid n \ge 0\} is recursive and can be easily enumerated in lexicographic order, but it is a well-known non-context-free language.

Therefore, LL is recursive but not necessarily context-free.

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

Published
Report a correction
Keep exploringMore Undecidability questions