Coursework FAQs

1. You say "write a simulator". What language should I use?

It's up to you! You could use Java, C++, Python, R, Mathematica, Matlab, or whatever you like. You could write a program in Visual Basic which outputs the results in plain text, then load them into Excel to produce graphical output. You should in the first instance ask each other for help about whatever programming language you use. I can also help with R, Mathematica, Java, Excel, and Python.

2. How do I generate an exponential random variable?

Most programming languages have a primitive which can generate a random number in the range [0,1]. Let U be such a number. Now let X= −log(U)/λ. Then X is an Exponential random variable with rate λ. Additionally, some programming languages have primitives for generating exponential random variables. In R, the code is rexp(1,rate=r).

3. What's a confidence interval?

Look at your notes from Section 7.4.2 of the first half of the course. If you do n experiments to measure a quantity x, and your n measurements are X1, X2, ..., Xn, then the procedure is as follows:
  1. calculate the mean, μ=(X1 + X2 + ... + Xn)/n.
  2. calculate the variance, (Σ(Xi-μ)2)/(n-1)
  3. calculate the standard deviation, σ=(variance)1/2
  4. the 95% confidence interval for x is then [μ-1.96σ μ+1.96σ].

4. How many measurements should I take of the blocking probability?

The more you take, the smaller σ will be, and the tighter your confidence interval will be.

For the purposes of this coursework, I don't mind how many you take, as long as you demonstrate that you know what you're doing.

5. How long should I run the simulator for, to obtain a good estimate for the blocking probability?

For the purposes of this coursework, I don't mind how long you run it for, as long as you demonstrate that you know what you're doing. You needn't spend more than 15 minutes of computing time running the simulation.

6. Can you remind me what a Poisson process is?

Let's say that buses arrive as a Poisson process of rate λ. That means that the interval between successive buses is an Exponential random variable, with rate λ, i.e. with mean 1/λ.

7. In the Erlang model, what's the relationship between the arrival process and the holding times? Are they both exponentials?

Let's suppose that the arrivals are a Poisson process of rate λ, and that call holding times are Exponential and have mean 1/μ, i.e. have rate μ. That means that the time between two successive arrivals is an Exponential random variable of rate λ, and that the time between a call arriving and departing is Exponential of rate μ. Don't get the two mixed up. Arrivals are a Poisson process. It doesn't mean anything to say "arrivals are Exponential" (although it is perfectly proper to say "inter-arrival times are Exponential").

Note also that the number of arrivals that occur in an interval of length T has a Poisson distribution with parameter λT. There are two separate concepts here: a Poisson arrival process, and a Poisson distribution. If you're as clever as Poisson, I'm sure you'll get several different things named after you too.

8. What's the function to calculate the equilibrium distribution of a Markov process?

9. What do you mean by "blocking probability", and how should I measure it?

You have to work that out yourself.

10. How will my program be marked? What if there's a bug in my code? What if my code is inefficient?

You should explain the purpose and reasoning behind your code. You do not need to spend too much time making your code efficient. I don't expect the program to run for more than 15 minutes on a modern computer.