Questions tagged [random-walk]

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.

248 questions
0
votes
2 answers

run an entire program a certain number of times via input

So my current code effectively runs the "random walk" problem and then uses the pythagorean theorem to figure out actual distance in units walked but now I need to modify my program so that I can do a certain number of trials of said walk and then…
dylnard
  • 15
  • 6
0
votes
1 answer

Pratical questions about the vrtest package

I want to perform Variance Ratio tests (Lo-MackKinlay, Chow-Denning) but I have some problem with the running of the commands. I have a price Index for 1957 to 2007. Do I need to perform the variance ratio tests on the level series or on the…
Geraldine
  • 47
  • 2
0
votes
1 answer

plot points individually after user input

I am trying to run a random walk simulation and graphs it. What i'm trying to get is to plot the first point of the graph, then offer the user an input box to guess whether the next point will go up or down, then show them the next point on the…
0
votes
1 answer

self-avoiding random walks on a lattice in C with recursion - memory allocation

I want to compute (for a project) self-avoiding random walks by using a recursive function. I've managed to do that with two arrays StepX and StepY that keep track of the x and y, respectively, of the path. The recursive function is something…
Helios
  • 457
  • 6
  • 17
0
votes
2 answers

2D random walk, Java

I'm writing a two-dimensional random walk that takes command line arguments. It's supposed to estimate how long it takes the random walker to hit the boundary of a 2N-by-2N square centered at the starting point. What I got so far is: public class…
bangalo
  • 65
  • 3
  • 8
-1
votes
1 answer

Find max distance from (0,0) and add to legend matplotlib

I have this code calculating a random walk that I am trying to find the max distance from (0.0) for all walks and add them to a legend. Added an image of the result I want to achieve. import numpy as np import matplotlib.pyplot as plt import…
-1
votes
1 answer

how do I select 1 row of data from 1 output of a function that produces two 2d array outputs

For context, I have a 2D Random walker function that outputs two 2d arrays. The two arrays represent the x position and the y position. Both these arrays are 2D because the No of columns represents the No of particles (100 columns is 100 particles)…
Hondros
  • 9
  • 3
-1
votes
1 answer

Random Walk(Python Crash Course) stuck in what seems to be a loop

I am working through the Python Crash Course book and I don't know how to fix a problem with the Random Walk part. When I run the code, the command prompt gets stuck in a "processing" mode" which I cannot leave unless I close the window, i.e. At…
-1
votes
1 answer

Random walk with smooth changes of direction

A typical random walk does not care about direction changes. Each iteration generates a new direction. But if you imagine a point animated on a random walk, it will mostly jump around. So, the goal is to have a smoother curve depending on the…
Michael W. Czechowski
  • 3,366
  • 2
  • 23
  • 50
-1
votes
2 answers

C++ if-statement for maximum value in array not pointing to correct element

I've an array of 2500 steps taken by a robot, each step taken in a random direction (up, down, right, or left). I'm supposed to store the Euclidian distance (a right triangle's hypotenuse) of each step from the robot's origin. No problem there. I'm…
-1
votes
1 answer

I don't understand why this Fortran program won't build

I was hoping that someone would be able to review my code for a summer project and let me know where I messed up. This is a random walk, but I make it so that when a walker goes over 6, it goes back to 1 and vise versa. Additionally, when there are…
Jack Tapay
  • 15
  • 3
-1
votes
1 answer

Self avoiding walk

I want to simulate a self avoiding random walk in two dimension on a square lattice and plot the path. So far I have written out the code for this problem: n <- 100 x <- 0 y <- 0 randomwalkx <- 0 randomwalky <- 0 for(i in 1:n){ random <-…
Job
  • 33
  • 1
  • 7
-1
votes
1 answer

random walk based on previous moves

I am pretty new to this area, so the question that I ask might be straight forward or look naive for other professionals. For a 1D random walk problems, such as drunkard's walk problem, there is no connection between the current move and the…
Lexus00
  • 3
  • 1
-1
votes
1 answer

random walk N times and only Nth return to the orignal place, what's the number of permulation?

suppose a partical can move on x-coordinate, which means it can move 0 to 1 or 1 to 2 or N-1 to N .etc, now it starts with 0, it can move one step every time, left or right (e.g. when it reaches 5, it can move right to 6 or left to 4). and after N…
stonestrong
  • 337
  • 1
  • 5
  • 13
-2
votes
1 answer

Quantum walk on 3D grid

I am trying to apply the quantum coin walk on a 3D grid, with 3 Hadamard coins. However I can't seem to get symmetric results after 3 steps. Is it simply not possible to have a probability distribution which is symmetric with such a coin? Thank…
1 2 3
16
17