You are on page 1of 34

UNIT- VI

Dynamic programming and Simmulation

DAY 1

Topics to be discussed: Introduction to dynamic programming

1) Give a brief introduction to dynamic programming.

Ans: Dynamic programming is a useful mathematical tool for making a


sequence of interrelated decisions. It provides a systematic procedure
for determining optimal combinations of decisions. In contrast to linear
programming, there does not exist a standard mathematical
formulation of the dynamic programming. Dynamic programming is a
general type of approach to problem solving and the particular
equations used must be developed to fit each situation. Therefore a
certain degree of in generality and insight into the general structure of
dynamic programming is required to recognize when and how a
problem can be solved by dynamic programming procedures. These
abilities can best be developed by an exposure to a wide variety of
dynamic programming applications and a study of the characteristics
that are common to all these situations. The technique is useful in large
number of multi period business problems, such as

Allocating capital funds


Allocating sales people to marketing areas
Evaluating investment opportunities
Smoothing production employment
2) Define dynamic programming and its terminology.
Ans: The mathematical technique of optimizing a sequence of inter-
related decisions over a period of time is called dynamic programming.

Stage: a period or a logical sub problem


State variables: A possible beginning situations or conditions of
a stage. These have been also called the input variable.
Decision variables: alternatives or possible decisions that exist
at each stage.
Decision criterion: a statement concerning the objective of the
problem.
Optimal policy: a set of decision rules developed as a result of
the decision criteria that give optimal decisions for any
entering condition at any stage.
Transformation: an algebraic statement that reveals the
relationship between stages, normally solutions are obtained
by working backward by the end of the problem toward the
beginning.
3) State the difference between linear programming and dynamic
programming.

Ans: First, there is no algorithm (like the simplex method) that can be
programmed to solve all problems. Instead, dynamic programming is a
technique that allows a difficult problem to be broken down into a
series of sub-problems, which are then evaluated by stages. Second,
linear programming is method that gives single stage (one time period)
solutions. Dynamic programming has the power to determine the
optimal solution over a one year time horizon by breaking the problem
into 12 smaller one month horizon problems and solve each of these
optimally. Hence, it uses a multi stage approach. Dynamic
programming uses the backward recursive method for solving the
problems.

4) State the Bellman’s principle of optimality.

Ans: Bellman principle of optimality states that “An optimal policy has
the property that whatever the initial state and decisions are, the
remaining decisions must constitute an optimal policy with regard to
the state resulting from the first decision.

Mathematically it can be written as

[
f N ( x )=max r ( d n ) + f N −1 {T ( x , d n ) } ]
dn ∈ {x }

Where f N ( x )=¿ optimal return from an N-stage process


when initial state is x
r ( d n)=immediate return due to decision d n
T ( x , d n )=¿ Transfer function which gives the resulting state.
{ x }= set of admissible decisions

5) Write the steps in dynamic programming.

Ans: Divide the original problem into sub- problems called stages

Solve the last stage of the problem for all possible conditions or
states
Working backward from that last stage, solve each intermediate
stage
Obtain the optimal solution for the optimal problem by solving all
stages sequentially

Important and JNTUK QUESTIONS:


1. What are the prerequisites for a problem to be solved by
dynamic programming?
R13, April 2016 Regular, set 1, M (8).
2. Illustrate Bellman’s principle optimality with example? R13,
April 2016 Regular, set 2, M (4).

DAY 2

Topics to be discussed: Applications of dynamic programming

1) Write the applications of dynamic programming.

Ans: In networking to transfer data from a sender to various receivers


in a sequential manner

Multi stage graph in computers


Travelling sales man problem
Single source shortest path
Document distance algorithms- to identify the extent of similarity
between two text documents used by search engines like Google,
Wikipedia, Quora and other websites.
Largest common subsequence – to identify similar videos used by
you tube
Water resource engineering
Economics
Image processing
Production optimization
Decision making
Optimal inventory control
Energy efficient scheduling of power stations
Cargo loading applications

