← RGPV CD-501 Theory of Computation November 2023 Solved Paper
Question
Design a DFA over {a,b} accepting strings containing at least three a symbols.
Asked in: CD-501 | November 2023 | 1(a)
Answer
Use states q0,q1,q2,q3 representing the number of a symbols seen, capped at three. Start at q0; only q3 accepts. On a move to the next state, with q3 looping. On b remain in the current state. Thus δ(qi,a)=qmin(i+1,3), δ(qi,b)=qi. For example ababa reaches q3, whereas abab reaches q2. The invariant proves correctness by induction on input length.
← RGPV CD-501 Theory of Computation November 2023 Solved Paper
Discussion
Ask a question, share your thoughts or report an error.
Sign in to participate in the discussion.
Join the discussion