GATE 2019 CS – Question 58
Let $\Sigma$ be the set of all bijections from $\{1,\dots,5\}$ to $\{1,\dots,5\}$, where $id$ denotes the identity function, i.e. $id(j)=j,\forall j$. Let $\circ$ denote composition on functions. For a string $x=x_1x_2\cdots x_n\in\Sigma^n$, $n\ge0$, let $\pi(x)=x_1\circ x_2\circ\cdots\circ x_n$.
Consider the language $L=\{x\in\Sigma^*\mid\pi(x)=id\}$. The minimum number of states in any DFA accepting $L$ is ________.
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: 120
Explanation
The DFA must remember the current composition $\pi$ of the prefix, which is an element of the symmetric group $S_5$ with $5!=120$ elements. All 120 are distinguishable, since from each one exactly one inverse element leads to $id$. So at least 120 states are needed, and 120 suffice.