Regular Languages - Infiniteness Problem

A Deterministic Finite Automaton is given to you in the form of a black box, i.e, you are only allowed to enter strings and check if it accepts but not allowed to examine the internal workings of the automaton.

If you're given that the automaton has 23 states, what is the length of the largest string you need to test before you can be sure that the Regular Language accepted by the automaton is finite?


The answer is 45.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Piotr Idzik
May 12, 2020

Let A \mathcal{A} be DFA a with n n states.

  • If there is a word w w with length k n k \geq n accepted by A \mathcal{A} , then the language accepted by A \mathcal{A} is infinite. Observe, that such word w w has the form w = x s y w = xsy , where s s is nonempty and the word x s μ y xs^\mu y is accepted by A \mathcal{A} , for all μ N 0 \mu \in \N_0 . In other words: there exists a loop in A \mathcal{A} . Clearly the length of such loop, is smaller or equal n n .

  • If there is a word w w witch length k 2 n k \geq 2n accepted by A \mathcal{A} , there there exists a word w w^\prime accepted by A \mathcal{A} with length k < 2 n k^\prime < 2n . Note that the word w w has the form w = x s μ y w = xs^\mu y , for some μ N 0 \mu \in \N_0 , with 0 < s n 0 < |s| \leq n and such that the word x s ν y x s^\nu y is accepted by A \mathcal{A} for every ν N 0 \nu \in \N_0 (intuition: the subword x x is used to each the loop mentioned above, the word s ν s^\nu passes the loop, and y y is used to reach the accepting state). Let w = x y w^\prime = xy . Since w = x s μ y 2 n |w| = |xs^\mu y| \leq 2n and 0 < s n 0 < |s| \leq n , then w < 2 n |w^\prime| < 2n .

Using the facts above, we conclude, that if there exists a word w w , such that n w < 2 n n \leq |w| < 2n accepted by A \mathcal{A} , then A \mathcal{A} accepts a infinite language. In order to determine, if a given DFA with n n states accepts or does not accept a infinite language, we need to check all words with length between n n and 2 n 1 2n-1 . In case if n = 23 n = 23 , we need to investigate the words not longer than 2 23 1 = 45 2\cdot 23-1 = 45 .

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...