You are on page 1of 85

INTRODUCTION

TO
OPERATIONS
RESEARCH

NIRUPAM CHATURVEDI
Game Theory Model formulation ( Pure & Mixed Strategy )

Game Theory

Decision Making Situations

Deterministic Situations Probabilistic Situations Uncertainty Situations


Game Theory
Terminologies of Game Theory
Players : Player A & Player B Or Company A & Company B
Strategy : Its course of action taken by players. Example A company will have different strategy to increase their
volume of sales.
 Pure Strategy : if company selects one strategy & Ignores other strategies, Its called Pure Strategy.
The sum of these probability are equal to one.
Example Strategy P1 P2 P3
If the company selects only 1 strategy means Select P2 than
P1 =0 , P2 = 1 , P3 = 0
So Sum of three strategy will be 0+ 1 +0 = 1
 Mixed Strategy : If player selects more than one strategy then its said Mixed strategy. The probability value of
each strategy will be less than one but total will be equal to one.
example : P1 = 0.45 P2= 0.55 P3 = 0
Sum of the Strategy = P1+P2+P3
0.45 + 0.55 + 0 = 1
Game Theory
Pay off Matrix : Player B
1 2 3
1 20 10 22
Player A 2 30 40 38
3 15 18 25
There are Player A & Player B
3 Strategy for both A & B
Figure inside is the outcome of the various combination of strategy.
Example if Player A Selects Strategy 2, B selects 1 , Outcome will be 30
Note : if the outcome is Positive value means it’s a gain of Player A & Loss of player B.
If the outcome is negative Value , means it’s a gain of player B & loss of player A.
Maximin Principle : Maximizes the minimum guaranteed gains of player A
Minmax Principle : Minimizes the maximum losses.
Saddle Point : Maximin value = Minimax value
Game Theory
Value of the Game : If the game has a saddle point , than the value of the
cell at the saddle point is called the value of the game.
Two Person Zero sum Game : In a game with two players ,if the gain of
one player is equal to the loss of other player, that game is called two
person zero sum game.
Example ( Game with Pure Strategy )
Find the optimum Strategies of the players in the following games :
Player B
1 2 3
1 25 20 35
Player A 2 50 45 55
3 58 40 42

1ST Step to Find Row Minimum : means least value in each row
Player B
1 2 3 Row Minimum
1 25 20 35 20
Player A 2 50 45 55 45
3 58 40 42 40

2nd Step to Find Column Maximum : means Highest value in eachPlayer


column.
B
1 2 3 Row Minimum
1 25 20 35 20
Player A 2 50 45 55 45
3 58 40 42 40
Column Maximum 58 45 55

Now we have to find Maximum of the minimum value of row = 45 ( Maximin )


