What is the smallest number of states required for the NFA that accepts the language
(0 + 1)*(0 + 1)(0 + 1)* ?
Solution:
Given,
=>Regular expression = (0+1)*(0+1)(0+1)*
The answer will be "2"
Explanation:
=>NFA should accepte all the string starting with any number of 0's or 1's followed by 0 or 1 then followed by any number of 0's and 1's.
Drawing NFA for the given regular expression:
=>In the given NFA there are two states.
=>State A is initial state and state B is the final state.
=>At the final state only strings are accepted by the finite automata otherwise rejected.
I have explained each and every part with the help of statements attached to it.
Get Answers For Free
Most questions answered within 1 hours.