2) Solve the shortest path from City 1-City 10 in the diagram shown
below by using the recursive principle of dynamic programming.

Fig.6.1 Time allocation network


Important and JNTUK QUESTIONS:

1) What are the applications of dynamic programming problem?


Explain. R13, April 2016 Regular, set 1, M (4).

2) What are the applications of dynamic programming?


R13, April 2017 Regular/supply , set 1, M(4).

DAY 3

Topics to be discussed: Capital budgeting -dynamic programming

1) A corporation has $ 5million to allocate to its three plants for


possible expansion. Each plant has submitted a number of
proposals on how it intends to spend the money. Each proposal
gives the cost of the expansion (c) and the total revenue
expected (r). The following table gives the proposals generated.

Table.6.1Investment possibilities
Each plant is permitted to enact one of its proposals. The goal is
to

Maximize the firm’s revenue .A straightforward way to solve this


is to try all possibilities and choose the best. In this case, there are
only ways of allocating the money. Many of these are infeasible (for
instance, a proposal 3, 4, and 1 for the three plants costs $6 million).
Other proposals are feasible, but very poor (like proposals 1, 1, and 2,
which is feasible but returns only $4 million). Let's try to figure out the
revenues associated with each state. The only easy possibility is in stage
1, the

Let's break the problem into three stages: each stage


represents the money allocated to a single plant. So stage 1
represents the money allocated to plant 1, stage 2 the money
to plant 2, and stage 3 the money to plant 3. We will artificially
place an ordering on the stages, saying that we will first
allocate to plant 1, then plant 2, then plant 3. Each stage is
divided into states. A state encompasses the information
required to go from one stage to the next. In this case the
states for stages 1, 2, and 3 are
{0, 1, 2, 3, 4,5}: the amount of money spent on plant 1,
represented as , x1

{0, 1, 2, 3, 4, and 5}: the amount of money spent on plants 1


and 2 (x2)

{5}: the amount of money spent on plants 1, 2, and 3 (x3)

Associated with each state is revenue. Note that to make a


decision at

Stage 3, it is only necessary to know how much was spent on


plants 1 and

2, not how it was spent. Also notice that we will want (x3) to be 5

Let's try to figure out the revenues associated with each state.
The only

easy possibility is in stage 1,

Table.6.2 Stage 1 computations

We are now ready to tackle the computations for stage 2. In this case,
we want to find the best solution for both plants 1 and 2. If we want to
calculate the best revenue for a given (x 2), we simply go through all the
plant 2 proposals, allocate the given amount of funds to plant 2, and
use the above table to see how plant 1 will spend the remainder. For
instance, suppose want to determine the best allocation for state x 2=4.
In stage 2 we can do one of the following proposals: 1. Proposal 1 gives
revenue of 0, leaves 4 for stage 1, which returns 6. Total: 6. 2. Proposal
2 gives revenue of 8, leaves 2 for stage 1, which returns 6. Total: 14. 3.
Proposal 3 gives revenue of 9, leaves 1 for stage 1, which returns 5.
Total: 14. 4. Proposal 4 gives revenue of 12, leaves 0 for stage 1, which
returns 0. Total: 12

The best thing to do with four units is proposal 1 for plant 2 and
proposal 2 for plant 1, returning 14, or proposal 2 for plant 2 and
proposal 1 for plant 1, also returning 14. In either case, the revenue for
being in state x2=4. The rest of table 3 can be filled out similarly.

Table.6.3 Stage 2 computations

We can go now stage3. The only value we are interested in is x 3=5.


Once again, we go through all the proposals for this stage.
Determine the amount of money remaining and use Table.3 to
decide the value for the previous stages. So, we can do the
following at plant 3:

Proposal 1 gives revenue 0, leaves 5. Previous stages give 17. Total: 17.
Proposal 2 gives revenue 4, leaves 4. Previous stages give 14. Total: 18.

