import numpy as np
import matplotlib.pyplot as plt

mean  = 1      # scale parameter, the inverse of rate parameter
sample = 10    # sample times

S = np.random.exponential(mean, sample)
plt.figure('Cumulative Distribution')
plt.hist(S, bins=100, density=True, cumulative=True)
plt.xlabel('x')
plt.ylabel('Pr[X<=x]')
plt.title('Exponential mean %d times with rate parameter = %.2f. Mean = %.2f.' % (sample, 1/mean, np.mean(S)))
plt.grid()
plt.show()
