Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Python. Write a program that takes as input an 8 8 matrix where each element could be ' s ' ( a space )

Using Python. Write a program that takes as input an 88 matrix where each element could be 's'(a space) or 'w'(a wall), and
exactly one element is 'o'(the origin), and exactly one element is 'd'(the destination), and does the following:
(a) Assuming the grid is numbered 1-64(starting left to right, top to bottom in sequence), creates a vector of
states.
(b) Generates 4 transition matrices, one for each direction of movement. Movements are possible only between
spaces. Note that any action that moves across a wall or out of the grid would result in no movement (staying
in the same space).
(c) For a policy that randomly chooses each direction with equal likelihood, computes the average number of steps
it takes to move from the origin to the destination.
(d)(extra credit) Add as inputs to your code, a policy p=(pu,pd,pr,pt) where pu is the probability by which
'up' is the action, pd probability of moving one step down, pl probability of moving one step to the left, and
pr the probability of moving one step to the right, and compute the average number of steps to get from the
origin to the destination.
Execute your code for the following maze grid:
In a written report, describe clearly and mathematically how you developed the Markov chain for the problem and
explain using an example executed using your code.
image text in transcribed

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

Practical Neo4j

Authors: Gregory Jordan

1st Edition

1484200225, 9781484200223

More Books

Students also viewed these Databases questions

Question

5. Discuss the key components of behavior modeling training.

Answered: 1 week ago

Question

4. Develop a self-directed learning module.

Answered: 1 week ago

Question

2. Provide recommendations for effective on-the-job training.

Answered: 1 week ago