A random walk is a mathematical formalization of a path that consists in a succession of random steps. A random walk can be a Markov chain or process; it can be on a graph or a group. Random walks can model randomized processes, in fields such as: ecology, economics, psychology, computer science, physics, chemistry, and biology.
Questions tagged [random-walk]
248 questions
0
votes
0 answers
How to generate a random number from a weird distribution
I study a problem of a random walk with drift and an absorbing boundary. The system is well theoretically understood. My task is to simulate it numerically, in particular to generate random numbers from this distribution, see the formula. It is the…
0
votes
1 answer
Random Walks in R
I would like to convert some MATLAB code in R to represent a Two-dimensional and Three-dimensional random walk.
I have this interesting MATLAB code from a professor's notes which I cannot run properly in MATLAB:
%%TWO-DIMENSIONAL RANDOM WALK%%…

fina
- 429
- 4
- 12
0
votes
1 answer
Random Walk Monte Carlo simulation
I'm having some troubles trying to write a code for the following exercise:
Write a program RandomWalkers.java that takes two integer command-line arguments r and trials. In each of trials independent experiments, simulate a random walk until the…

Tr909
- 31
- 3
0
votes
0 answers
Paint biggest area in the circle with the smallest travel distance
We have a simple autonomous car with the brush, the goal is to paint the biggest area in a circle. There are following rules:
We can move car by the given angle and the distance from the current angle and position.
Starting point is in the center…

Alex Craft
- 13,598
- 11
- 69
- 133
0
votes
1 answer
Gaussian Sum with python
I found this code :
import numpy as np
import matplotlib.pyplot as plt
# We create 1000 realizations with 200 steps each
n_stories = 1000
t_max = 500
t = np.arange(t_max)
# Steps can be -1 or 1 (note that randint excludes the upper limit)
steps =…
user10674336
0
votes
1 answer
How do I initialise the plot of my function to start at 0?
This is probably a really stupid question, but I just can't seem to work out how to do it for some reason. I've created a function for a random walk here which just uses the numpy binomial function with one trial (ie if it's under 0.5 it's -1, over…

T. L
- 103
- 2
- 8
0
votes
2 answers
Random Walk - Any Direction
I'm new to this, but I'm trying to create a program that goes on a Random Walk in turtle and I have no idea what I'm doing.This is the program that I need to create Requirements, and this is what I have so far Code. I'm starting to get a little…

Kalosak
- 13
- 2
0
votes
1 answer
Creating histograms of distance from the origin for 2D Random Walkers
Let's say you can show the distribution in space of the the positions of a large number of random walkers at three different time points. This was provided an answer to my previous question and with some tweaks is beautiful.
clc;
close all;
M =…

99 Fishing
- 5
- 2
0
votes
1 answer
What causes Java version Random walk doesn't converge to expected value?
Basically, I implemented a Random walk program in Java. And I know the distance should converge to l * (n ^ 0.5)(l is the step length, n is the total steps). If let l equals to 1, then d = n ^ 0.5 or in other words: d = sqrt(n).
But, strangly,…

Sraw
- 18,892
- 11
- 54
- 87
0
votes
2 answers
How to produce a time series data with deterministic random walk and drift, given the mean and variance for the series?
I have been given the mean and variance. I need to produce a deterministic random walk from the given variables. These are the expected properties for the time series data:
Mean: 27.57020098
Median: 27.815
Std…

Sharvil Mainkar
- 11
- 3
0
votes
0 answers
2D Radom Walk with Mpi
I'm trying to extend the code found here for the random walk problem to handle walkers walking in a 2D grid in 4 directions. To simplify the problem a bit, my code assumes the subdomain size to be always 4 and the number of processes (world size) is…
0
votes
0 answers
How to conduct a random walk without visiting the same vertices/nodes
I'm running the random walk function in R using iGraph, where my random walker is traveling along a road network. However, when I run the below code I find that the random walker always goes back to the same vertices/nodes. Is there a way I can…

Yaya
- 1
- 3
0
votes
0 answers
When I run my Fortran code more than once, the value on the file are exactly the same
I am currently working on a Random Walk Fortran program and I was wondering why my the file I create from the program always has the same values after I run it on compilers like Geany and SilverFrost.
Here's the code:
program InfiniteWalk
implicit…

Jack Tapay
- 15
- 3
0
votes
1 answer
Python randomly generated walks give same outcome when graphed
from pylab import *
no_steps = 10000
number = random()
position = zeros(no_steps)
position[0] = 0
time = zeros(no_steps)
time[0] = 0
for i in range(1, no_steps):
time[i] = time[i-1] + 1
if number >= 0.5:
position[i] =…

user490418
- 5
- 1
0
votes
1 answer
random walk python implementation
Hello there is a python implementation of igraph_random_walk available in the r version?
If is not available How can I easly develop one random walk function using igraph?
Hope someone will help me.

emanuele
- 1
- 1