I have just started learning about DFAs and regular languages, and have had some success with constructing simple ones such as ensuring an even number of 1's and 0's but have got a bit confused trying to design a DFA which will accept two (or more) consecutive 0's and no consecutive 1's. my terrible attempt. I am aware this is not correct but could someone help point out in what ways I have went wrong? Thank you in advance.
2026-03-27 16:26:35.1774628795
Problem constructing a DFA
233 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
1
There are 1 best solutions below
Related Questions in AUTOMATA
- Exitstance of DPA of L = $\{ww^r\}$
- Automata defined by group presentations.
- How to prove convergence of a sequence of binary numbers
- A finite automaton that accepts at least three $a$s and at least two $b$s.
- Is my DFA correct?
- Intersection of two languages (Formal Languages and Automata Theory)
- Is there any universal algorithm converting grammar to Turing Machine?
- Build a Context-Free Grammar for a given language
- Prove that $B = B ^+$ iff $BB \subseteq B$
- Proving a Language is Regular via Automata
Trending Questions
- Induction on the number of equations
- How to convince a math teacher of this simple and obvious fact?
- Find $E[XY|Y+Z=1 ]$
- Refuting the Anti-Cantor Cranks
- What are imaginary numbers?
- Determine the adjoint of $\tilde Q(x)$ for $\tilde Q(x)u:=(Qu)(x)$ where $Q:U→L^2(Ω,ℝ^d$ is a Hilbert-Schmidt operator and $U$ is a Hilbert space
- Why does this innovative method of subtraction from a third grader always work?
- How do we know that the number $1$ is not equal to the number $-1$?
- What are the Implications of having VΩ as a model for a theory?
- Defining a Galois Field based on primitive element versus polynomial?
- Can't find the relationship between two columns of numbers. Please Help
- Is computer science a branch of mathematics?
- Is there a bijection of $\mathbb{R}^n$ with itself such that the forward map is connected but the inverse is not?
- Identification of a quadrilateral as a trapezoid, rectangle, or square
- Generator of inertia group in function field extension
Popular # Hahtags
second-order-logic
numerical-methods
puzzle
logic
probability
number-theory
winding-number
real-analysis
integration
calculus
complex-analysis
sequences-and-series
proof-writing
set-theory
functions
homotopy-theory
elementary-number-theory
ordinary-differential-equations
circles
derivatives
game-theory
definite-integrals
elementary-set-theory
limits
multivariable-calculus
geometry
algebraic-number-theory
proof-verification
partial-derivative
algebra-precalculus
Popular Questions
- What is the integral of 1/x?
- How many squares actually ARE in this picture? Is this a trick question with no right answer?
- Is a matrix multiplied with its transpose something special?
- What is the difference between independent and mutually exclusive events?
- Visually stunning math concepts which are easy to explain
- taylor series of $\ln(1+x)$?
- How to tell if a set of vectors spans a space?
- Calculus question taking derivative to find horizontal tangent line
- How to determine if a function is one-to-one?
- Determine if vectors are linearly independent
- What does it mean to have a determinant equal to zero?
- Is this Batman equation for real?
- How to find perpendicular vector to another vector?
- How to find mean and median from histogram
- How many sides does a circle have?
Because you have the transition $q_1\overset{1}\longrightarrow q_1$, your DFA will accept $11001$: since this has two consecutive $1$s, it should not be accepted. And because the only way to reach the acceptor state $q_4$ is via the transition $q_3\overset{1}\longrightarrow q_4$, every string that is accepted must contain a $1$, meaning that $00$, which ought to be accepted, won’t be.
If $q_1$ is the initial state, the $0$- and $1$-transitions out of it clearly must go to different states. Moreover, neither of them can go back to $q_1$. I already pointed out why the $1$-transition can’t go back to $q_1$. The $0$-transition from $q_1$ can’t loop back to $q_1$, because then $q_1$ would have to be both an acceptor state (to accept $00$) and a non-acceptor state (to reject $0$). Thus, we can start like this:
$$\begin{array}{c|c|c} \text{state}&0&1\\ \hline q_1&q_2&q_3\\ \end{array}$$
I’ll start by following the $0$ branch. A second $0$ must take us to an acceptor state, so it will have to be a new state, $\color{crimson}{q_4}$. (I’ll use color to mark an acceptor state.) A $1$, though gets us no further towards an acceptable string than an initial $1$ would have done: we might as well go to $q_3$.
$$\begin{array}{c|c|c} \text{state}&0&1\\ \hline q_1&q_2&q_3\\ q_2&\color{crimson}{q_4}&q_3\\ \end{array}$$
Getting a $0$ while in $q_3$ is no different from getting an initial $0$: we still haven’t had two consecutive $0$s, but we also aren’t dead yet with two consecutive $1$s. Thus, we can go to $q_2$. Getting a $1$, though, is fatal: it should send us to a ‘garbage’ state, a non-accepting dead end state. Since that state is a dead end, every input should just loop it back to itself. I’ll make that one $q_5$.
$$\begin{array}{c|c|c} \text{state}&0&1\\ \hline q_1&q_2&q_3\\ q_2&\color{crimson}{q_4}&q_3\\ q_3&q_2&q_5\\ q_5&q_5&q_5 \end{array}$$
Now what should happen when we’re at $\color{crimson}{q_4}$? That means that we’ve seen at least two consecutive $0$s and have not seen two consecutive $1$s, so further inputs of $0$ without intervening $1$s should be accepted, and we should be able to loop at $\color{crimson}{q_4}$. An input of $1$ still leaves us with an acceptable word, so it has to go to an acceptor state (and therefore not to $q_3$), but it clearly can’t loop at $\color{crimson}{q_4}$: that would let us accept $0011$, for instance. It needs to go to a new acceptor state, $\color{crimson}{q_6}$.
$$\begin{array}{c|c|c} \text{state}&0&1\\ \hline q_1&q_2&q_3\\ q_2&\color{crimson}{q_4}&q_3\\ q_3&q_2&q_5\\ \color{crimson}{q_4}&\color{crimson}{q_4}&\color{crimson}{q_6}\\ q_5&q_5&q_5 \end{array}$$
If we’re at $\color{crimson}{q_6}$, we’ve seen at least one pair of consecutive $0$s, but we’ve just read a $1$. A $0$ input at this point leaves us with an acceptable string that does not end in $1$, so we can go back to $\color{crimson}{q_4}$; a $1$ input, on the other hand, kills the string, and we can go to $q_5$, the garbage state.
$$\begin{array}{c|c|c} \text{state}&0&1\\ \hline q_1&q_2&q_3\\ q_2&\color{crimson}{q_4}&q_3\\ q_3&q_2&q_5\\ \color{crimson}{q_4}&\color{crimson}{q_4}&\color{crimson}{q_6}\\ q_5&q_5&q_5\\ \color{crimson}{q_6}&\color{crimson}{q_4}&q_5 \end{array}$$
Each state actually encodes a specific status:
When designing a DFA, it’s often helpful to think through what statuses are significant and to assign a state to each in just this way.