Transcript
Page 1: Why Wait?!? Bryan Gorney Joe Walker Dave Mertz Josh Staidl Matt Boche

Why Wait?!?Bryan Gorney

Joe WalkerDave Mertz

Josh StaidlMatt Boche

Page 2: Why Wait?!? Bryan Gorney Joe Walker Dave Mertz Josh Staidl Matt Boche

Purpose: To minimize costs of businesses with waiting lines, taking into consideration the cost of servers and the long-run loss of revenue by making customers wait too long.

Outline:

I. Rudiments of Queuing Theorya. 1 Customer, 1 Serverb. Many Customer, No Serverc. Many Customers, 1 Server

II. Concept of a Stationary DistributionIII. Traffic Intensity

a. Average Queue Lengthb. Little’s Principlec. Average Waiting Time

IV. Store Profit Maximization

Page 3: Why Wait?!? Bryan Gorney Joe Walker Dave Mertz Josh Staidl Matt Boche

1 Customer, 1 Server

• N(t) = number of individuals at checkout counter at time t.

• N(t) has only two possible values of 0 or 1.

• “being served” corresponds to N(t) = 1.

• “finished being served” corresponds to N(t) = 0.

Page 4: Why Wait?!? Bryan Gorney Joe Walker Dave Mertz Josh Staidl Matt Boche

To obtain the time-dependent transition probabilities for this Markov chain, let

Xt =

be the time-dependent distribution vector for the states “being served” and “finished being served”.

That is,

p(t) = P[N(t) = 1]

and

q(t) = P[N(t) = 0]

