Markov Chains: What are they and where do they matter?

blog 7

Named after a Russian Mathematician Andrey Markov, Markov Chains deal with a sequence of possible events in which the probability of the next event depends only on the current state of the event. The underlying base idea of a Markov Chain is a “Markov Property” aka “Memoryless property” that states that as long as we know the current state of the process, any more information about the past states would not be helpful in predicting the probability of future state of the process. It is by virtue of this assumption that Markov Chains finds its use in many applications.

Introduction

Markov Processes are essentially random processes that satisfy “Markov property”. A random process (aka stochastic process) is a collection of random events whose outcomes are denoted by a set of random variables. Let us consider the task of picking a card from a full deck of 52 cards. If we were to denote the probability of such a card to be a ‘face card’ i.e, either one among King, Queen, Jack, Ace to a random variable ‘X’, then a random process could be thought of as repeating this same experiment once everyday. The collection of such outcomes denoted by the value of ‘X’ is discrete in a sense that the changes to the random variable ‘X’ happen at discrete intervals in time and hence this is called the ‘Discrete-time random process’. Contrastingly, a ‘Continuous-time random process’ is one where a random variable takes continuous values and lacks any “steps” in its appearance. For example, an experiment where a random variable ‘X’ denotes the current share price of a trading stock is continuous-time in nature. A ‘Markov Chain’ usually refers to a discrete-time Markov process.

How does it work?

A state-space is a collection of all the possible states the process(application) can take. The working of Markov Chains can be explained below :

Flowchart depicting the working of Markov Chains A general model of markov chains showing the three states S0,S1 & S2 in its state space S and their transition probabilities in the form a directed graph below,

26

  1. If it is a Sunny day today, there is 70% probability for the next day to be Sunny as well while 30% for it to be Rainy.
  2. If it is a Rainy day today, there is 80% probability that next day is Rainy too while 20% probability for it to turn Sunny.

We begin by noting down all the possible states to define the state space S. For this example,

Next step is to construct the probability transition matrix which shows us the general probabilities for all possible transitions in the state space.

StatesSunnyRainy
Sunny0.70.3
Rainy0.20.8

Probability Transition Matrix

The same information is also represented in the form of a directed graph below showing the transition probabilities for each possible transition. [1]

26.0

By Markov chains assumption, any state Sn can be represented as

where P is the transition probability matrix.

Since calculations for successive states are of the same form, it can be generalized that any state Sn can be represented as

Now, let’s assume that today is a sunny day and we are interested in finding the weather 3 days later. So we have

Hence the probability of it being a rainy day three days later is 52.5%.

Various Use Case Scenarios

Markov Chains can be designed to model many real-world processes and hence they are used in a variety of fields and applications across domains. Some of them include:

Domain Applications:

Some of the applications of Markov chains include but not limited to,