Therefore, the optimal solution is to implement proposal 2 at plant 3,


proposal 2 or 3 at plant 2, and proposal 3 or 2 (respectively) at plant 1.
This gives revenue of 18.
If you study this procedure, you will find that the calculations are done
recursively. Stage 2 calculations are based on stage 1, stage 3 only on
stage 2. Indeed, given you are at a state, all future decisions are made
independent of how you got to the state. This is the principle of
optimality and all of dynamic programming rests on this assumption.
We can sum up these calculations in the following formulas:

Denote by r(kj) the revenue for proposal kj at stage j , and by c(k j) the
corresponding cost. Let fj (xj) be the revenue of state xj in state j. Then
we have the following calculations

f 1( x 1 ¿ =max { r ( k 1 ) }
k 1 :c (k 1) ≤ x 1

f j ( x j ) =max {r ( k j ) + f j−1 ( x j −c ( k j ) ) } for j =2,3

k j : c (k j) ≤ x j

Important and JNTUK QUESTIONS:


1) How dynamic programming can be used to solve capital budgeting
problems.. R13, April 2015 Regular, set 4, M (8).

DAY 4

Topics to be discussed: linear programming -dynamic programming


approach

1) Write the linear programming -dynamic programming approach.


Maximize z=c1 x1 + c2 x2 + …+ c n
Subjected to the constraints
a 11 x1 + a12 x 2+ …+a1 n x n ≤ b1
a 21 x1 + a22 x 2+ …+a 2n x n ≤ b2
; ;; ;; ; ; ; ; ; ;; ;; ; ; ;
a m 1 x 1+ am 2 x2 +…+ amn xn ≤ bm
x 1 ≥ 0 , x2 ≥ 0 , … . x n ≥0

Ans: This problem can be formulated as a dynamic programming as


follows:

Let each activity j (1, 2….n) be a stage. The level of activity x j ≥ 0


represents decision variables at stage j . Since x j is continuous,
each stage possesses an infinite number of alternatives within the
feasible region. Since the linear programming problem is an
allocation problem, states may be defined as the amounts of
resources to be allocated to the current stage and succeeding
stages. This will result in a backward functional equation. Since
there are m resources, stages must be represented by an m-
dimensional vector.
Let ( β 1 j , β 2 j … .. β mj ) be the states of the system at stage j in
accordance with the definition i.e amounts of resources 1, 2, 3 …
m respectively, are allocated to stage j , j+1 … … n . Using the
backward recursive equation, let f j (β 1 j , β 2 j , … β mj ) be the optimum
value of the objective function for stages j , j+1,…….n for given
states β 1 j , β 2 j,……. β mj.
f n ( β1 n , β 2 n ,… .. β mn )=max [ c n x n ], i=1,2 , … m

0 ≤ aij x n ≤ β ¿

f j ( β 1 j , β 2 j ,… .. β mj ) =max [ c j x j +f j+1 (β 1 j −a1 j , …… … .. β mj−a mj x j ) ]

0 ≤ aij x j ≤ β ij

(i=1,2 , … . , m)

For j=1,2,3 … ., n−1 , where it is understood that 0 ≤ βij ≤b i for all i∧ j

The recursion equation given above can be used to solve the linear
programming problem by the dynamic programming approach.

10)Solve the LPP problem by dynamic programming.


Max Z=3x1+5x2
Subjected to x1≤ 4
2x2≤ 12
3x1+2x2≤ 18
Stages: these two activities can be interpreted as the two stages.
Decision variables: xn is the decision variable at stage n.
States: sn = amount of respective resources still available.
Sn = (R1, R2, R3), where Ri is the amount of resource i remaining to
be allocated.
Therefore, s1 = (4, 12, 18), s2 = (4 – x1, 12, 18 – 3x1)
f2(R1, R2 , R3, x2) = contribution of activity 2 to Z if system starts in
state (R1, R2 , R3) at stage 2 and decision is x2 = 5x2.

