<p>I still can't comment, so this is not another answer it is adding some math to the given answer
Since </p>

<p><span class="math-container">$ Log X*Y = log X + log Y $</span></p>

<p><span class="math-container">$ Log(X ^ i) = i * log X
$</span></p>

<p>So substituting </p>

<p><span class="math-container">$
Ln Z +1/2 Ln X + 1/2 Ln Y = Ln (z * Srqt(X*Y)) $</span></p>

<p>will simplify the expression a lot, but I have to reduce it in handwritten form because I'm writing from a phone now</p>

<p>You will reach</p>

<p><strong><span class="math-container">$ max [ w*(w-c)]  $</span></strong></p>

<p>which clearly happens at</p>

<p><strong><span class="math-container">$ c=w/2 $</span></strong></p>

<p>(try any values)</p>

<p>2- Also, are you sure of ur use of the term <strong>"dynamic programming"</strong>???</p>

<p>3- And I don't understand from where came the term</p>

<p><span class="math-container">$ [ Alpha*Beta / (Alpha*Beta +1)] $</span>  , that's why I substituted twice (in the original formula before this reduction too)</p>

<p>4- Finally,  I don't see why didn't u substitute 
    <span class="math-container">$ V(t) = u(t) $</span>   from the beginning to simplify things? 
I simplified ur formulas mathematically, but I don't get how u reached the EQ (I admit I'm not specialized in ur field I came for an interdisciplinary problems). 
I get that</p>

<p><span class="math-container">$ Saving(t) = Return_of_Saving(t-1) + w(t)- c(t) $</span>
Then u say her expected wealth "w" at time t+1 is an average of two values. So<br>
<span class="math-container">$ W(t+1)= (alpha + beta) /2 * W(t) + Income(t+1) - C(t+1) $</span>
 - that u have to add a factor for the decrease of money value &amp; the increase of prices with time, that's ur "b" in the maximization formula right? </p>

<p>Anyways, if u don't care to explain just be informed of these logarithmic relations &amp; use them to simplify </p>

<p><img src="https://i.sstatic.net/58dul.jpg" alt="enter image description here"></p>

CC BY-SA 4.0
2020-04-18T09:48:59.963Z
Welcome! Please make an effort to make this answer useful.
emeryville
CC BY-SA 4.0
2020-04-18T18:28:54.783Z
What should I do?
ShAr
CC BY-SA 4.0
2020-04-18T19:17:58.640Z
Please read this https://economics.stackexchange.com/help/formatting and also use LaTeX commands, e.g. alpha should be written `$\alpha$` to get $\alpha$. Also write down in the post all the results in the image.
emeryville
CC BY-SA 4.0
2020-04-19T03:46:29.237Z
This could be a side note about the write format yes, but I was expecting comments on the topic & points discussed.
ShAr
CC BY-SA 4.0
2022-08-01T18:26:39.570Z
Hi ShAr, can you please look at my question which is about recursive model https://economics.stackexchange.com/questions/52248/keeping-up-with-johnes-utility-in-the-recursive-equilibrium-model
studentp
CC BY-SA 4.0
2020-04-17T18:54:36.080Z
2020-04-19T04:16:39.367Z
2020-04-19T04:16:39.367Z
ShAr
<p>Your value function is as follows:
<span class="math-container">$$
V_t[w] = \max_{c_t \in[0,w]} \left\{u(c_t) + \frac{1}{2}V_{t+1}[\alpha(w_t - c_t)] + \frac{1}{2}V_{t+1}[\beta(w_t-c_t)] \right\}
$$</span>
with the terminal condition
<span class="math-container">$$
V_{T}[w_T] = \max_{c_T \in [0,w_T]} u(c_T)
$$</span></p>

<p>So, we can solve this via backward induction. Clearly, at the final period <span class="math-container">$T$</span>, since <span class="math-container">$u$</span> is monotonic, we consume everything, so <span class="math-container">$V_T[w_T] = u(w_T) = \ln(w_T)$</span>. </p>

