IAE Academy

GATE 2018 CS Q.52: solution and answer

GATE 2018 · CSQ.52 · 2 marks · NAT

Given a language , define as follows:


The order of a language is defined as the smallest such that . Consider the language (over alphabet 0) accepted by the following automaton. The order of is ______.

GATE 2018 CS question 52: State diagram with three states in a row.Tap to open full size
Figure from the GATE 2018 CS paper. It is part of the question.
Figure description

State diagram with three states in a row. The first state (call it q0) has an incoming start arrow and is a double circle (accepting). The second state (q1) is also a double circle (accepting). The third state (q2) is a single circle (non-accepting). Transitions: q0 --0--> q1 (arrow from first to second labelled 0); q1 --0--> q2 (upper curved arrow from second to third labelled 0); q2 --0--> q1 (lower curved arrow from third back to second labelled 0). No other transitions.

Answer and solution

ANSWER

The order of is 2.

Official answer: 2Source: Official answer key, GATE 2018 CS (IIT Guwahati)

  1. Name the states: is the start state and is accepting, is accepting, is non-accepting. The transitions are , and .

  2. Track the state after zeros. gives , gives , gives , gives , and from then on the state alternates . So is reached exactly after an odd number of zeros.

  3. Accepted strings are (in ) and for odd . Hence .

  4. and , which contains . So . Also , so will differ from if , which is checked next.

  5. . Odd length followed by odd length gives every even length . Concatenating with ( odd) gives the odd lengths, and gives length 0. So , which contains , and so .

  6. . Every string of this set is a power of 0, so . Since , every is . So .

  7. , and , so the smallest with is .

KEY IDEA

Find the language of the automaton, then compute successive powers. Because , the powers grow (), and once a power equals it cannot change.

WATCH OUT FOR

Forgetting that the start state is accepting, so . Without it would miss the odd lengths and the powers would not stabilise at .

From the GATE 2018 CS paper. Every question of this paper · Download the full paper · All 18 Finite automata questions, with notes

More Finite automata questions