3 ms·
Visualize a random walk with generative art
- csmeyer 4y agoHope the video is fun, and here’s a math puzzle I thought of while creating it. 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?
- gus_massa 4y agoThe pen is a circle or a square? It looks like a circle, but if it were a square it may be easier to calculate the probabilities. (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.
- csmeyer 4y agoIn the animation the pen is a rasterized circle of radius 12, but for calculations assuming it’s a square makes sense. FWIW I have no idea what the answer is to the question! I imagine making as many simplifying assumptions as possible and generalizing from there will help
- led_dude_77 4y agoawesome 1/10