M4.2 The Phone Can Ring Anytime: Continuous-Time Markov Chains
Builds on2 notes
One operator, one phone line
Calls arrive at an average of three per hour; a call lasts ten minutes on average. Calls arriving while the line is busy are rejected rather than queued.
What fraction of time is the operator busy?
Multiplying three calls by ten minutes counts rejected calls as served. Model arrivals as a Poisson process with rate per hour and independent exponential service times with rate . These distributional assumptions do not follow from the means alone.
DiscussionQ1
What are the states? If three per hour is not a probability, how does it determine a short-time transition?
Show the reasoning
Let be idle (0) or busy (1), with continuous time measured in hours.
A rate is a short-time probability slope. For Poisson arrivals, one event in has probability and multiple events have probability . A rate may exceed one. The service rate is conditional on being busy, not the unconditional number completed each hour.
For small , transitions are approximately . This approximation can fail at large intervals. The interval-independent object is its derivative at zero: the rate matrix.
Memoryless alarms
A token in the idle square waits for an exponential alarm of rate three, then moves to busy. There it waits for an alarm of rate six, then returns. Each alarm’s remaining law does not depend on time already waited.
Rates describe short-time slopes rather than a chosen round length. They determine holding times and destinations on departure.
Rates determine exponential holding times; long-run occupancy reflects the mean durations of the two parts of a cycle.
Write the generator
From short-time probabilities to rates
Express the short-time matrix as
The rate matrix, or generator, has off the diagonal and . Row sums are zero, reflecting probability conservation. Formally .
Evolve for a finite interval
Time-homogeneous Markov transitions compose by . Subdivide time and take the limit:
This is the matrix analogue of the exponential limit. Differentiating also gives
The resulting linear matrix ODE has solution .
The forward equation
For row-vector initial law , satisfies
Expanding the diagonal term shows that each state’s change equals inflow minus outflow. This is the forward equation, also called the master equation.
It parallels M3.2 on a finite state space. Probability conservation follows from .
Solve the two-state example
Busy probability satisfies , giving
The stationary law solves , or :
Busy occupancy is one third, not one half. Initial-state influence decays on time scale hour, about seven minutes. The nonzero generator eigenvalue supplies the exponential decay rate.
DetailsExact transitions, holding times, and oversized Euler steps
Let Π have every row equal to π. Then and , so . It equals I at zero, tends to Π, and has derivative R at zero.
The probability of staying in state beyond time is . Holding times are exponential with mean , the continuous analogue of geometric memorylessness.
The Euler approximation is stochastic only if its diagonal entries stay nonnegative: here hour. At half an hour it gives invalid probabilities. The exact matrix remains stochastic for every .
Why the naive one-half answer fails
Only idle-line arrivals are accepted, at rate per hour. Two ten-minute calls occupy twenty minutes, giving one third. A queue would require different states; the offered load one half is not the occupancy of this loss system.
With Poisson arrivals and independent finite-mean nonexponential service, the renewal-cycle busy fraction remains . But idle/busy alone is generally no longer this CTMC, and transient probabilities and residual service times change. Time-varying arrival rates also require a time-dependent analysis.
Try it
import numpy as np
rng = np.random.default_rng(0)
lam, mu, T = 3., 6., 20000.
t, x, busy = 0., 0, 0.
while t<T:
stay = rng.exponential(1/lam if x==0 else 1/mu)
busy += min(stay,T-t)*x # Truncate the final holding interval.
t += stay
x = 1-x
print('busy fraction:',busy/T)
# Fixed ten-minute service preserves long-run occupancy but loses memorylessness.
Check your understanding
References
- Norris, J. R. Markov Chains. Cambridge University Press, 1997.
- Grimmett, G., Stirzaker, D. Probability and Random Processes, 3rd ed. Oxford University Press, 2001.
- Anderson, W. J. Continuous-Time Markov Chains: An Applications-Oriented Approach. Springer, 1991.