223k views
3 votes
Let Σ = { 0, 1 } (a) Construct a DFA that recognises all words over Σ except the empty word

(b) Construct a DFA that recognises the language { w ∈ Σ * : w contains at least two 0s and at most one 1 }
(c) Construct a DFA that recognises the language { 0^{2m+1} 1³ⁿ : m, n ∈ ℕ }
(d) Construct an NFA that recognises all words over Σ except the empty word
(e) Construct an NFA that recognises the language { w ∈ Σ * : w contains an even number of 0s, or exactly two 1s }
(f) Construct an NFA that recognises the language { w ∈ Σ ∗ : w does not contain 011 as a substring }

User Gusti Adli
by
8.5k points

1 Answer

4 votes

Final answer:

The question involves constructing finite automata, both DFA and NFA, for various languages over the alphabet {0, 1}. These automata must handle different language constraints, such as avoiding the empty word, including certain numbers of 0s and 1s in the string, or avoiding specific substrings.

Step-by-step explanation:

The task is to construct finite automata for given languages over the alphabet \(\Sigma = \{ 0, 1 \}\).

  • (a) A Deterministic Finite Automaton (DFA) that recognizes all words over \(\Sigma\) except the empty word can be made using two states: State 1 (initial and accepting) transitions to State 2 (also accepting) on both inputs 0 and 1. State 2 remains in itself on any input. This ensures that the empty word is not accepted as there is no transition into an accepting state without reading an input.
  • (b) A DFA for words with at least two 0s and at most one 1 can have multiple states, including a dead state for any sequence with more than one 1 or less than two 0s.
  • (c) This DFA would require constructing a pattern that allows odd numbers of 0s followed by multiples of three 1s. Transitions are designed to only accept strings that fit the { 0^{2m+1} 1^3n} pattern.
  • (d) A Non-deterministic Finite Automaton (NFA) that recognizes all words over \(\Sigma\) except the empty word can simply transition from an initial state to an accepting state on either input, and loop on the accepting state with both inputs.
  • (e) An NFA for recognizing an even number of 0s or exactly two 1s would have states for tracking the parity of the number of 0s read and would accept on states that either have read two 1s or are in the 'even' state for 0s.
  • (f) The NFA for the language that does not contain the substring 011 has states that track the last two inputs and transitions to a dead state upon reading the sequence 011.
User Wouter Van Damme
by
8.4k points