The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+1 vote
89 views

Please help in creating the DFA for (n(w)-n(w))mod 3>0

asked in Theory of Computation by (21 points) | 89 views

1 Answer

+2 votes

verify it

answered by Boss (11.6k 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?

Related questions



Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

44,262 questions
49,758 answers
164,196 comments
65,849 users