Starting from:

$20

CS6313 Mini Project 1 Solved

1.  Consider Exercise 4.11 from the textbook. In this exercise, let XA be the lifetime of block A, XB be the lifetime of block B, and T be the lifetime of the satellite. The lifetimes are in years. It is given that XA and XB follow independent exponential distributions with mean 10 years. One can follow the solution of Exercise 4.6 to show that the probability density function of T is

(

0.2exp(−0.1t) − 0.2exp(−0.2t), 0 ≤ t < ∞, fT(t) =

                                                                0,                                                                    otherwise,

and E(T) = 15 years.

1

(a)    Use the above density function to analytically compute the probability that thelifetime of the satellite exceeds 15 years.

(b)    Use the following steps to take a Monte Carlo approach to compute E(T) and P(T > 15).

i.         Simulate one draw of the block lifetimes XA and XB. Use these draws to simulate one draw of the satellite lifetime T.

ii.       Repeat the previous step 10,000 times. This will give you 10,000 drawsfrom the distribution of T. Try to avoid ‘for’ loop. Use ‘replicate’ function instead. Save these draws for reuse in later steps. [Bonus: 1 bonus point for not taking more than 1 line of code for steps (i) and (ii).]

iii.     Make a histogram of the draws of T using ‘hist’ function. Superimpose the density function given above. Try using ‘curve’ function for drawing the density. Note what you see.

iv.     Use the saved draws to estimate E(T). Compare your answer with the exact answer given above.

v.       Use the saved draws to estimate the probability that the satellite lasts morethan 15 years. Compare with the exact answer computed in part (a).

vi.     Repeat the above process of obtaining an estimate of E(T) and an estimate of the probability four more times. Note what you see.

(c)    Repeat part (vi) five times using 1,000 and 100,000 Monte Carlo replicationsinstead of 10,000. Make a table of results. Comment on what you see and provide an explanation

2. (10 points) Use a Monte Carlo approach estimate the value of π based on 10,000 replications. [Ignorable hint: First, get a relation between π and the probability that a randomly selected point in a unit square with coordinates — (0,0), (0,1), (1,0), and (1,1) — falls in a circle with center (0.5,0.5) inscribed in the square. Then, estimate this probability, and go from there.]

2

More products