Some decision properties of Regular Languages
Print this page
First   |   Last   |   Prev   |   Next

This theorem gives us the following naive algorithm to determine the emptiness and finiteness of a language L(M) accepted by a DFA M .

Algorithm to decide emptiness

  • Run M on all strings of length less than n , where n is the number of states.
  • If M accepts any of these, than L(M) is nonempty. Otherwise, L(M) is empty. (From part (1) of the theorem).

But the algorithm is highly inefficient, since the DFA M may have to check all the strings of length less than n and there are strings of such length.

Algorithm to decide finiteness of L(M) .

  • Run M on all strings of length between n and 2n
If M accepts any string of these, then L(M) is infinite. Otherwise, L(M) is finite.(From part (2) of the theorem)
First   |   Last   |   Prev   |   Next