Hi Crawbears,
For Crawstat’s inaugural post, I built a fun, basic simulation with Python that you could try yourself.
A random walk simulation is a great way of arriving at a distribution of outcomes and a probability. Consider the following scenario, loosely based on a Dora the Explorer story that my daughter, Danae, and son, Shaelo, like, though it mirrors our family’s real-life strawberry-centered snacking.
Danae and Shaelo have a basket of juicy strawberries. They’d like to hike up to Strawberry Summit, which is 100 steps high, and devour their strawberries while watching the sunset. To make things exciting, they’ll roll a die 100 times. For each roll, if the die turns up 1 or 2, they’ll take 1 step down. If it turns up 3, 4, or 5, they’ll take 1 step up. If it turns up 6, they’ll roll again and take as many steps up as the die turns up. There’s a 0.2% chance they’ll lose self control, eat the strawberries on the spot, and return home.
In order to determine and visualize their chances of reaching Strawberry Summit, I’ve built a basic simulation of 1,000 random walks of 100 die rolls. My code, explanatory notes, and visualizations are below. Are you curious about their chances? Drumroll please…


Danae & Shaelo have an 8% chance of making it to Strawberry Summit for the sunset. In fact, they’re much more likely not to reach it. It’s up to them what they’d like to do, but I’d say those odds are worth it for a nice hike, great view, and juicy strawberries.
What did you think of the simulation? It’s pretty powerful huh? Check out Python’s documentation on pseudorandom number generation and playing around with it yourself to see all the cool things you can do.
Next week, I’ll explore the rise of the NBA three pointer.
To the summit,
Rish