Looking for suggestions and steps on how to run this simulation. An elliptical j
ID: 3111193 • Letter: L
Question
Looking for suggestions and steps on how to run this simulation.
An elliptical jungle clearing has been identified as a military target for a bombing run. Let the equation for the ellipse (in meters) be X2 /4002 +Y2 /2002 = 1. Assume the approach of the bomber will be along the major axis, and the target would be the point (0, 0). Assume also that variation of the drop in the X and Y directions are independent, with X~N(0, 1752 ) and Y~N(50, 1502 ), with the bias in Y due to unexpected cross breezes. Any strike within the ellipse is considered a hit. Simulate the probability of hit by using 1000 simulations for the X and Y positions of the bomb impact and determining whether that point is inside the ellipse. Note: You will likely want to express the equation in terms of X and Y to compare an observed X to the boundary for X and the observed Y to the boundary for Y. I recommend that you first screen the observed X and Y to see if they individually have the proper domain for the ellipse: then see if the point is inside. Run your simulation of 1000, ten times, and list in increasing order your sample proportions to the hundredths place.
Explanation / Answer
p=numeric(10)
for(j in 1:10)
{
check=numeric(1000)
x=rnorm(1000,0,175) #SIMULATING X
y=rnorm(1000,50,150) #SIMULATING Y
for(i in 1:1000)
{
if(abs(x[i])<(400)&&abs(y[i])<(200)&& x[i]^2/400^2+y[i]^2/200^2<1){check[i]=1} #CHECKING-CONDITIONS
}
p[j]=length(which(check>0))/1000
}
p
o=order(p) #ORDERING THE VALUES IN INCREASINHG ORDER
for(i in 1:10)
{
proportion[i]=p[o[i]]
}
proportion
OUTPUT:
0.711 0.716 0.716 0.719 0.719 0.721 0.726 0.729 0.737 0.745
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.