Homework 1
Due Tuesday, April 13.

This assignment will serve as a review of probability theory, and an introduction to its use in computer network analysis. (If you are curious, click here for a typical example of how deeply probabilistic analysis is used at the graduate study and research level. Of course, our usage in this undergraduate course will be much less and much simpler than the level of that research paper.)

You are required to use LaTeX to write up any homework requiring mathematics, including this one.

Problem I:

Suppose we have two network nodes, each connected to one transmission line. Time is divided into slots named slot 0, slot 1, slot 2, etc. Each node has a message to send, taking one time unit to transmit.

If both nodes attempt to transmit during the same time slot, they will "collide" and must try again, either in the next time slot or the slot after the next, with probability p and 1-p, respectively. (They will definitely collide during slot 0.) Let T denote the time slot in which the process completes, i.e. the final transmission occurs.

For example, suppose they collide in slot 2. Then a node will generate a random number, and either try again in slot 3 (with probablity p) or slot 4 (with probability 1-p).

Find the following quantities as functions of p:

(a) P(T is less than or equal to 3).

(b) P(there is a collision in slot 1 | T = 4).

(c) E(number of transmissions attempted in slot 3).

These problems may seem rather daunting to you at first, but they are actually very easy. Just ask yourself, "How could it happen? Let's list the ways." For instance, what are all the possible scenarios under which T could be equal to 3?

Problem II:

Suppose in the setting of Problem I each node waits a random amount of time before starting its first transmission. Let T1 and T2 be the two times at which they start. Assume they are independent with density 2exp(-2t), t > 0. Find the following (your answer must be an exact expression):

(a) P(1 < T1 < 2.5).

(b) P(T1 < T2 - 1).

To check your answers:

Simulation is a powerful tool in computing probabilities. It allows you to compute probabilities that you cannot do in "closed form" (i.e. using exact mathematical analysis), and it enables you to check probabilities that you can computer in close form. Here we are in the latter case.

I have written a simulation program for you which will check your answers for parts (a) and (b) of problem I; you should be able to easily modify the program to check your answer for (c).

For problem II, you can write your own program (much, much simpler than the one above), using the fact (take my word for it) that -0.5 * log(1-rand()) will generate a random variable having the given density. (This assumes rand() returns a value uniformly distributed on (0,1), such as on the SGIs. On the HPs the return value is uniformly distributed on (0,2^15-1), so you must divide by 2^15-1.)

In part (a), for instance, the core of your code will be something like

for (I = 0; I < NREPS; I++)  {
   T1 = -0.5 * log(1-rand();
   if (T1 >= 1.0 && T1 <= 2.5) Count++;
}
Prob = ((float) Count) / NREPS;

Do NOT turn in any simulation work you do, as it is only to serve as a check on your work. Your written work must consist of exact, mathematical analysis, with clear explanations.