p(t)q(t))(

Page 5: Why Wait?!? Bryan Gorney Joe Walker Dave Mertz Josh Staidl Matt Boche

• q(t) = 1 – p(t)

• lim p(t) = 0

lim Xt =

State diagram

P[service is completed in t] = t

P[service is not completed in t] = 1 – t

t t

1 0

t

t

(0

1)

1

Page 6: Why Wait?!? Bryan Gorney Joe Walker Dave Mertz Josh Staidl Matt Boche

The transition matrix for each t time step is given by

A =

Thus, Xt+t = AXt

which in matrix form gives:

(1 – t 0

t 1

)

p(t + t)

q(t + t)( ) = (1 – t 0

t 1

) p(t)q(t))(

Page 7: Why Wait?!? Bryan Gorney Joe Walker Dave Mertz Josh Staidl Matt Boche

Performing matrix multiplication yields:

p(t + t) = (1 – t)p(t)

Rearranging so difference quotient is on the left-hand side:

By letting t go to zero, the difference quotient becomes a derivative, and

p(t + t) – p(t)

t= -p(t)

p(t + t) – p(t)

tt 0limp’(t) = = -p(t)

Page 8: Why Wait?!? Bryan Gorney Joe Walker Dave Mertz Josh Staidl Matt Boche

This is the exponential differential equation with solution:

p(t) = P[N(t) = 1] = pe-t

Since we assumed that there is an individual initially being served, N(0) = 1. This implies that p(0) = 1 which gives

p0 = 1. Finally we have:

p(t) = P[N(t) = 1] = e-t

Since q(t) = 1 – p(t), the probability of completing the service is:

q(t) = 1 – e-t

Page 9: Why Wait?!? Bryan Gorney Joe Walker Dave Mertz Josh Staidl Matt Boche

• Next let T denote the time at which service is completed. It is considered to be the time until transition from one state to another.

• T is a continuous random variable with range 0 < T < .

• P[T > t] = P[N(t) = 1].

• P[T < t] = 1 – e-t (complement).

• Left-hand side = cumulative distribution function of the continuous random variable T.

• Right-hand side = exponential distribution.

Page 10: Why Wait?!? Bryan Gorney Joe Walker Dave Mertz Josh Staidl Matt Boche

P[T > s + t given T > s] = P[T > t] (Memoryless property)

for all s,t > 0.

Density function is the derivative of the cumulative distribution which is:

f(t) = P[T < t] = e-t, 0 < t < .

E(T) = tf(t)dt = te-tdt =

Thus the average value of T is . We interpret the service rate as:

ddt

0

0

1

1

1Mean Time Until Transition=

Page 11: Why Wait?!? Bryan Gorney Joe Walker Dave Mertz Josh Staidl Matt Boche

Many Customers, No Server

1. The probability that an arrival occurs in a short interval [t, t+t] is proportional to the length of the interval t.In symbols:

P[ N(t+t) - N(t) = 1] = t

for some constant >0.

Let N(t) be a time dependent function that denotes the number of customer arrivals in a given interval [0,t], and assume the following:

Page 12: Why Wait?!? Bryan Gorney Joe Walker Dave Mertz Josh Staidl Matt Boche

2. The Memoryless Property:The probability that an arrival occurs in [t, t+t] doesnot depend on the time of previous arrivals:

P[ N(t+t) – N(t) = n | N(s) = m ] = P[ N(t+t) – N(t) = n]

for all 0 s t.

3. Occurrences of arrivals in non-overlapping intervals areindependent.

4. The Probability of two or more arrivals in [t, t+t] is negligible.

Page 13: Why Wait?!? Bryan Gorney Joe Walker Dave Mertz Josh Staidl Matt Boche

Assume Pn(t) = P[N(t) = n]

N(t) has possible values 0,1,2,… since it is possibleto have any number of customers in line.

Considering a time step of size t, N(t) forms a MarkovChain, with a transition matrix of:

A = (1-t 0 0 0 . . . t 1-t 0 0 . . . 0 t 1- t 0 . . .

)

Page 14: Why Wait?!? Bryan Gorney Joe Walker Dave Mertz Josh Staidl Matt Boche

t t t

1-t 1-t 1-t

State Diagram of Transition Matrix

Xt+t = AXt is the state equation for each time step size t, where:

(P0(t)P1(t) :Pn(t) :

)Xt =

Page 15: Why Wait?!? Bryan Gorney Joe Walker Dave Mertz Josh Staidl Matt Boche

After Matrix Multiplication: we have the followingsystem of equations:

P0(t+t) = (1-t)P0(t) P1(t+t) = tP0(t)+(1-t)P1(t)

Pn(t+t) = tPn-1(t)+(1-t)Pn(t)

These equations can then be rearranged to make difference quotients.

Page 16: Why Wait?!? Bryan Gorney Joe Walker Dave Mertz Josh Staidl Matt Boche

Letting t go to zero we obtain a system of differentialequations. For n 1,

Pn’(t) = limt0

= [Pn-1(t) – Pn(t)],

and for n = 0,

P0’(t) = -P0(t)

This equation is the exponential differential equation with initial condition that there are no arrivals (P0(0) = 1). This gives:

P0(t) = e-t

Pn(t+ t) – Pn(t) t

Page 17: Why Wait?!? Bryan Gorney Joe Walker Dave Mertz Josh Staidl Matt Boche

Similarly, letting n=1,

P1’(t) = [P0(t)- P1(t)]= [e-t - P1(t)]

This is a first-order linear differential equationwhich can be solved by multiplying by theintegrating factor et.

ddt

[etP1(t)] = so that etP1(t) = t+c

The initial condition P0(0) =1 implies Pn(0) = 0for all n 1, thus:

P1(t) = te-t

Page 18: Why Wait?!? Bryan Gorney Joe Walker Dave Mertz Josh Staidl Matt Boche

It can be shown by induction that the system of differential equations has solution:

Pn(t) = e-t(t)n for t0, n = 0,1,2,… n!

•Known as a homogeneous Poisson process with rate . ( does not depend on time variable t)•Mean is t (t customers during time interval of length t)

Ex. = 2 customers/minute, t =5 minutes t = 5*2 = 10 customers over 5 minutes

Page 19: Why Wait?!? Bryan Gorney Joe Walker Dave Mertz Josh Staidl Matt Boche

Many Customers, 1 Server

• Let N(t) = number of individuals at checkout counter at time t.

• N(t) = any of the integer values 0, 1, 2, … at time t.

• Probability of arrival in t is t.

• Probability of departure in t is t.

Page 20: Why Wait?!? Bryan Gorney Joe Walker Dave Mertz Josh Staidl Matt Boche

• Three mutually exclusive events:

I. Exactly one arrival in (t,t + t)

II. Exactly one departure in (t,t + t)

III. No arrivals or departures in (t,t + t).

00 11 22

tttt tt

tttt tt

1 – 1 – t - t - tt1 – 1 – tt 1 – 1 – t - t - tt

Page 21: Why Wait?!? Bryan Gorney Joe Walker Dave Mertz Josh Staidl Matt Boche

• The time step for this Markov chain is t and the transition matrix is:

1-1-t t t 0 0 0 …t 0 0 0 …

t 1 – t 1 – t – t – t t t 0 0 …t 0 0 …

0 0 t 1 – t 1 – t – t – t t t 0 …t 0 ….. ........ ..

...... ......

....

..( )A =A =

Page 22: Why Wait?!? Bryan Gorney Joe Walker Dave Mertz Josh Staidl Matt Boche

• Let Pn(t) = P[N(t) = n] be the probability that there are n customers in the queue at time t. Thus letting

PP00(t)(t)

PP11(t)(t)

PPnn(t)(t)

......

......

( )XXtt = =

Page 23: Why Wait?!? Bryan Gorney Joe Walker Dave Mertz Josh Staidl Matt Boche

• We obtain the equation Xt + t = AXt for the single-server queue.

• The state equation gives the following (infinite) system of equations for the single-server queue:

P0(t + t) = (1 – t)P0(t) + tP2(t)

P1(t + t) = (1 – t - t)P1(t) + tP0(t) + tP2(t)

Pn(t + t) = (1 – t - t)Pn(t) + tP0 - 1(t) + tPn + 1(t)

......

......

Page 24: Why Wait?!? Bryan Gorney Joe Walker Dave Mertz Josh Staidl Matt Boche

System of differential equations by letting t go to zero; more specifically, for n > 1,

limlimt 0t 0

PPnn(t + (t + t) – Pt) – Pnn(t)(t)

ttP’P’nn(t) =(t) =

= -(= -(PPnn(t) (t) PPn – 1n – 1(t) + (t) + PPn – n –

11(t)(t)And, PAnd, P00’(t) = -’(t) = -PP00(t) + (t) + PP11(t).(t).

Page 25: Why Wait?!? Bryan Gorney Joe Walker Dave Mertz Josh Staidl Matt Boche

Many classical methods are available for the solving thesystem:

PPnn’(t) =’(t) = -(-(PPnn(t) (t) PPn – 1n – 1(t) + (t) + PPn – 1n – 1(t)(t)

PP00’(t) = -’(t) = -PP00(t) + (t) + PP11(t)(t)

However, they involve ideas beyond the scope of our analysis -instead, we will be using the system of equations to obtainsteady-state (time-independent) behavior.

Page 26: Why Wait?!? Bryan Gorney Joe Walker Dave Mertz Josh Staidl Matt Boche

Stationary Distribution

Looking for whether the system of time-dependent probabilities settles down and displays no more “transient” behavior - analogous to finding the fixed points for deterministic systems. In this case, the fixed points will be “stationary” distributions.

The system of differential equations:

PPnn’(t) =’(t) = -(-(PPnn(t) (t) PPn – 1n – 1(t) + (t) + PPn – 1n – 1(t)(t)

PP00’(t) = -’(t) = -PP00(t) + (t) + PP11(t)(t)

has a fixed point or stationary distribution provided its rates of change are zero, that is:

Pnn’’(t) = 0 for n 0.

Page 27: Why Wait?!? Bryan Gorney Joe Walker Dave Mertz Josh Staidl Matt Boche

lim Pn’(t) = 0 for n 0, is equivalent to assuming that

lim Pn(t) = Pn exists, where Pn does not depend upon t.

Applying Pn’(t) = 0 to the system of equations, we obtain:

1.) 0 = -P0 + P1

and

2.) 0 = -(+ )Pn + Pn-1 + Pn+l, for n > 1.

Solving for P1, using equation 1:

P1 = (P0

Solving for P2, using P1 and equation 2:

P2 = (2 P0

Continuing on, using induction, shows:

Pn = (n P0

t

t

Page 28: Why Wait?!? Bryan Gorney Joe Walker Dave Mertz Josh Staidl Matt Boche

Queue size must be a non-negative integer, hence,P0 + P1 + P2 + … = 1

So,P0 + ()P0 + (2P0+ … = 1

Which is,

P0 Σ (n = 1.

This sums to 1/(1-()) provided that () < 1, which is the condition for the stationary distribution.

Using this sum, P0 = 1 – (so the stationary distribution for the single-server queue is:

Pn = ()n(1-())

n = 0

Page 29: Why Wait?!? Bryan Gorney Joe Walker Dave Mertz Josh Staidl Matt Boche

Traffic Intensity• Average Queue Length• Little’s Principle• Average Waiting Time

Page 30: Why Wait?!? Bryan Gorney Joe Walker Dave Mertz Josh Staidl Matt Boche

Average Queue Length

Let ρ = (λ / μ). (called the traffic intensity of the queue)

By assumption, ρ < 1, as λ < μ.

Using ρ in: Pn = (λ / μ)n (1 – (λ / μ)),

Pn = ρn (1 – ρ).

Page 31: Why Wait?!? Bryan Gorney Joe Walker Dave Mertz Josh Staidl Matt Boche

Obtaining the average number Na of customers in the queue:

Na = E(N) = Σ nPn = Σ n(ρn(1 – ρ))

= (1 – ρ) Σ nρn = (1 – ρ) Σ ρnρn-1

= (1 – ρ)ρ Σ = (1 – ρ)ρ Σ

= (1 – ρ)ρ = (1 – ρ)ρ(1 – ρ)-2

=

n = 0

n = 0

ddρ

ρn

n = 0

n = 0

n = 0

ddρ

n = 0

ddρ

ρn

(1 / (1 – ρ))

ρρ - 1

Page 32: Why Wait?!? Bryan Gorney Joe Walker Dave Mertz Josh Staidl Matt Boche

Average Number of Customers in Queue

0

1

2

3

4

5

6

7

8

9

10

0 0.2 0.4 0.6 0.8 0.9 1

Traffic Intensity (p)

Nu

mb

er o

f C

ust

om

ers

ρρ - 1

Na =

Page 33: Why Wait?!? Bryan Gorney Joe Walker Dave Mertz Josh Staidl Matt Boche

Average Waiting Time

Little’s Principle – the average number of customers in a queueing system is equal to the average arrival rate of customers to that system times the average time spent in that system.

Naa = = λTa

Ta = Na a / / λ = (ρ / ((1 – ρ)λ) = ((λ / μ) / ((1 – (λ / μ))λ))

= (1 / μ) / (1 – (λ / μ)) = (1 / μ) / (1 – ρ) = 1/(μ - λ)

Page 34: Why Wait?!? Bryan Gorney Joe Walker Dave Mertz Josh Staidl Matt Boche

Average Waiting Time

0

2

4

6

8

10

12

0 0.2 0.4 0.6 0.8 0.9 1

Traffic Intensity

Un

its

of

Tim

eTa = 1/ (μ – λ )

Page 35: Why Wait?!? Bryan Gorney Joe Walker Dave Mertz Josh Staidl Matt Boche

Model Formulation of Store Profit Maximization

C(ŧ), which is the Customer Attrition Function, models the loss of profit per day and is given below:

C(ŧ) ={0 for ŧ Ta0

ATa0 for ŧ Ta0

Ta0 represents the threshold where customers stop returning to the store due to long waiting times.

Page 36: Why Wait?!? Bryan Gorney Joe Walker Dave Mertz Josh Staidl Matt Boche

Ŧ0

ŧ

C(ŧ)

Graph of Customer Attrition Function

C(ŧ) = C(1/(μ-λ)) for one server C(ŧ) = C(1/(μ-λ)) for servers

This models the loss of profit due to customers having to wait in lines

Page 37: Why Wait?!? Bryan Gorney Joe Walker Dave Mertz Josh Staidl Matt Boche

Customer waiting costs plus employee costs

J() = C(1/(μ-λ)) +K 1 <

= # number of employees (checkers)K = cost associated with retaining those employees

Page 38: Why Wait?!? Bryan Gorney Joe Walker Dave Mertz Josh Staidl Matt Boche

Conclusion

The object of the manager is to minimize J() byfinding the number of employees that eliminates the attrition factor by decreasing costs.

Page 39: Why Wait?!? Bryan Gorney Joe Walker Dave Mertz Josh Staidl Matt Boche

References

A Course in Mathematical Modeling, by Douglas Mooneyand Randall Swift

Dr. Steve Deckelman