All mock tests are FREE till 31 December — register to save your progress

The finite state machine given in figure below recognizes :

Figure

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: D. any string of odd number of a’s and odd number of b’s

Explanation

Horizontal a-edges flip a-parity and vertical b-edges flip b-parity. The start state is (even a, even b) and the accepting state, diagonally opposite, is (odd a, odd b).

More Theory of Computation and Compilers questions