Search for question
Question

1. (a) To use the inverse transform method, we compute the c.d.f. of X: If 0 < x < 1, F(x) = f(y)dy = f*dy = v= { If 1 <

x < 5/2, F(x) = = [[ f(x) y = = = + [² / dy = Note that F(z) = 0 for z ≤0 and F(x) = 1 for x ≥ 5/2. The inverse of F(x) can be easily found as follows: F-1(U) = { 2√ I 1 if 0 ≤ y < 1/4, 2y + 1/2, if 1/4 ≤ y ≤ 1, With the inverse of c.d.f. of X, we can generate samples of X as follows: Step 1 Generate U from Unif[0, 1]. Step 2 Set X = F-¹(U) and return X. (b) Consider the ratio of f(x) and g(z): R(2): = if 0 < x < 1, if 1 ≤ x ≤ g(x) which attains maximum at r € (0,1] and Rmaz = 25/16 = c. To generate random variate from g(x), we can use the inverse transform method. To this end, we first compute the c.d.f. associated with g: F₁(x) = g(x)dx = ² for 0≤x≤5/2. Then, it is easy to see that F¹(y)=√y for 0 ≤ y ≤1. Hence, we can use the acceptance-rejection algorithm to generate samples from f(x) as follows: Step 1 Generate U₁, U₂ independently from Unif[0, 1] and let X = √U₁. Step 2 If(U₂ ≤R(X)/c){Set Y = X and return Y} else{Go to Step 1}.

Fig: 1