1)Mod functions are always Regular .
2)If some language contain relation b/w 'a mod x' and 'b mod y ' then our DFA contains x*y states.
Sorry above DFA is wrong one
The correct DFA for {( #0(w) – #1(w) )mod3) = 1}
and in parallel both my first and second statement are false , good that misconception cleared.
if our question contains {w|(|#0(w) – #1(w)|mod3) = 1} i just notice the actual question is that actually.
Its not regular.
http://www.ugrad.cs.ubc.ca/~cs421/hw/2/a.pdf
tell me if here also some problem.