F1(4, 12, 18, x1) = contribution of activity 1 and 2 to Z if system


starts in state (4, 12, 18) at stage 1, immediate decision is x 1, and
then optimal decision is made at
Important and JNTUK QUESTIONS:

1) Use dynamic programming to solve the problem.


Maximize 2x1+3x2+4x3
Subjected to x1+4x2+5x3≤ 12
x1, x2, x3 are non negative integers. R13, Nov2017 Supply, set 1, M
(10).
2) Apply the dynamic programming problem to solve the following
problem.
Minimize f ( x )=x 21 + x 22+ x 23
Subjected to
x 1+ x2 + x 3 ≥ 15
x1 , x2 , x3 ≥ 0

R13, April 2017, Regular/ Supply set 2, M (10).

DAY 5

Topics to be discussed : introduction to simulation

1) Write the definitions of simulation.

Ans: Simulation is the representation of reality through the use of a


model or other device which will react in the same manner as reality
under a given set of conditions.

According to Donald G.Malcolm, a simulated model may be defined as


one which depicts the working of a large scale system of men,
machines, materials and information operating over a period of time in
a simulated environment of the actual real world conditions.

According to T.H. Naylor, simulation is a numerical technique for


conducting experiments on digital computer, which involves certain
types of mathematical and logical relationships necessary to describe
the behavior and structure of a complex real world system over
extended periods of time.

2) Write the types of simulation models.

Ans: Simulation is mainly two types

Analogue simulation: simulating the reality in physical form,


analogous refer to environmental simulation. To perform a number of
experiments on simulated models to predict the behavior of the real
system under true, environments.

Computer simulation: For complex and intricate problems of


managerial decision making, the analogue simulation may not be
applicable and the actual experimentation with the system may be
uneconomical also. Under these situations the complex system is
formulated into a mathematical model for which a computer program
is developed, and then the problem is solved by using high speed
electronic computer. Such type of simulation is called computer
simulation.

The simulation can be classified into four categories:

Deterministic models: In these models, input and output variables are


not permitted to be random variables and models are described by
exact functional relationship.

Stochastic models: In these models, at least one of the variables or


functional relationship is given by probability functions.

Static models: These models do not take variable time into


consideration.

Dynamic models: these models deal with time varying interaction.

3) Write the phases of simulation.

Ans: Determine the goals and objectives

Build a conceptual model

Convert into a specification model

Convert into a computational model


Verify

Validate

Conceptual: It deals with how comprehensive should the model


be, Which are state variables, which are dynamic variables and which
are important.

Specification: It is concerned with on paper work it involves


equations and

Pseudo code etc and also related to how will the model receives
inputs. Computational: It is regarding to the development of a
computer program by using any general purpose programming
language or simulation language

Verification and validation: verification deals with to check whether


computational model should be consistent with the specification model
or not. Validation checks whether computational model should be
consistent with the system being analyzed.
Fig.6.2 Steps in simulation

Important and JNTUK QUESTIONS:

1) Discuss the various type’s simulation models? R13, April 2016


Regular, set 4, M(8).
2) What is simulation and what are the different types of it? R13,
Nov/Dec 2016 Supply, set 1, M (3).
3) Explain phases of simulation. R13, Nov/Dec 2016 Supply, set 1, M
(6).
4) What is simulation? Lists the applications simulation. R13, April
2017, Regular, set 2, M (4).

DAY 6

Topics to be discussed: Advantages and disadvantages of simulation

1) Write the advantages of simulation.

Ans: New policies, operating procedures, information flows and so on


can be explored without disrupting ongoing operation of the real
system.
New hardware designs, physical layouts, transportation systems and …
can be tested without committing resources for their acquisition.
Time can be compressed or expanded to allow for a speed-up or slow-
down of the phenomenon
Insight can be obtained about interaction of variables and important
variables to the performance.
Bottleneck analysis can be performed to discover where work in
process, the
System is delayed.
A simulation study can help in understanding how the system operates.
What if” questions can be answered?

