STAT 340 - Assignment 2 - Winter 2014
Last (Family) Name:
First (Given) Name:
Numeric UW ID:
Quest User ID:
Due Date: This is due on Feb. 28th at 9:30 in the morning either in the drop box on the 4th floor
of MC OR, if requested in the question, online.
G
STAT 340 - Assignment 1 - Spring 2014
Last (Family) Name:
First (Given) Name:
Numeric UW ID:
Quest User ID:
Due Date: This is due on May 23 at 10:00 in the morning either in the drop box
Comparing estimators for Call
Option Pricing Example
script9 uses a variety of estimators:
Best efficiency (74) for stratified-antithetic
0.37
[ f (.47 + .37U ) + f (.84 .37U )]
2
.16
+
[ f (.84 + .16U ) + f (1 .16U )]
2
This is stratified into [.47,.84]
Stat340: Computer Simulation of Complex Systems
Spring 2013
Assignment 2 Solutions
Professor: Ali Ghodsi
1
TA: Wu Lin
Question 1
2
We have f (x) = (2/ 2)ex /2 , x > 0 and g(x) = ex , so, f (x)/g(x) =
2
f (x)
max(f (x)/g(x) = 2e/ , therefore cg(x) = e(x1)
Winter 2012
Stat 340
STAT 340 - Winter 2012
In this exam please assume the following:
1. Any Condence Intervals and Hypothesis Tests where the % are not given are at a 95% and 5% level
respectively.
2. You are marked according to the clarity and completne
Clicker Test 8
Is the following data from X U (0,1) ?
Data Values 0.1
0.7
1. What is the Alternative Hypothesis?
A) The data is not X U (0,1) .
B)The data is X U (0,1) .
D) None of the above.
2. Calculate the KS distance for these data values.
A) 0.1 B) 0
Clicker Test WF - 15
Question 1: The (Optimal) Control Variate estimator is given by:
1
n
~
1
OCV = ( g ( X i )kh ( X i ) ) + k h ( x ) dx
n i=1
0
In each case below the answers are either:
A) TRUE
B) FALSE
1. X X i j
i
j
2.
g ( Xi) g ( X j) i j
3.
h ( X
Clicker Test MW - 15
1
Question 1: Let
= x 2 dx .
0
Given the uniform realizations 0.1, 0.7 and 0.9,
use ANTI to estimate .
A) 0.74
B) 0.37 C) 0.33
E) None of the above.
D) 0.44
2
Question 2: Let
= exp ( sin ( x ) ) dx .
3
Given the uniform realizations 0
Clicker Test WF - 16
Question 1: A particular variance reduction technique was used below.
u = runif(1000)
x = u^(2/3)
y = (exp(x)+x*exp(x)/(3/2*sqrt(x)
mean(y)
[1] 2.732461
Part 1: What variance reduction technique is it?
A) CMC B) OCV C) STRAT D) IMP E)
Clicker Test WF - 9
Question 1: Consider the LCG
x n=( 5 x n1+2 ) mod 9
.
Part a) Let the seed be x =12 then the first 10 pseudorandom numbers
are:
A) 8, 6, 4, 0, 2, 3, 8, 6, 4, 0
B) 8, 6, 5, 0, 2, 3, 8, 1, 2, 3
C) 8, 6, 3, 0, 2, 3, 0, 2, 3, 0
D) 8, 1, 5,
Clicker Test WF - 17
1
Question 1: Consider
estimate
1
= x dx
0
. We wish to use stratified sampling to
. We decide to break the interval at 3/4.
3 /4
1
= x dx= x dx + x dx
0
0
3/ 4
Part 1: What is the transformation that you will use for the first integr
Clicker Test WF - 19
Question 1: An M/M/1 queue is one which,
A) Arrivals occur according to a poisson process.
B) Departures occur according to a poisson process.
C) The calling population is infinite.
D) All of the above.
E) None of the above.
Question
Clicker Test
Simulations in this course are:
A)
B)
C)
D)
E)
Dynamic
Stochastic
Analytic
Both A and B
None of the above
What is the result of the following R code?
X = c(-1,2,4)
Y = c(X[1],X[-3],4)
Y
A)X
B)-1,2,4,4
C)-1,-1,2,4
D)
None of the above
Clicker Test 11
1. Let U U ( 0,1 ) with a realization u=0.5 . Let
X~Geo(0.3). What is the corresponding value
for x given the realization above?
A) 0 B) 1 C) 2 D) 3 E) None of the above
2. Let U~U(0,1). What formula can be used to
generate a random variab
Clicker Test 19
1. In stratified sampling with 2 strata we take samples of
size n and n . The size of n and n is dependent
on:
A) The size of the strata.
B) The variability within the strata.
C) The bias of the strata.
D) Both A and B
E) Both A and C.
1
2
STAT 340 Test 3
Spring 2014
Basic Rules:
1. Only a math approved, non-programmable, non-graphical calculator is allowed.
2. Please put your cell phone in your bag. A cell phone that is within reach is considered to be an illegal
tool.
3. Please leave all
STAT 340 Test 1
Spring 2014
Basic Rules:
1. Only a math approved, non-programmable, non-graphical calculator is allowed.
2. Please put your cell phone in your bag. A cell phone that is within reach is considered to be an illegal
tool.
3. Please leave all
Clicker Test 15
1. I would like to estimate the area, using CMC,
given by the following integral:
= exp (x ) dx
0
We randomly select, from a U(0,1), the values ,
2/4 and . What is the estimated area?
A) 1 B) 1.2 C) 0.8 D) 0.4 E) None of the above.
Clicker Test 18
1. I would like to estimate the area, using importance
sampling, given by the following integral:
1
= ln ( x +1 ) dx
0
I decide to use the helper function
h ( x )=
3
x
2
. We
randomly select, from a U(0,1), the values , and .
What is the e
Clicker Test 21
Consider the following realizations from a standard Normal
Random Variable: cfw_0.6, -2.1, -1.5
1. Using the realization(s) above which of the following
would be the realization of a log normal random
variable?
A) -0.51
B) Not a Number
C)
STAT 340 Test 3 Spring 2015
Basic Rules:
1. Only a math approved, non-programmable, non-graphical calculator is allowed.
2. Please put your cell phone in your bag. A cell phone that is within reach is considered to be an illegal
tool.
3. Please leave all
Clicker Test MW - 4
Question 1: After midterm 1 I take a sample of 10 students
midterms. A 95% confidence interval for the mean midterm
grade based on this sample is ( 70,80 ) . Please answer each of
the following with either A) TRUE or B) FALSE:
a) We ar
Clicker Test WF - 11
Question 1: Consider:
cfw_
f ( x )= 0.05 for x =1,3,5,7,9
0.15 for x=2,4,6,8,10
Part A. Note that x is uniformly 1,3,5,7,9. Given a uniform u , what
would be a formula for generating x over these values?
A)2floor(5u)+1 B) 2floor(6u)+1
Clicker Test WF - 14
1
Question 1: Let
= x 2 dx .
0
Given the uniform realizations 0.1, 0.7 and 0.9,
use ANTI to estimate .
A) 0.74
B) 0.37 C) 0.33
E) None of the above.
D) 0.44
2
Question 2: Let
= exp ( sin ( x ) ) dx .
3
Given the uniform realizations 0
Clicker Test WF - 18
Last class we covered the montreal problem. The following questions
refer to what we covered.
Question 1: How many transmission lines were there?
A) 4
B) 7
C) 8
D) 9
E) None of the above.
Question 2: How many paths bring electricity t
Clicker Test MW - 5
Question 1: A 90% confidence interval for a proportion is given as
(17,23)%. Perform a suitable test of hypothesis to determine
whether or not the population proportion is greater than 24%.
Part i) What was the original sample size?
A)
Clicker Test MW - 1
Question 1: Let
L=X + 2Y +1
. Then
X BIN (2,0.5)
and let
Y exp(0.5)
. Let
E ( L )=
A)
2.5
B)
3
C)
4
D)
6
E) None of the above
Question 2: What is the result of the following R
code?
X = c(-1,2,4)
Y = c(X[-2],X[c(1,3)])
sort(Y)
A)X
B)(-
Clicker Test MW - 8
Question 1: Consider the data: x=c(0.1, 0.25, 0.7, 0.8). Is the
data from a F ( x )=x , 0< x <1 ? We start by building an ECDF:
^
Part i) The F values are:
A) c(1:4)/4 B) c(0:4)/4 C) c(1,2,4)/4 D) c(1/4,2/4,3/4)
E) None of the above
^
Clicker Test WF - 4
Question 1a: After midterm 1 I take a sample of 10
students midterms. A 90% confidence interval for the
mean midterm grade based on this sample is ( 70,80 ) . Please
answer each of the following with either:
A) TRUE
B) FALSE
C) Maybe
P
Clicker Test MW - 6
Question 1: We generate, using R, data that follows from a
standard normal distribution. The code is:
data = rnorm(1000,0,1)
Interval
Observed Probability Expected
( ,1) (1, )
318
(1,0)
354
0.34
(0,1)
0.34
Is the data generated using R