Hw9sol - IEOR 4404 Simulation Prof Mariana Olvera-Cravioto Assignment#9 Solutions 28th November 2006 Page 1 of Assignment#9 Solutions 1(a X(n 1 =

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
IEOR 4404 Assignment #9 Solutions Simulation 28th November 2006 Prof. Mariana Olvera-Cravioto Page 1 of ?? Assignment #9 Solutions 1. (a) X ( n + 1) = 1 n +1 n +1 i =1 X i = 1 n +1 ( n i =1 X i + X n +1 ) = 1 n +1 ( n X ( n ) + X n +1 ) = X ( n ) + X n +1 - X ( n ) n +1 . And, to prove the second equality, note that: S 2 ( n +1) = 1 n [ n +1 i =1 ( X i - X ( n +1)) 2 ] = 1 n [ n +1 i =1 X 2 i - ( n +1) . X 2 ( n +1)] = 1 n [ n i =1 X 2 i + X 2 n +1 - ( n + 1) × [ n n +1 ( X ( n ) + X n +1 ) 2 ]. Continuing from here with some algebra (expanding and regrouping terms), we get: S 2 ( n + 1) = (1 - 1 /n ) S 2 ( n ) + 1 n +1 [ X ( n ) - X n +1 ) 2 ]. But, X ( n + 1) - X ( n ) = 1 n +1 ( X n +1 - X ( n )). Therefore, ( X ( n + 1) - X ( n )) 2 = 1 ( n +1) 2 ( X ( n + 1) - X ( n )) 2 . And, S 2 ( n + 1) = (1 - 1 /n ) S 2 ( n ) + ( n + 1)( X ( n + 1) - X ( n )) 2 . (b) The following code asks the user to input a vector of data and then computes the sample mean and standard deviation using the recursive formulas above. data=input(’\n Enter data vector:’) n=length(data);
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/17/2010 for the course IEOR 4404 taught by Professor C during the Spring '10 term at Columbia.

Page1 / 2

Hw9sol - IEOR 4404 Simulation Prof Mariana Olvera-Cravioto Assignment#9 Solutions 28th November 2006 Page 1 of Assignment#9 Solutions 1(a X(n 1 =

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online