2) Write the disadvantages of simulation.

Ans: Model building requires special training.


Vendors of simulation software have been actively developing packages
that contain models that only need input (templates).
Simulation results can be difficult to interpret.
Simulation modeling and analysis can be time consuming and
expensive.
Much simulation software has output-analysis.

3) Write the applications of simulation.

Ans: Manufacturing Applications


Semiconductor Manufacturing
Construction Engineering and project management
Military application
Logistics, Supply chain and distribution application
Transportation modes and Traffic
Business Process Simulation
Health Care
Automated Material Handling System (AMHS)
Test beds for functional testing of control-system software
Risk analysis
Insurance, portfolio...
Computer Simulation
CPU, Memory…
Network simulation
Internet backbone, LAN (Switch/Router), Wireless, PSTN (call center)...

4) Write the applications of simulation in manufacturing.

Ans: Manufacturing represents one of the most important applications


of simulation. This technique represents a valuable tool used by
engineers when evaluating the effect of capital investment in
equipment and physical facilities like factory plants, warehouses, and
distribution centers. Simulation can be used to predict the performance
of an existing or planned system and to compare alternative solutions
for a particular design problem.
Another important goal of Simulation in Manufacturing Systems is to
quantify system performance. Common measures of system
performance include the following

 Throughput under average and peak loads;


 System cycle time (how long it takes to produce one part);
 Utilization of resource, labor, and machines;
 Bottlenecks and choke points;
 Queuing at work locations;
 Queuing and delays caused by material-handling devices and
systems;
 WIP storages needs;
 Staffing requirements;
 Effectiveness of scheduling systems;
 Effectiveness of control systems.

Important and JNTUK QUESTIONS

1) What are the applications of simulation? R13, April 2016 Regular,


set 2, M (8).
2) State advantages and disadvantages of simulation. R13, April 2017
Regular, set 4, M (4).
3) Write the advantages and limitations of simulation. R13, April
2017 Regular, set 3, M (4).
4) Write the application of simulation in manufacturing. R13, April
2017Regular, set 3, M (4).

DAY 7
Topics to be discussed: Simulation languages

1) Write about the commonly used simulation languages.

Ans: Object oriented simulation languages


Online simulation languages
Advanced continuous simulation language
Graphic simulation language (GSL)
Object Oriented Simulation
Object Oriented Simulation (OOS) can be considered as a special case of
Object Oriented Programming (OOP). Some principles of OOP like
existence of a varying number of instances of interfering objects have
been in standard use in simulation environment for a long time, often
using other terminology. The Simula language (used to be called
Simula67) is the first true object oriented language. OOPS like classes,
inheritance, virtual methods, etc. have been defined in Simula.
MODSIM is another object oriented simulation language. These are the
most commonly accepted features of OOS
a. The algorithm or system dynamics is expressed in terms of objects
(actors) that exist in parallel and that interact with each other. Every
object is represented by:
1. Parameters
2. Attributes
3. Methods
4. Life, that represents the activity started upon object creation.

Objects can interact in these ways


1. Direct access to parameters and attributes
2. Mutual calling of methods
3. Communication and synchronization of objects lives.

b. Conceptually a object is defined as Object = Data + Procedures that is


called
Encapsulation. Generally the object's data or a part of it, is hidden and
values can be accessed and modified only through (well defined)
methods. This concept is called Information hiding.
c. Similar objects (actors) are grouped by to the classes also called
prototypes. A class describes objects that have the same parameters,
attributes, methods, and lives. A class can be also interpreted as
knowledge of certain type of objects. Such knowledge is represented by
a data part and by operations that can be performed on the data. This
is similar to abstract data types, but classes are much richer.
d. Objects can be classified hierarchically generally called inheritance.
Very often the term subclass is introduced. A subclass Y of a class X
inherits all parameters, attributes, and methods from the class X. Its
declaration can add any number of additional parameters, attributes,
and methods. A subclass may also add some activity to the life of the
parent class. A subclass can be used as a parent class of other
subclasses. Some OOP languages (not Simula) enable the so-called
multiple inheritance. In this case a subclass can inherit from more than
one parent classes. It might be desirable, that certain methods then
behave in different way according to the current object instance being
referenced that may change dynamically during program execution.
This concept called polymorphism is supported by the mechanism
called late binding and the methods involved are called virtual methods
that may change at every level of hierarchy.

