Skip to content
Official PYQ · 2004

GATE CS 2004 Q86 — Regular Expressions and Finite Automata

Explain with AI

The following finite state machine accepts all those binary strings in which the number of 11’s and 00’s are respectively:

     

Choose one option
View worked solution

Answer: A

To determine the language accepted by the given finite state machine (FSM), we can analyze its state transitions based on the number of 11s and 00s in the input string.

A standard product automaton for tracking the count of two independent properties modulo mm and nn has m×nm \times n states. Here, the FSM has 66 states, which suggests a combination of modulo 33 and modulo 22 counters (3×2=63 \times 2 = 6 states).

Step-by-Step Analysis:

  1. Tracking 11s (Modulo 3): The transitions for input 11 form cycles of length 33. This tracks the number of 11s modulo 33: No. of 1’s(mod3)∈{0,1,2}\text{No. of 1's} \pmod 3 \in \{0, 1, 2\}
  2. Tracking 00s (Modulo 2): The transitions for input 00 form cycles of length 22. This tracks the number of 00s modulo 22: No. of 0’s(mod2)∈{0,1}\text{No. of 0's} \pmod 2 \in \{0, 1\}
  3. Accepting State: The start state is also the only accepting (final) state. This state corresponds to the remainder being 00 for both counts: No. of 1’s≡0(mod3)  ⟹  divisible by 3\text{No. of 1's} \equiv 0 \pmod 3 \implies \text{divisible by 3} No. of 0’s≡0(mod2)  ⟹  divisible by 2\text{No. of 0's} \equiv 0 \pmod 2 \implies \text{divisible by 2}

Thus, the FSM accepts all binary strings where the number of 11s is divisible by 33 and the number of 00s is divisible by 22.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Regular Expressions and Finite Automata questions