- 2073 Shrawan
Configuration of DFA; DFA with 01 and 10
Short answer
A configuration is (state, remaining input). The DFA counts runs: q0 start; A0 (0-run), A1 (1-run); B1 after 01, B0 after 10; F final trap when both seen. Transitions: q0-0->A0, q0-1->A1; A0-0->A0, A0-1->B1; A1-0->B0, A1-1->A1; B1-0->F, B1-1->B1; B0-0->B0, B0-1->F; F loops on 0,1.
Define a configuration of a DFA. Design a DFA for the language L = {w ∈ {0,1}* : w has both 01 and 10 as substrings}. Verify your design by taking one accepted and one rejected string.
Configuration (instantaneous description) of a DFA
A configuration of a DFA M = (Q, Σ, δ, q₀, F) is a pair (q, w) ∈ Q × Σ*, where q is the current state and w is the unread part of the input. One move is
(q, aw) ⊢ (δ(q, a), w), for a ∈ Σ, w ∈ Σ*.
M accepts x iff (q₀, x) ⊢* (f, ε) for some f ∈ F. The initial configuration is (q₀, x).
DFA for strings having both 01 and 10 as substrings
A string contains both 01 and 10 exactly when it has at least three runs (blocks) of equal symbols, e.g. 010, 101, 0110, 1001. The DFA counts runs up to three.
States: q0 start; A0 = still in first run of 0's; A1 = first run of 1's; B1 = seen 01, now in 1's; B0 = seen 10, now in 0's; F = both found (final trap).
M = ({q0, A0, A1, B1, B0, F}, {0,1}, δ, q0, {F})
| State | 0 | 1 |
|---|---|---|
| → q0 | A0 | A1 |
| A0 | A0 | B1 |
| A1 | B0 | A1 |
| B1 | F | B1 |
| B0 | B0 | F |
| *F | F | F |
┌─0─► A0 ─1─► B1 ─0─┐
──► q0 │ ├─► ((F)) ↺0,1
└─1─► A1 ─0─► B0 ─1─┘
(A0↺0 A1↺1 B1↺1 B0↺0)
Verification
- Accepted: 0110. (q0, 0110) ⊢ (A0, 110) ⊢ (B1, 10) ⊢ (B1, 0) ⊢ (F, ε). F is final. It contains 01 and 10.
- Rejected: 0011. (q0, 0011) ⊢ (A0, 011) ⊢ (A0, 11) ⊢ (B1, 1) ⊢ (B1, ε). B1 is not final (no 10).
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- DFA for (a(ab)*b)* · Theory of Computation, chapter 2
- DFA starts or ends with 01 · Theory of Computation, chapter 2
- DFA for {00}*{11}* language · Theory of Computation, chapter 2
- DFA avoiding substring 10110 · Theory of Computation, chapter 2
- DFA: even 0s and even 1s · Theory of Computation, chapter 2
- PDA configuration; PDA for a^(3n)b^n · Theory of Computation, chapter 3
- String insulator configuration and advantages · Transmission and Distribution System Design, chapter 3
- 400 kV lines: configuration, V-string, earth wires · Transmission and Distribution System Design, chapter 4
- Sallen-Key LPF at 10 kHz, largest C 0.01 μF · Filter Design, chapter 6
- Settling tank 30 m x 3 m, 0.02 mm at 25°C; 0.01 mm at 10°C · Water Supply Engineering, chapter 6 · asked 3×