Skip to content
Official PYQ · 2019

GATE CS 2019 Q48 — Regular Expressions and Finite Automata

Explain with AI
Let Σ\Sigma be the set of all bijections from {1,…,5}\{1, \dots , 5\} to {1,…,5}\{1, \dots , 5 \}, where idid denotes the identity function, i.e. id(j)=j,∀jid(j)=j, \forall j. Let ∘\circ denote composition on functions. For a string x=x1x2…xn∈Σn,n≥0x=x_1 x_2 \dots x_n \in \Sigma^n, n \geq 0, let π(x)=x1∘x2∘⋯∘xn\pi(x)=x_1 \circ x_2 \circ \dots \circ x_n. Consider the language L={x∈Σ∗∣π(x)=id}L=\{x \in \Sigma^* \mid \pi (x) =id\}. The minimum number of states in any DFA accepting LL is _______
View worked solution

Answer: 120

The set of all bijections from {1,…,5}\{1, \dots, 5\} to {1,…,5}\{1, \dots, 5\} under the composition operation ∘\circ forms the symmetric group S5S_5.

Let G=S5G = S_5 be this group. The identity element of GG is idid, and the size of the group is ∣G∣=5!=120|G| = 5! = 120.

DFA Construction

We can construct a DFA M=(Q,Σ,δ,q0,F)M = (Q, \Sigma, \delta, q_0, F) to accept LL as follows:

  • States (QQ): The states correspond to the elements of the group GG. Thus, Q=S5Q = S_5.
  • Start State (q0q_0): The identity element idid.
  • Accepting States (FF): The singleton set {id}\{id\}.
  • Transition Function (δ\delta): For any state g∈Gg \in G and input symbol x∈Σx \in \Sigma, the transition is defined by group multiplication: δ(g,x)=g∘x\delta(g, x) = g \circ x

Proof of Minimality

To show that this DFA is minimal, we must prove that all states in QQ are pairwise distinguishable:

Let g1,g2∈Gg_1, g_2 \in G be two distinct states (g1≠g2g_1 \neq g_2). Consider the string w=g1−1∈Σ∗w = g_1^{-1} \in \Sigma^* (since every bijection has a unique inverse in S5S_5):

  • Processing ww from state g1g_1 leads to: δ(g1,g1−1)=g1∘g1−1=id∈F\delta(g_1, g_1^{-1}) = g_1 \circ g_1^{-1} = id \in F
  • Processing ww from state g2g_2 leads to: δ(g2,g1−1)=g2∘g1−1≠id∉F(since g1≠g2)\delta(g_2, g_1^{-1}) = g_2 \circ g_1^{-1} \neq id \notin F \quad (\text{since } g_1 \neq g_2)

Since ww distinguishes g1g_1 and g2g_2, no two states in the DFA can be merged. Thus, the DFA is minimal.

The minimum number of states is equal to the number of elements in S5S_5:

Number of states=5!=120\text{Number of states} = 5! = 120

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

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