Explanation : The DFA for accepting L will have 5! = 120 states, since we need one state for every possible permutation function on 5 elements. The starting state will be “id” state, named as
and from there
n! arrows will go the n! states each named with a distinct permutation of the set {1, 2, 3, 4, 5}. Since composition of permutation function is closed every arrow has to go to some permutation and hence some state.
Since the language only has those strings where π(x) = id only the starting state (“id” state) will be the final state.
Sample machine with only 2 states is shown below