I am having a hard time to understand the value iteration derived from the Bellman equation:
$$V_{k=0}(s) = 0$$
$$\forall s : V_{k+1}(s) = \max_a \Bigr[ R(s,a) + \gamma \sum_{s'} P(s'|s, \pi(s)) V_k(s') \Bigr]$$
I am trying to understand this on a concrete example I have thought of: A maze and a rat in it:
+------------------+
| s2 s3|
+------+ s1 +------+
| |
| R |
There are only three states. $s_1$ is a T-junction with the possible actions, left and right. $s_2$ and $s_3$ is food and something else poision or so. Thus granting rewards $(2,0)$. Everything is determinstic and I would like to use a discounting of $\gamma = 0.5$
How would a concrete example look like:
Here are my thoughts:
- $R(s,a)$ is the reward which would be granted immediately (isn't it?), so I guess for $s_1$ this would be $0$?
- the sum $\sum_{s'}$ is the sum over the possible transition states, that would be $s_2$ and $s_3$?
- the transition probability $P(s'|s, \pi(s))$ is not given, but maybe it's just $1/2$
When I try to write it down it does not seem to make a lot sense:
\begin{align} V_{k=1}(s_1) = 0 + 0.5 + (0.5 \cdot 0 + 0.5 \cdot 0) = 0 \end{align}
This would just become zero again, is that correct?
\begin{align} V_{k=1}(s_2) = 3 + 0.5 + (0.5 \cdot 0 + 0.5 \cdot 0) = 3 \end{align}
How would the $a$ be evaluated? Its the state of the rat and it should choose the one with the highest result, but what are possible $a$?