Artificial Corner

A Medium publication about AI, tech, programming, data science and everything in between (We’re…

Member-only story

DATA | PYTHON | STATISTICS

Introduction to Markov Chains in Python

A practical guide to writing your first Markov Chain program in Python

David Farrugia
Artificial Corner
Published in
5 min readJul 9, 2023

--

Photo by Karine Avetisyan on Unsplash

Introduction

As we navigate the digital era, it’s clear that data is our most invaluable asset, often likened to oil for its transformative power. Understanding the rhythm and patterns within data is fundamental to harnessing its potential.

In this article, we’ll venture into the world of a tool that assists us in unravelling these mysteries — Markov Chains.

The brainchild of Russian mathematician Andrey Markov, Markov Chains are rooted in the concept of randomness.

These are statistical models comprising a sequence of potential events where the likelihood of each event is based solely on the outcome of the preceding one.

In short, it’s a game of chance where your current status influences the outcome, and not the journey taken to reach there.

Perhaps a great example to understand this is the board game ‘snakes and ladders’. The player moves and results are entirely dependent on a random dice roll.

Markov Chains are widely admired for their ‘memory-less’ attribute.

--

--

Artificial Corner
Artificial Corner

Published in Artificial Corner

A Medium publication about AI, tech, programming, data science and everything in between (We’re currently not accepting new writers)

David Farrugia
David Farrugia

Written by David Farrugia

Data Scientist | AI Enthusiast and Researcher | Talks about Python, AI, and Data. Get in touch — davidfarrugia53@gmail.com

No responses yet