<p>Let us now consider one period previous, so period <span class="math-container">$T-1$</span>. The value function is:
<span class="math-container">$$
V_{T-1}[w] = \max_{c_{T-1} \in [0,w_{T-1}]} \left\{u(c_{T-1}) + \frac{1}{2}V_{T}[\alpha(w_{T-1} - c_{T-1})] + \frac{1}{2}V_{T}[\beta(w_{T-1}-c_{T-1})] \right\}
$$</span>
We already know what <span class="math-container">$V_T[\cdot]$</span> is, so substituting,
<span class="math-container">$$
V_{T-1}[w] = \max_{c_{T-1} \in [0,w_{T-1}]} \left\{u(c_{T-1}) + \frac{1}{2}u(\alpha(w_{T-1} - c_{T-1})) + \frac{1}{2}u(\beta(w_{T-1}-c_{T-1})) \right\}
$$</span>
considering the case <span class="math-container">$u(\cdot) = \ln(\cdot)$</span>,
<span class="math-container">$$
V_{T-1}[w] = \max_{c_{T-1} \in [0,w_{T-1}]} \left\{\ln(c_{T-1}) + \frac{1}{2}\ln(\alpha(w_{T-1} - c_{T-1})) + \frac{1}{2}\ln(\beta(w_{T-1}-c_{T-1})) \right\}
$$</span>
Take first order conditions, and we can get optimal <span class="math-container">$c_{T-1}^*(w_{T-1})$</span>.</p>

<p>Then we have solved what <span class="math-container">$V_{T-1}[\cdot]$</span> is! We can then do the same procedure by considering <span class="math-container">$V_{T-2}$</span>. Repeat until we get to <span class="math-container">$V_0$</span>.</p>

<p>EDIT to reflect comment.
You now know that <span class="math-container">$c^*_{T−1}(w_{−1})=\frac{\alpha\beta}{1 + \alpha \beta}w_{T-1}$</span>.
Plugging back into <span class="math-container">$V_{T-1}$</span>, we have solved for the value of <span class="math-container">$V_{T-1}$</span>,
<span class="math-container">\begin{align}
V_{T-1}[w] &amp;= \ln(\frac{\alpha\beta}{1 + \alpha \beta}w_{T-1}) + \frac{1}{2}\ln(\alpha(w_{T-1} - \frac{\alpha\beta}{1 + \alpha \beta}w_{T-1})) + \frac{1}{2}\ln(\beta(w_{T-1}-\frac{\alpha\beta}{1 + \alpha \beta}w_{T-1})) \\
&amp;=\ln(\frac{\alpha\beta}{1 + \alpha \beta}w_{T-1}) + \frac{1}{2}\ln(\alpha(\frac{w_{T-1}}{1 + \alpha \beta})) + \frac{1}{2}\ln(\beta(\frac{w_{T-1}}{1 + \alpha \beta}))
\end{align}</span></p>

<p>Finally, lets now go to <span class="math-container">$T-2$</span>. The value function is
<span class="math-container">$$
V_{T-2}[w] = \max_{c_{T-2} \in[0,w_{T-2}]} \left\{\ln(c_{T-2}) + \frac{1}{2}V_{T-1}[\alpha(w_{T-2} - c_{T-2})] + \frac{1}{2}V_{T-1}[\beta(w_{T-2}-c_{T-2})] \right\}
$$</span>
We just solved what <span class="math-container">$V_{T-1}$</span> is! Plug it in, and repeat.</p>

<p>This expression will probably blow up quite quickly, so it will be a pain to solve analytically.</p>

