Simulate systems over timeLesson 42 of 76 · 9 min
Failure and repair use up time
Estimate finite-horizon availability while accounting for the full observation window.
Availability over a finite window is the fraction of that window during which the system is working. A failure probability for an entire mission answers a different question. A repairable system can fail and return to service within the same observation.
The model alternates exponential working and repair periods, starts healthy, and clips each interval at the horizon. That clipping prevents a long final interval from contributing time outside the observed window. Retain both working and down time as a ledger check.
For this simple alternating process, a long-run availability reference is mean uptime divided by mean uptime plus mean repair time. A finite window starting healthy need not equal that limit. Compare longer horizons and state the starting condition before interpreting the average.
- Alternate states
- Clip the final segment
- Finite-window availability
Should a repair that ends after the horizon contribute its entire duration?
Write a prediction (optional)
Seeded teaching simulation
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 ↗
Mean finite-window availability: 0.8332 Long-run reference for this model: 0.8333
Read the first result
The time ledger sums to the horizon in every trial. The finite healthy-start result is not automatically a stationary availability estimate.
Try an edit
Replace horizon = 100 with horizon = 1000. Select Run Python again. Compare Mean finite-window availability with Long-run reference for this model before and after the change. Does a longer window make the healthy start less important?
Scope. The model assumes independent exponential working and repair periods and omits shared failures and maintenance scheduling.
Try a fresh case
Which definition matches finite-window availability?
Need a hint?
Hint 1
Keep the units of the numerator and denominator visible.
Hint 2
Ask how an early failure followed by quick repair should count.