Visualize a random walk with generative art
youtube.com
youtube.com
The algorithm:
Pen width = 12px Canvas x bounds = [-900px, 900px] Canvas y bounds = [-600px, 600px]
At each timestep: - The pen starts at the origin - A direction is chosen [N,S,E,W] with each direction receiving 25% probability. - The pen moves forward in that direction with a distance chosen uniformly from the integer range [50,75] - After moving, if the pen is out of bounds of the canvas in the x direction, set its x coordinate to 0 leaving the y coordinate unchanged - After moving, if the pen is out of bounds of the canvas in the y direction, set its y coordinate to 0 leaving the x coordinate unchanged
What is the probability that at timestep t, a pixel (x, y) is colored?
(I guess there is no closed form for the probabilities, but if the pen is a square I guess ¿¿¿P(x,y)=P(x)*P(y)??? or something like that?
Do you have some "heat maps" of frequencies after 1000 simulations?
A related problem the limit of the probabilities of finding the pen in one point. It's probably greater in the center, because when it's near the border it got sucked and teletransported to the center. It also may have strips, instead of being a function that just decrease when move from the center.