A drunken turtle starts at the origin and takes unit steps,
turning through a randdom angle after each step. We are interested in
the distribution of the number of close-returns to the origin, for a fixed
number of steps and a fixed measure of closeness.
Usage
drunkenSim(steps = 1000, reps = 10000, close = 0.5,
seed = NULL, table = FALSE)
Arguments
- steps
the number of steps the turtle will take
- reps
number of simulations to perform
- close
the distance from the origin that counts as "close"
- seed
The user may provide a seed-value for random-number
generation.
- table
Does the user want a table of the results?
Examples
drunkenSim(seed = 3030)
#> The average number of close returns was: 1.6151.