Peter Linz Edition 4 Exercise 2.1 Question 7-c,d,e,f (Page No. 47)
0 votes
0 votes
  1. L= {w: $n_{a}(w) mod \ 3 >1$}

  1. L= {w: $n_{a}(w) mod \ 3 >n_{b}(w)mod \ 3$}

  1. L= { w: $(n_{a}(w) - n_{b}(w))\mod \ 3>0$

  1. L= {w: $(n_{a}(w) + 2n_{b}(w))\mod \ 3<2$}

Please verify above three dfa for the given languages. I think all three are correct, just doing it for surety and help me to find out the correct dfa for f)

in Theory of Computation
244 views

8 Comments

e is not right as it is accepting abb but it should not be accepted as 1-2=-1< 0

0
0
(-1 mod 3) is 2 >0 which is greater than zero.
0
0
aabbb on question d
0
0
for part f :

there are 3 states, p,q and r, where p is initial state and p,q are final states.

p on a, q

p on b, r

q on a, r

q on b, p

r on a, p

r on b, q
1
1

(-1 mod 3) is 2

From whom u learnt this?

0
0

Thank you sir. But how to approach this kind of question by generating certain strings or any other logic especially e and f ?

0
0
by experience you will get @kushagra

moreover no need to call me as sir, you can call me by name
0
0
edited by

find b modN , just keep adding N to −b until the number is between 0 and N

As an example, N=13, b=−27 Add 13 to -27, you get -14, again you get -1, and again you get 12.

So, −27 mod13 =12

 

One more way:

Take $−100\ mod\ 8= 4$. This is because $8\times−13=−104$ The remainder is 4.

.

0
0

Please log in or register to answer this question.

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
Welcome to GATE CSE Doubts, where you can ask questions and receive answers from other members of the community.