Let $M=(K, Σ, \sigma, s, F)$ be a finite state automaton, where
$K = \{A, B\}, Σ = \{a, b\}, s = A, F = \{B\},$
$\sigma(A, a) = A, \sigma(A, b) = B, \sigma(B, a) = B \text{ and} \ \sigma(B, b) = A$
A grammar to generate the language accepted by $M$ can be specified as $G = (V, Σ, R, S), $ where $V = K \cup Σ$, and $S = A.$
Which one of the following set of rules will make $L(G) = L(M)$ ?
- $\{A → aB, A → bA, B → bA, B → aA, B → \epsilon)$
- $\{A → aA, A → bB, B → aB, B → bA, B → \epsilon)$
- $\{A → bB, A → aB, B → aA, B → bA, B → \epsilon)$
- $\{A → aA, A → bA, B → aB, B → bA, A → \epsilon)$