Description
The PMF given below describes the probability that a transaction submitted to a database server will complete in x units of time.
x Prob(x)
1 .25
2 .42
3 .33
For example, the probability that a transaction will take two seconds to complete (i.e., x=2) is 42%. A user has to execute 3 transactions one after the other using that database server. Answer the following questions:
Compute the mean and the standard deviation of the time it takes to finish the processing of a single transaction.
Derive the probability mass function for the total time it takes to finish the processing of all three transactions.
Compute the mean and the standard deviation of the total time it takes to finish the processing of all three transactions.
Derive the cumulative probability distribution function for the total time it takes to finish the processing of all three transactions.
What is the probability that it will take no more than 5 seconds to execute all three transactions?
Derive the probability mass function for the maximum time it takes to complete any one of the three transactions.
Compute the mean and the standard deviation of the maximum time it takes to complete any one of the three transactions.
Measurements of a network router reveal that on average the router has 8 packets in transit and that the time it takes a packet to go through the router is 1 msec. Knowing that the time needed for the router to process and transmit a single packet is 0.2 msec, answer the following questions:
What would be your estimate of the rate with which packets arrive at the router?
What would be your estimate of the average number of packets waiting to be processed in the router?
According to your answers above, what is the minimum number of processors that must exist in that router?
Under what assumptions would your answers to the above questions hold?
The availability of a web server is rated at 98%. Answer the following questions:
What is the probability that in a sequence of 100 connections to the web server, no connections will be refused.
What is the probability that in a sequence of 100 connections to the web server, exactly one connection will be refused.
What is the probability that in a sequence of 100 connections to the web server, at most three connections will be refused.
What is the probability that the web server will be able to successfully respond to 50 or more consecutive requests for connections?
What is the average number of requests that will be successfully served before a connection is refused?
What is the average number of requests that will be successfully served out of a set of 500 requests for connections?
The execution of an application requires that a total of 100 requests be submitted to a server one after the other (i.e., once a response is received for a request the next request is submitted). The average server response time for a single request is 20 msec and the standard deviation is 5 msec. Ignoring all delays other than the time it takes the above web server to respond to each one of the 100 requests, one can say that the response time for the application is the sum of the response times for all 100 requests. Answer the following questions:
Write down the probability density function for the time it takes the application to execute all 100 requests.
What is the probability that the application will take between 2 seconds and 2.1 seconds to complete?
What is the probability that the application will take more than 2.5 seconds to complete?
Write a C/C++/Java function that returns a random value that is distributed according to an exponential distribution with a mean of T.
Hint: Given that all you have through the C library is the drand48() uniform random number generator, you will need to find the relationship that maps a uniform random variable that ranges from 0 to 1 to an exponential random variable with mean T. One way of establishing this relationship is to equate the cumulative distribution functions for a uniformly distributed random variable (say U) and an exponentially distributed random variable (say V) as follows:
F(U) = U, where 0 <= U <= 1
F(V) = 1 – exp(-lambda*V), where 0<= V <= infinity
Equating the above two, we get:
U = 1 – exp(-lambda*V)
Which leads to the following relationship.
V = – ln(1-U) /lambda
Thus, to generate an exponentially distributed random variable V with a mean of (1/lambda), one need to generate a uniformly distributed random variable U and substitute in the equation above.
Run your simulator to generate 100 values (for some value of lambda). Compare the CDF of the random variable that you have obtained empirically with the CDF obtained analytically. Do they match? Explain why or why not.