Answer : Option B
Given: $\sigma(A, a) = A, \sigma(A, b) = B, \sigma(B, a) = B \text{ and} \ \sigma(B, b) = A$
The DFA will be:-
Reg expression : $a^*b(a+ba^*b)^*$ ; The language accepted by the DFA is : All strings containing odd number of ‘$b$’
Now, let’s examine the options:-
Option A) $\{A → aB, A → bA, B → bA, B → aA, B → \epsilon\}$
$\implies A→ aB/bA$
$B→ bA/aA/ \epsilon$ We can notice that this grammar generates “a” which is not generated by the Machine M. This is wrong.
Option C) $\{A → bB, A → aB, B → aA, B → bA, B → \epsilon\}$
$\implies A → bB/ aB$
$B → aA/bA/\epsilon$ We can notice that this grammar also generates “a” which is not generated by the Machine M. This is wrong.
Option D) $\{A → aA, A → bA, B → aB, B → bA, A → \epsilon\}$
$\implies A → aA/bA/\epsilon$
$B → aB/bA$ We can notice that this grammar accepts null string which is not generated by the Machine M. Hence it is also wrong.
Option B) $\{A → aA, A → bB, B → aB, B → bA, B → \epsilon\}$
$\implies A → aA/bB$
$B → aB/bA/\epsilon$ We can notice that this grammar accepts only odd number of $b$ which is correct.
Edit: Provided the corect reasonings.