# Lab 5, due Monday, 29 March 04

**General Considerations**: Your program code
should be placed at $HOME/CZ3102/lab5, as usual. This is the last lab.

### Q1

[This is problem 5 on page 296, modified.]
Consider telephone calls on a network with infinitely many lines.
That is, every incoming call can be answered. Suppose that the
arrival of calls is Poisson distributed with mean rate L, and
the terminations of calls are Poisson points with means rate M,
and they are independent processes.
(a) If P_{n}(t) is the probability
that exactly n lines are in use at time t, derive the following
dynamics

dP_{n}(t)/dt = - (L+n M)P_{n}(t) + L P_{n-1}(t) + (n+1) M P_{n+1}(t),

the index takes values n = 0, 1, 2, 3, ..., where we define P_{n}(t) = 0 if n < 0.

(b) Show that the mean number of calls, m, satisfies

dm(t)/dt = L - M m(t)

(c) Solve the set of equations P_{n}(t) numerically. We use L=2, and M=1,
and assuming no phone calls at time t = 0. Since n runs from
0 to infinity, we have to cut-off at some finite n, say n = 6.
Make a plot of P_{n}(t) vs t. Check that sum of P_{n}(t)
over n for any t is 1 approximately, but why?

(d) [Difficult] Compute the same P_{n}(t) by simulation, i.e., generate the
random process using random number (Poisson processes) and samples the
number of calls. You have to simulate many times (say 10000) to get
good statistics.