@debargha
QUERY 1::
even I got these figures.
but see the transition for ‘b’ from state r=0 ,for the first diagram..
If I give string as ‘b’ (it is of length 1) then also it gets accepted which is wrong.
also it accepts ‘bbbaa’ which is worng.
QUERY 2::
Accha are we applying modulus opeartor here?
I mean |b-a|=|a-b|?
QUERY 3::
In the second diagram if we apply bbbaa where |n(a)-n(b)|=1 it is landing in state r=2,but it should land in r=1,will this be a problem?