Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

bThis coding exercise is to perform a tiny simulation given a Markov chain transition matrix. Create a Python function named mc simulation that can simulate

bThis coding exercise is to perform a tiny simulation given a Markov chain transition matrix. Create a Python
function named mc simulation that can simulate a history (sequence) of states given any transition matrix. The specific requirements are as follows.
Two inputs: (i) A: a Markov chain transition matrix; (ii) t: the number of steps to simulate. You can
use the row indices [0,1,..., n 1] of matrix A as the set of states.
2
IE 3312 Probabilistic Operations Research
One output: a list of states H =[s0, s1, s2,..., st], where si represents the state occurred at time i in
this simulation. You need to randomly pick an arbitrary state from S as the initial state s0.
Test instance: test your algorithm with inputs S and A being the state set and transition matrix of
Gamblers Ruin (class example) with p =0.52, and use t =10 as the number of simulation steps. Run
five times of your function, and check how is the simulated history of each run.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Temple Of Django Database Performance

Authors: Andrew Brookins

1st Edition

1734303700, 978-1734303704

More Books

Students also viewed these Databases questions

Question

What about leadership lessons from particularly good or bad bosses?

Answered: 1 week ago