Uploaded by Mehul Srivastava

solution question 1

advertisement
Solution to Question 1
Part (b)
(b) {w in {0,1}* : w contains at most two 0s or contains at least three 1s}
DFA Description:
To construct a DFA to recognize the language, we consider different states that represent the
number of 0s and 1s we have seen so far in the input string.
States Description:
- State q0 (start): No 0s or 1s have been seen yet.
- State q1: One 0 has been seen and less than three 1s have been observed.
- State q2: Two 0s have been seen and less than three 1s have been observed.
- State q3 (accept): At least three 1s or more than two 0s have been seen.
Transitions:
- From q0: on input 0, it transitions to q1; on input 1, it transitions to itself; on seeing three
1s, it transitions to q3.
- From q1: on input 0, it transitions to q2; on input 1, it transitions to itself; on seeing three
1s, it transitions to q3.
- From q2: on input 0, it transitions to q3; on input 1, it transitions to itself; on seeing three
1s, it transitions to q3.
- From q3: on any input (0 or 1), it transitions to itself.
Transition Table:
Download