In this problem, we employ the result of Problem 10.6.4 as the basis for a function s=newarrivals(lambda,T) that generates a Poisson arrival process. The program newarrivals.m should do the following:
- Generate a sample value of N, a Poisson (λT) random variable.
- Given N = n, generate {U1,..., Un}, a set of n uniform (0, T ) random variables.
- Sort{U1,..., Un}from smallest to largest and return the vector of sorted elements.
Write the program newarrivals.m and experiment to find out whether this program is any faster than poissonarrivals.m.