How can i make Automata accepting a string of zeros and ones with even number of ones and number of zeros should be divisible by 5?

1 answer

Answer

1201256

2026-05-19 16:35

+ Follow

To create an automaton that accepts strings of zeros and ones with an even number of ones and a number of zeros divisible by 5, you can use a combination of states to track both conditions. Create states to represent the parity of the count of ones (even or odd) and the remainder when the count of zeros is divided by 5 (0 to 4). Transition between these states based on the input symbol (0 or 1), ensuring that when a zero is read, you update the remainder, and when a one is read, you toggle the parity. The accepting state will be reached when the automaton is in the "even ones" state and the remainder of zeros is 0.

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.