-1

How can I create a DFA automaton that will have every four digits (if they exist) at least two 1s for strings of languages with alphabet {0,1}? The expression at least two 1s seems easier than the expression every four digits

wajaap
  • 133
  • 8

1 Answers1

3

Create a DFA with 16 states, each corresponding to the last four letters possible.

For more details:

  • the first three states will be special states with no turning back that will serve to count the number of $1$'s only in the three first letters;
  • then you will navigate between states depending on the number of $1$'s read in the last four letters;
  • each time you might reach a state describing zero or one $1$'s read in the last four letters, you can instead reach a non-final sink state that will loop on itself.
Nathaniel
  • 15,071
  • 2
  • 27
  • 52