On Line Simulation
Internet together with Java and JavaScript offer incredible possibilities
in problem
Solving. Instead of time consuming downloading and installation of
software packages, it is possible to open directly various solvers,
especially for problems that are not frequent and that do not require
time consuming computation.

Advanced Continuous Simulation Language


The Advanced Continuous Simulation Language, or ACSL (pronounced
"axle"), is a
computer language designed for modelling and evaluating the
performance of continuous systems described by time-dependent,
nonlinear differential equations. It is a dialect of the Continuous System
Simulation Language (CSSL).
ACSL is an equation-oriented language consisting of a set of arithmetic
operators,
standard functions, a set of special ACSL statements, and a MACRO
capability which allows extension of the special ACSL statements. ACSL
is intended to provide a simple method of representing mathematical
models on a digital computer. Working from an equation description of
the problem or a block diagram, the user writes ACSL statements to
describe the system under investigation. The important feature of ACSL
is its sorting of the continuous model equations, in contrast to general
purpose programming languages such as FORTRAN where program
execution depends critically on statement order.
Applications of ACSL in new areas are being developed constantly.
Typical areas in
which ACSL is currently applied include control system design,
aerospace simulation, chemical process dynamics, power plant
dynamics, plant and animal growth, toxicology models, vehicle
handling, microprocessor controllers, and robotics.
Graphic Simulation Language GSL
GSL is a FORTRAN-oriented language, which combines the activity and
process
Concepts of a discrete simulation language with continuous simulation
concepts, thereby permitting the simulation of systems, which call for
combining continuous and discrete simulation techniques. The basic
structural component of GSL is the simulation block, which corresponds
either to an activity of a discrete system or a dynamic region of a
continuous system. Both discrete and continuous simulation blocks may
have multiple process instances, which may be controlled dynamically
at run- time. The result is a combined language, which retains the
features of both continuous and discrete simulation languages and
moreover takes advantage of the desirable features of each to
supplement the other.

SIMULA
The first Object Oriented Language (OOL) Simula 67 was officially
introduced by Ole Johan Dahl and Kristen Nygaard at the IFIP TC 2
Working Conference on Simulation Languages in Lysebu near Oslo in
May 1967. All modern programming work carried out today is based on
principles of OOP introduced for the first time in the Simula definition.
A computer program is a series of instructions, which contains all the
information necessary for a computer to perform some task. It is similar
to a knitting pattern, a recipe or a musical score. Like all of these it uses
special shorthand, known in this case as a programming language. We
will learn the programming in SIMULA 67, in SIMULA 67, 67 stood for
1967, the year in which this earlier version was first defined.

Important and JNTUK QUESTIONS:

1) Briefly explain about the simulation languages. R13, Nov.2017


Supply, set 1, M (6).

DAY 8

Topics to be discussed: Application of simulation for inventory


problems

1) Write about the application of simulation to inventory control.

Ans: For providing efficient services to the customers, it is necessary


to choose to reorder point with proper consideration of demand
during lead time. If the lead time and demand of inventory per unit
time both are random variables, then the simulation technique can
be applied to determine the effect of alternate inventory policies on
a stochastic inventory system, e.g., and different combinations of
order quantity and reorder point. The basic approach would be to
find the probability distribution of the input and output functions of
the past data. Then, we run the inventory system artificially by
generating the future observation on the assumptions of the same
distributions. The method involves a good amount of computation.
But, in simple problems it is possible to generate artificial samples
for future with the help of random numbers and then the entire
computations are done with the help of desk calculator. Of course, it
becomes necessary to use electronic computers for solving more
complex problems.

