The GATE Grind

GATE 2018 CS – Question 62

Theory of Computation · Regular Expressions and Finite Automata · 2 marks · Numerical answer

Given a language $L$, define $L^i$ as follows: $L^0=\{\varepsilon\}$ and $L^i=L^{i-1}\cdot L$ for all $i>0$. The order of a language $L$ is defined as the smallest $k$ such that $L^k=L^{k+1}$.

Consider the language $L_1$ (over alphabet 0) accepted by the automaton in the figure.

The order of $L_1$ is ________.

Diagram for GATE 2018 CS question 62

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: 2

Explanation

The automaton accepts $ arepsilon$ and all odd powers: $L_1={ arepsilon}cup{0^{2k+1}}$. Then $L_1^2$ contains every $0^n$ (for example $00=0cdot0$), and so does $L_1^3$, but $L_1
e L_1^2$ because $00
otin L_1$. So the order is 2.