Pergunta

For Σ = {a,b,c,d,e,...,z}, consider the set L of words w such that the last symbol of w has not appeared before. For example, the words apple, google, k, and ε are in L, but the words potato, and nutrition are not in L. Suppose we want to construct a DFA for this language. How many states will it have (minimally)? Describe the DFA succinctly: do not attempt to draw it, but explain its formal definition, (e.g. states and transitions) using a suitable mathematical notation.

I don't need the whole definition, just a start as to how many states it will have and why. From there I'm comfident I can figure it out.

Foi útil?

Solução

Some hints:

  • You're going to need one state for each possible subset of Σ so that you can keep track of which characters you've seen so far.

  • For each subset of Σ, you'll need another state to represent "this set of characters, where the last character read happened to be in the set."

I'll leave the rest of the details to you and you'll have to think about how to formally prove this is correct.

Hope this helps!

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top