In [1]:
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
In [2]:
#Exercise 1
def poisson_p():
arrival_time=np.array([])
t=0
T=20
lmbda=1
inter_a=-1/lmbda*np.log(np.random.rand())
t+=inter_a
while ( t