+1 vote
83 views

asked | 83 views

verify it

answered by Boss (11.3k points)
0
It is also accepting $b$.
0
@Jason

why should it not accept $b$ ?
0

n= 0 and nb = 1. (0-1)mod3 = -1 mod 3 = -1 > 0 Which is False.

+1
in mathematics mod return -ve value???

no

becoz remainder is always positive

-1 mod 3 = 2 > 0
0
@Jason

please see comment by @pawan
0
But when we did mod in CPP/C then it shows -1 and in Maths it is 2, why?
+1
in c

-1 mod 3 =-1

(they evaluate 1 mod 3 =1 and take sign as a numerator sign)

for ex.   1 mod -3 = 1

(as numerator sign is positive)
+1
correct!!
0
The answer seems to be correct but is there any way of designing such type of DFA's or we should go with hit and trial methods?