A parcel hub receives parcels at random times, some parcels are priority and some arrive delayed from upstream, and a scanner at the hub is sometimes out of service. Useful questions about the hub draw on these parts, alone or together, such as the chance of a delay among the next five parcels, the wait until the next arrival and the chance that the scanner works at a later checkpoint. This lesson builds one model from three submodels with stated links between them, computes exact answers, checks one submodel with a recorded simulation and names the questions the model leaves open. Every numerical input is constructed for teaching, so the internal consistency of the model says nothing about how a real hub behaves.
Key terms
Combined probability model
Definition A combined probability model joins several submodels, each describing one part of a system, and states how the submodels relate, for example which of them are independent of each other. It is complete for a question when these statements determine the probability of every event the question involves, including events that involve more than one part.
In plain words Build the model in pieces that each make sense on their own, then say explicitly how the pieces fit together. Without the second step, a question that mixes two pieces usually has no definite answer.
Example The hub model has three submodels.
- Arrivals form a homogeneous Poisson process with rate per hour. The number of arrivals in the first hours, and more generally the number in any time interval of length hours, has the distribution, and the counts in disjoint intervals are independent.
- Each parcel is priority, the event , with probability . It has an upstream delay, the event , with probability if it is priority and if not. The delay refers to travel before the hub, not to anything that happens at the hub. The priority and delay marks are independent across parcels and independent of the arrival times.
- A scanner is observed at hourly checkpoints , with checkpoint at hour on the arrival clock, and is either available, state , or unavailable, state . Its state is a Markov chain that starts at , and the chain is independent of the arrivals and the parcel marks taken together.
The transition matrix of the scanner chain, with rows and columns in the order , , is
Priority and ordinary parcels partition the parcels, and the two routes to a delay contribute and . The law of total probability gives , and Bayes’ theorem gives
A parcel is priority with probability , but a delayed parcel is priority with probability .
Independence of submodels
Definition Two submodels are independent when every event determined by one of them is independent of every event determined by the other, so that
for every event of the first and every event of the second. In a combined model this is an assumption written into the specification. It allows a joint probability across submodels to be computed as a product, and it says nothing about two events inside one submodel, which may be dependent by design.
In plain words Multiply probabilities from different parts only when the model says those parts are independent, and check that the two events really belong to different parts. Priority and delay belong to the same parcel, so an independence assumption between submodels does not cover them.
Example Let be the event that at least one parcel arrives between hour 2 and hour 2.25, the quarter hour after checkpoint 2. The arrival count for a quarter hour is , since , so . The card on checkpoint availability finds . The scanner chain and the arrivals were assumed independent, so
This is a statement about availability at one instant and arrivals in a later interval. It does not give the probability that every parcel arriving in that quarter hour is scanned at once, which would need the scanner to be available throughout the interval, something the model does not describe. By contrast, the product is not , which equals , because priority and delay are dependent within one parcel.
Fixed batch versus fixed time window
Definition A fixed batch is a predetermined number of parcels, such as the next five, however long they take to arrive. Because the marks are independent across parcels and independent of the arrival times, the number of delayed parcels in the batch satisfies . A fixed time window is a time interval of predetermined length hours. The number of parcels arriving in it has the distribution and is itself random, so the number of delayed parcels in a window depends on the arrival submodel as well as on the marks, while the distribution of for a fixed batch comes from the parcel marks alone.
In plain words Name the observation unit before calculating. A batch of five parcels has a fixed size and a random duration, and a one-hour window has a fixed duration and a random number of parcels, even though the hub averages four parcels per hour.
Example For the next five parcels, , so and
For time, the chance of no arrivals in the first hour is . From time , the wait until the first arrival exceeds hours exactly when the first hours contain no arrival, so for
and with rate per hour. The same argument applied to the window after any fixed starting time gives the same distribution for the wait from that time. Fifteen minutes is hour, so the next arrival comes within 15 minutes with probability . The mean wait is hour, which is 15 minutes, but the median wait is hour, about 10.4 minutes, and no single wait is guaranteed to be close to the mean. Delays in a one-hour window are a third question. Their expected number is by the rule for random sums with independent counts, since the marks are independent of the count, but their distribution is not , because the number of parcels in the hour is random.
Checkpoint availability
Definition For the scanner chain, the checkpoint availability at checkpoint is , the probability that the scanner is available at that instant. Conditioning on the state at checkpoint gives the recurrence
A stationary distribution satisfies and . The first coordinate of reads , and with it becomes . So , and the only stationary distribution is . Subtracting from both sides of the recurrence gives
so from every starting distribution. This agrees with the general result for an irreducible, aperiodic chain on a finite state space, and here the formula also shows that the gap shrinks by the factor at each step.
In plain words Checkpoint availability is a probability about the scanner’s state at one checkpoint. It says nothing about whether the scanner stays up between checkpoints, since the model records nothing in between. The stationary value is the limit of these checkpoint probabilities, not a statement that the scanner works for two thirds of each hour.
Example Starting from , the first checkpoint has . A scanner available at checkpoint 2 got there either by staying available or by failing and recovering, so
Availability at both checkpoints 1 and 2 is a different event, with probability , because it excludes the path that fails and recovers. The deviation formula gives again, and the later values and continue toward .
Sensitivity analysis
Definition A sensitivity analysis changes one input or one assumption of a model, holds the rest of the specification fixed, and recalculates the outputs. In a combined model with independent submodels, a change to the inputs of one submodel can change only the answers that involve that submodel, including joint answers that multiply its probabilities. Answers that involve only the other submodels stay the same, as long as the independence assumptions are kept.
In plain words The structure of the model tells you in advance which answers a change can reach. Whether the independence assumptions themselves still hold after a real change is a separate question about the hub, and the algebra cannot settle it.
Example Raise the arrival rate from to per hour and keep everything else. The chance of no arrivals in an hour falls from to , the mean wait falls from 15 to 10 minutes, and the chance of an arrival within 15 minutes rises from about to . The joint probability from the card on independence of submodels becomes
The five-parcel batch probability stays , because a batch is defined by its parcels and not by time, and the scanner values and stay as well.
Simulation check of a submodel
Definition A simulation check of a submodel generates outcomes from that submodel with a stated program, generator and seed, records the output, and compares the resulting estimate with the exact prediction using its Monte Carlo standard error. For an event with exact probability , estimated by its frequency in independent simulated repetitions, the standard error is . Such a check tests whether the program and the calculation agree for that submodel only. It says nothing about submodels that were not simulated, and nothing about whether the model describes a real system.
In plain words Three different things stay separate. The exact prediction is fixed by the model. A simulated output varies from run to run, typically by about one standard error. Whether the model fits real parcels, arrivals and scanners is an empirical question that neither the prediction nor the simulation can answer.
Example One run was recorded with Python 3.12.14 and the generator random.Random(55012). It simulated 10,000 independent five-parcel batches. For each parcel it drew the priority flag first, priority when random() was below , and then the delay flag, delayed when the next draw was below for a priority parcel or below otherwise. At least one delay occurred in 5501 batches, an estimate of . The exact probability is about , and the standard error is
so the estimate lies about standard errors below the prediction, a gap of ordinary size for Monte Carlo error. The run also recorded 7443 delayed parcels among 50,000, a fraction of against , and 3745 of the delayed parcels were priority, a fraction of about against . The run contains no arrival times and no scanner states, so it checks the parcel submodel and nothing else.
Check yourself
- Suppose the scanner is unavailable at checkpoint 0. Find its availability at checkpoints 1 and 2, the probability that it is available at both checkpoints 1 and 2, and the limit of .
Show the answer
From state the scanner recovers with probability , so . The recurrence gives , which is the sum over the two paths, . Availability at both checkpoints needs the path that recovers at checkpoint 1 and stays available, with probability , smaller than . With the deviation formula gives
so , the same limit as from .
- A colleague multiplies two pairs of probabilities. The first product, , is offered as the probability that the scanner is available at checkpoint 2 and the next five parcels include at least one delay. The second, , is offered as the probability that a parcel is priority and delayed. Which product does the model justify?
Show the answer
The first product is justified. The scanner event belongs to the chain, the batch event is determined by the arrivals and the parcel marks, and the chain was assumed independent of those two taken together, so their joint probability is . The second is not. Priority and delay belong to the same parcel and are dependent, since differs from . The correct value is
twice the product. Independence between submodels does not justify multiplying the probabilities of two events inside one submodel.
- Change the priority probability from to and keep both conditional delay probabilities. Find , and the probability of at least one delay among the next five parcels. Which earlier answers stay the same, and what could make that conclusion fail at a real hub?
Show the answer
The two routes to a delay now contribute and , so and
For five parcels, , so and
The arrival and scanner answers stay the same, including , , , and the joint value , because their inputs did not change and the model makes them independent of the parcel marks. The scanner and batch value from question 2 does change, to , because it involves the batch. At a real hub, more priority parcels might bring more handling work, more scanner failures or a different arrival pattern. Any such link would change the arrival or scanner submodel or break its independence from the parcel marks, and the remedy would be a new model, not a change of one number.