Random Walks Examples with Python

Tamir Suliman
8 min readFeb 11, 2024

Introduction

Random walks are essential in probability and are used widely in scientific domains like physics, biology and chemistry. This matters since it implies that deep mathematical properties of exemplifying randomness are present in these applications.
Random walk can be defined as the process that proceeds along a trail of random moves in a graph or a space. The directions and size of steps may differ depending on the distributions of random steps. Generated from [Starla](http://dr.dontcheva.com/starla.html). In the article random walks by python implementation will be used while attempting to analyze and discuss the various statistical properties and related theorems. Including examples from real world problems.

Lattice random walk

One of the widely used random walk models is that of a random walk on a regular lattice, where at each step the location jumps to another site following some probability distribution [1].
Study Python code for one-dimensional random walk below. First of all, we import the random and matplotlib libraries.

Random walk python program in 1 — D

--

--

Tamir Suliman

Writer, Engineer, Cyber security enthusiast ,PhD. Candidate & 4 Open Source write about my day to day experience in Software Data, and Engineering.