1

I am new to this computation theory and I am trying to answer the following question. Can you please check if I am on the right track? If there is any material that I can study for problems like these, i appreciate that too. Thank you in advance.

Given NFAs $M_1$ and $M_2$ with the same alphabet $\Sigma$, construct NFAs that recognize $L(M_1) \setminus L(M2)$.

Do i prove this using $L(M_1) \setminus L(M_2) = L(M_1) \cap L(M_2)^C$?

AlexR
  • 25,110
Danny
  • 13

2 Answers2

0

Your set theoretic notation is correct, but think about it in terms of running the automaton on an input. You take a string $\omega \in \Sigma^{*}$. Run it through $M_{1}$. If it accepts, run it through $M_{2}$. If $M_{2}$ accepts $\omega$, reject.

That's how you construct your automaton to recognize $L(M_{1}) - L(M_{2})$.

ml0105
  • 15,062
0

ml0105's solution is correct however if you consider the problem as creating ONE automaton to recognize $L(M_{1})-L(M_{2})$ you need to do something else... first you create an automaton to accept $\overline{L(M_{2})}$, for that it's enough to transform any final (accept) state to non-final and vice versa; then you need to make an automaton to accept $L(M_{1})\cap\overline{L(M_{2})}$, for that read here.

I know 2 books that are great for reading in this field:

  1. Sipser
  2. Linz

And here is a good slides: Slides, you can find much more and better ones online...