Finite state machine boolean expression
Actually, when you see the state representation of the FSM, you shall notice that the output is \$1\$ when both the inputs \$A\$ and \$B\$ are \$1\$ and the machine is in state \$S_2\$ which is represented by the encoding \$10\$. So, it is enough to represent the output as \begin{equation}q = S_1 AB\end{equation}. The reason that the \$ \bar{S_0}\$ is not included in the expression \begin{equation} S_1'=\bar{S_1}S_0 B+S_1 AB\end{equation} is that there is no state defined by the encoding \$11\$ and hence the state \$10\$ is actually \$1X\$ and hence it is sufficient to include just \$S_1\$.