Now we have to find the Minimum of the maximum value of column = 45 ( Minimax )
Player A is called Maximin Player ( Maximizing its minimum guaranteed gain
Player B is called Minimax player ( Minimizing its maximum Loss )
Player B
1 2 3 Row Minimum
1 25 20 35 20
Player A 2 50 45 55 45 Maximin
3 58 40 42 40
Column Maximum 58 45 55
Minimax

Saddle Point

In this Game Maximin value = Minimax Value


45 = 45
Saddle Point of this Game = 45
Value of the Game ( V ) = 45
Hence the game has a saddle point at the cell corresponding to row 2 & column 2.
Optimal Probabilities
A { P1, P2, P3 } = A ( 0,1, 0) P1, P2, P3 = Strategy for player A
B { q1, q2, q3 } = B (0,1,0 ) q1, q2, q3 = Strategy of Player B
Example ( Game with Mixed Strategy )
Consider the following payoff matrix with respect to player A & solve it optimally.
Player B
1 2
1 9 7
Player A
2 5 11
Note : If the game has no saddle point , then game has said to have Mixed Strategy .
Saddle Points means Maximin = Minimax
First we have to find out that game has saddle point or not.
1ST Step to Find Row Minimum : means least value in each row
Player B
1 2 Row Minimum
1 9 7 7
Player A
2 5 11 5
2nd Step to Find Column Maximum : means Highest value in each column.
Player B
1 2 Row Minimum
1 9 7 7 Maximin
Player A
2 5 11 5
Clumn Maximum 9 11
Minimax
In the above table
Maximin value ≠ Minimax Value
7≠ 9
Means there is no saddle point.
We have to find the Mixed Strategy
1st Step is to find out the Oddments
Oddments means = You have to find the difference between the first row write against the 2 nd row & difference
between the second row , write against the 1st row
Like For ROWs 9-7 = 2 11-5 = 6
For Columns 9-5 = 4 11-7 = 4
Player B
1 2 Oddments
1 9 7 6
Player A
2 5 11 2
Oddments 4 4

We have to find the Probability for both row & Column


P1 = 6 / 6+2 = 6/8 OR 3/4 , P2 = 2 / 6+2 = 2 / 8 OR 1/ 4
Q1 = 4 / 4 + 4 = 4 / 8 or 1/ 2 Q2 = 4/ 4 + 4 = 4/ 8 0r 1/ 2
1 2 Oddments
1 9 7 6
Player A
2 5 11 2
Oddments 4 4
Value of the Game ( V ) = c11 x 6 + c21 x 2 / 6 +2 or 9 x 6 + 5 x2 / 6 + 2 or 54 + 10 / 8 = 64/ 8 or 8
C12 x 6 + c22 x2 / 6 + 2 or 7 x 6+ 11x2 / 6+2 or 42 + 22 / 8 = 64 / 8 or 8
For Column V = c11 x 4 + c 12 x 4 /4 + 4 or 9 x4 + 7x4 / 4+4 or 36 + 28 / 8 = 64 / 8 or 8
c21 x4 + c22 x 4 / 4 + 4 or 5x4 + 11x4 / 4+ 4 or 20 + 44 / 8 = 64 / 8 or 8

Hence the Strategy of Player A ( 3/4 , 1/ 4 )


Player B ( 1/ 2, 1/2 )
Value of the game = 8

You all will observe that for Player A Probability of selection of the Individual strategy will be less than one but
total will be equal to one.
3/ 4 + 1 /4 = 3 + 1 / 4 or 4/4 = 1
For Player B also Probability of selection of the Individual strategy will be less than one but total will be equal to
one.
1/ 2 + 1 /2 = 2/2 or 1
Game Theory ( Dominance Property )
Dominance Property : In some games , it is possible to reduce the size of the payoff matrix by eliminating rows ( or
columns ) which are dominated by other row ( or column ) respectively.
Dominance property for rows rows :
x≤Y
Means : If all the entries in a row of a payoff matrix should be lesser than or equal to the corresponding entries of
another row , if yes that row can be deleted.
Example Row X of the payoff matrix are less than or equal to the corresponding entries of another row y , than row x is
dominated by row y , so row X should be eliminated from the payoff matrix. Delete the least value row.
Dominance property for columns :
x≥Y
Means : if all the entries in a columns should be greater than or equal to the corresponding entries of another column , If
yes that column can be deleted.
Example Column X of the payoff matrix are gretaer than or equal to the corresponding entries of another Column y , then
Column x is dominated by Column y , so Column X should be eliminated from the payoff matrix. Delete the Highest value
.

This is because Player A is the gainer & Player B is the loser.


Check : You can compare one row value with an average of two or more rows in order to eliminate & reduce the payoff
matrix
Similarly , You can compare one column valye with an average of two or more columns in order to eliminate & reduce
the payoff matrix
Example ( Dominance ) Pure & Mixed Strategy
The following table represents the payoff matrix with respect to Player A. Solve it optimally using
dominance property. Player A has 4 Strategy , Player B has 5 Strategy. Matrix numbers are the
Outcomes. Player B
1 2 3 4 5
1 4 6 5 10 6
2 7 8 5 9 10
3 8 9 11 10 9
Player A 4 6 4 10 6 4

Note : If the game has no saddle point , then game has said to have Mixed Strategy .
Saddle Points means Maximin = Minimax
First we have to find out that game has saddle point or not.
1ST Step to Find Row Minimum : means least value in each row
Player B
1 2 3 4 5 Row Minimum
1 4 6 5 10 6 4
2 7 8 5 9 10 5
3 8 9 11 10 9 8
Player A 4 6 4 10 6 4 4
2nd Step to Find Column Maximum : means Highest value in each column.
Player B
1 2 3 4 5 Row Minimum
1 4 6 5 10 6 4
2 7 8 5 9 10 5
3 8 9 11 10 9 8 Maximin value
Player A 4 6 4 10 6 4 4
Column Maximum 8 9 11 10 10

Minimax value Value of Game


In the above table
Maximin value = Minimax Value
8= 8
Means there is a saddle point.
Value of Game = 8
Probability of Player A : Player A need to select 3rd Strategy , remaining Strategy should be Zero
Player A = { 0,0, 1, 0 }
Probability of Player B : Player B need to select 1st Strategy , remaining Strategy should be Zero
Player B = { 1,0,0, 0, 0 }
Now Solve the problem using Dominance Property
Player B
1 2 3 4 5
1 4 6 5 10 6
2 7 8 5 9 10
3 8 9 11 10 9
Player A 4 6 4 10 6 4

1st Step : we need to take the total of Each & every row
4 + 6 + 5 + 10 + 6 = 31
7+8+5+9+10 = 39
Player B
1 2 3 4 5
1 4 6 5 10 6 31
2 7 8 5 9 10 39
3 8 9 11 10 9 47
Player A 4 6 4 10 6 4 30
Least value
Now we have to select the least one = 30
Row : If all the entries in a row of a payoff matrix should be lesser than or equal to the corresponding entries of another row , if yes that
row can be deleted.
We have to compare least value row from other rows
Result : Row 4 is dominated by row 3 , so delete row 4
Player B
1 2 3 4 5
1 4 6 5 10 6 31
2 7 8 5 9 10 39
3 8 9 11 10 9 47
Player A 4 6 4 10 6 4 30
Next Least Value = 31
Player B
1 2 3 4 5
1 4 6 5 10 6 31 Next Least Value
2 7 8 5 9 10 39
3 8 9 11 10 9 47
Player A 4 6 4 10 6 4 30

We have to compare least value row ( 1st Row )from other rows
Result : Row 1 is dominated by row 3 , so delete row 1
Player B
1 2 3 4 5
1 4 6 5 10 6 31
2 7 8 5 9 10 39
3 8 9 11 10 9 47
Player A 4 6 4 10 6 4 30

Next Least Value = 39


We have to compare least value row ( 2nd Row )from other rows
We observe NO DOMINATION
So we move towards Column reduction
Player B
1 2 3 4 5
2 7 8 5 9 10
Player A
3 8 9 11 10 9
Player B
1 2 3 4 5
2 7 8 5 9 10
Player A
3 8 9 11 10 9

1st Step : we need to take the total of Each & every Column
7 + 8= 15, 8 +9 = 17, 5 +11 = 16, 9+ 10 = 19, 10+ 9 = 19
Player B
1 2 3 4 5
2 7 8 5 9 10
Player A
3 8 9 11 10 9
15 17 16 19 19

Dominance Property for Column : if all the entries in a columns should be greater than or equal to the
corresponding entries of another column , If yes that column can be deleted.
Now we have to select the Highest one = 19 ( 4 th Column )
Compare 4th Column from 1st Column
Result : 4th Column is dominated by 1st Column
Player as
B all values are lesser than the 4 th Column, So delete
the 4th Column 2
1
7
2
8
3
5
4
9
5
10
Player A
3 8 9 11 10 9
15 17 16 19 19

Highest Value
Player B
1 2 3 4 5
2 7 8 5 9 10
Player A
3 8 9 11 10 9
15 17 16 19 19

 Now we have to select the Next Highest one = 19 ( 5 th Column )


Compare 5th Column from 1st Column
Result : 5th Column is dominated by 1st Column as all values are lesser than the 5th Column, So delete the 5th Column
 Now we have to select the Next Highest one = 17 ( 2 nd Column )
Compare 2nd Column from 1st Column
Player B
Result : 2nd Column is dominated by 1st Column as all values are lesser than the 2nd Column, So delete the 2nd Column
1 2 3 4 5
2 7 8 5 9 10
Player A
3 8 9 11 10 9
15 17 16 19 19

 Now we have to select the Next Highest one = 16 ( 3rd Column )


Compare 3rd Column from 1st Column

Result : 3rd Column is not dominated by 1st Column as all values are > than the 2nd Column, No Dominance
Now we have to go to Row reduction
Player B
1 3
2 7 5
Player A
3 8 11
1st Step : we need to take the total of Each & every row

Player B
1 3
2 7 5 12 Least Value
 Now we have to select the least one = 12 Player A
3 8 11 19
Row : If all the entries in a row of a payoff matrix should be lesser than or equal to the corresponding entries of another row , if yes that row can be
deleted.
We have to compare least value row from other rows
Result : Row 1 is dominated by row 2 , so delete row 1
 Now we have to scan the column
Select the Highest Value = 11
Compare the 2nd column with 1st column
Dominance Property for Column : if all the entries in a columns should be greater than or equal to the corresponding entries of another column , If yes
that column can be deleted.
Player will select strategy of 8 , Player A will select 3rd strategy , Probability of Player A = ( 0, 0, 1 ,0 ) ,
Player B will select 1st strategy, Probability of Player B = ( 1,0,0,0,0,)
Example ( Dominance ) Pure & Mixed Strategy
Player B
1 2 3 4
1 5 -3 3 4
Player A
2 -4 5 4 5
3 4 -4 -3 3

1ST Step to Find Row Minimum : means least value in each row .
Player B
1 2 3 4 Row Minimum
Player A
1 5 -3 3 4 -3 Maximin Value
2 -4 5 4 5 -4
3 4 -4 -3 3 -4
2nd Step to Find Column Maximum : means Highest value in each column.
Player B
1 2 3 4 Row Minimum
1 5 -3 3 4 -3
Player A
2 -4 5 4 5 -4
3 4 -4 -3 3 -4
Column Maximum 5 5 4 5

Minimax Value
In the above table
Maximin value ≠ Minimax Value
-3 ≠ 4
Now Solve the problem using Dominance Property
Player B
1 2 3 4
1 5 -3 3 4
Player A
2 -4 5 4 5
3 4 -4 -3 3

1st Step : we need to take the total of Each & every row
5 -3 + 3 + 4 = 9
-4 + 5+4 + 5 = 10 1 2
Player B
3 4
1 5 -3 3 4 9
Player A
2 -4 5 4 5 10
3 4 -4 -3 3 0 Least Value

Now we have to select the least one = 0


Row : If all the entries in a row of a payoff matrix should be lesser than or equal to the corresponding entries of another
row , if yes that row can be deleted.
We have to compare least value row from other rows Result : Row 3 is dominated by row 1 , so delete row 3
Player B
1 2 3 4
1 5 -3 3 4 9 Least Value
2 -4 5 4 5 10
3 4 -4 -3 3 0
Next Least Value = 9
We have to compare least value row ( 1st Row )from 2nd rows
We observe NO DOMINATION
So we move towards Column reduction
Player B
1 2 3 4
1 5 -3 3 4
Player A
2 -4 5 4 5
1st Step : we need to take the total of Each & every Column
5 -4 = 1, -3 +5 = 2 , 3 + 4 = 7 , 4 + 5 = 9,

Player B
1 2 3 4
1 5 -3 3 4
Player A
2 -4 5 4 5
1 2 7 9

Dominance Property for Column : if all the entries in a columns should be greater than or equal to the corresponding
entries of another column , If yes that column can be deleted.
Now we have to select the Highest one = 9 ( 4th Column )
Compare 4th Column from 1st Column , No dominance , Now compare 4th Column with 2nd column
Result : 4th Column is dominated by 2nd Column as all values are lesser than the 4th Column, So delete the 4th Column
 Now we have to select the Next Highest one = 7 ( 3rd Column )
Compare 3rd Column from 1st Column
Result : 3rd Column is not dominated by 1st Column as all values are > than the 2nd Column, No Dominance
Similarly you compare 2nd with 1 & 3 column but no Dominance
Player B
1 2 3 4
1 5 -3 3 4
Player A
2 -4 5 4 5
1 2 7 9

In this case you take Average of 2 column


Player B
1 2 3
1 5 -3 3
Player A
2 -4 5 4

Average of column 1 & 2 5 + ( -3 ) / 2 or 5-2 / 2 = 1


-4 + 5 / 2 or 1 / 2 = 1/2
Compare the average of two value with 3rd , 1 < 3 & 1/ 2 < 4 , so average of two dominance on 3 , so delete 3
Player B
1 2 Oddments
1 5 -3 9
Player A
2 -4 5 8
Oddments 8 9

1st Step is to find out the Oddments


Oddments means = You have to find the difference between the first row write
against the 2nd row & difference between the second row , write against the 1st row
Like For ROWs 5- ( -3) = 8 5- ( -4) = 9
For Columns 5- ( -4) = 9 5 –(-3)= 8
We have to find the Probability for both row & Column
P1 = 9 / 9+8 = 9/17 , P2 = 8 / 9+8 = 8 / 17
Q1 = 8 / 8+ 9 = 8 / 17 Q2 = 9/ 8 + 9 = 9/ 17
Player B
1 2 Oddments
1 5 -3 9
Player A
2 -4 5 8
Oddments 8 9

Value of the Game ( V ) = c11 x 9 + c21 x 8/ 9 +8 or 5 x 9 + (-4 ) x 8 / 9 + 8 or


45 -32 / 17 = 13 / 17 or 0.76

Hence the Strategy of Player A ( 9/17 , 8/ 17, 0 )


Player B (8/ 17, 9/ 17,0, 0 )
Value of the game = 0.76

You all will observe that for Player A Probability of selection of the Individual strategy will be less
than one but total will be equal to one.
9/ 17+ 8 /17 + 0 = 17/17 = 1
For Player B also Probability of selection of the Individual strategy will be less than one but total
will be equal to one.
8/ 17 + 9/ 17 +0 +0 = 17/17 = 1
Game Theory ( Graphical )
I 2 x n game – Payoff matrix contains 2 Rows & n columns
II m x 2 game – Payoff matrix Contains m Rows & 2 columns

2 x n game – Payoff matrix contains 2 Rows & n columns


Step 1 : Reduce the size of the payoff matrix of player A by applying the dominance property if it
exist.
Step 2 :
i. Let x be the probability of selection of alternative 1 by player A & 1-x be the probability of
selection of alternative 2 by player A.
ii. Derive the expected gain function of player A with respect to each of the alternative of player B
iii. Find the Value of gain when x=0, x= 1
iv. Plot the gain function on the graph by assuming a suitable scale ( Keep x on x axis, gain on y axis
.
v. Find the Highest intersection point in the lower boundary of graph --- Maximin Point.
vi. If the no of line passing through the maximin point is only two, form 2x2 payoff matrix –Go to
stop 8 otherwise go to step 7
vii. Identify any two lines with opposite slopes passing through that two points then form a payoff
matrix.
viii. Solve the 2x2 game using oddments & find the solution for player A & B & also value of game.
Example
Consider the payoff matrix of player A as shown below & solve it optimally using
graphical method. Player A has two strategy & Player B has 5 Strategy. Numbers in the
matrix are the outcomes.
Player B
1 2 3 4 5
1 -4 2 5 -6 6
Player A
2 3 -9 7 4 8

Note : If the game has no saddle point , then game has said to have Mixed Strategy .
Saddle Points means Maximin = Minimax
First we have to find out that game has saddle point or not.
1ST Step to Find Row Minimum : means least value in each row
Player B
1 2 3 4 5 Row Minimum
1 -4 2 5 -6 6 -6 Maximin Value
Player A
2 3 -9 7 4 8 -9
2nd Step to Find Column Maximum : means Highest value in each column.
Player B
1 2 3 4 5 Row Minimum
1 -4 2 5 -6 6 -6 Maximin Value
Player A
2 3 -9 7 4 8 -9
Column Maximum 3 2 7 4 8

Minimax Value

Maximin value ≠ Minimax Value


-6 ≠ 2
So this problem has no saddle point . It means It has Mixed Strategy.
Check the Dominance Property 1st Step : we need to take the total of Each & every Column
Player B
1 2 3 4 5
1 -4 2 5 -6 6
Player A
2 3 -9 7 4 8
-1 -7 12 -2 14

Dominance Property for Column : if all the entries in a columns should be greater than or equal to the
corresponding entries of another column , If yes that column can be deleted.
Now we have to select the Highest one = 14 ( 5th Column )
Compare 5 th Column from 1st Column
Result : 5th Column is dominated by 1st Column as all values are lesser than the 5th Column, So
delete the 5th Column
Player B
1 2 3 4 5
1 -4 2 5 -6 6
Player A
2 3 -9 7 4 8
-1 -7 12 -2 14

Now we have to select the Highest one = 12 ( 3rd Column Column )


Compare 3rd Column from 1st Column
Result : 3rd Column is dominated by 1st Column as all values are lesser than the 3rd Column, So delete
the 3rd Column
All other least Value if you will check , No dominance .
But we have reduced two columns
Player B
1 2 4
1 -4 2 -6
Player A
2 3 -9 4
Player A has two Strategy : for the First strategy , Probability will be x.
For 2nd strategy , Probability will be 1-x
Expected Payoff function & Gain of Player
A.
A’s Expected gains
Bs Alternatives A Expected Payoff Function x=0 x= 1
1 -4x + 3 ( 1-x)= -7x+3 3 -4
2 2x- 9 (1-x) = 11 x -9 -9 2
4 -6x+4 ( 1-x) = -10x+4 4 -6
Graphical Method
Graphical Method
From Graphical Method we have selected two strategy for B as B2 & B4
Now we can form 2x 2 matrix.
By taking 1 & 2 strategy for A
2 & 4 strategy for B Player B Oddments
2 4
1 2 -6 13
Player A
2 -9 4 8
Oddments 10 11

We have to find the Probability for both row & Column


P1 = 13/ 13 +8 = 13/21 , P2 = 8 / 13+8 = 8 / 21
Q1 = 10 / 10+ 11 = 10 / 21 Q2 = 11/ 10 + 11 = 11/ 21
Value of the Game ( V ) = c11 x 13 + c21 x 8/ 13 +8 or 2 x 13 + (-9 ) x 8 / 13+ 8 or
26 -72 / 21 = -46 / 21

Hence the Strategy of Player A ( 13/21 , 8/ 21 )


Player B (0, 10/ 21 , 0 , 11/ 21 , 0 )
Value of the game = -46/ 21
Queuing Theory
Introduction
Queuing theory deals with problems that involve waiting (or queuing). It is
quite common that instances of queue occurs everyday in our daily life.
Examples of queues or long waiting lines might be :
Waiting for service in banks and at reservation counters.
 Waiting for a train or a bus.
 Waiting for checking out at the Supermarket.
 Waiting at the telephone booth or a barber’s saloon.
Whenever a customer arrives at a service facility, some of them usually have
to wait before they receive the desired service.
This forms a queue or waiting line and customers feel discomfort either
mentally or physically because of long waiting queue.
Queuing Theory
We infer that queues form because the service facilities are inadequate.
 If service facilities are increased, then the question arises how much to increase?
For example, how many buses would be needed to avoid queues?
How many reservation counters would be needed to reduce the queue?
 Increase in number of buses and reservation counters requires additional resource.
At the same time, costs due to customer dissatisfaction must also be considered.
In designing a queuing system, the system should balance service to customers (short
queue) and also the economic considerations (not too many servers).
 Queuing theory explores and measures the performance in a queuing situation
such as average number of customers waiting in the queue, average waiting time of
a customer and average server utilization.
Queuing System
 The customers arrive at service counter (single or
in groups) and are attended by one or more
servers.
 A customer served leaves the system after getting
the service.

 In general, a queuing system comprises with two


components, the queue and the service facility.
The queue is where the customers are waiting to be
served.
The service facility is customers being served and the
individual service stations.
Characteristics of Queuing System
• In designing a good queuing system, it is necessary to have a good
information about the model.
• The characteristics listed below would provide sufficient information.
a. The arrival pattern.
b. The service mechanism.
c. The queue discipline.
d. The number of customers allowed in the system.
e. The number of service channels.
The Arrival Pattern:
• The arrival pattern describes how a customer may become a part of the queuing system.
• The arrival time for any customer is unpredictable.
• Therefore, the arrival time and the number of customers arriving at any specified time intervals
are usually random variables.
• A Poisson distribution of arrivals correspond to arrivals at random.
• In Poisson distribution, successive customers arrive after intervals which independently are and
exponentially distributed.
• The Poisson distribution is important, as it is a suitable mathematical model of many practical
queuing systems as described by the parameter “the average arrival rate”.
The Service Mechanism:
• The service mechanism is a description of resources required for service.
• If there are infinite number of servers, then there will be no queue.
• If the number of servers is finite, then the customers are served according to a specific order.
• The time taken to serve a particular customer is called the service time.
• The service time is a statistical variable and can be studied either as the number of services
completed in a given period of time or the completion period of a service.
The Queue Discipline:
• The most common queue discipline is the “First Come First Served” (FCFS) or “First-in, First-out” (FIFO).
Situations like waiting for a haircut, ticket-booking counters follow FCFS discipline.
• Other disciplines include “Last In First Out” (LIFO) where last customer is serviced first,
• “Service In Random Order” (SIRO) in which the customers are serviced randomly irrespective of their arrivals.
• “Priority service” is when the customers are grouped in priority classes based on urgency.
• “Preemptive Priority” is the highest priority given to the customer who enters into the service, immediately,
even if a customer with lower priority is in service.
• “Non-preemptive priority” is where the customer goes ahead in the queue, but will be served only after the
completion of the current service.
The Number of Customers Allowed in the System:
• Some of the queuing processes allow the limitation to the capacity or size of the waiting room,
• so that the waiting line reaches a certain length, no additional customers is allowed to enter until space becomes
available by a service completion.
• This type of situation means that there is a finite limit to the maximum queue size.
The Number of Service Channels:
• The more the number of service channels in the service facility, the greater the overall service rate of the facility.
• The combination of arrival rate and service rate is critical for determining the number of service channels.
• When there are a number of service channels available for service, then the arrangement of service depends
upon the design of the system’s service mechanism.
• Parallel channels means, a number of channels
providing identical service facilities so that
several customers may be served
simultaneously.
• Series channel means a customer go through
successive ordered channels before service is
completed.
• A queuing system is called a one-server model,
i.e., when the system has only one server,
• and a multi-server model i.e., when the system
has a number of parallel channels, each with
one server
Attitude of Customers
• Patient Customer: Customer arrives at the service system, stays in the
queue until served, no matter how much he has to wait for service.
• Impatient Customer: Customer arrives at the service system, waits for a
certain time in the queue and leaves the system without getting service due
to some reasons like long queue before him.
• Balking: Customer decides not to join the queue by seeing the number of
customers already in service system.
• Reneging: Customer after joining the queue, waits for some time and leaves
the service system Notes due to delay in service.
• Jockeying: Customer moves from one queue to another thinking that he
will get served faster by doing so.
Waiting Line Process
A waiting line process or queuing process is defined by two important
elements:
The population source of its customers
The process or service system.
The customer population can be considered as finite or infinite.
• The customer population is finite when the number of customers affects
potential new customers for the service system already in the system.
• When the number of customers waiting in line does not significantly
affect the rate at which the population generates new customers, the
customer population is considered infinite.
• Customer behavior can change and depends on waiting line
characteristics.
Another element of queuing system is service system.
• The number of waiting lines,
• the number of servers,
• the arrangements of the servers,
• the arrival and service patterns, and
• the service priority rules characterize the service system.
Queue system can have channels or multiple waiting lines.
Example:
• Single waiting line : bank counter, airline counters, restaurants, amusement parks. In these examples
multiple servers might serve customers.
• In the single line multiple servers has better performance in terms of waiting times and eliminates
jockeying behavior than the system with a single line for each server.
• System serving capacity is a function of the number of service facilities and server proficiency.
• In waiting line system, the terms server and channel are used interchangeably.
• Waiting line systems are either single server or multiple servers.
Example:
1. Single server: gas station, food mart with single checkout counter, a theater with a single person selling
tickets and controlling admission into the show.
2. Multiple server: gas stations with multiple gas pumps, grocery stores with multiple cashiers, multiple
tellers in a bank.
Waiting Line Process
The process of waiting line is characterized by rate at which customers
arrive and are served by service system.
• Arrival rate specifies the average number of customers per time
period.
• The service rate specifies the average number customers that can be
serviced during a time period.
• The service rate governs capacity of the service system.
• It is the fluctuation in arrival and service patterns that causes wait in
queuing system.
Poisson and Exponential Distributions
• Both the Poisson and Exponential distributions play a prominent role in queuing theory.
• Considering a problem of determining the probability of n arrivals being observed during a time interval of
length t, where the following assumptions are made.
i. Probability that an arrival is observed during a small time interval (say of length v) is proportional to the
length of interval. Let the proportionality constant be λ , so that the probability is λ v.
ii. Probability of two or more arrivals in such a small interval is zero.
iii. Number of arrivals in any time interval is independent of the number in nonoverlapping time interval.
These assumptions may be combined to yield what probability distributions are likely to be, under Poisson
distribution with exactly n customers in the system.
Suppose function P is defined as follows:
P (n customers during period t) = the probability that n arrivals will be observed in a time interval of length t
then,
P (n, t) = (λ t)^n e^- λ t
n! (n = 0, 1, 2,……………) (1)
This is the Poisson probability distribution for the discrete random variable n, the number of arrivals, where
the length of time interval, t is assumed to be given. This situation in queuing theory is called Poisson arrivals.
Since the arrivals alone are considered (not departures), it is called a pure birth process.
The time between successive arrivals is called inter-arrival time.
 In the case where the number of arrivals in a given time interval has Poisson distribution,
inter-arrival times can be shown to have the exponential distribution.
 If the inter-arrival times are independent random variables, they must follow an exponential
distribution with density f(t) where,
f (t) = λ e ^–λ t (t > 0) (2)
Thus for Poisson arrivals at the constant rate λ per unit, the time between successive arrivals
(inter-arrival time) has the exponential distribution. The average Inter - arrival time is denoted
by I.
For example, in the following arrival situations, the average arrival rate λ per hour, and the
average inter arrival time in hour, are determined.
1. One arrival comes every 15 minutes.
Average arrival rate, l = 60/15 = 4 arrivals per hour.
Average inter arrival time I = 15 minutes = ¼ or 0.25 hour.
2. Three arrivals occur every 6 minutes.
Average arrival rate, l = 30 arrivals per hour.
Average Inter-arrival time, I = 60/30 = 2 minutes = or 0.33 hr
Similarly, in the following service situations, the average service rate
per hour, µ and average service time in hours are determined.
1. One service is completed in 10 minutes.
Average service rate, m =60/10 = 6 services per hour.
Average service time, S= 60/6= 10 minutes or 0.166 hour.
2. Number of customers served in 15 minutes is 4.
Average service rate, m =4X60/15 =16 services per hour.
Average services time, =60/16 = 3.75 mins or 0.0625 hour.
EXAMPLE
• In a factory, the machines break down and require service according to a Poisson
distribution at the average of four per day. What is the probability that exactly six
machines break down in two days?
Solutions :
λ= 4, n=6, t =2
P(n, t) = P(6, 4) when l = 4
P (n, t) = (λ t)^n e^- λ t
n!
P ( 6, 2) = (4X2)^6 e ^-4x2
6!
= 8^6 e^-8 / 6 x5x4x3x2x1 = 0.1221
Symbols and Notations
The symbols and notations used in queuing system are as follows:
n = Number of customers in the system (both waiting and in service).
λ = Average number of customers arriving per unit of time.
µ = Average number of customers being served per unit of time.
λ / µ = p, traffic intensity.
C = Number of parallel service channels (i.e., servers).
Ls = Average or expected number of customers in the system (both waiting and in service).
Lq = Average or expected number of customers in the queue.
Ws = Average waiting time in the system (both waiting and in service).
Wq = Average waiting time of a customer in the queue.
Pn = Time independent probability that there are n customers in the system (both waiting
and in service).
Pn (t) = Probability that there are n customers in the system at any time t (both waiting
and in service
Queueing Models
• Different models in queueing theory are classified by using special notations described initially in 1953 in the form (a/b/b).
• Later A.M. Lee in 1966 added the symbols d and c to the Kendall notation.
• Now in the literature of queuing theory the standard format used to describe the main characteristics of parallel queues is as
follows:
{(a/b/c) = (d/c) }
Where
a = arrivals distribution
b = service time
c = number of service channels (servers)
d = maximum number of customers allowed in the system
e = queue discipline
Model 1: (MM1) : (∞ / FIFO)
Assumptions This model is based on the following assumptions:
1. The arrivals follow Poisson distribution, with a mean arrival rate λ .
2. The service time has exponential distribution, average service rate µ
3. There is only a single server.
4. Arrivals are infinite population ∞
5. Customers are served on a First-in, First-out basis (FIFO).
System of Steady-state Equations
• In this method, the question arises whether the service can meet the customer demand. This
depends on the values of λ and µ
• If λ > µ i.e., if arrival rate is greater than or equal to the service rate, the waiting line would increase
without limit.
• Therefore for a system to work, it is necessary that λ < µ.
• As indicated earlier, traffic intensity p = λ / µ. This refers to the probability of time. The service
station is busy.
• We can say that, the probability that the system is idle or there are no customers in the system,
P0 = 1 – p.
• From this, the probability of having exactly one customer in the system is P1 = p P0 .
• Likewise, the probability of having exactly 2 customers in the system would be
P3 = pP1 = p^2 P0
The probability of having exactly n customers in the system is
Pn = p^ nP0 = p^n(1-p) = (λ / µ)^n P0
Formulas
The evaluation of Model I is listed below:
• Expected number of customers in the system:
Ls = λ / µ- λ = p / 1-p
• Expected number of customers in the queue
Lq= λ^2 /µ( µ- λ ) = p^2 / 1-p
• Average waiting time in the system
Ws = 1/ µ- λ
• Average waiting time in the queue:
Wq= λ / µ(µ- λ )
• Average waiting time for a customer
W ( w /w >0)= 1/ µ ( 1-p) or 1/ µ- λ
• Expected length of non-empty queue
L ( m / m >0)= µ / µ- λ
Formulas
• Probability that there are n customers in the system:
Pn = (λ / µ)^nP0 = (λ / µ)^n ( 1- λ / µ)
• Probability that there is nobody in the system:
P0 = 1- λ / µ
• Probability that there is at least one customer or queue is busy
Pb = 1- P0
• Traffic intensity, or utilization factor,
p=λ/µ
Example
Consider a situation where the mean arrival rate (l) is one customer every 4 minutes and the mean service time
(m) is 2½ minutes. Calculate the average number of customers in the system, the average queue length and the
time taken by a customer in the system and the average time a customer waits before being served.
Solutions :
Given, Average Arrival Rate λ = 1 customer every 4 minutes or 15 customers per hour
Average Service –Rate µ = 1 customer every 2½ minutes or 24 customers per hour 1.
The average number of customers in the system
Ls = λ / µ- λ = 15/ 24-15 = 15/ 9 or 1.66 Customers
The average queue length:
Lq= λ^2 /µ( µ- λ ) = 15^2 / 24 ( 24-15 ) = 225 / 216 = 1.04 Customers
The average time a customer spends in the system:
Ws = 1/ µ- λ = 1/ 24-15 = 1/9 = 0.11 x60 = 6.66 Mins
The average time a customer waits before being served:
Wq= λ / µ(µ- λ ) = 15 / 24 ( 24-15 ) = 15 / 216 = 0.069 x60 = 4.16 mins
Example 2
Trucks at a single platform weigh-bridge arrive according to Poisson probability distribution. The time required to weigh the truck
follows an exponential probability distribution. The mean arrival rate is 12 trucks per day, and the mean service rate is 18 trucks per
day. Determine the following:
i. What is the probability that no trucks are in the system?
ii. What is the average number of trucks waiting for service?
iii. What is the average time a truck waits for weighing service to begin?
iv. What is the probability that an arriving truck will have to wait for service?
Solution: Given λ = 12 trucks per days, µ = 18 trucks per day.
1. Probability that no trucks are waiting for service
P0 = 1- λ / µ = 1 - 12/18 = 1- 2/3 = 3-2 / 3 = 1/3 = 0.3333 or 33.33 %
2. Average number of trucks waiting for service
Lq= λ^2 /µ( µ- λ ) = 12 ^2 / 18 ( 18-12 ) = 144 / 108 = 1.33 Trucks
3. Average time a truck waits for weighing service to begin
Wq= λ / µ(µ- λ ) = 12 / 18 ( 18-12 ) = 12 /108 = 0.1111 days or 53. 3 mins.
4. Probability that an arriving truck will have to wait for service,
P0 = 1- Po = 1- 0.3333 = 0.6667 or 66.67 %
Model 2 ( M/M/1): (N /FCFS ) , Single server , Limited queue length
Assumptions This model is based on the following assumptions:
1. The arrivals follow Poisson distribution, with a mean arrival rate λ .
2. The service time has exponential distribution, average service rate µ
3. There is only a single server.
4. Arrivals are finite population N ( Limited number of customers )
5. Customers are served on a First-come, First- serve (FCFS).
Operating Characteristics
a. Probability that server is idle ( or empty system )
Po = 1-p / 1-p^N+1, p = λ / µ , p = rho
b. Probability that there are n customer in the system
Pn = p^n Po, n =0,1,2 …..N
Pn = p^n ( 1-p / 1-p^N+1)
c. Average number of customer in the ( Expected ) system
Ls = p/1-p – (N+1 )p^N+1/ 1-p^N+1
d. Average number of customer in queue
Lq = Ls - λe / µ = Ls – λ( 1- PN ) / µ (λe= Mean arrival entering in system λe = λ ( 1-PN)
e. Average waiting time of customer in system
Ws = Ls / λe = Ls / λ ( 1-PN)
f. Average waiting time of customer in Queue Wq = Ws-1 / µ
Example
Train arrive at the yard every 15 minutes & service time is 32 minutes.
If the capacity of the yard is limited to 4 trains, Find :
1. Probability that the yard is empty.
2. Average number of trains in the system.
Solution :
N = 4 ( Yard Capacity ) means Finite population.
Arrival rate λ = 1/ 15 train / Min
1 x60 / 15 = 4 trains / min
Service rate µ = 1/ 32 Train / min
= 60 /32 = 1.88 train / min
1. Probability that the yard is empty
Po= 1-p / 1-p^ N+1 , p ( rho ) = λ/ µ
4/ 1.88 = 2.1
Po= 1-2.1 / 1- ( 2.1 )^4+1 or -1.1 / 1 – 40.84 ) = -1.1 / -39.84 or Po = 0.027
Example
2 . Average number of trains in the system.
Ls = p/1-p – (N+1) p^N+1 / 1-p ^ N +1
2.1 /1-2.1 – (4 +1 ) (2.1 ) ^4+1/ 1- (2.1 )^4+1
Ls = 2.1 /-1.1 – 5 x 40.84 / 1-40.84
Ls = 2.1 /-1.1 -204.20 /-39.84
Ls = -1.909- (- 5.125 )
Ls = -1.909+5.125 or Ls = 3.216 or 3 trains
Introduction to
Simulation

Discrete-Event System Simulation


Outline
 When Simulation Is the Appropriate Tool
 When Simulation Is Not Appropriate
 Advantages and Disadvantages of Simulation
 Areas of Application
 Systems and System Environment
 Components of a System
 Discrete and Continuous Systems
 Model of a System
 Types of Models
 Discrete-Event System Simulation
 Steps in a Simulation Study

5
9
Definition
 A simulation is the imitation of the operation of real-world
process or system over time.
 Generation of artificial history and observation of that
observation history
 A model construct a conceptual framework that
describes a system
 The behavior of a system that evolves over time is
studied by developing a simulation model.
 The model takes a set of expressed assumptions:
 Mathematical, logical
 Symbolic relationship between the entities

6
0
Goal of modeling and simulation
 A model can be used to investigate a wide verity of “what if”
questions about real-world system.
 Potential changes to the system can be simulated and predicate their
impact on the system.
 Find adequate parameters before implementation
 So simulation can be used as
 Analysis tool for predicating the effect of changes
 Design tool to predicate the performance of new system
 It is better to do simulation before Implementation.

6
1
How a model can be developed?
 Mathematical Methods
 Probability theory, algebraic method ,…
 Their results are accurate
 They have a few Number of parameters
 It is impossible for complex systems

 Numerical computer-based simulation


 It is simple
 It is useful for complex system

6
2
When Simulation Is the Appropriate Tool
 Simulation enable the study of internal interaction of a
subsystem with complex system
 Informational, organizational and environmental changes
can be simulated and find their effects
 A simulation model help us to gain knowledge about
improvement of system
 Finding important input parameters with changing simulation
inputs
 Simulation can be used with new design and policies
before implementation
 Simulating different capabilities for a machine can help
determine the requirement
 Simulation models designed for training make learning
possible without the cost disruption
 A plan can be visualized with animated simulation
treated only by simulation
 The modern system (factory, wafer fabrication plant,
6

service organization) is too complex that its internal


When Simulation Is Not Appropriate

 When the problem can be solved by common


sense.
 When the problem can be solved analytically.
 If it is easier to perform direct experiments.
 If cost exceed savings.
 If resource or time are not available.
 If system behavior is too complex.
 Like human behavior
Advantages and
disadvantages of
simulation
 In contrast to optimization models, simulation
models are “run” rather than solved.
 Given as a set of inputs and model characteristics the
model is run and the simulated behavior is observed
Advantages of simulation
 New policies, operating procedures, information flows and son 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( clock is self-control).
 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.
Disadvantages of simulation
 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.
 Many simulation software have output-analysis.
Areas of application
 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),...
Systems and System Environment
 A system is defined as a groups of objects that
are joined together in some regular interaction
toward the accomplishment of some purpose.
 An automobile factory: Machines, components parts
and workers operate jointly along assembly line
 A system is often affected by changes occurring
outside the system: system environment.
 Factory : Arrival orders
 Effect of supply on demand : relationship between factory
output and arrival (activity of system)
 Banks : arrival of customers
Components of system
 Entity
 An object of interest in the system : Machines in factory
 Attribute
 The property of an entity : speed, capacity
 Activity
 A time period of specified length :welding, stamping
 State
 A collection of variables that describe the system in any time : status of machine (busy,
idle, down,…)
 Event
 A instantaneous occurrence that might change the state of the system:
breakdown
 Endogenous
 Activities and events occurring with the system
 Exogenous
 Activities and events occurring with the environment
Discrete and Continues Systems
 A discrete system is one in which the state variables
change only at a discrete set of points in time : Bank
example
Discrete and Continues Systems (cont.)
 A continues system is one in which the state variables change
continuously over time: Head of water behind the dam
Model of a System
 To study the system
 it is sometimes possible to experiments with system
 This is not always possible (bank, factory,…)
 A new system may not yet exist
 Model: construct a conceptual framework that
describes a system
 It is necessary to consider those accepts of systems that
affect the problem under investigation (unnecessary
details must remove)
Types of Models
Characterizing a Simulation Model
 Deterministic or Stochastic
 Doesthe model contain stochastic components?
 Randomness is easy to add to a DES
 Static or Dynamic
 Is time a significant variable?
 Continuous or Discrete
 Does the system state evolve continuously or only at
discrete points in time?
 Continuous: classical mechanics
 Discrete: queuing, inventory, machine shop models
Discrete-Event Simulation Model
 Stochastic: some state variables are random
 Dynamic: time evolution is important
 Discrete-Event: significant changes occur at
discrete time instances
Model Taxonomy
DES Model Development

How to develop a model:


1) Determine the goals and objectives
2) Build a conceptual model
3) Convert into a specification model
4) Convert into a computational model
5) Verify
6) Validate
Typically an iterative process
Three Model Levels
 Conceptual
 Very high level
 How comprehensive should the model be?
 What are the state variables, which are dynamic, and which are
important?
 Specification
 On paper
 May involve equations, pseudocode, etc.
 How will the model receive input?
 Computational
 A computer program
 General-purpose PL or simulation language?
Verification vs. Validation
 Verification
 Computational model should be consistent with
specification model
 Did we build the model right?
 Validation
 Computational model should be consistent with the
system being analyzed
 Did we build the right model?
 Can an expert distinguish simulation output from
system output?
 Interactive graphics can prove valuable
Steps in Simulation
Study
Simulation Model ( Monte carlo based )
THANK YOU 

You might also like