2
$\begingroup$

I'm trying to prove the language L = {$0^n 𝑥1^𝑛$ | x ∈ Σ*, n ≥ 1} is regular, but don't know how to present it in a DFA/NFA. I'm thinking to have n+1 states in a NFA, with the start state as the accepting state. The NFA reada $0$s to go from q$0$ to q$n+1$, then reading $1$s or $0$s to stay in the q$n+1$, then reading the same number of $1$s to go back to the q$0$. Is this a valid way to prove L is regular?

$\endgroup$
2
  • $\begingroup$ There is no limit to $n$: the number of states of a finite automaton can't grow with it. (Oops - didn't see one star.) $\endgroup$
    – greybeard
    Commented Oct 4, 2020 at 7:42
  • $\begingroup$ Showing an FA with that language might convince even me that $L$ was regular. $\endgroup$
    – greybeard
    Commented Oct 4, 2020 at 8:03

3 Answers 3

3
$\begingroup$

Your language consists of all words starting with $0$ and ending with $1$.

$\endgroup$
2
$\begingroup$

Your solution depends on $n$. In this case the $n$ in the formulation of the language is not a constant, but a variable ranging over the positive integers $n\ge 1$. So we need strings of the form $0^n x 1^n$ for any $n\ge 1$, and any $x\in\Sigma^*$.

In general that would not be possible with a FSA, it cannot count and compare the numbers of $0$'s and $1$'s, but this is a trick question. See the answer by Yuval.

$\endgroup$
1
$\begingroup$

Your language is regular and can be rewritten as $$ L = {0\Sigma^*1} $$ (start with 0 end with 1) enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.