{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

10SimHw4Sol

# 10SimHw4Sol - IEOR 4404 Simulation Prof Mariana...

This preview shows pages 1–3. Sign up to view the full content.

IEOR 4404 Assignment #4 Solutions Simulation March 4, 2010 Prof. Mariana Olvera-Cravioto Page 1 of 4 Assignment #4 Solutions 1. First note that an immediate algorithm is to generate an exponential random variable X with rate 1, and return X whenever X < 0 . 05. Doing so is inefficient, however, because the probability of the event { X < 0 . 05 } is small. (Indeed, P ( X < 0 . 05) = 1 - e - 0 . 5 .) Instead, we can use the inverse transform method. Let Y [ X | X < 0 . 05]. The cumulative distribution function of Y is given by F ( y ) = P [ Y y ] = P [ X y | X < 0 . 05] = Z y 0 f ( u ) du = 1 1 - e - 0 . 05 (1 - e - y ) , for 0 < y < 0 . 05. The inverse of this function is given by F - 1 ( y ) = - ln(1 - (1 - e - 0 . 05 ) y ) . With this, we can implement the inverse transform method to generate Y . The steps of the algorithm are the following: STEP 1. Generate a random number U , uniform on [0 , 1]. STEP 2. Return Y = F - 1 ( U ) = - ln(1 - (1 - e - 0 . 05 ) U ). The following MATLAB code can be used for estimating E [ X | X < 0 . 05]: >> rand(’state’,0); >> S=0; >> for i=1:1000 S=S-log(1-rand(1)*( 1-exp(-0.05) ) ); end >> S/1000 ans = 0.0249 The exact value of E [ X | X < 0 . 05] can be computed as follows: E [ X | X < 0 . 05] = Z 0 . 05 0 xf ( x ) dx = Z 0 . 05 0 x e - x 1 - e - 0 . 05 dx = 1 - 1 . 05 e - 0 . 05 1 - e - 0 . 05 , where we compute the integral using integration by parts.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
2 IEOR 4404, Assignment #4 Solutions 2. We wish to generate X by using the acceptance rejection algorithm with an exponential random variable Y with rate λ . That is, Y has density h ( y ) = λe - λy for y 0. We wish to find the rate λ that minimizes the number of iterations needed in the algorithm. First, note that we need to have f (
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 4

10SimHw4Sol - IEOR 4404 Simulation Prof Mariana...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online