GateAI
Regular Expressions and Finite Automata

GATE CSE 2024 Set 1 · Q50

MSQ2 marksMedium

Time

Consider the 5-state DFA MM accepting the language L(M)⊂(0+1)∗L(M) \subset (0 + 1)^* shown below. For any string w∈(0+1)∗w \in (0 + 1)^* let n0(w)n_0(w) be the number of 0's in ww and n1(w)n_1(w) be the number of 1's in ww. Which of the following statements is/are FALSE?

GATE CSE 2024 Set 1 Q50 diagram

Select all that applyOne or more correct

Pick every correct option

Solution

Step-by-step verified solution

Official answer: B) States 3 and 4 are distinguishable in M; C) States 2 and 5 are distinguishable in M

Regular Expressions and Finite Automata

Let us analyze the transitions of the given DFA MM:

  • State 11 is both the start state and the only accepting state: F={1}F = \{1\}.

  • δ(1,0)=2\delta(1, 0) = 2, δ(1,1)=4\delta(1, 1) = 4

  • δ(2,0)=3\delta(2, 0) = 3, δ(2,1)=1\delta(2, 1) = 1

  • δ(3,0)=1\delta(3, 0) = 1, δ(3,1)=2\delta(3, 1) = 2

  • δ(4,0)=1\delta(4, 0) = 1, δ(4,1)=5\delta(4, 1) = 5

  • δ(5,0)=4\delta(5, 0) = 4, δ(5,1)=1\delta(5, 1) = 1

### 1. State Distinguishability / Equivalence

  • Pair (2,5)(2, 5):

    • On input 00: δ(2,0)=3\delta(2, 0) = 3 and δ(5,0)=4\delta(5, 0) = 4.

    • On input 11: δ(2,1)=1∈F\delta(2, 1) = 1 \in F and δ(5,1)=1∈F\delta(5, 1) = 1 \in F.

  • Pair (3,4)(3, 4):

    • On input 00: δ(3,0)=1∈F\delta(3, 0) = 1 \in F and δ(4,0)=1∈F\delta(4, 0) = 1 \in F.

    • On input 11: δ(3,1)=2\delta(3, 1) = 2 and δ(4,1)=5\delta(4, 1) = 5.

Since both transitions from {2,5}\{2, 5\} lead to {3,4}\{3, 4\} on 00 and {1}\{1\} on 11, and both transitions from {3,4}\{3, 4\} lead to {1}\{1\} on 00 and {2,5}\{2, 5\} on 11, states 22 and 55 are indistinguishable (2≡52 \equiv 5), and states 33 and 44 are indistinguishable (3≡43 \equiv 4).

  • Statement (B) says states 33 and 44 are distinguishable, which is FALSE (they are equivalent).

  • Statement (C) says states 22 and 55 are distinguishable, which is FALSE (they are equivalent).

### 2. Pair (2,4)(2, 4)

  • On input 11: δ(2,1)=1∈F\delta(2, 1) = 1 \in F, but δ(4,1)=5∉F\delta(4, 1) = 5 \notin F.

  • Thus, string 1 distinguishes states 22 and 44. Statement (A) is TRUE.

### 3. Language of the DFA The states track the value of (n0(w)−n1(w))(mod3)(n_0(w) - n_1(w)) \pmod 3:

  • State 11: (n0(w)−n1(w))≡0(mod3)(n_0(w) - n_1(w)) \equiv 0 \pmod 3

  • States {2,5}\{2, 5\}: (n0(w)−n1(w))≡1(mod3)(n_0(w) - n_1(w)) \equiv 1 \pmod 3

  • States {3,4}\{3, 4\}: (n0(w)−n1(w))≡2(mod3)(n_0(w) - n_1(w)) \equiv 2 \pmod 3

If n0(w)=n1(w)n_0(w) = n_1(w), then n0(w)−n1(w)=0≡0(mod3)n_0(w) - n_1(w) = 0 \equiv 0 \pmod 3, which leads to state 11 (the accepting state). Therefore, any such string is accepted. Statement (D) is TRUE.

Since the question asks for the FALSE statements, the correct options are B and C.

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Regular Expressions and Finite Automata previous year question is Q50 of the GATE CSE 2024 Set 1 paper. Find more GATE CSE PYQs on Regular Expressions and Finite Automata in Theory of Computation, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Regular Expressions and Finite Automata PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Regular Expressions and Finite Automata in GATE CSE

Regular Expressions and Finite Automata has 41 GATE CSE PYQs across 24 papers from 2011 to 2026. 4 of them are 2-mark MSQs like this one, and GATE CSE 2024 Set 1 has 2.

How GATE tests Regular Expressions and Finite Automata

More from GATE CSE 2024 Set 1

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2024 Set 1 · Q50 · MSQ

Consider the 5-state DFA M accepting the language L(M) ⊂ (0 + 1)* shown below. For any string w ∈ (0 + 1)* let n0(w) be the number of 0's in w and n1(w) be the number of 1's in w. Which of the following statements is/are FALSE?

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.