2) A book store wishes to carry Ramayana in stock. Demand is


probabilistic and replenishment of stock takes 2 days (i.e, if an order
is placed on March I, it will be delivered at the end of the day on
March 3). The probabilities of demand are given below:

Demand (daily): 0 1 2 3 4

Probability: 0.05 0.10 0.30 0.45 0.10

Each time an order is placed, the store incurs an ordering cost of Rs.
10 per order. The store also incurs a carrying cost of Rs. 0.50 per
book per day. The inventory carrying cost is calculated on the basis
of stock at that time of each day. The manager of the book store
wishes to compare two options for his inventory decision.

A: Order 5 books when the inventory at the beginning of the day plus
orders outstanding is less than 8 books.
B: Order 8 books when the inventory at the beginning of the day plus
orders outstanding is less than 8.

Currently (beginning of the first day) the store has stock of 8 books
plus 6 books ordered 2 days ago and expected to arrive next day.

Using the Monte-Carlo simulation for 10 cycles, recommend which


option the manager should choose. The two digits random numbers
are given as: 89, 34, 78, 63, 61, 81, 39, 16, 13, and 73.

Table.6.4 demand scope

Demand probability Cum.prob. Random nos.


0 0.05 0.05 00-04
1 0.10 0.15 05-14
2 0.30 0.45 15-44
3 0.45 0.90 45-89
4 0.10 1.00 90-99

Stock in hand =8, and stock on order =6 (expected next day)

Table.6.5 Option A

Rando Deman Opt. Recei Closing Opt. Order CI


m No. d Stock pt stock in stock quantit stock
sales In hand hand on y on
order order
89 3 8 ---- 5 6 --- 6
34 2 5 6 9 -- -- --
78 3 9 - 6 - 5 5
63 3 6 - 3 5 - 5
61 3 3 - 0 5 5 10
81 3 0 5 2 5 5 10
39 2 2 - 0 10 - 10
16 2 0 5 3 5 - 5
13 1 3 5 7 0 5 5
73 3 7 - 4 5 - 5

No of orders =4, ordering cost =4X10= Rs. 40.

Closing stock of 10 days=39, carrying cost= 39X0.50=1950

Cost for 10 days=5950.

Table.6.6 Option B

sales Opt. Recei Closing Opt. Order Closing


Stock pt stock in stock quantit stock
In hand hand on y on
order order
3 8 ---- 5 6 --- 6
2 5 6 9 -- -- -
3 9 - 6 - 8 8
3 6 - 3 8 - 8
3 3 - 0 8 - 8
3 3 8 5 - 8 8
2 5 - 3 8 - 8
2 3 - 1 8 - 8
1 1 8 8 - - -
3 8 - 5 - 8 8

No of orders =3, ordering cost= Rs.30

Closing stock of 10 days =43, carrying cost=45X0.50=Rs.22.50


Since option B has lower cost, manager should choose option B.
Important and JNTUK QUESTIONS

1) How to solve simulation for solving inventory problem. R13, April


2017 Regular, set 4, M (8).

DAY 9

Topics to be discussed: Application of simulation for Queuing problems

1) Write about the Monte-Carlo simulation?

Ans: The Monte-Carlo technique has become so much important


part of simulation model that the terms are often assumed to be
synonymous. However, it is only a special technique of simulation.
The technique of Monte-Carlo involves the selection of random
observations within the simulation model.

This technique is restricted for applications involving random


numbers to solve deterministic and stochastic problems. The
principle of this technique is replacement of actual statistical
universe by another universe described by some assumed
probability distribution and then sampling from this theoretical
population by means of random numbers. In fact, this process is the
generation of simulated statistics (random variables) that can be
explained in sample terms as choosing a random number and
substituting this value in standard probability density function to
obtain random variable or simulated statistics.

