Skip to content
Official PYQ · 2018

GATE CS 2018 Q52 — Regular and Context-free Languages

Explain with AI

Given a language LL, define LiL^i as follows:L0={ε}L^0 = \{ \varepsilon \}Li=Li−1∙L for all I>0L^i = L^{i-1} \bullet L \text{ for all } I >0The order of a language LL is defined as the smallest kk such that Lk=Lk+1L^k = L^{k+1}. Consider the language L1(L_1 (over alphabet 0)0) accepted by the following automaton.

The order of L1L_1 is ________.

View worked solution

Answer: 2

The given automaton has three states: q0q_0 (start and final state), q1q_1 (non-final state), and q2q_2 (final state), with transitions forming a cycle of length 3: q0→0q1→0q2→0q0q_0 \xrightarrow{0} q_1 \xrightarrow{0} q_2 \xrightarrow{0} q_0.

Thus, the language L1L_1 consists of all strings 0n0^n where n≢1(mod3)n \not\equiv 1 \pmod 3:

L1={ε,02,03,05,06,08,09,… }L_1 = \{\varepsilon, 0^2, 0^3, 0^5, 0^6, 0^8, 0^9, \dots\}

Now, let us compute the powers of L1L_1:

  • L10L_1^0: {ε}\{\varepsilon\}
  • L11L_1^1: {ε,02,03,05,06,08,09,… }\{\varepsilon, 0^2, 0^3, 0^5, 0^6, 0^8, 0^9, \dots\}
  • L12=L1∙L1L_1^2 = L_1 \bullet L_1: Since ε∈L1\varepsilon \in L_1, we have L1⊆L12L_1 \subseteq L_1^2. The lengths of non-empty strings in L12L_1^2 are formed by the sum of any two lengths from L1L_1. Since 2∈L12 \in L_1 and 3∈L13 \in L_1, any integer n≥2n \ge 2 can be expressed as 2a+3b2a + 3b for non-negative integers a,ba, b. Thus, all lengths ≥2\ge 2 are present: L12={ε}∪{0n∣n≥2}L_1^2 = \{\varepsilon\} \cup \{0^n \mid n \ge 2\}
  • L13=L12∙L1L_1^3 = L_1^2 \bullet L_1: Since the minimum non-zero length in L1L_1 is 2, any non-zero string in L13L_1^3 must have length at least 2. Since ε∈L1\varepsilon \in L_1, we have L12⊆L13L_1^2 \subseteq L_1^3. Thus: L13={ε}∪{0n∣n≥2}L_1^3 = \{\varepsilon\} \cup \{0^n \mid n \ge 2\}

Since L12=L13L_1^2 = L_1^3, the smallest kk such that L1k=L1k+1L_1^k = L_1^{k+1} is 22.

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

Published
Report a correction
Keep exploringMore Regular and Context-free Languages questions