Design a DFA that accepts strings containing 1010 as substring.


Design a DFA that accepts strings containing 1010 as substring.
We know from DFA,
A = (Q, Σ, δ, q0, F)
Now,

Here,
Q: Finite set of states
Σ: Input symbols
δ: Transition function
q0: Initial state
F: Final state
∴ A = ({q0, q1, q2, q3, q4}, {0, 1}, δ, q0, {q4})


Now, transition function for 1010,
δ ̂ (q0, ϵ) = q_0
δ ̂ (q0, 1) = δ (δ ̂ (q0, ϵ), 1) = δ (q0, 1) = q1
δ ̂ (q0, 10) = δ (δ ̂ (q0, 1), 0) = δ (q1, 0) = q2
δ ̂ (q0, 101) = δ (δ ̂ (q0, 10), 1) = δ (q2, 1) = q3
δ ̂ (q0, 1010) = δ (δ ̂ (q0, 101), 0) = δ (q3, 0) = q4

No comments

Dear Members, Thanks for Your Comments. We must be reply your comment answer as soon as possible. Please Stay with us.....

Theme images by ideabug. Powered by Blogger.