2) Solve the Queuing problem by the method of simulation.


Records of 100 truckloads of finished jobs arriving in a
department’s check-out area show the following: Checking out
takes 5 minutes and checker takes care of only one truck at a time.
The data is summarized in the following table 6.7

Arrivals and time Table 6.7

Truck inter-arrival time (min): 1 2 3 4 5 6 7


8 9 10
Frequency : 1 4 7 17 31 23 7
5 3 2(total=100

As soon as the trucks are checked out, the truck drivers take them
to the next departments. Using Monte-Carlo simulation,
determine:

Average waiting time before service and likely to be the longest


wait

Ans: From the given distribution of truck arriving times, construct a


cumulative probability distribution is given in the table. This enables
us to select the range of random numbers for which shall choose a
prescribed value of time.

Table 6.8 cumulative probability

Period(length=1min) Frequency Probability Cumulative Random


Prob. numbers
1 1 0.01 0.01 0
2 4 0.04 0.05 1-4
3 7 0.07 0.12 5-11
4 17 0.17 0.29 12-28
5 31 0.31 0.60 29-59
6 23 0.23 0.83 60-82
7 7 0.07 0.90 83-89
8 5 0.05 0.95 90-94
9 3 0.03 0.98 95-97
10 2 0.02 1.00 98-99

First select 20 two digit random numbers from the random number
table. The first random number for the arrival time is 12. This
number lies in the range (12-28). This random number indicates the
arrival time at 10.04 am assuming that the checking starts at
10.00a.m. Similarly work-out all simulated arrivals and service times.
Since the first truck arrives at 10.04 am, the checker waits for 4
minutes. This is indicated in the last column, as checkers waiting
time in table below. The checker takes 5 minutes and thus the
service for first truck will end at 10.09 am. The next truck will arrive
at 10.10 a.m. which indicates that the checker waits for 1 minute.
Whenever the truck has to wait because of the checker being busy in
dealing with previous truck, the waiting time is listed in the last
column of the table. The similar procedure can be adopted to
prepare the entire work sheet.

Table 6.9 waiting times

S.No Random Inter- Arriva Service Service Waiting time


number arrival l time begins ends for
time Checke Truck
r
1 12 4 10.04 10.04 10.09 4 -
2 81 6 10.10 10.10 10.15 1 -
3 36 5 10.15 10.15 10.20 - -
4 82 6 10.24 10.21 10.26 1 -
5 21 4 10.25 10.26 10.31 - 1
6 74 6 10.31 10.31 10.36 - -
7 90 8 10.39 10.39 10.44 3 -
8 55 5 10.44 10.44 10.49 - -
9 79 6 10.50 10.50 10.55 1 -
10 70 6 10.56 10.56 11.01 1 -
11 14 4 11.00 11.01 11.06 - 1
12 59 5 11.05 11.06 11.11 - 1
13 62 6 11.11 11.11 11.16 - -
14 57 5 11.16 11.16 11.21 - -
15 15 4 11.20 11.21 11.26 - 1
16 18 4 11.24 11.26 11.31 - 2
17 74 6 11.30 11.31 11.36 - 1
18 11 3 11.33 11.36 11.41 - 3
19 41 5 11.38 11.41 11.46 - 3
20 29 5 11.43 11.46 11.51 - 3

After completing the simulation, the following information can be


obtained which describe the behavior of single server counter as
given below.
total waiting time
Average waiting time of trucks before service = total number of arrivals

16/20=0.8 minutes.

Expected longest period of waiting = 3 minutes.

Important and JNTUK QUESTIONS:


1) How simulation can be applied to solve a queuing problem. R13,
April 2017 Regular, set 4, M (6).

2) Explain the Monte-Carlo simulation method is a special type of


simulation method. R13, April 2017 Regular, set 4, M (6).

You might also like