Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import numpy
from matplotlib import pyplot
import seaborn
p = numpy.logspace(-6, 0, 50)
pyplot.figure(figsize=(10, 5))
for k in [1, 3, 10, 30, 100, 300, 1000]:
Z = (p * k**2 + (1 - p)) / (p * k + (1 - p))
pyplot.plot(p, Z, label='Delay factor %d for train problem' % k)
pyplot.title('Average time you have to wait given that train problems with some probability and magnitude')
pyplot.xlabel('Probability of train problem')
pyplot.ylabel('Average time you have to wait compared to baseline')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.