I have the following question I want to understand.
The owner of a chain of three grocery stores has purchased five crates of fresh strawberries. The estimated probability distribution of potential sales of the strawberries before spoilage differs among the three stores. Therefore, the owner wants to know how to allocate five crates to the three stores to maximize expected profit. For administrative reasons, the owner does not wish to split crates between stores. However, he is willing to distribute no crates to any of his stores. The table below gives the estimated expected profit at each store when it is allocated various numbers of crates. Use dynamic programming to determine how many of the five crates should be assigned to each of the three stores to maximize the total expected profit. Start by giving the Bellman equations. $$ \begin{array}{c|ccc} &&\text{Stores}\\ \text{Crates} & 1 & 2 & 3 \\ \hline 0 & 0 & 0 & 0 \\ 1 & 5 & 6 & 4 \\ 2 & 9 & 11 & 9 \\ 3 & 14 & 15 & 13 \\ 4 & 17 & 19 & 18 \\ 5 & 21 & 22 & 20 \end{array} $$
Define $x_i$ to be the number of crates allocated to store $i$, and let $p_i(x_i)$ provide the expected profit from allocating $x_i$ crates to store $i$. Let $s_i$ denote the aggregated number of crates to be available for stores $i,i+1,i+2$ (for as far they exists). So $s_3$ denotes the number of crates for only store $3$; and $s_1$ denotes the number of crates for stores $1,2$ and $3$ together.
Per the solution: The Bellman equations (backward recursion) are now given by: $$\begin{align*} &f_i(s_i) = \max_{0 \leq x_i \leq s_i} [p_i(x_i) + f_{i+1}(s_i - x_i)] \text{ for } i=1,2,3 \\ & f_4(s_4)=0\end{align*}$$
I understand the $p_i(x_i)$ part. As that is the direct profit associated with taking decision $x_i$. My problem is with the $s_i - x_i$ part. Why does this appear in the recursion formula?
Thanks in advance.
$f_1(s_1)$ is the value of having $s_1$ crates left to assign to store 1. After assigning $x_1$ crates to store 1, the owner has $s_2 = s_1 - x_1$ crates left for store 2. Etc.
If this is too simplistic please let me know and I'll try to be more articulate.