Cake Eating in Finite and Infinite Time
The following was implemented in Maple by Marcus Davidsson (2008) davidsson_marcus@hotmail.com
and is based upon the work by Adamek (2006) The Cake-Eating Problem
1) Cake Eating in Finite Time
Introduction
We assume that we have a cake that in the first period has a size of CS(1)
We now assume that we have five time periods. We assume that we consume a fraction of the cake in each time period denoted by C(1), C(2), C(3), C(4).
Note that we assume that the cake is completly gone in the fifth time period which means that our consumption in period five is zero
The equation of motion for the cake size in each periods are given by
We will now derive the expressions for consumption in the four periods
Period-1
The cake size in the last period is given by
where C(1), C(2), C(3) and C(4) are the amount of consumtion in each period
We again assume that all cake is gone in the last period which means that CS(5)=0.
If we plug this into the previous equation then we get the expression for the terminal condition in period one
We can now express this equation in C(1) terms only.
Note that we discount consumption over time where B^t is a discount factor. Note that B=1/(1+r) where r is the interest rate.
Note that since B^t < 1 it means that consumption will be decreasing over time
If we plug the all the rewritten expressions into the previous equation we get
We now solve for CS(1)
We now note that
We know that
We now multiply both sides by B so we get
Which can be written as
Now we know that X and Y are given by
We now subtract BCS(initial) from both sides of CS(initial) so we get
We now divide both sides by (1-B) so we get
We can now solve for C(1)
Which is the expression for the optimal consumtion in period one
Period-2
Our terminal condition for period two is given by
We can now express this equation in C(2) terms only.
If we plug that into the previous equation we get
We now solve for CS(2)
We now subtract BCS(2) from both sides of CS(2) so we get
We can now solve for C(2)
Which is the expression for the optimal consumtion in period two
Period-3
Our terminal condition for period three is given by
We can now express this equation in C(3) terms only.
We now solve for CS(3)
We now subtract BCS(3) from both sides of CS(3) so we get
We can now solve for C(3)
Which is the expression for the optimal consumtion in period three
Period-4
The above equation is already express in only C(4) terms which means that we can solve for consumption directly
Which is the expression for the optimal consumtion in period four
Consumtion Dynamics Over Time
We can now visualize the dynamics of consumtion over time
We first note that the equations of motion for the cake size in period two and three are given by
This means that the equation of motions can be written as
We now assume that
Which means that the amount of consupmtion in each period are given by
We first make sure that all cake is consumed
We can now plot the consumption over time
We can now plot the cake size over time
Alternative Formulation
Note that we could have solved the above problem in a much more straight forward way
We assume that our utility from cake consumption at time t is given by
We now note that we discount utility from cake consumption over time.
The discounting is done through a discount factor B^t where B=1/(1+r) and r is the interest rate. Note that since B^t < 1 it means that will be decreasing over time.
We now note that our objective is to maximize the sum of the discounted utility form consumption over time as seen below
If we plug in the previous expression in this equation we get
In our case our objective function Ob is therefor given by
We again assume that
This gives us
Which is the same values of , , and we had before
2) Cake Eating in infinite Time
The cake size in the end for a n period example is given by
We again assume that all cake is gone in the last period which means that CS(n+1)=0.
which can be written as
##########################################
if we assume that
then the sum
can be approximated by
The sum of can therefor be approximated by the expression
which means that we can write the above expression as
which gives us
which means that that consumption is given by
when then
We can show this by noting that
This means that our previous equation is reduced to
We can now visualize the consumtion and cake size over time
Consumption vector
Cake size vector
Legal Notice: The copyright for this application is owned by the authors. Neither Maplesoft nor the authors are responsible for any errors contained within and are not liable for any damages resulting from the use of this material.. This application is intended for non-commercial, non-profit use only. Contact the authors for permission if you wish to use this application in for-profit activities.