2 votes 2 votes Please help in creating the DFA for (na (w)-nb (w))mod 3>0 Theory of Computation theory-of-computation peter-linz peter-linz-edition4 finite-automata + – Manish Kumar 24 asked Feb 19, 2018 • edited Mar 5, 2019 by Naveen Kumar 3 Manish Kumar 24 1.2k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
2 votes 2 votes verify it pawan kumarln answered Feb 19, 2018 pawan kumarln comment Share Follow See all 9 Comments See all 9 9 Comments reply Jason commented Feb 19, 2018 reply Follow Share It is also accepting $b$. 0 votes 0 votes joshi_nitish commented Feb 19, 2018 reply Follow Share @Jason why should it not accept $b$ ? 0 votes 0 votes Jason commented Feb 19, 2018 reply Follow Share na = 0 and nb = 1. (0-1)mod3 = -1 mod 3 = -1 > 0 Which is False. 0 votes 0 votes pawan kumarln commented Feb 19, 2018 reply Follow Share in mathematics mod return -ve value??? no becoz remainder is always positive -1 mod 3 = 2 > 0 1 votes 1 votes joshi_nitish commented Feb 19, 2018 reply Follow Share @Jason please see comment by @pawan 0 votes 0 votes Jason commented Feb 19, 2018 reply Follow Share But when we did mod in CPP/C then it shows -1 and in Maths it is 2, why? 0 votes 0 votes pawan kumarln commented Feb 19, 2018 reply Follow Share 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 votes 1 votes reena_kandari commented Feb 19, 2018 reply Follow Share correct!! 1 votes 1 votes Manish Kumar 24 commented Feb 28, 2018 reply Follow Share 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? 0 votes 0 votes Please log in or register to add a comment.