CC BY-SA 4.0
2019-11-21T10:26:34.823Z
Walrasian Auctioneer thank you very much! Does any book have these techiques gathered all together so as not to disturb anyone in the future :) for such a problem?
Nav89
CC BY-SA 4.0
2019-11-21T23:12:07.547Z
Well, if we solve thr FOC for $V_{T-1}$, we can take that $c^{*}_{T-1}(w_{T-1})=\dfrac{\alpha\beta}{1+\alpha\beta}w_{T-1}$. But, I am a little confused, about how to apply this result to find $V_{T-2}$ and so on until I find $V_0$
Nav89
CC BY-SA 4.0
2019-11-22T19:18:58.333Z
@Nav89 Hopefully the edited answer will be useful. As for techniques, Recursive Macroeconomic Theory Ljungqvist and Sargent is a standard graduate level textbook, but I think googling for lecture notes will be more useful.
Walrasian Auctioneer
CC BY-SA 4.0
2019-11-22T23:05:28.107Z
Walrasian Auctioneer Thank you for everything! I need to get back to the work!
Nav89
CC BY-SA 4.0
2022-08-01T18:25:16.560Z
Dear Walrasian Auctioneer user can you please my question which is about recursive competitive equilibrium model https://economics.stackexchange.com/questions/52248/keeping-up-with-johnes-utility-in-the-recursive-equilibrium-model
studentp
CC BY-SA 4.0
2019-11-21T00:18:48.183Z
2019-11-22T19:17:10.217Z
2019-11-22T19:17:10.217Z
Walrasian Auctioneer
<p>Let <span class="math-container">$w_t$</span> denote a consumer's wealth at time <span class="math-container">$t$</span> and <span class="math-container">$c_t$</span>,
the amount she chooses to consume, so her savings exiting this time period are <span class="math-container">$w_t-c_t$</span>. Given this savings decision, her savings <span class="math-container">$w_{t+1}$</span> at time <span class="math-container">$t+1$</span> are determined by a random process in which <span class="math-container">$w_{t+1}=\alpha w_t$</span> or <span class="math-container">$w_{t+1}=\beta w_t$</span>, where <span class="math-container">$\alpha,\beta$</span> are postitive constants, each with probability <span class="math-container">$\dfrac{1}{2}$</span> and independent of past rates of return on her savings. At time <span class="math-container">$t$</span>, when she is choosing <span class="math-container">$c_t$</span>, she knows <span class="math-container">$w_t$</span> but she doesn’t know
anything about future returns except the probabilistic law just given; she does know her past consumption decisions, of course, and past rates of return. Considering a log utility, i.e. <span class="math-container">$u(t)=ln(c_t)$</span> and assuming that the consumer is impatient, so that he discounts future utility by a factor <span class="math-container">$b$</span> each period, where <span class="math-container">$0 &lt; b &lt; 1$</span>, then the consumer's decision problem can be written as follows:
<span class="math-container">$$v(c_t)=\max_{c_t \geqslant 0}\sum_{t=0}^{T}b^{t}u(c_t)$$</span></p>

<p>If the consumer can not borrow, then what is the optimal consumption level for the consumer?</p>

<p><span class="math-container">$\underline{Note:}$</span> The problem is based on David M. Kreps' microeconomic theory book, but it is adjusted to be a finite horizon problem. Kreps, in his book, solves this problem in a fuzzy way for <span class="math-container">$T=3$</span>, that is not obvious to me. However, due to the fact that I know little of dynamic programming, since I am in the begining of examining this topic, I would appreciate it, if someone could provide a solution in the finite horizon. If the problem is not set in a rigorous way, I would be glad too to see somene making any appropriate change. I beleive that it is a classic problem in the field of economics.</p>

CC BY-SA 4.0
2019-11-16T05:14:25.913Z
Could you elaborate how $w_{t+1}$ evolves? Is it $\alpha w_t$ or $\alpha (w_t - c_t)$ (i.e. pre or post savings)?
Walrasian Auctioneer
CC BY-SA 4.0
2019-11-16T08:04:10.060Z
@Walrasian Auctioneer you are right! It is $\alpha(w_t-c_t)$, post savings!
Nav89
CC BY-SA 4.0
2019-11-19T23:44:41.720Z
Ok! Since nobody answered the question, I would like to know if there is some kind of cookbook which provides all the techniques for the dynamic programming (from deterministic to stochastic maths)?
Nav89
<optimization><dynamic-programming><dynamic-optimization><optimal-control><recursive-macroeconomics>
Dynamic programming, optimal consumption-savings (finite horizon) problem
Nav89
# Dynamic programming, optimal consumption-savings (finite horizon) problem

(Asked by: username_0 on 2019-11-11)

Let $w\_t$ denote a consumer's wealth at time $t$ and $c\_t$,
the amount she chooses to consume, so her savings exiting this time period are $w\_t-c\_t$. Given this savings decision, her savings $w\_{t+1}$ at time $t+1$ are determined by a random process in which $w\_{t+1}=\alpha w\_t$ or $w\_{t+1}=\beta w\_t$, where $\alpha,\beta$ are postitive constants, each with probability $\dfrac{1}{2}$ and independent of past rates of return on her savings. At time $t$, when she is choosing $c\_t$, she knows $w\_t$ but she doesn’t know
anything about future returns except the probabilistic law just given; she does know her past consumption decisions, of course, and past rates of return. Considering a log utility, i.e. $u(t)=ln(c\_t)$ and assuming that the consumer is impatient, so that he discounts future utility by a factor $b$ each period, where $0 < b < 1$, then the consumer's decision problem can be written as follows:
$$v(c\_t)=\max\_{c\_t \geqslant 0}\sum\_{t=0}^{T}b^{t}u(c\_t)$$

