LogoAlan Craig Data Science Portfolio Architecture

Markov Simulation: Supermarket Customers

python logo

In this project, I use Object Orientated Python to build a program that simulates customer behaviour in a supermarket which models the movements for each customer between various food sections in a store.

A Markov Chain describes a Stochastic process where each state depends only on the previous one. Each transition in a Markov Chain happens with a transition probability that is conditional on the present state. These probabilities can be written as a transition probability matrix P. Long term dependencies exist in Markov Chains, but they are fully encoded in the transition probabilities. If you know the current state, that’s enough. Knowing the past states does not provide additional information.


The sales department is interested in a summary of the collected data. I generate a report including numbers and diagrams. We are interested in the following:

The project involves the following tasks:



Lets get in touch and talk about your next project.