0

I am given the following regular expression, which accepts all strings over $\{a,b,c\}$ whose $n$th character from the right is $a$:

$$ (a|b|c)^*a(a|b|c)^{n-1}. $$

The exercise asks for the number of states in the minimal DFA for the language.

The answer must be similar to this question but still, I don't get it.

When $n = 1$, I was able to determine that the answer is $2$ by constructing an $\epsilon$-NFA from the regular expression, determinizing it, and minimizing the resulting DFA.

Yuval Filmus
  • 276,994
  • 27
  • 311
  • 503
Nikos
  • 1
  • The answer is identical, with the same proof. – Yuval Filmus Nov 03 '19 at 16:39
  • @YuvalFilmus can you please tell me what changes if the nth term becomes (a|b) instead of a?

    Regular expression: (a|b|c)*(a|b)(a|b|c)^n-1

    – Nikos Nov 03 '19 at 16:53
  • 1
    This is something that you should be able to do on your own. – Yuval Filmus Nov 03 '19 at 16:53
  • Welcome to CS.SE! Since you haven't given us any indication what you don't get, why you don't get it, and what you do understand, I don't see that there is any question to answer here, beyond what is already answered at the duplicate question. – D.W. Nov 03 '19 at 19:53
  • You can treat the two letters $b,c$ identically, since they’re completely interchangeable in this context. So the proof given in the linked question is still valid, with virtually no changes. – Yuval Filmus Nov 03 '19 at 20:43

0 Answers0