- 2070 Bhadra · 3 marks
DFA with no three consecutive 0's
Short answer
DFA states: s0 (0 zeros, start), s1 (1 zero), s2 (2 zeros) are final; s3 (3 zeros) is dead. On 0, move s0→s1→s2→s3; on 1, all go to s0. Accepts strings with no 000.
Construct a DFA that recognize the language "The set of bit strings that do not contain three consecutive 0's". Show only necessary figures and state diagrams.
Let L = set of bit strings with no substring 000. The DFA must remember how many 0's have just occurred in a row (0, 1 or 2). A third consecutive 0 sends it to a dead state.
States
- s₀: last symbol is 1 (or nothing read yet): 0 zeros in a row (start).
- s₁: exactly one 0 at the end.
- s₂: exactly two 0's at the end.
- s₃: three consecutive 0's seen (dead state, non-final).
Final states: {s₀, s₁, s₂}.
Transition table
| State | 0 | 1 |
|---|---|---|
| → *s₀ | s₁ | s₀ |
| *s₁ | s₂ | s₀ |
| *s₂ | s₃ | s₀ |
| s₃ | s₃ | s₃ |
State diagram
1 (loop)
+--+
v | 0 0 0
->((s0))-------->((s1))-------->((s2))-------->(s3) 0,1 (loop)
^ | |
+------1--------+ |
+----------------1-------------+
(Double brackets mean final. Every 1 from s₁ or s₂ returns to s₀; s₀ loops on 1; s₃ loops on 0 and 1.)
Check: 1001: s₀ -1→ s₀ -0→ s₁ -0→ s₂ -1→ s₀, accepted. 10001: s₀ s₀ s₁ s₂ s₃ s₃, rejected. Brute-force test up to length 12 confirmed that the DFA accepts exactly the strings with no 000.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Language of grammar; grammar for strings not ending in ab · Discrete Structure, chapter 2
- Construct FSA accepting reverse language · Discrete Structure, chapter 2
- Define FSM; design FSA with two consecutive a's · Discrete Structure, chapter 2 · asked 4×
- Design NFA for strings ending with aba · Discrete Structure, chapter 2
- Design FSA for strings beginning with baa · Discrete Structure, chapter 2
- NFA and DFA from grammar σ→bσ|aC · Discrete Structure, chapter 2 · asked 4×
- DFA for {00}*{11}* language · Theory of Computation, chapter 2
- Detector for three consecutive zeros · Digital Logic, chapter 9 · asked 2×
- Three consecutive zeros detector using SR · Digital Logic, chapter 9 · asked 2×
- 8085 ALP: transfer with bit set/reset · Microprocessor, chapter 2