GATE Computer ScienceVery hardGATE CS (PYQ pattern)
Which of the following unary languages is NOT regular?
- A. { a^(k²) : k ≥ 0 }* (Kleene star of the perfect-square lengths)
- B. { aⁿ : n is a composite number }
- C. { a^(3i + 5j) : i, j ≥ 0 }
- D. { aⁿ : the decimal digits of n add up to a multiple of 3 }
Correct answer: B. { aⁿ : n is a composite number }
(squares)* contains a¹, hence equals a*: regular. 3i + 5j produces 0, 3, 5, 6 and every n ≥ 8, an eventually periodic set: regular. The digit sum of n is ≡ n (mod 3), so that language is { aⁿ : 3 | n }: regular. If the composites were regular, so would be a*a* ∖ composites ∩ aa a* = the primes, which are not regular.
More Theory of Computation questions
- Which one of the following statements is FALSE?
- Which regular expression denotes exactly the set of strings over {a, b} with an EVEN number of a's (zero included)?
- A DFA has 8 states. To decide whether the language it accepts is infinite, it suffices to check whether it accepts some string whose…
- Which of the following statements are correct? I. The reversal of a deterministic context-free language is always deterministic…
- Which of the following statements are correct? I. Recursively enumerable languages are closed under union and intersection. II…
- L₁ and L₂ are context-free languages. Which statement about L₁ ∩ L₂ is always correct?