Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

.. CODE FOR PART 1 AND 2 IF IT IS POSSIBLE MATLAB A worker is trapped in a mine during a mining accident. He starts

..

CODE FOR PART 1 AND 2 IF IT IS POSSIBLE MATLAB

A worker is trapped in a mine during a mining accident. He starts at point 1.

In front of him there are three paths. The 1rst leads him back to point 1 (that

is, it leads him to where he started). The second leads him to a point 2. And the

third path leads him to the exit (which we will call point 3). At the point 2 there

are an additional two paths. One of those leads him back to point 2 and the other

leads him back to point 1. To make things worse, this poor guy has amnesia. It is

important to note that the amnesia is what makes this problem a Markov chain.

This is because every time he reaches a point, he is equally likely to choose any of

the paths that lie in front of him because he can't remember anything. Assume

each path takes an hour to travel.

Problem 1. Write a code to simulate the problem and track the number of

hours the worker spent in the mine trying to escape. To do this, make use of

random number generation in Matlab to perform Monte Carlo simulations for a

large number of realizations (say N > 1000). Afterwards, answer the following

questions:

1. What is the expected value of the number of hours the worker spent in the

mine while trying to escape?

2. What is the probability that the worker would get out in 8 hours or less?

3. What is the probability that the worker would spend more than 20 hours in

the mine?

Problem 2. Construct the transition matrix P that describes the Markov

chain. Calculate P2, P3, P4, P5, and P100 in Matlab and explain what the results

mean. (Note: if A = Px, the element Ai;j corresponds to the probability of going

from i to j in x steps.)

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

More Books

Students also viewed these Databases questions

Question

If T: C2 C2 satisfies and find 2 -G])- 43

Answered: 1 week ago