Your first simulationLesson 04 of 76 · 7 min
See the outcomes before the headline
Read an outcome distribution and distinguish quantiles from a mean.
A histogram groups values into bins, intervals whose bar heights count observations. The ten delivery delays below are invented values in days. Most are small, with one large delay: a long right tail. We can learn to summarise that shape without first choosing a random-input distribution.
The mean is total delay divided by ten. The median, or P50, is the middle of the sorted values; here the fifth and sixth values are both 3 days. A quantile is a cutoff for a stated fraction. P90 means roughly 90% of outcomes are at or below the cutoff.
NumPy's default linear interpolation puts P90 one tenth of the way from the ninth value, 5, to the tenth, 15: 6 days. That cutoff need not be an observed delay. These percentiles describe the supplied outcomes, not uncertainty about an estimated mean. Keep the raw values beside the picture because changing bins can change its appearance.
For a right-skewed distribution, must the mean equal the median?
Write a prediction (optional)
Ten invented delivery delays · inspectable summaries
Select Run Python below with the code unchanged.
A saved draft is open. To run the published example, open Tools and select Restore example. Recover draft brings your code back.
Execution error
Technical error details
Your result
Published example output
This result comes from the original Python. Your runs appear above. Build environment ↗
INVENTED delivery delays (days): [ 1 1 2 2 3 3 4 4 5 15] Mean delay (days): 4.0 Median and P90 (days): [3. 6.]
Read the first result
Compare Mean delay (days) with the two numbers in Median and P90 (days). The large delay lifts the mean above the median. The published P90 is 6 days. Nine of the ten supplied delays are at or below it.
Try an edit
In the delay array, predict what happens if the last value rises. Replace the final 15 with 30. Select Run Python again. Compare Mean delay (days) and Median and P90 (days). Which summaries move when only the largest delay increases?
Scope. These ten delays are invented examples, not measured data or random draws. They illustrate summaries; they do not establish a delivery-delay model or a reliable future tail.
Try a fresh case
P90 delivery time is eight days. What does that describe?
Need a hint?
Hint 1
Name whether the quantity concerns outcomes or an estimated average.
Hint 2
Think about the upper 10% of outcomes.