08SimHw9sol

# 08SimHw9sol - IEOR 4404 Simulation Prof. Mariana...

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

IEOR 4404 Assignment #9 Solutions Simulation December 6, 2008 Prof. Mariana Olvera-Cravioto Page 1 Assignment #9 Solutions 1. Five elements, numbered 1, 2, 3, 4, 5, are initially arranged in a random order (i.e., the initial ordering is a random permutation of 1, 2, 3, 4, 5). At each stage one of the elements is selected and put at the front of the list. That is, if the present order is 2, 3, 4, 1, 5 and element 1 is chosen, then the new ordering is 1, 2, 3, 4, 5. Suppose that each selection is, independently, element i with probability p i , where p 1 = 1 15 , p 2 = 2 15 , p 3 = 3 15 , p 4 = 4 15 , p 5 = 5 15 . Let L j denote the position of the j th element to be selected, and let L = 100 j =1 L j . We are interested in using simulation to estimate E [ L ]. (a) Explain how we could use simulation to estimate E [ L ]. (b) Compute E [ N i ], where N i is the number of times element i is chosen in the 100 selections. (c) Let Y = 5 i =1 iN i . Do you think Y is positively or negatively correlated with L ? (d) Develop a simulation study to estimate L , using Y is a control variable. Proof: (a) The algorithm, (i) Simulate a random permutation of 1, 2, 3, 4, 5 (ii) Repeat the 100 selections according to p ’s, and record L = 100 j =1 L j . (iii) Go back to (1), and replicate n times. (iv) Estimate E [ L ] by the sample mean of the n replications. (b) Notice that N i is the number of times element i is chosen, which has nothing to do with positions. E [ N i ] = 100 p i (c) We test the correlation by simulation. nb simu = 100; for i = 1:nb simu L = 0; Y = 0; permutation = randperm(5); for k = 1:100 temp = rand; if temp < 1/15 selection = 1; elseif temp < 3/15; selection = 2; elseif temp < 6/15; selection = 3; elseif temp < 10/16;

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

View Full Document
IEOR 4404, Assignment #9 Solutions 2 selection = 4; else selection = 5; end index = ﬁnd(permutation == selection); for j = index:-1:2 permutation(j) = permutation(j-1); end permutation(1) = selection; L = L+index; Y = Y+selection; end L vector(i) = L; Y vector(i) = Y;
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 12/20/2010 for the course IEOR E4404 taught by Professor Marianaolvera-cravioto during the Spring '08 term at Columbia.

### Page1 / 7

08SimHw9sol - 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