Consider the following languages: L₁ = { aⁿ | n > 0 } L₂ = { a²ⁿ | n ≥ 0 } L₃…
2020
Consider the following languages:
L₁ = { aⁿ | n > 0 }
L₂ = { a²ⁿ | n ≥ 0 }
L₃ = { ωω | ω ∈ {a, b}* }
Which of the languages is (are) regular?
- A.
L₁ and L₂ only
- B.
L₁ and L₃ only
- C.
L₁ only
- D.
L₂ only
Attempted by 26 students.
Show answer & explanation
Correct answer: A
L₁ = { aⁿ | n > 0 } is regular as it matches the regex aa*. L₂ = { a²ⁿ | n ≥ 0 } is regular as it matches (aa)*. L₃ = { ωω | ω ∈ {a, b}* } is non-regular because finite automata cannot match the first half of a string with the second half. Thus, L₁ and L₂ are regular.
A video solution is available for this question — log in and enroll to watch it.