Pepe Coco
Pepe Coco

Reputation: 1

NFA or e-NFA for the condition , n % 5 = 0 where n is the number of 1s

How to create an NFA or eNFA that satisfies the condition

n mod 5 = 0 where n is the number of 1s

I made two NFAs and I am not sure if they are correct. I am confused if how many states should be there and what should be the final state. Am I allowed to loop back to q0 or should I just add another state?

n mod 5 = 0 NFAs

Upvotes: 0

Views: 56

Answers (1)

Mit Shah
Mit Shah

Reputation: 117

From the given two images second diagram is the correct one.

Reason:

  • first diagram is not satisfy the condition 0 mod 5 = 0

  • second diagram satisfy all condition for n mod 5 = 0

Upvotes: 0

Related Questions