If the consumer can not borrow, then what is the optimal consumption level for the consumer?

$\underline{Note:}$ The problem is based on David M. Kreps' microeconomic theory book, but it is adjusted to be a finite horizon problem. Kreps, in his book, solves this problem in a fuzzy way for $T=3$, that is not obvious to me. However, due to the fact that I know little of dynamic programming, since I am in the begining of examining this topic, I would appreciate it, if someone could provide a solution in the finite horizon. If the problem is not set in a rigorous way, I would be glad too to see somene making any appropriate change. I beleive that it is a classic problem in the field of economics.

**Tags:** optimization, dynamic-programming, dynamic-optimization, optimal-control, recursive-macroeconomics
> **Comments:**
> **username_1**: Could you elaborate how $w_{t+1}$ evolves? Is it $\alpha w_t$ or $\alpha (w_t - c_t)$ (i.e. pre or post savings)?  
> **username_0**: @Walrasian Auctioneer you are right! It is $\alpha(w_t-c_t)$, post savings!  
> **username_0**: Ok! Since nobody answered the question, I would like to know if there is some kind of cookbook which provides all the techniques for the dynamic programming (from deterministic to stochastic maths)?  

---

## 2 answers

### Answer by username_1 on 2019-11-21. Score: 4 | Accepted answer

Your value function is as follows:
$$
V\_t[w] = \max\_{c\_t \in[0,w]} \left\{u(c\_t) + \frac{1}{2}V\_{t+1}[\alpha(w\_t - c\_t)] + \frac{1}{2}V\_{t+1}[\beta(w\_t-c\_t)] \right\}
$$
with the terminal condition
$$
V\_{T}[w\_T] = \max\_{c\_T \in [0,w\_T]} u(c\_T)
$$

So, we can solve this via backward induction. Clearly, at the final period $T$, since $u$ is monotonic, we consume everything, so $V\_T[w\_T] = u(w\_T) = \ln(w\_T)$.

Let us now consider one period previous, so period $T-1$. The value function is:
$$
V\_{T-1}[w] = \max\_{c\_{T-1} \in [0,w\_{T-1}]} \left\{u(c\_{T-1}) + \frac{1}{2}V\_{T}[\alpha(w\_{T-1} - c\_{T-1})] + \frac{1}{2}V\_{T}[\beta(w\_{T-1}-c\_{T-1})] \right\}
$$
We already know what $V\_T[\cdot]$ is, so substituting,
$$
V\_{T-1}[w] = \max\_{c\_{T-1} \in [0,w\_{T-1}]} \left\{u(c\_{T-1}) + \frac{1}{2}u(\alpha(w\_{T-1} - c\_{T-1})) + \frac{1}{2}u(\beta(w\_{T-1}-c\_{T-1})) \right\}
$$
considering the case $u(\cdot) = \ln(\cdot)$,
$$
V\_{T-1}[w] = \max\_{c\_{T-1} \in [0,w\_{T-1}]} \left\{\ln(c\_{T-1}) + \frac{1}{2}\ln(\alpha(w\_{T-1} - c\_{T-1})) + \frac{1}{2}\ln(\beta(w\_{T-1}-c\_{T-1})) \right\}
$$
Take first order conditions, and we can get optimal $c\_{T-1}^\*(w\_{T-1})$.

Then we have solved what $V\_{T-1}[\cdot]$ is! We can then do the same procedure by considering $V\_{T-2}$. Repeat until we get to $V\_0$.

EDIT to reflect comment.
You now know that $c^\*\_{T−1}(w\_{−1})=\frac{\alpha\beta}{1 + \alpha \beta}w\_{T-1}$.
Plugging back into $V\_{T-1}$, we have solved for the value of $V\_{T-1}$,
\begin{align}
V\_{T-1}[w] &= \ln(\frac{\alpha\beta}{1 + \alpha \beta}w\_{T-1}) + \frac{1}{2}\ln(\alpha(w\_{T-1} - \frac{\alpha\beta}{1 + \alpha \beta}w\_{T-1})) + \frac{1}{2}\ln(\beta(w\_{T-1}-\frac{\alpha\beta}{1 + \alpha \beta}w\_{T-1})) \\
&=\ln(\frac{\alpha\beta}{1 + \alpha \beta}w\_{T-1}) + \frac{1}{2}\ln(\alpha(\frac{w\_{T-1}}{1 + \alpha \beta})) + \frac{1}{2}\ln(\beta(\frac{w\_{T-1}}{1 + \alpha \beta}))
\end{align}

