We have an assignment on random walk, but I can't figure out the expected value. The situation is as follows:

  • In the origin there is a hunter that shoots at a duck, but misses. The duck starts at a random position $(x_0,y_0)$ at a distance of $15$ from the hunter/origin. As it is startled from the sound, it will do a random walk of $n$ steps of size $6$ in any random direction with $\theta \in ]0,2\pi[$. After $n$ steps the hunter has reloaded his gun and will not miss. The hunter has only a range of $20$ though, so if the duck is outside of that range it escapes, if not it is eaten. Assume that the duck escapes in the $n$-th step, what would the expected distance be?

I have no problem simulating the problem, throwing away the instances that ended within the shooting range of the hunter and then take the average of distances of the remaining locations, but I can't seem to figure out the exact average distance to compare with. We are required to find $N$, the number of walks required to get a correct average up to $0.1$ accuracy.


As a reply to Ronno: It is not necessary to calculate the probability of being 0.1 accurate. We need to create a convergence plot of the average distances. I quote "Show the convergence graph on the distance of the duck. For $n=1,2,3,4$, find $N_n$ for which the simulated distance is accurate up to 0.1.". That is all that is really asked, but I can't find the expected value to compare with.

Sidequestion (solved):

  • When having $n = 1$ step and not removing any instances, I would expect the average distance to be $15$, the place the duck started, but it gives something like $15.6$. Which to me is counter-intuitive. Am I doing something wrong, or is my intuition off?


After thinking back about it, this actually does make sense. The average distance of the points on a circle is only the origin of that circle if the distance is measured from the origin itself, not from any other point.

  • $\begingroup$ You seem to know some amount of (La)TeX, but I added the dollar signs required for MathJax. For some basic information about writing math at this site see e.g. here, here, here and here. $\endgroup$ – ronno Dec 21 '13 at 12:01
  • $\begingroup$ Since you're simulating a random process, you'd need a probability of being accurate by $0.1$, right? Also, you should mention that the duck starts at a distance $15$ from the origin in the problem statement. $\endgroup$ – ronno Dec 21 '13 at 12:04
  • $\begingroup$ @ronno Just wondering, since I'm new here. Is this not the place for such questions? How come I didn't get any responses? :( $\endgroup$ – Peter Raeves Dec 22 '13 at 21:33
  • $\begingroup$ The question seems to be on-topic to me. $\endgroup$ – ronno Dec 23 '13 at 6:00
  • $\begingroup$ Is the 'average distance' you want to work out the distance of the duck from the hunter, AFTER the random steps, ASSUMING that the hunter misses? If so, I don't see why you expect 15. You are taking an average of things that are at least 20, so the average should be at least 20. Am I missing something? $\endgroup$ – jwg Dec 27 '13 at 1:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.