GATE / CS ARCHIVE

GATE CSE 2018 / QUESTION 52

Order of a unary language

Theory of Computation · Finite Automata · Full GATE CSE 2018 paper

GATE 2018, Q52 2 marks · NAT
Report issue

Finite Automata

Question 52, GATE 2018: Define L^0={ε}, L^(i+1)=L^iL; order is least k with L^k=L^(k+1). The unary DFA has accepting start q0, accepting q1, rejecting q2, and transitions q0−0→q1, q1−0→q2, q2−0→q1. Find order of its language.
Tap to enlarge
Answer & solution

Official answer: 2

Method

A path of length 0 accepts, and positive path lengths accept exactly when odd. Concatenation over a unary alphabet adds lengths. Every positive even length 2m can be decomposed as 1+(2m−1), both positive odd, so two language factors suffice for every even length as well. Zero and odd lengths use ε in one factor. To prove the least order, explicitly exclude k=0 and k=1: length 1 distinguishes L0 from L, and length 2 distinguishes L from L².

Solution

The start state is accepting. After one 0 the automaton enters an accepting state alternating with a nonaccepting state, so L1 contains epsilon and precisely the positive odd-length unary words. L1 squared contains every unary word: odd lengths use one odd word and epsilon, while any positive even length is the sum of two positive odd lengths. Hence L1²=0* and L1³=0*. But L10 differs from L1, and L1 differs from L1² because length 2 is absent from L1. The smallest equality index is therefore 2.

Original paper, page 21 · Answer key