Finally, lets now go to $T-2$. The value function is
$$
V\_{T-2}[w] = \max\_{c\_{T-2} \in[0,w\_{T-2}]} \left\{\ln(c\_{T-2}) + \frac{1}{2}V\_{T-1}[\alpha(w\_{T-2} - c\_{T-2})] + \frac{1}{2}V\_{T-1}[\beta(w\_{T-2}-c\_{T-2})] \right\}
$$
We just solved what $V\_{T-1}$ is! Plug it in, and repeat.

This expression will probably blow up quite quickly, so it will be a pain to solve analytically.

> **Comments:**
> **username_0**: Walrasian Auctioneer thank you very much! Does any book have these techiques gathered all together so as not to disturb anyone in the future :) for such a problem?  
> **username_0**: Well, if we solve thr FOC for $V_{T-1}$, we can take that $c^{*}_{T-1}(w_{T-1})=\dfrac{\alpha\beta}{1+\alpha\beta}w_{T-1}$. But, I am a little confused, about how to apply this result to find $V_{T-2}$ and so on until I find $V_0$  
> **username_1**: @Nav89 Hopefully the edited answer will be useful. As for techniques, Recursive Macroeconomic Theory Ljungqvist and Sargent is a standard graduate level textbook, but I think googling for lecture notes will be more useful.  
> **username_0**: Walrasian Auctioneer Thank you for everything! I need to get back to the work!  
> **username_4**: Dear Walrasian Auctioneer user can you please my question which is about recursive competitive equilibrium model https://economics.stackexchange.com/questions/52248/keeping-up-with-johnes-utility-in-the-recursive-equilibrium-model  

---

### Answer by username_2 on 2020-04-17. Score: -4

I still can't comment, so this is not another answer it is adding some math to the given answer
Since

$ Log X\*Y = log X + log Y $

$ Log(X ^ i) = i \* log X
$

So substituting

$
Ln Z +1/2 Ln X + 1/2 Ln Y = Ln (z \* Srqt(X\*Y)) $

will simplify the expression a lot, but I have to reduce it in handwritten form because I'm writing from a phone now

You will reach

**$ max [ w\*(w-c)] $**

which clearly happens at

**$ c=w/2 $**

(try any values)

2- Also, are you sure of ur use of the term **"dynamic programming"**???

3- And I don't understand from where came the term

$ [ Alpha\*Beta / (Alpha\*Beta +1)] $ , that's why I substituted twice (in the original formula before this reduction too)

4- Finally, I don't see why didn't u substitute
$ V(t) = u(t) $ from the beginning to simplify things?
I simplified ur formulas mathematically, but I don't get how u reached the EQ (I admit I'm not specialized in ur field I came for an interdisciplinary problems).
I get that

$ Saving(t) = Return\_of\_Saving(t-1) + w(t)- c(t) $
Then u say her expected wealth "w" at time t+1 is an average of two values. So  
$ W(t+1)= (alpha + beta) /2 \* W(t) + Income(t+1) - C(t+1) $
- that u have to add a factor for the decrease of money value & the increase of prices with time, that's ur "b" in the maximization formula right?

Anyways, if u don't care to explain just be informed of these logarithmic relations & use them to simplify

![enter image description here](https://i.sstatic.net/58dul.jpg)

> **Comments:**
> **username_3**: Welcome! Please make an effort to make this answer useful.  
> **username_2**: What should I do?  
> **username_3**: Please read this https://economics.stackexchange.com/help/formatting and also use LaTeX commands, e.g. alpha should be written `$\alpha$` to get $\alpha$. Also write down in the post all the results in the image.  
> **username_2**: This could be a side note about the write format yes, but I was expecting comments on the topic & points discussed.  
> **username_4**: Hi ShAr, can you please look at my question which is about recursive model https://economics.stackexchange.com/questions/52248/keeping-up-with-johnes-utility-in-the-recursive-equilibrium-model  

---

