Question: 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.
 Using Python. Write a program that takes as input an 88

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!