This preview shows pages 1–2. Sign up to view the full content.
IEOR 4404
Assignment #9 Solutions
Simulation
28th November 2006
Prof. Mariana OlveraCravioto
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);
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
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.
 Spring '10
 C

Click to edit the document details