44 views
Find DFA on $\Sigma =(a,b)$ for

L={ w : $(n_{a}(w)-n_{b}(w))mod3>0$ }

This problem is slightly tricky, and depends on how you define the mod function.

Look here and you’ll see what I mean.

I’ve a doubt in the question itself

Can I write like this?

$n_{a}mod3-n_{b}mod3>0$

So, $n_{a}mod3>n_{b}mod3$
I don’t think you can, I think what you can do is take the absolute value of the difference and then take modulus 3.
but why not?

e.g take a string like b, it’ll give you -1 you’ll have to reject that, which is a problem and makes the language not regular.

then can we consider this?
$\left | n_{a}mod3-n_{b}mod3 \right |>0$
Yes, you can.