The goal is to find an optimal deterministic policy for this MDP:
There are two possible policies: left (L) and right (R). What is the optimal policy, when different discounts are used:
A $\gamma = 0$
B $\gamma = 0.9$
C $\gamma = 0.5$
The optimal policy $\pi_* \ge \pi$ if $v_{\pi^*}(s) \ge v_{\pi}(s), \forall s \in S$, so to find the optimal policy, the goal is to check which one of those results in the largest state value function for all states in the system given discount factors (A,B,C).
The Bellman equation for the state value function is
$v(s) = E_\pi[G_t | S_t= s] = E_\pi[R_{t+1} + \gamma v(S_{t+1}) | S_t = s]$
The suffix $_n$ marks the current iteration, and $_{n+1}$ marks the next iteration. The following is valid if the value function is initialized to $0$ or some random $x \ge 0$.
A) $\gamma = 0$
$v_{L,n+1}(S_0) = 1 + 0 v_{L,n}(S_L) = 1$
$v_{R,n+1}(S_0) = 0 + 0 v_{R,n}(S_R) = 0$
$L$ is optimal in case A.
B) $\gamma = 0.9$
$v_{L,n+1}(S_0) = 1 + 0.9 v_{L,n}(S_L) = 1 + 0.9(0 + 0.9 v_{L,n}(S_0)) = 1 + 0.81v_{L,n}(S_0)$
$v_{R,n+1}(S_0) = 0 + 0.9 v_{R,n}(S_R) = 0 + 0.9(2 + 0.9 v_{R,n}(S_0)) = 1.8 + 0.81v_{R,n}(S_0)$
$R$ is optimal in case B.
C) $\gamma = 0.5$
$v_{L,n+1}(S_0) = 1 + 0.5 v_{L,n}(S_L) = 1 + 0.5(0 + 0.9 v_{L,n}(S_0)) = 1 + 0.45v_{L,n}(S_0)$
$v_{R,n+1}(S_0) = 0 + 0.5 v_{R,n}(S_R) = 0 + 0.5(2 + 0.9 v_{R,n}(S_0)) = 1 + 0.45v_{R,n}(S_0)$
Both $R$ and $L$ are optimal in case C.
Question: Is this correct?