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?
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.
Let A be DFA a with n states.
If there is a word w with length k ≥ n accepted by A , then the language accepted by A is infinite. Observe, that such word w has the form w = x s y , where s is nonempty and the word x s μ y is accepted by A , for all μ ∈ N 0 . In other words: there exists a loop in A . Clearly the length of such loop, is smaller or equal n .
If there is a word w witch length k ≥ 2 n accepted by A , there there exists a word w ′ accepted by A with length k ′ < 2 n . Note that the word w has the form w = x s μ y , for some μ ∈ N 0 , with 0 < ∣ s ∣ ≤ n and such that the word x s ν y is accepted by A for every ν ∈ N 0 (intuition: the subword x is used to each the loop mentioned above, the word s ν passes the loop, and y is used to reach the accepting state). Let w ′ = x y . Since ∣ w ∣ = ∣ x s μ y ∣ ≤ 2 n and 0 < ∣ s ∣ ≤ n , then ∣ w ′ ∣ < 2 n .
Using the facts above, we conclude, that if there exists a word w , such that n ≤ ∣ w ∣ < 2 n accepted by A , then A accepts a infinite language. In order to determine, if a given DFA with n states accepts or does not accept a infinite language, we need to check all words with length between n and 2 n − 1 . In case if n = 2 3 , we need to investigate the words not longer than 2 ⋅ 2 3 − 1 = 4 5 .