SlideShare a Scribd company logo
Mathematical blog #2: Recursion
Introduction
In history, mankind is continuously faced with problems and we try to come to a solution using our
knowledge, mind and experiences. ‘Recursion’ is one way of thinking (approaching) a given problem
and is one the central ideas of computer science and thus optimization in this continuously in
complexity growing supply chain world.
In a formal definition, recursion is the philosophy that underlies the analysis of many models,
particularly dynamic ones. The principle, popularized by Bellman and developed by R. Howard under
the name ‘dynamic programming’, is to decompose a complicated problem into a series of smaller,
simpler problems.
Within this dynamic programming, you have a distinction between deterministic and probabilistic
programming. Probabilistic programming is highly effective as applied to multi-stage decisions,
whereby, as the name implies, opportunities to revise previous decisions occur time and again,
eliminating the need for a single once-and-for-all decision. For this reason, probabilistic dynamic
programming, has one or two possible applications in the theory of inventory control. For instance, in
the determination of the levels s and S in an (s, S) order policy (min-max policy) and in the calculation
of optimum production levels.
The remainder of the blog will deal with an example of applying probabilistic dynamic programming
in the real-world and the application of it in inventory control.
Parking Spaces
In this problem (MacQueen and Miller, 1960), you are driving down a one-way road toward your
destination, looking for a parking space. As you drive along, you can observe only one parking space
at a time, the one right next to you, noting whether or not it is vacant. If it is vacant, you may either (1)
stop and park there or (2) drive on to the next space. If it is occupied (not vacant), then you must
drive on to the next space. You cannot return to vacant spaces that you have passed. Assume that
vacant spaces occur independently and that the probability that any given space is vacant is p where
0 < p < 1. If you have not parked by the time you reach your destination, you must park in the payed
parking lot, at a cost of c. If you park x spaces away from your destination, then you consider that a
parking cost of x has been incurred. The closest space (before reaching the pay parking lot) to your
destination is one space away from your destination: x=1. For convenience, we interpret space x=0 as
existing and corresponding to having driven by the last available space, so the only option left is the
pay lot. Furthermore, c > 1: There are possible spaces that are better than going straight to the pay
lot. Your objective is to minimize your total expected parking cost.
Let the state s = (x, i) be defined by the number x of the space that is being approached, and i, which
is the availability of the space: i=0 indicates that the space is vacant and i=1 indicates that the space is
occupied. For example, if s = (3,0) then you are still looking for a space, have approached the spot
that is three spaces away from your destination, and it is vacant. Let a=0 denote the decision to park
and let a=1 denote the decision to drive to the next space. If you decide to park (having observed
state (3,0)), you incur the cost of 3 and the process ends.
Both options are available if the space is vacant: A(x,0) = {0,1}, and you must drive to the next spot if
the space is occupied: A(x,1)={1}, for all x.
Now let f(s) = f(x, i) denote the minimum expected cost of parking, starting in state s (space x with
availability i). For state s = (1, i) for example, the expected costs can be denoted as follows:
𝑓(1, 𝑖) = {
min(1, 𝑐) = 1 𝑖𝑓 𝑖 = 0
𝑐 𝑖𝑓 𝑖 = 1
(1.1)
That is, if i=0, you have a choice of parking now (choosing a=0), resulting in a cost of 1, or driving
past (choosing a=1), which means that you must park in the pay lot resulting in a cost of c. Since, by
assumption, c > 1, you prefer to park if you can.
It is convenient to define another function, which facilitates the general analysis.
For x ≥ 0, let
𝐹( 𝑥) ≔ 𝑝𝑓( 𝑥,0) + 𝑞𝑓( 𝑥,1), (1.2)
where q ≔ 1-p is the probability that a space is occupied. F(x) is the minimum expected cost of
parking, given that you are approaching space x (still looking to park) but have not yet observed its
availability. If the space is vacant, which occurs with probability p, the optimal cost will be f(x,0) and if
it is occupied (probability q), the cost will be f(x,1).
The expected costs for all states s = (x, i) can therefore be denoted as
𝑓( 𝑥, 𝑖) = {
min( 𝑥, 𝐹( 𝑥 − 1)) 𝑖𝑓 𝑖 = 0
𝐹( 𝑥 − 1) 𝑖𝑓 𝑖 = 1
(1.3)
In words, suppose that you approach space x (still looking to park) and observe that its availability. If
the space is available, then you can choose to park there, and incur cost x, or drive on to the next
space and incur the optimal cost of doing so, namely F(x-1). If x ≤ F(x-1), then it is optimal to park.
Otherwise, it is optimal to drive on. If space x is occupied, you must drive to the next space and face
the optimal expected cost, F(x-1) of doing so.
Now, if we use the understanding of above, we can interpret F(x-1) – x as the saving by driving to the
next space, closer to our destination. Let’s denote this as
𝑔( 𝑥) ≔ 𝐹( 𝑥 − 1) − 𝑥, (1.4)
which state that g(x) is negative number when driving to the next space if beneficial to drive to next
space. If it is positive, we have to park in x.
It is also easy to see, that we can write g(x+1) as
𝑔( 𝑥 + 1) = −1 + 𝑝(min(0, 𝑔( 𝑥)) + 𝑞𝑔( 𝑥), (1.5)
If we work backwards using (1.5) and using the understanding of the recursion in (1.4), it’s easy to
verify that we have to find a so-called cutoff point (let’s call this S) where g(x) is positive and g(x+1) is
negative. We can therefore solve (1.5) for every state, starting at x=0 and find our optimal cutoff point.
For example, suppose p = 0.2 and c =5. Then g(1) = c-1 =4. Using (1.4), we compute g(x) for
increasing values of x until g(x) < 0, at which point the optimal policy has been found. Here, g(2)= -1
+0.2(0)+0.8(4)=2.2, g(3)= -1+0.2(0)+0.8(2.2)=0.76, and g(4)= -1+0.2(0)+0.8(0.76)=-0.392. This means
that the optimal cutoff point is x=3. This means that you could drive straight to x=3 and park there if
it is vacant.
Application in inventory control
The example of probabilistic dynamic programming is already quite complex to comprehend when
you don’t have a specific background. When we extend this problem to an infinite horizon and
multiple parameters (what is mostly the case in inventory control), the solution becomes even more
complex.
Within inventory control, the most significant benefit of probabilistic dynamic programming, is to find
an optimal order strategy. The optimal order strategy in theory is an s, S policy. This means that you
have an order level of s and when your inventory position is going under this order level s, you have
to order up to ceiling S. Although literature provides solid solutions (eg. Bartmann (1992), Federgruen
& Zheng, 1991) to this problem, there are some drawbacks in these solutions. They are
incomprehensive to inventory controllers with not a specific mathematical background and most
software packages don’t contain these algorithms or techniques and/or are not transparent in it.
One way to avoid the above drawbacks, is computing the order level s in a formal way (see for
example Axsäter, 2006) and compute S as s added with the economic order quantity (EOQ). This
yields an approximate solution where the total cost deviation is at his minimum.
Next blog
The next blog will be about probability theory: distributions and numerical integration. The
applications in inventory control to be discussed in this blog will be mainly determining order levels.
Further questions or discussions on recursion can be addressed to s.pauly@slimstock.com.

More Related Content

What's hot

Lecture 3 qualtifed rules of inference
Lecture 3 qualtifed rules of inferenceLecture 3 qualtifed rules of inference
Lecture 3 qualtifed rules of inferenceasimnawaz54
 
Lecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inferenceLecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inferenceasimnawaz54
 
I2ml3e chap2
I2ml3e chap2I2ml3e chap2
I2ml3e chap2
sreedevibalasubraman
 
Ch6
Ch6Ch6
Binary Session Types for Psi-Calculi (APLAS 2016)
Binary Session Types for Psi-Calculi (APLAS 2016)Binary Session Types for Psi-Calculi (APLAS 2016)
Binary Session Types for Psi-Calculi (APLAS 2016)
Hans Hyttel
 
A Theory of the Learnable; PAC Learning
A Theory of the Learnable; PAC LearningA Theory of the Learnable; PAC Learning
A Theory of the Learnable; PAC Learning
dhruvgairola
 
Predicates and Quantifiers
Predicates and QuantifiersPredicates and Quantifiers
Predicates and Quantifiers
blaircomp2003
 
The False-Position Method
The False-Position MethodThe False-Position Method
The False-Position MethodTayyaba Abbas
 
Quantifier
QuantifierQuantifier
Application of derivatives
Application of derivativesApplication of derivatives
Application of derivatives
MD.ASHIQUZZAMAN KHONDAKER
 
Daa chapter11
Daa chapter11Daa chapter11
Daa chapter11
B.Kirron Reddi
 
Presentation aust final
Presentation aust finalPresentation aust final
Presentation aust final
Satyajit Nag Mithu
 
Discrete Random Variables And Probability Distributions
Discrete Random Variables And Probability DistributionsDiscrete Random Variables And Probability Distributions
Discrete Random Variables And Probability Distributions
DataminingTools Inc
 
Application of derivatives
Application of derivatives Application of derivatives
Application of derivatives
Seyid Kadher
 
Predicates and Quantifiers
Predicates and Quantifiers Predicates and Quantifiers
Predicates and Quantifiers
Istiak Ahmed
 
Predicate &amp; quantifier
Predicate &amp; quantifierPredicate &amp; quantifier
Predicate &amp; quantifier
University of Potsdam
 

What's hot (18)

Lecture 3 qualtifed rules of inference
Lecture 3 qualtifed rules of inferenceLecture 3 qualtifed rules of inference
Lecture 3 qualtifed rules of inference
 
Lecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inferenceLecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inference
 
PAC Learning
PAC LearningPAC Learning
PAC Learning
 
I2ml3e chap2
I2ml3e chap2I2ml3e chap2
I2ml3e chap2
 
Ch6
Ch6Ch6
Ch6
 
Binary Session Types for Psi-Calculi (APLAS 2016)
Binary Session Types for Psi-Calculi (APLAS 2016)Binary Session Types for Psi-Calculi (APLAS 2016)
Binary Session Types for Psi-Calculi (APLAS 2016)
 
A Theory of the Learnable; PAC Learning
A Theory of the Learnable; PAC LearningA Theory of the Learnable; PAC Learning
A Theory of the Learnable; PAC Learning
 
Predicates and Quantifiers
Predicates and QuantifiersPredicates and Quantifiers
Predicates and Quantifiers
 
The False-Position Method
The False-Position MethodThe False-Position Method
The False-Position Method
 
Quantifier
QuantifierQuantifier
Quantifier
 
Application of derivatives
Application of derivativesApplication of derivatives
Application of derivatives
 
Daa chapter11
Daa chapter11Daa chapter11
Daa chapter11
 
Presentation aust final
Presentation aust finalPresentation aust final
Presentation aust final
 
Discrete Random Variables And Probability Distributions
Discrete Random Variables And Probability DistributionsDiscrete Random Variables And Probability Distributions
Discrete Random Variables And Probability Distributions
 
Limit
LimitLimit
Limit
 
Application of derivatives
Application of derivatives Application of derivatives
Application of derivatives
 
Predicates and Quantifiers
Predicates and Quantifiers Predicates and Quantifiers
Predicates and Quantifiers
 
Predicate &amp; quantifier
Predicate &amp; quantifierPredicate &amp; quantifier
Predicate &amp; quantifier
 

Similar to Mathematical blog #2

OPERATIONS RESEARCH
OPERATIONS RESEARCHOPERATIONS RESEARCH
OPERATIONS RESEARCH
Makaha Rutendo
 
Reference Frame Introduction
Reference Frame IntroductionReference Frame Introduction
Reference Frame Introduction
Build Intuit
 
Chapter 01 - p2.pdf
Chapter 01 - p2.pdfChapter 01 - p2.pdf
Chapter 01 - p2.pdf
smarwaneid
 
A043001006
A043001006A043001006
A043001006
inventy
 
A043001006
A043001006A043001006
A043001006
inventy
 
A043001006
A043001006A043001006
A043001006
inventy
 
Modified Procedure to Solve Fuzzy Transshipment Problem by using Trapezoidal ...
Modified Procedure to Solve Fuzzy Transshipment Problem by using Trapezoidal ...Modified Procedure to Solve Fuzzy Transshipment Problem by using Trapezoidal ...
Modified Procedure to Solve Fuzzy Transshipment Problem by using Trapezoidal ...
inventionjournals
 
Dynamic programming
Dynamic programmingDynamic programming
Dynamic programming
Jay Nagar
 
Machine learning (1)
Machine learning (1)Machine learning (1)
Machine learning (1)NYversity
 
Project in Calcu
Project in CalcuProject in Calcu
Project in Calcupatrickpaz
 
The Weak Solution of Black-Scholes Option Pricing Model with Transaction Cost
The Weak Solution of Black-Scholes Option Pricing Model with Transaction CostThe Weak Solution of Black-Scholes Option Pricing Model with Transaction Cost
The Weak Solution of Black-Scholes Option Pricing Model with Transaction Cost
mathsjournal
 
THE WEAK SOLUTION OF BLACK-SCHOLE’S OPTION PRICING MODEL WITH TRANSACTION COST
THE WEAK SOLUTION OF BLACK-SCHOLE’S OPTION PRICING MODEL WITH TRANSACTION COSTTHE WEAK SOLUTION OF BLACK-SCHOLE’S OPTION PRICING MODEL WITH TRANSACTION COST
THE WEAK SOLUTION OF BLACK-SCHOLE’S OPTION PRICING MODEL WITH TRANSACTION COST
mathsjournal
 
THE WEAK SOLUTION OF BLACK-SCHOLE’S OPTION PRICING MODEL WITH TRANSACTION COST
THE WEAK SOLUTION OF BLACK-SCHOLE’S OPTION PRICING MODEL WITH TRANSACTION COSTTHE WEAK SOLUTION OF BLACK-SCHOLE’S OPTION PRICING MODEL WITH TRANSACTION COST
THE WEAK SOLUTION OF BLACK-SCHOLE’S OPTION PRICING MODEL WITH TRANSACTION COST
mathsjournal
 
THE WEAK SOLUTION OF BLACK-SCHOLE’S OPTION PRICING MODEL WITH TRANSACTION COST
THE WEAK SOLUTION OF BLACK-SCHOLE’S OPTION PRICING MODEL WITH TRANSACTION COSTTHE WEAK SOLUTION OF BLACK-SCHOLE’S OPTION PRICING MODEL WITH TRANSACTION COST
THE WEAK SOLUTION OF BLACK-SCHOLE’S OPTION PRICING MODEL WITH TRANSACTION COST
mathsjournal
 
THE WEAK SOLUTION OF BLACK-SCHOLE’S OPTION PRICING MODEL WITH TRANSACTION COST
THE WEAK SOLUTION OF BLACK-SCHOLE’S OPTION PRICING MODEL WITH TRANSACTION COSTTHE WEAK SOLUTION OF BLACK-SCHOLE’S OPTION PRICING MODEL WITH TRANSACTION COST
THE WEAK SOLUTION OF BLACK-SCHOLE’S OPTION PRICING MODEL WITH TRANSACTION COST
mathsjournal
 
Applicationofpartialderivativeswithtwovariables 140225070102-phpapp01 (1)
Applicationofpartialderivativeswithtwovariables 140225070102-phpapp01 (1)Applicationofpartialderivativeswithtwovariables 140225070102-phpapp01 (1)
Applicationofpartialderivativeswithtwovariables 140225070102-phpapp01 (1)shreemadghodasra
 
lec18_ref.pdf
lec18_ref.pdflec18_ref.pdf
lec18_ref.pdf
vishal choudhary
 
Application of partial derivatives with two variables
Application of partial derivatives with two variablesApplication of partial derivatives with two variables
Application of partial derivatives with two variables
Sagar Patel
 
04 Machine Learning - Supervised Linear Classifier
04 Machine Learning - Supervised Linear Classifier 04 Machine Learning - Supervised Linear Classifier
04 Machine Learning - Supervised Linear Classifier
Andres Mendez-Vazquez
 

Similar to Mathematical blog #2 (20)

OPERATIONS RESEARCH
OPERATIONS RESEARCHOPERATIONS RESEARCH
OPERATIONS RESEARCH
 
Reference Frame Introduction
Reference Frame IntroductionReference Frame Introduction
Reference Frame Introduction
 
Chapter 01 - p2.pdf
Chapter 01 - p2.pdfChapter 01 - p2.pdf
Chapter 01 - p2.pdf
 
A043001006
A043001006A043001006
A043001006
 
A043001006
A043001006A043001006
A043001006
 
A043001006
A043001006A043001006
A043001006
 
Modified Procedure to Solve Fuzzy Transshipment Problem by using Trapezoidal ...
Modified Procedure to Solve Fuzzy Transshipment Problem by using Trapezoidal ...Modified Procedure to Solve Fuzzy Transshipment Problem by using Trapezoidal ...
Modified Procedure to Solve Fuzzy Transshipment Problem by using Trapezoidal ...
 
Dynamic programming
Dynamic programmingDynamic programming
Dynamic programming
 
Machine learning (1)
Machine learning (1)Machine learning (1)
Machine learning (1)
 
Project in Calcu
Project in CalcuProject in Calcu
Project in Calcu
 
The Weak Solution of Black-Scholes Option Pricing Model with Transaction Cost
The Weak Solution of Black-Scholes Option Pricing Model with Transaction CostThe Weak Solution of Black-Scholes Option Pricing Model with Transaction Cost
The Weak Solution of Black-Scholes Option Pricing Model with Transaction Cost
 
THE WEAK SOLUTION OF BLACK-SCHOLE’S OPTION PRICING MODEL WITH TRANSACTION COST
THE WEAK SOLUTION OF BLACK-SCHOLE’S OPTION PRICING MODEL WITH TRANSACTION COSTTHE WEAK SOLUTION OF BLACK-SCHOLE’S OPTION PRICING MODEL WITH TRANSACTION COST
THE WEAK SOLUTION OF BLACK-SCHOLE’S OPTION PRICING MODEL WITH TRANSACTION COST
 
THE WEAK SOLUTION OF BLACK-SCHOLE’S OPTION PRICING MODEL WITH TRANSACTION COST
THE WEAK SOLUTION OF BLACK-SCHOLE’S OPTION PRICING MODEL WITH TRANSACTION COSTTHE WEAK SOLUTION OF BLACK-SCHOLE’S OPTION PRICING MODEL WITH TRANSACTION COST
THE WEAK SOLUTION OF BLACK-SCHOLE’S OPTION PRICING MODEL WITH TRANSACTION COST
 
THE WEAK SOLUTION OF BLACK-SCHOLE’S OPTION PRICING MODEL WITH TRANSACTION COST
THE WEAK SOLUTION OF BLACK-SCHOLE’S OPTION PRICING MODEL WITH TRANSACTION COSTTHE WEAK SOLUTION OF BLACK-SCHOLE’S OPTION PRICING MODEL WITH TRANSACTION COST
THE WEAK SOLUTION OF BLACK-SCHOLE’S OPTION PRICING MODEL WITH TRANSACTION COST
 
THE WEAK SOLUTION OF BLACK-SCHOLE’S OPTION PRICING MODEL WITH TRANSACTION COST
THE WEAK SOLUTION OF BLACK-SCHOLE’S OPTION PRICING MODEL WITH TRANSACTION COSTTHE WEAK SOLUTION OF BLACK-SCHOLE’S OPTION PRICING MODEL WITH TRANSACTION COST
THE WEAK SOLUTION OF BLACK-SCHOLE’S OPTION PRICING MODEL WITH TRANSACTION COST
 
Applicationofpartialderivativeswithtwovariables 140225070102-phpapp01 (1)
Applicationofpartialderivativeswithtwovariables 140225070102-phpapp01 (1)Applicationofpartialderivativeswithtwovariables 140225070102-phpapp01 (1)
Applicationofpartialderivativeswithtwovariables 140225070102-phpapp01 (1)
 
Ch10 Recursion
Ch10 RecursionCh10 Recursion
Ch10 Recursion
 
lec18_ref.pdf
lec18_ref.pdflec18_ref.pdf
lec18_ref.pdf
 
Application of partial derivatives with two variables
Application of partial derivatives with two variablesApplication of partial derivatives with two variables
Application of partial derivatives with two variables
 
04 Machine Learning - Supervised Linear Classifier
04 Machine Learning - Supervised Linear Classifier 04 Machine Learning - Supervised Linear Classifier
04 Machine Learning - Supervised Linear Classifier
 

Recently uploaded

The use of Nauplii and metanauplii artemia in aquaculture (brine shrimp).pptx
The use of Nauplii and metanauplii artemia in aquaculture (brine shrimp).pptxThe use of Nauplii and metanauplii artemia in aquaculture (brine shrimp).pptx
The use of Nauplii and metanauplii artemia in aquaculture (brine shrimp).pptx
MAGOTI ERNEST
 
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
yqqaatn0
 
Unveiling the Energy Potential of Marshmallow Deposits.pdf
Unveiling the Energy Potential of Marshmallow Deposits.pdfUnveiling the Energy Potential of Marshmallow Deposits.pdf
Unveiling the Energy Potential of Marshmallow Deposits.pdf
Erdal Coalmaker
 
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATIONPRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
ChetanK57
 
20240520 Planning a Circuit Simulator in JavaScript.pptx
20240520 Planning a Circuit Simulator in JavaScript.pptx20240520 Planning a Circuit Simulator in JavaScript.pptx
20240520 Planning a Circuit Simulator in JavaScript.pptx
Sharon Liu
 
Salas, V. (2024) "John of St. Thomas (Poinsot) on the Science of Sacred Theol...
Salas, V. (2024) "John of St. Thomas (Poinsot) on the Science of Sacred Theol...Salas, V. (2024) "John of St. Thomas (Poinsot) on the Science of Sacred Theol...
Salas, V. (2024) "John of St. Thomas (Poinsot) on the Science of Sacred Theol...
Studia Poinsotiana
 
原版制作(carleton毕业证书)卡尔顿大学毕业证硕士文凭原版一模一样
原版制作(carleton毕业证书)卡尔顿大学毕业证硕士文凭原版一模一样原版制作(carleton毕业证书)卡尔顿大学毕业证硕士文凭原版一模一样
原版制作(carleton毕业证书)卡尔顿大学毕业证硕士文凭原版一模一样
yqqaatn0
 
DERIVATION OF MODIFIED BERNOULLI EQUATION WITH VISCOUS EFFECTS AND TERMINAL V...
DERIVATION OF MODIFIED BERNOULLI EQUATION WITH VISCOUS EFFECTS AND TERMINAL V...DERIVATION OF MODIFIED BERNOULLI EQUATION WITH VISCOUS EFFECTS AND TERMINAL V...
DERIVATION OF MODIFIED BERNOULLI EQUATION WITH VISCOUS EFFECTS AND TERMINAL V...
Wasswaderrick3
 
Chapter 12 - climate change and the energy crisis
Chapter 12 - climate change and the energy crisisChapter 12 - climate change and the energy crisis
Chapter 12 - climate change and the energy crisis
tonzsalvador2222
 
Lateral Ventricles.pdf very easy good diagrams comprehensive
Lateral Ventricles.pdf very easy good diagrams comprehensiveLateral Ventricles.pdf very easy good diagrams comprehensive
Lateral Ventricles.pdf very easy good diagrams comprehensive
silvermistyshot
 
Leaf Initiation, Growth and Differentiation.pdf
Leaf Initiation, Growth and Differentiation.pdfLeaf Initiation, Growth and Differentiation.pdf
Leaf Initiation, Growth and Differentiation.pdf
RenuJangid3
 
Shallowest Oil Discovery of Turkiye.pptx
Shallowest Oil Discovery of Turkiye.pptxShallowest Oil Discovery of Turkiye.pptx
Shallowest Oil Discovery of Turkiye.pptx
Gokturk Mehmet Dilci
 
Orion Air Quality Monitoring Systems - CWS
Orion Air Quality Monitoring Systems - CWSOrion Air Quality Monitoring Systems - CWS
Orion Air Quality Monitoring Systems - CWS
Columbia Weather Systems
 
Nutraceutical market, scope and growth: Herbal drug technology
Nutraceutical market, scope and growth: Herbal drug technologyNutraceutical market, scope and growth: Herbal drug technology
Nutraceutical market, scope and growth: Herbal drug technology
Lokesh Patil
 
nodule formation by alisha dewangan.pptx
nodule formation by alisha dewangan.pptxnodule formation by alisha dewangan.pptx
nodule formation by alisha dewangan.pptx
alishadewangan1
 
In silico drugs analogue design: novobiocin analogues.pptx
In silico drugs analogue design: novobiocin analogues.pptxIn silico drugs analogue design: novobiocin analogues.pptx
In silico drugs analogue design: novobiocin analogues.pptx
AlaminAfendy1
 
DMARDs Pharmacolgy Pharm D 5th Semester.pdf
DMARDs Pharmacolgy Pharm D 5th Semester.pdfDMARDs Pharmacolgy Pharm D 5th Semester.pdf
DMARDs Pharmacolgy Pharm D 5th Semester.pdf
fafyfskhan251kmf
 
bordetella pertussis.................................ppt
bordetella pertussis.................................pptbordetella pertussis.................................ppt
bordetella pertussis.................................ppt
kejapriya1
 
NuGOweek 2024 Ghent programme overview flyer
NuGOweek 2024 Ghent programme overview flyerNuGOweek 2024 Ghent programme overview flyer
NuGOweek 2024 Ghent programme overview flyer
pablovgd
 
ISI 2024: Application Form (Extended), Exam Date (Out), Eligibility
ISI 2024: Application Form (Extended), Exam Date (Out), EligibilityISI 2024: Application Form (Extended), Exam Date (Out), Eligibility
ISI 2024: Application Form (Extended), Exam Date (Out), Eligibility
SciAstra
 

Recently uploaded (20)

The use of Nauplii and metanauplii artemia in aquaculture (brine shrimp).pptx
The use of Nauplii and metanauplii artemia in aquaculture (brine shrimp).pptxThe use of Nauplii and metanauplii artemia in aquaculture (brine shrimp).pptx
The use of Nauplii and metanauplii artemia in aquaculture (brine shrimp).pptx
 
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
 
Unveiling the Energy Potential of Marshmallow Deposits.pdf
Unveiling the Energy Potential of Marshmallow Deposits.pdfUnveiling the Energy Potential of Marshmallow Deposits.pdf
Unveiling the Energy Potential of Marshmallow Deposits.pdf
 
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATIONPRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
 
20240520 Planning a Circuit Simulator in JavaScript.pptx
20240520 Planning a Circuit Simulator in JavaScript.pptx20240520 Planning a Circuit Simulator in JavaScript.pptx
20240520 Planning a Circuit Simulator in JavaScript.pptx
 
Salas, V. (2024) "John of St. Thomas (Poinsot) on the Science of Sacred Theol...
Salas, V. (2024) "John of St. Thomas (Poinsot) on the Science of Sacred Theol...Salas, V. (2024) "John of St. Thomas (Poinsot) on the Science of Sacred Theol...
Salas, V. (2024) "John of St. Thomas (Poinsot) on the Science of Sacred Theol...
 
原版制作(carleton毕业证书)卡尔顿大学毕业证硕士文凭原版一模一样
原版制作(carleton毕业证书)卡尔顿大学毕业证硕士文凭原版一模一样原版制作(carleton毕业证书)卡尔顿大学毕业证硕士文凭原版一模一样
原版制作(carleton毕业证书)卡尔顿大学毕业证硕士文凭原版一模一样
 
DERIVATION OF MODIFIED BERNOULLI EQUATION WITH VISCOUS EFFECTS AND TERMINAL V...
DERIVATION OF MODIFIED BERNOULLI EQUATION WITH VISCOUS EFFECTS AND TERMINAL V...DERIVATION OF MODIFIED BERNOULLI EQUATION WITH VISCOUS EFFECTS AND TERMINAL V...
DERIVATION OF MODIFIED BERNOULLI EQUATION WITH VISCOUS EFFECTS AND TERMINAL V...
 
Chapter 12 - climate change and the energy crisis
Chapter 12 - climate change and the energy crisisChapter 12 - climate change and the energy crisis
Chapter 12 - climate change and the energy crisis
 
Lateral Ventricles.pdf very easy good diagrams comprehensive
Lateral Ventricles.pdf very easy good diagrams comprehensiveLateral Ventricles.pdf very easy good diagrams comprehensive
Lateral Ventricles.pdf very easy good diagrams comprehensive
 
Leaf Initiation, Growth and Differentiation.pdf
Leaf Initiation, Growth and Differentiation.pdfLeaf Initiation, Growth and Differentiation.pdf
Leaf Initiation, Growth and Differentiation.pdf
 
Shallowest Oil Discovery of Turkiye.pptx
Shallowest Oil Discovery of Turkiye.pptxShallowest Oil Discovery of Turkiye.pptx
Shallowest Oil Discovery of Turkiye.pptx
 
Orion Air Quality Monitoring Systems - CWS
Orion Air Quality Monitoring Systems - CWSOrion Air Quality Monitoring Systems - CWS
Orion Air Quality Monitoring Systems - CWS
 
Nutraceutical market, scope and growth: Herbal drug technology
Nutraceutical market, scope and growth: Herbal drug technologyNutraceutical market, scope and growth: Herbal drug technology
Nutraceutical market, scope and growth: Herbal drug technology
 
nodule formation by alisha dewangan.pptx
nodule formation by alisha dewangan.pptxnodule formation by alisha dewangan.pptx
nodule formation by alisha dewangan.pptx
 
In silico drugs analogue design: novobiocin analogues.pptx
In silico drugs analogue design: novobiocin analogues.pptxIn silico drugs analogue design: novobiocin analogues.pptx
In silico drugs analogue design: novobiocin analogues.pptx
 
DMARDs Pharmacolgy Pharm D 5th Semester.pdf
DMARDs Pharmacolgy Pharm D 5th Semester.pdfDMARDs Pharmacolgy Pharm D 5th Semester.pdf
DMARDs Pharmacolgy Pharm D 5th Semester.pdf
 
bordetella pertussis.................................ppt
bordetella pertussis.................................pptbordetella pertussis.................................ppt
bordetella pertussis.................................ppt
 
NuGOweek 2024 Ghent programme overview flyer
NuGOweek 2024 Ghent programme overview flyerNuGOweek 2024 Ghent programme overview flyer
NuGOweek 2024 Ghent programme overview flyer
 
ISI 2024: Application Form (Extended), Exam Date (Out), Eligibility
ISI 2024: Application Form (Extended), Exam Date (Out), EligibilityISI 2024: Application Form (Extended), Exam Date (Out), Eligibility
ISI 2024: Application Form (Extended), Exam Date (Out), Eligibility
 

Mathematical blog #2

  • 1. Mathematical blog #2: Recursion Introduction In history, mankind is continuously faced with problems and we try to come to a solution using our knowledge, mind and experiences. ‘Recursion’ is one way of thinking (approaching) a given problem and is one the central ideas of computer science and thus optimization in this continuously in complexity growing supply chain world. In a formal definition, recursion is the philosophy that underlies the analysis of many models, particularly dynamic ones. The principle, popularized by Bellman and developed by R. Howard under the name ‘dynamic programming’, is to decompose a complicated problem into a series of smaller, simpler problems. Within this dynamic programming, you have a distinction between deterministic and probabilistic programming. Probabilistic programming is highly effective as applied to multi-stage decisions, whereby, as the name implies, opportunities to revise previous decisions occur time and again, eliminating the need for a single once-and-for-all decision. For this reason, probabilistic dynamic programming, has one or two possible applications in the theory of inventory control. For instance, in the determination of the levels s and S in an (s, S) order policy (min-max policy) and in the calculation of optimum production levels. The remainder of the blog will deal with an example of applying probabilistic dynamic programming in the real-world and the application of it in inventory control. Parking Spaces In this problem (MacQueen and Miller, 1960), you are driving down a one-way road toward your destination, looking for a parking space. As you drive along, you can observe only one parking space at a time, the one right next to you, noting whether or not it is vacant. If it is vacant, you may either (1) stop and park there or (2) drive on to the next space. If it is occupied (not vacant), then you must drive on to the next space. You cannot return to vacant spaces that you have passed. Assume that vacant spaces occur independently and that the probability that any given space is vacant is p where 0 < p < 1. If you have not parked by the time you reach your destination, you must park in the payed parking lot, at a cost of c. If you park x spaces away from your destination, then you consider that a parking cost of x has been incurred. The closest space (before reaching the pay parking lot) to your destination is one space away from your destination: x=1. For convenience, we interpret space x=0 as existing and corresponding to having driven by the last available space, so the only option left is the pay lot. Furthermore, c > 1: There are possible spaces that are better than going straight to the pay lot. Your objective is to minimize your total expected parking cost. Let the state s = (x, i) be defined by the number x of the space that is being approached, and i, which is the availability of the space: i=0 indicates that the space is vacant and i=1 indicates that the space is occupied. For example, if s = (3,0) then you are still looking for a space, have approached the spot that is three spaces away from your destination, and it is vacant. Let a=0 denote the decision to park
  • 2. and let a=1 denote the decision to drive to the next space. If you decide to park (having observed state (3,0)), you incur the cost of 3 and the process ends. Both options are available if the space is vacant: A(x,0) = {0,1}, and you must drive to the next spot if the space is occupied: A(x,1)={1}, for all x. Now let f(s) = f(x, i) denote the minimum expected cost of parking, starting in state s (space x with availability i). For state s = (1, i) for example, the expected costs can be denoted as follows: 𝑓(1, 𝑖) = { min(1, 𝑐) = 1 𝑖𝑓 𝑖 = 0 𝑐 𝑖𝑓 𝑖 = 1 (1.1) That is, if i=0, you have a choice of parking now (choosing a=0), resulting in a cost of 1, or driving past (choosing a=1), which means that you must park in the pay lot resulting in a cost of c. Since, by assumption, c > 1, you prefer to park if you can. It is convenient to define another function, which facilitates the general analysis. For x ≥ 0, let 𝐹( 𝑥) ≔ 𝑝𝑓( 𝑥,0) + 𝑞𝑓( 𝑥,1), (1.2) where q ≔ 1-p is the probability that a space is occupied. F(x) is the minimum expected cost of parking, given that you are approaching space x (still looking to park) but have not yet observed its availability. If the space is vacant, which occurs with probability p, the optimal cost will be f(x,0) and if it is occupied (probability q), the cost will be f(x,1). The expected costs for all states s = (x, i) can therefore be denoted as 𝑓( 𝑥, 𝑖) = { min( 𝑥, 𝐹( 𝑥 − 1)) 𝑖𝑓 𝑖 = 0 𝐹( 𝑥 − 1) 𝑖𝑓 𝑖 = 1 (1.3) In words, suppose that you approach space x (still looking to park) and observe that its availability. If the space is available, then you can choose to park there, and incur cost x, or drive on to the next space and incur the optimal cost of doing so, namely F(x-1). If x ≤ F(x-1), then it is optimal to park. Otherwise, it is optimal to drive on. If space x is occupied, you must drive to the next space and face the optimal expected cost, F(x-1) of doing so. Now, if we use the understanding of above, we can interpret F(x-1) – x as the saving by driving to the next space, closer to our destination. Let’s denote this as 𝑔( 𝑥) ≔ 𝐹( 𝑥 − 1) − 𝑥, (1.4) which state that g(x) is negative number when driving to the next space if beneficial to drive to next space. If it is positive, we have to park in x. It is also easy to see, that we can write g(x+1) as 𝑔( 𝑥 + 1) = −1 + 𝑝(min(0, 𝑔( 𝑥)) + 𝑞𝑔( 𝑥), (1.5)
  • 3. If we work backwards using (1.5) and using the understanding of the recursion in (1.4), it’s easy to verify that we have to find a so-called cutoff point (let’s call this S) where g(x) is positive and g(x+1) is negative. We can therefore solve (1.5) for every state, starting at x=0 and find our optimal cutoff point. For example, suppose p = 0.2 and c =5. Then g(1) = c-1 =4. Using (1.4), we compute g(x) for increasing values of x until g(x) < 0, at which point the optimal policy has been found. Here, g(2)= -1 +0.2(0)+0.8(4)=2.2, g(3)= -1+0.2(0)+0.8(2.2)=0.76, and g(4)= -1+0.2(0)+0.8(0.76)=-0.392. This means that the optimal cutoff point is x=3. This means that you could drive straight to x=3 and park there if it is vacant. Application in inventory control The example of probabilistic dynamic programming is already quite complex to comprehend when you don’t have a specific background. When we extend this problem to an infinite horizon and multiple parameters (what is mostly the case in inventory control), the solution becomes even more complex. Within inventory control, the most significant benefit of probabilistic dynamic programming, is to find an optimal order strategy. The optimal order strategy in theory is an s, S policy. This means that you have an order level of s and when your inventory position is going under this order level s, you have to order up to ceiling S. Although literature provides solid solutions (eg. Bartmann (1992), Federgruen & Zheng, 1991) to this problem, there are some drawbacks in these solutions. They are incomprehensive to inventory controllers with not a specific mathematical background and most software packages don’t contain these algorithms or techniques and/or are not transparent in it. One way to avoid the above drawbacks, is computing the order level s in a formal way (see for example Axsäter, 2006) and compute S as s added with the economic order quantity (EOQ). This yields an approximate solution where the total cost deviation is at his minimum. Next blog The next blog will be about probability theory: distributions and numerical integration. The applications in inventory control to be discussed in this blog will be mainly determining order levels. Further questions or discussions on recursion can be addressed to s.pauly@slimstock.com.