A robbery has just been committed at the Corner Market in the downtown area of t
ID: 3238863 • Letter: A
Question
A robbery has just been committed at the Corner Market in the downtown area of the city. The market owner was able to activate the alarm, and the robber fled on foot. Police officers arrived a few minutes later and asked the owner, “How long ago did the robber leave?” “He left about 10 minutes ago and headed east.”, the owner responded. “He’s probably ten blocks away by now.”, one of the officers said to the other. “Not likely”, said the storeowner. “He was so stoned on drugs that I bet he’s still only within a few blocks of here! He’s probably just running in circles!” Perform a simulation experiment that will test the storeowner’s hypothesis. Assume the following: • It takes him 1 minute to walk each block (they are short). • At the end of each minute interval he is at a corner. There is a 40% chance that he will fall asleep for 1 minute, and a 15% chance that he walk east, or north, or west, or south. Run at least 1000 trials of the ten-minute journey of the robber. (Please don't copy the already solved 5 trail Answer). a. What is the probability he is two blocks or less (walking on streets) from the store? b. On average how many block has he walked? c. On average how far away is he (using blocks-no “diagonals”) from the store?
Explanation / Answer
Let (x,y) denote the position of the robber at any time. The starting point is the origin of the 2D cartesian coordinate such that north is the positive Y direction and east the positive X direction. So, the robber runs towards east and starts from position (0,0) to reach position (1,0) after 1 minute. Next his position depends on the probability generated.
Code:
for (j in 1:1000)
{
x=1
y=0
for (i in 1:9)
{
r =runif(1)
if(r<=0.4)# Stationary
b=b-1#If stationary, number of blocks travelled reduced by 1
else if(r<=0.55)#North
y=y+1
else if(r<=0.70)#East
x=x+1
else if(r<=0.85)#South
y=y-1
else#West
x=x-1
}
if(abs(x)+abs(y)<=2)#if 2 blocks or less away from store
a=a+1
c=c+abs(x) + abs(y)#total blocks away from store
}
print(a/1000)
print(b/1000)
print(c/1000)
Results:
a. 0.459, on an average 45.9% of times rober is less than 2 steps after 10 mins
b. 6.398, robber takes 6.398 steps on an average
c. 2.778, robber is on an average 2.778 blocks away from start after 10 mins
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.